llvm-project
171940db - [X86]: `sub(0, and(X, 1))` -> `ashr(shl(X, SizeInBits - 1), SizeInBits - 1)` (#243478)

Commit
2 days ago
[X86]: `sub(0, and(X, 1))` -> `ashr(shl(X, SizeInBits - 1), SizeInBits - 1)` (#243478) In `InstCombine`, expressions of the form `ashr(shl(X, SizeInBits - 1), SizeInBits - 1)` are canonicalized into the form `sub(0, and(X, 1))`. The issue with this representation is that the generated code is suboptimal and requires an additional register. To address this, an inverse operation has been added for `x86`. Fixes https://github.com/llvm/llvm-project/issues/208410
Author
Parents
Loading