hanchenye-llvm-project/llvm/test/Transforms/EarlyCSE
Craig Topper f14e62c9a5 [EarlyCSE] Improve EarlyCSE of some absolute value cases.
Change matchSelectPattern to return X and -X for ABS/NABS in a well defined order. Adjust EarlyCSE to account for this. Ensure the SPF result is some kind of min/max and not abs/nabs in one place in InstCombine that made me nervous.

Prevously we returned the two operands of the compare part of the abs pattern. The RHS is always going to be a 0i, 1 or -1 constant. This isn't a very meaningful thing to return for any one. There's also some freedom in the abs pattern as to what happens when the value is equal to 0. This freedom led to early cse failing to match when different constants were used in otherwise equivalent operations. By returning the input and its negation in a defined order we can ensure an exact match. This also makes sure both patterns use the exact same subtract instruction for the negation. I believe CSE should evebntually make this happen and properly merge the nsw/nuw flags. But I'm not familiar with CSE and what order it does things in so it seemed like it might be good to really enforce that they were the same.

Differential Revision: https://reviews.llvm.org/D47037

llvm-svn: 332865
2018-05-21 18:42:42 +00:00
..
AArch64
atomics.ll
basic.ll
commute.ll [EarlyCSE] Improve EarlyCSE of some absolute value cases. 2018-05-21 18:42:42 +00:00
conditional.ll
const-speculation.ll
debuginfo-dce.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
edge.ll
fence.ll
flags.ll
floatingpoint.ll
globalsaa-memoryssa.ll
guards.ll
instsimplify-dom.ll
int_sideeffect.ll
invariant-loads.ll [EarlyCSE] Don't hide earler invariant.scopes 2018-03-15 18:12:27 +00:00
invariant.start.ll [EarlyCSE] Don't hide earler invariant.scopes 2018-03-15 18:12:27 +00:00
memoryssa.ll
pr33406.ll
read-reg.ll
readnone-mayunwind.ll