forked from OSchip/llvm-project
[RISC-V] Fixed alias for addi x2, x2, 0
A missing check for non-zero immediate in MCOperandPredicate caused c.addi16sp sp, 0 to be selected which is not a valid instruction. llvm-svn: 339381
This commit is contained in:
parent
03406c50fa
commit
10de234905
|
@ -187,7 +187,7 @@ def simm10_lsb0000nonzero : Operand<XLenVT>,
|
|||
int64_t Imm;
|
||||
if (!MCOp.evaluateAsConstantImm(Imm))
|
||||
return false;
|
||||
return isShiftedInt<6, 4>(Imm);
|
||||
return isShiftedInt<6, 4>(Imm) && (Imm != 0);
|
||||
}];
|
||||
}
|
||||
|
||||
|
|
|
@ -60,3 +60,6 @@ li x12, -0x80000000
|
|||
li x12, 0x80000000
|
||||
# CHECK-EXPAND: c.li a2, -1
|
||||
li x12, 0xFFFFFFFF
|
||||
|
||||
# CHECK-EXPAND: c.mv sp, sp
|
||||
addi x2, x2, 0
|
||||
|
|
Loading…
Reference in New Issue