[PATCH] D139598: [InstCombine] Fold (X << Z) / (X * Y) -> (1 << Z) / Y
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 8 04:55:33 PST 2022
RKSimon added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:1062
+ return BinaryOperator::CreateUDiv(
+ Builder.CreateShl(ConstantInt::get(Ty, 1), Z), Y);
+ }
----------------
arsenm wrote:
> Can you preserve NUW and exact?
Move the !IsSigned check outside to avoid the cost of match calls?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139598/new/
https://reviews.llvm.org/D139598
More information about the llvm-commits
mailing list