[all-commits] [llvm/llvm-project] c877eb: [InstCombine] Add tests for folding `(add X, (sext...
goldsteinn via All-commits
all-commits at lists.llvm.org
Sat Jun 1 15:49:50 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c877eb3754ad1a61db2717530141eded580c3533
https://github.com/llvm/llvm-project/commit/c877eb3754ad1a61db2717530141eded580c3533
Author: Noah Goldstein <goldstein.w.n at gmail.com>
Date: 2024-06-01 (Sat, 01 Jun 2024)
Changed paths:
A llvm/test/Transforms/InstCombine/fold-ext-eq-c-with-op.ll
Log Message:
-----------
[InstCombine] Add tests for folding `(add X, (sext/zext (icmp eq X, C)))`; NFC
Commit: 0310f7f2d0c56a5697710251cec9803cbf7b4d56
https://github.com/llvm/llvm-project/commit/0310f7f2d0c56a5697710251cec9803cbf7b4d56
Author: Noah Goldstein <goldstein.w.n at gmail.com>
Date: 2024-06-01 (Sat, 01 Jun 2024)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
M llvm/test/Transforms/InstCombine/apint-shift.ll
M llvm/test/Transforms/InstCombine/fold-ext-eq-c-with-op.ll
Log Message:
-----------
[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
Compare: https://github.com/llvm/llvm-project/compare/e7e6e1ecadc5...0310f7f2d0c5
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list