[PATCH] D130080: [InstCombine] Change order of canonicalization of ADD and AND

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 05:43:54 PDT 2022


foad created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
foad requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Canonicalize ((x + C1 <https://reviews.llvm.org/C1>) & C2) --> ((x & C2) + C1 <https://reviews.llvm.org/C1>) for suitable constants
C1 <https://reviews.llvm.org/C1> and C2, instead of the other way round. This should allow more
constant ADDs to be matched as part of addressing modes for loads and
stores.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130080

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
  llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
  llvm/test/Transforms/InstCombine/add.ll
  llvm/test/Transforms/InstCombine/integer-round-up-pow2-alignment.ll
  llvm/test/Transforms/InstCombine/or.ll
  llvm/test/Transforms/InstCombine/sub.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130080.445791.patch
Type: text/x-patch
Size: 10302 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220719/5187008f/attachment.bin>


More information about the llvm-commits mailing list