Add the optimizations we have in the SelectionDAG version.
Known non-negative copies all known bits. Any known one other than
the sign bit makes result non-negative.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/test/Transforms/InstCombine/abs-intrinsic.ll | ||
---|---|---|
88 | This test folds, so FIXME here is confusing. Do we want a reduced test without the icmp? define i32 @abs_of_zext(i31 %x) { %zext = zext i31 %x to i32 %abs = call i32 @llvm.abs.i32(i32 %zext, i1 false) ret i32 %abs } |
Comment Actions
Add vector tests. Remove FIXME from test
llvm/test/Transforms/InstCombine/abs-intrinsic.ll | ||
---|---|---|
88 | I assume this will be covered by your InstSimplify change? |
Comment Actions
LGTM
llvm/test/Transforms/InstCombine/abs-intrinsic.ll | ||
---|---|---|
88 | Yes, that will get it. No need to duplicate here. |
This test folds, so FIXME here is confusing. Do we want a reduced test without the icmp?