[PATCH] D131786: [ARM] Support all versions of AND, ORR, EOR and BIC in optimizeCompareInstr

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 10:48:23 PDT 2022


efriedma added inline comments.


================
Comment at: llvm/lib/Target/ARM/ARMInstrInfo.td:4888
+// as it will be handled separately after isel by the peephole
+// that fuse a shift with a comparison (by using shift's S-version).
 def : ARMPat<(ARMcmpZ GPR:$src, mod_imm:$imm),
----------------
I'm not sure how you use the shift's S-version in general.  Do we have test coverage for something like `void a(int x, int y, void z()) { if ((x >> 1) == y) z(); }`?

(If the issue is that we're choosing CMPrsi over CMPri, you can probably use AddedComplexity to force the preferred form.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131786



More information about the llvm-commits mailing list