llvm-project
0a8acd2e - [DAG] ComputeNumSignBits - ISD::EXTRACT_ELEMENT needs to return at least 1 (#155455)

Commit
13 days ago
[DAG] ComputeNumSignBits - ISD::EXTRACT_ELEMENT needs to return at least 1 (#155455) When going through the ISD::EXTRACT_ELEMENT case, `KnownSign - rIndex * BitWidth` could produce a negative. When a negative is produced, the lower bound of the `std::clamp` is returned. Change that lower bound to one to avoid potential underflows, because the expectation is that `ComputeNumSignBits` should always return at least 1. Fixes #155452.
Author
Parents
Loading