Turn canonicalized subtraction back into (-1 - B) and combine it with (A + 1) into (A - B).
This is similar to the folding already done for (B ^ -1) + Const into (-1 + Const) - B.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Transforms/InstCombine/InstCombineAddSub.cpp | ||
---|---|---|
1217 ↗ | (On Diff #152611) | The constants are already canonicalized to RHS, so it's just m_Add(). |
Comment Actions
LGTM - see inline for some test suggestions.
test/Transforms/InstCombine/add.ll | ||
---|---|---|
801–802 ↗ | (On Diff #152651) |
|