diff options
author | Noah Goldstein <goldstein.w.n@gmail.com> | 2024-05-30 10:01:33 -0500 |
---|---|---|
committer | Noah Goldstein <goldstein.w.n@gmail.com> | 2024-06-01 17:49:15 -0500 |
commit | 0310f7f2d0c56a5697710251cec9803cbf7b4d56 (patch) | |
tree | a27b331fbd47fb4e7623442371912eda70991487 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | |
parent | c877eb3754ad1a61db2717530141eded580c3533 (diff) | |
download | llvm-0310f7f2d0c56a5697710251cec9803cbf7b4d56.zip llvm-0310f7f2d0c56a5697710251cec9803cbf7b4d56.tar.gz llvm-0310f7f2d0c56a5697710251cec9803cbf7b4d56.tar.bz2 |
[InstCombine] Fold `(add X, (sext/zext (icmp eq X, C)))`
We can convert this to a select based on the `(icmp eq X, C)`, then
constant fold the addition the true arm begin `(add C, (sext/zext 1))`
and the false arm being `(add X, 0)` e.g
- `(select (icmp eq X, C), (add C, (sext/zext 1)), (add X, 0))`.
This is essentially a specialization of the only case that sees to
actually show up from #89020
Closes #93840
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
0 files changed, 0 insertions, 0 deletions