[PATCH] D128428: [LoongArch] Add codegen support for conditional branches

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 10:56:34 PDT 2022


xen0n added inline comments.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchInstrInfo.td:195
 class BrCC_2RI16<bits<6> op, string opstr>
-    : Fmt2RI16<op, (outs), (ins GPR:$rj, GPR:$rd, simm16_lsl2:$imm16), opstr,
+    : Fmt2RI16<op, (outs), (ins GPR:$rj, GPR:$rd, simm16_lsl2_br:$imm16), opstr,
                "$rj, $rd, $imm16"> {
----------------
Could you explain a bit on why this is needed? I can't easily understand this as the only change is on the "guard" of said definition but the dropped check seems too important to ignore. (Maybe because I haven't looked at LLVM source code as hard as you did.)


================
Comment at: llvm/test/CodeGen/LoongArch/ir-instruction/br.ll:21
+; LA32-NEXT:    beq $a2, $a0, .LBB1_2
+; LA32-NEXT:    b .LBB1_1
+; LA32-NEXT:  .LBB1_1: # %test
----------------
Why this redundant unconditional jump? Is it because optimization is not enabled or other reason?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128428/new/

https://reviews.llvm.org/D128428



More information about the llvm-commits mailing list