Index: src/IceTargetLowering.cpp |
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp |
index 2935df9fd339b1c38d6dd625da703c95e2ea1b8d..0d12d481adb4a49b878699c60240d2faf94c8236 100644 |
--- a/src/IceTargetLowering.cpp |
+++ b/src/IceTargetLowering.cpp |
@@ -308,6 +308,7 @@ TargetLowering::AutoBundle::~AutoBundle() { |
} |
void TargetLowering::genTargetHelperCalls() { |
+ Utils::BoolFlagSaver _(GeneratingTargetHelpers, true); |
for (CfgNode *Node : Func->getNodes()) { |
Context.init(Node); |
while (!Context.atEnd()) { |
@@ -706,10 +707,16 @@ void TargetLowering::scalarizeArithmetic(InstArithmetic::OpKind Kind, |
Variable *Dest, Operand *Src0, |
Operand *Src1) { |
scalarizeInstruction( |
- Dest, Src0, Src1, |
- [this, Kind](Variable *Dest, Variable *Src0, Variable *Src1) { |
+ Dest, [this, Kind](Variable *Dest, Operand *Src0, Operand *Src1) { |
return Context.insert<InstArithmetic>(Kind, Dest, Src0, Src1); |
- }); |
+ }, Src0, Src1); |
+} |
+ |
+Variable *TargetLowering::makeExtract(Operand *Src, Operand *Index) { |
+ const auto ElementTy = typeElementType(Src->getType()); |
+ auto *Op = Func->makeVariable(ElementTy); |
+ Context.insert<InstExtractElement>(Op, Src, Index); |
+ return Op; |
} |
void TargetLowering::emitWithoutPrefix(const ConstantRelocatable *C, |