[PATCH] D73790: [AArch64][GlobalISel] Walk through G_AND in TB(N)Z bit calculation

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 09:49:48 PST 2020


aemerson added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp:1014
+    // Look through binary operations that we might want to try and fold in.
+    if (MI->getNumOperands() != 3)
       break;
----------------
We need to be explicit here about which opcode's we're looking for.


================
Comment at: llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp:1027
+    auto VRegAndVal = getConstantVRegValWithLookThrough(ConstantReg, MRI);
+    if (!VRegAndVal) {
+      std::swap(ConstantReg, TestReg);
----------------
Do we see these cases of constants on LHS often? Maybe we should fix that at the place of origin if we can.

Also: this is only valid for commutative ops, e.g. not shifts.


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

https://reviews.llvm.org/D73790





More information about the llvm-commits mailing list