[PATCH] D110339: SelectionDAGBuilder: Improve canonicalization by not swapping branch targets

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 23 09:28:20 PDT 2021


MatzeB added inline comments.


================
Comment at: llvm/test/CodeGen/X86/2006-08-21-ExtraMovInst.ll:15
+; CHECK-NEXT:    cmpl $39, %ecx
+; CHECK-NEXT:    jle .LBB0_1
 ; CHECK-NEXT:  # %bb.2: # %bb12
----------------
RKSimon wrote:
> This kind of thing is going to increase EFLAGS usage - I addressed this for CMOVs + SETs with SGT/UGT in D101074 but haven't had time to address JMP/BRANCH, or add the SLE/ULE equivalent yet.
> This kind of thing is going to increase EFLAGS usage

Wow, I was not aware that affects performance. Does that mean MachineCodePlacement / analyzeBranch can pessimize code when it flips the true/false branches and negates the condition of a jump?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110339



More information about the llvm-commits mailing list