[PATCH] D154807: [InstCombine] Transform `(add (shl (neg X), Cnt))` -> `(sub (shl X, Cnt))`
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 26 00:38:06 PDT 2023
nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.
LG
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp:1151
+// (add A, (shl (neg B), Y))
+// -> (sub A, (shl B, Y))
+static Instruction *combineAddSubWithShlAddSub(InstCombiner::BuilderTy &Builder,
----------------
Y -> Cnt to match the name in the implementation.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp:1162
+ return nullptr;
+}
+
----------------
This is probably small enough to inline now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154807/new/
https://reviews.llvm.org/D154807
More information about the llvm-commits
mailing list