Index: src/IceTargetLoweringARM32.cpp |
diff --git a/src/IceTargetLoweringARM32.cpp b/src/IceTargetLoweringARM32.cpp |
index f302e35c7efc71f8338177674e9015015732fffc..066c2bfbfde5a7ab202f21d79ecf6b29b481f8cf 100644 |
--- a/src/IceTargetLoweringARM32.cpp |
+++ b/src/IceTargetLoweringARM32.cpp |
@@ -583,10 +583,10 @@ void TargetARM32::genTargetHelperCallFor(Inst *Instr) { |
const InstCast::OpKind CastKind = CastInstr->getCastKind(); |
if (isVectorType(DestTy)) { |
- scalarizeUnaryInstruction( |
- Dest, Src0, [this, CastKind](Variable *Dest, Variable *Src) { |
+ scalarizeInstruction( |
+ Dest, [this, CastKind](Variable *Dest, Variable *Src) { |
return Context.insert<InstCast>(CastKind, Dest, Src); |
- }); |
+ }, Src0); |
CastInstr->setDeleted(); |
return; |
} |
@@ -742,10 +742,11 @@ void TargetARM32::genTargetHelperCallFor(Inst *Instr) { |
auto *CmpInstr = llvm::cast<InstIcmp>(Instr); |
const auto Condition = CmpInstr->getCondition(); |
scalarizeInstruction( |
- Dest, CmpInstr->getSrc(0), CmpInstr->getSrc(1), |
+ Dest, |
[this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { |
return Context.insert<InstIcmp>(Condition, Dest, Src0, Src1); |
- }); |
+ }, |
+ CmpInstr->getSrc(0), CmpInstr->getSrc(1)); |
CmpInstr->setDeleted(); |
} |
return; |
@@ -757,14 +758,32 @@ void TargetARM32::genTargetHelperCallFor(Inst *Instr) { |
auto *CmpInstr = llvm::cast<InstFcmp>(Instr); |
const auto Condition = CmpInstr->getCondition(); |
scalarizeInstruction( |
- Dest, CmpInstr->getSrc(0), CmpInstr->getSrc(1), |
+ Dest, |
[this, Condition](Variable *Dest, Variable *Src0, Variable *Src1) { |
return Context.insert<InstFcmp>(Condition, Dest, Src0, Src1); |
- }); |
+ }, |
+ CmpInstr->getSrc(0), CmpInstr->getSrc(1)); |
CmpInstr->setDeleted(); |
} |
return; |
} |
+ case Inst::Select: { |
+ Variable *Dest = Instr->getDest(); |
+ const auto DestTy = Dest->getType(); |
+ if (isVectorType(DestTy)) { |
+ auto *SelectInstr = llvm::cast<InstSelect>(Instr); |
+ scalarizeInstruction(Dest, |
+ [this](Variable *Dest, Variable *Src0, |
+ Variable *Src1, Variable *Src2) { |
+ return Context.insert<InstSelect>(Dest, Src0, Src1, |
+ Src2); |
+ }, |
+ SelectInstr->getSrc(0), SelectInstr->getSrc(1), |
+ SelectInstr->getSrc(2)); |
+ SelectInstr->setDeleted(); |
+ } |
+ return; |
+ } |
} |
} |