[AArch64][FastISel] Variant of the logical instructions that use two input

registers cannot write on SP.

rdar://problem/20748715

llvm-svn: 236352
This commit is contained in:
Quentin Colombet 2015-05-01 21:34:57 +00:00
parent 6efd273a61
commit 0de2346859
2 changed files with 20 additions and 1 deletions

View File

@ -2573,7 +2573,7 @@ bool AArch64FastISel::optimizeSelect(const SelectInst *SI) {
Src1Reg = emitLogicalOp_ri(ISD::XOR, MVT::i32, Src1Reg, Src1IsKill, 1);
Src1IsKill = true;
}
unsigned ResultReg = fastEmitInst_rr(Opc, &AArch64::GPR32spRegClass, Src1Reg,
unsigned ResultReg = fastEmitInst_rr(Opc, &AArch64::GPR32RegClass, Src1Reg,
Src1IsKill, Src2Reg, Src2IsKill);
updateValueMap(SI, ResultReg);
return true;

View File

@ -114,3 +114,22 @@ entry:
}
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64)
define void @logicalReg() {
; Make sure we generate a logical reg = reg, reg instruction without any
; machine verifier errors.
; CHECK-LABEL: logicalReg:
; CHECK: orr w{{[0-9]+}}, w{{[0-9]+}}, w{{[0-9]+}}
; CHECK: ret
entry:
br i1 undef, label %cond.end, label %cond.false
cond.false:
%cond = select i1 undef, i1 true, i1 false
br label %cond.end
cond.end:
%cond13 = phi i1 [ %cond, %cond.false ], [ true, %entry ]
ret void
}