[PATCH] D139598: [InstCombine] Fold (X << Z) / (X * Y) -> (1 << Z) / Y
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 18:37:05 PST 2022
arsenm added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:1062
+ return BinaryOperator::CreateUDiv(
+ Builder.CreateShl(ConstantInt::get(Ty, 1), Z), Y);
+ }
----------------
Can you preserve NUW and exact?
================
Comment at: llvm/test/Transforms/InstCombine/div-shift.ll:556
}
; negative test - sdiv
----------------
Vector test? Tests with flag preservation?
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