Skip to content
Commit 1d1d1e6f authored by Sanjay Patel's avatar Sanjay Patel
Browse files

[InstCombine] fold full-shift of sdiv to icmp+extend

This is a disguised sign-bit test with offset:
(X / +DivC) >> (Width - 1) --> ext (X <= -DivC)
(X / -DivC) >> (Width - 1) --> ext (X >= +DivC)

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

We don't match/test poison in the sdiv constant because
that would be immediate undefined behavior.
parent 0ae6bc07
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment