mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
[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
ba797dbf52
commit
c63c7fe0e5
@ -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
Block a user