| Index: src/IceTargetLoweringARM32.cpp
|
| diff --git a/src/IceTargetLoweringARM32.cpp b/src/IceTargetLoweringARM32.cpp
|
| index 1dde797887ef1542709398e405fd13f38d868e2a..15e7ab61b0950fa06e42b865e7cef42c60f6937a 100644
|
| --- a/src/IceTargetLoweringARM32.cpp
|
| +++ b/src/IceTargetLoweringARM32.cpp
|
| @@ -575,8 +575,20 @@ void TargetARM32::genTargetHelperCallFor(Inst *Instr) {
|
| Variable *Dest = Instr->getDest();
|
| Operand *Src0 = Instr->getSrc(0);
|
| const Type DestTy = Dest->getType();
|
| - const InstCast::OpKind CastKind =
|
| - llvm::cast<InstCast>(Instr)->getCastKind();
|
| + auto *CastInstr = llvm::cast<InstCast>(Instr);
|
| + const InstCast::OpKind CastKind = CastInstr->getCastKind();
|
| +
|
| + if (isVectorType(DestTy)) {
|
| + scalarizeUnaryInstruction(Dest, Src0,
|
| + [this, CastKind](Variable *Dest,
|
| + Variable *Src) {
|
| + return Context.insert<InstCast>(CastKind,
|
| + Dest, Src);
|
| + });
|
| + CastInstr->setDeleted();
|
| + return;
|
| + }
|
| +
|
| switch (CastKind) {
|
| default:
|
| return;
|
| @@ -721,6 +733,38 @@ void TargetARM32::genTargetHelperCallFor(Inst *Instr) {
|
| }
|
| llvm::report_fatal_error("Control flow should never have reached here.");
|
| }
|
| + case Inst::Icmp: {
|
| + Variable *Dest = Instr->getDest();
|
| + const Type DestTy = Dest->getType();
|
| + if (isVectorType(DestTy)) {
|
| + auto *CmpInstr = llvm::cast<InstIcmp>(Instr);
|
| + const auto Condition = CmpInstr->getCondition();
|
| + scalarizeInstruction(Dest, CmpInstr->getSrc(0), CmpInstr->getSrc(1),
|
| + [this, Condition](Variable *Dest, Variable *Src0,
|
| + Variable *Src1) {
|
| + return Context.insert<InstIcmp>(Condition, Dest,
|
| + Src0, Src1);
|
| + });
|
| + CmpInstr->setDeleted();
|
| + }
|
| + return;
|
| + }
|
| + case Inst::Fcmp: {
|
| + Variable *Dest = Instr->getDest();
|
| + const Type DestTy = Dest->getType();
|
| + if (isVectorType(DestTy)) {
|
| + auto *CmpInstr = llvm::cast<InstFcmp>(Instr);
|
| + const auto Condition = CmpInstr->getCondition();
|
| + scalarizeInstruction(Dest, CmpInstr->getSrc(0), CmpInstr->getSrc(1),
|
| + [this, Condition](Variable *Dest, Variable *Src0,
|
| + Variable *Src1) {
|
| + return Context.insert<InstFcmp>(Condition, Dest,
|
| + Src0, Src1);
|
| + });
|
| + CmpInstr->setDeleted();
|
| + }
|
| + return;
|
| + }
|
| }
|
| }
|
|
|
| @@ -4196,9 +4240,6 @@ TargetARM32::lowerInt8AndInt16IcmpCond(InstIcmp::ICond Condition, Operand *Src0,
|
| }
|
|
|
| TargetARM32::CondWhenTrue TargetARM32::lowerIcmpCond(const InstIcmp *Instr) {
|
| - assert(Instr->getSrc(0)->getType() != IceType_i1);
|
| - assert(Instr->getSrc(1)->getType() != IceType_i1);
|
| -
|
| Operand *Src0 = legalizeUndef(Instr->getSrc(0));
|
| Operand *Src1 = legalizeUndef(Instr->getSrc(1));
|
|
|
| @@ -4235,6 +4276,7 @@ TargetARM32::CondWhenTrue TargetARM32::lowerIcmpCond(const InstIcmp *Instr) {
|
| switch (Src0->getType()) {
|
| default:
|
| llvm::report_fatal_error("Unhandled type in lowerIcmpCond");
|
| + case IceType_i1:
|
| case IceType_i8:
|
| case IceType_i16:
|
| return lowerInt8AndInt16IcmpCond(Condition, Src0, Src1);
|
|
|