Skip to content
Commit 7b9482df authored by Sanjay Patel's avatar Sanjay Patel
Browse files

[InstCombine] fold sdiv with common shl amount in operands

(X << Z) / (Y << Z) --> X / Y

https://alive2.llvm.org/ce/z/CLKzqT

This requires a surprising "nuw" constraint because we have
to guard against immediate UB via signed-div overflow with
-1 divisor.

This extends 008a8903 and is another transform
derived from issue #58137.
parent 4c19439d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment