diff options
author | Sanjay Patel <spatel@rotateright.com> | 2022-05-27 11:27:14 -0400 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2022-05-27 11:54:19 -0400 |
commit | b5b6aa4d53407ff1f7805fc000def63669d64a9f (patch) | |
tree | 34919f987e9bff599fdb9b3d75fb5785b131b2bb /llvm/lib/Object/WasmObjectFile.cpp | |
parent | 5a6e0857577e6dafb03716cfd47fa319441691dc (diff) | |
download | llvm-b5b6aa4d53407ff1f7805fc000def63669d64a9f.zip llvm-b5b6aa4d53407ff1f7805fc000def63669d64a9f.tar.gz llvm-b5b6aa4d53407ff1f7805fc000def63669d64a9f.tar.bz2 |
[InstCombine] fold multiply by signbit-splat to cmp+select
(ashr i32 X, 31) * C --> (X < 0) ? -C : 0
https://alive2.llvm.org/ce/z/G8u9SS
With a constant operand, this is an improvement in IR
and codegen (where it can be converted to a mask op).
Without a constant operand, we would have to negate
the operand, so that is probably better left to the backend.
This is similar but not the same optimization that is requested
in #55618.
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions