[llvm] r346959 - [RISCV] Mark C.EBREAK instruction as having side effects

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 15 06:52:24 PST 2018


Author: asb
Date: Thu Nov 15 06:52:24 2018
New Revision: 346959

URL: http://llvm.org/viewvc/llvm-project?rev=346959&view=rev
Log:
[RISCV] Mark C.EBREAK instruction as having side effects

C.EBREAK was defined with hasSideEffects = 0, which is incorrect and 
inconsistent with the non-compressed instruction form. This patch corrects 
this oversight.

This wouldn't cause codegen issues, as compressed instructions are only ever 
generated by converting the non-compressed form as an MCInst. But having 
correct flags is still worthwhile.

Differential Revision: https://reviews.llvm.org/D54256
Patch by Luís Marques.

Modified:
    llvm/trunk/lib/Target/RISCV/RISCVInstrInfoC.td

Modified: llvm/trunk/lib/Target/RISCV/RISCVInstrInfoC.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/RISCV/RISCVInstrInfoC.td?rev=346959&r1=346958&r2=346959&view=diff
==============================================================================
--- llvm/trunk/lib/Target/RISCV/RISCVInstrInfoC.td (original)
+++ llvm/trunk/lib/Target/RISCV/RISCVInstrInfoC.td Thu Nov 15 06:52:24 2018
@@ -478,7 +478,7 @@ let hasSideEffects = 0, mayLoad = 0, may
 def C_MV : RVInst16CR<0b1000, 0b10, (outs GPRNoX0:$rs1), (ins GPRNoX0:$rs2),
                       "c.mv", "$rs1, $rs2">;
 
-let rs1 = 0, rs2 = 0, hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
+let rs1 = 0, rs2 = 0, hasSideEffects = 1, mayLoad = 0, mayStore = 0 in
 def C_EBREAK : RVInst16CR<0b1001, 0b10, (outs), (ins), "c.ebreak", "">;
 
 let hasSideEffects = 0, mayLoad = 0, mayStore = 0,




More information about the llvm-commits mailing list