[PATCH] D73924: [AArch64][GlobalISel] Fold G_SHL into TB(N)Z bit calculation

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 14:22:52 PST 2020


aemerson accepted this revision.
aemerson added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp:1063
+      // (tbz (shl x, c), b) -> (tbz x, b-c) when b-c is positive and fits in
+      // the type of the register.
+      if (*C <= Bit && (Bit - *C) < MRI.getType(TestReg).getSizeInBits()) {
----------------
I guess the case where b-c is negative isn't hit in real code. If it does come from real world code then the entire condbr can be folded away as always/never taken tbz/tbnz.


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

https://reviews.llvm.org/D73924





More information about the llvm-commits mailing list