[llvm] [TTI][RISCV] Unconditionally break critical edges to sink ADDI (PR #108889)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 09:19:16 PDT 2024


================
@@ -91,14 +87,14 @@ define i32 @f_small_edge_neg(i32 %in0) minsize {
 ; constant is medium and not fit in 6 bit (compress imm),
 ; but fit in 12 bit (imm)
 ; RV32IFDC-LABEL: <f_medium_ledge_pos>:
-; RV32IFDC: addi [[MAYZEROREG:.*]], [[REG:.*]], -0x20
-; RV32IFDC: RESBROPT [[MAYZEROREG]], [[PLACE:.*]]
+; RV32IFDC: addi [[MAYZEROREG:.*]], [[REG:.*]], -0x21
+; RV32IFDC: [[COND:c.b.*]] [[MAYZEROREG]], [[PLACE:.*]]
 ; --- no compress extension
 ; RV32IFD-LABEL: <f_medium_ledge_pos>:
-; RV32IFD: addi [[REG:.*]], zero, 0x20
-; RV32IFD: RESBRNORMAL [[ANOTHER:.*]], [[REG]], [[PLACE:.*]]
+; RV32IFD: addi [[REG:.*]], zero, 0x21
+; RV32IFD: [[COND:b.*]] [[ANOTHER:.*]], [[REG]], [[PLACE:.*]]
 define i32 @f_medium_ledge_pos(i32 %in0) minsize {
-  %cmp = icmp CMPCOND i32 %in0, 32
+  %cmp = icmp CMPCOND i32 %in0, 33
----------------
preames wrote:

I landed these changes on main, and eventually figured out we could autogen this test without loosing the spirit of the compressed checks.  The resulting diff (there is a much bigger one than even I'd realized) should be a lot more obvious now.  They do look to be improvements.

https://github.com/llvm/llvm-project/pull/108889


More information about the llvm-commits mailing list