[PATCH] D90723: [AArch64][GlobalISel] Select G_SELECT cc, t, (G_SUB 0, x) -> CSNEG t, x, cc

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 12 10:08:37 PST 2020


aemerson added inline comments.


================
Comment at: llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp:1028
+    auto MaybeZero =
+        getConstantVRegValWithLookThrough(Sub->getOperand(1).getReg(), MRI);
+    if (!MaybeZero || MaybeZero->Value != 0)
----------------
I committed a patch to recognize a negate idiom for G_PTR_ADD in ad376657c1ec4da950d18b37b523585ccd4fc7bb, maybe you can re-use that as a helper, or just copy the MI PatternMatch code since its only a few lines.


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

https://reviews.llvm.org/D90723



More information about the llvm-commits mailing list