HomePhabricator

[InstSimplify] Fold abs(abs(x)) -> abs(x)

Authored by craig.topper on Sat, Aug 1, 10:01 AM.

Description

[InstSimplify] Fold abs(abs(x)) -> abs(x)

It's always safe to pick the earlier abs regardless of the nsw flag. We'll just lose it if it is on the outer abs but not the inner abs.

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

Details

Committed
craig.topperSat, Aug 1, 1:25 PM
Differential Revision
D85053: [InstSimplify] Fold abs(abs(x)) -> abs(x)
Parents
rG4a19e6156ed5: [InstCombine] Fold abs(-x) -> abs(x)
Branches
Unknown
Tags
Unknown