HomePhabricator

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

Authored by craig.topper on Sat, Aug 1, 9:59 AM.

Description

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

Negating the input doesn't matter. I left a FIXME to copy the nsw flag if its present on the neg but not on the abs.

Reviewed By: nikic

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

Details

Committed
craig.topperSat, Aug 1, 1:25 PM
Reviewer
nikic
Differential Revision
D85055: [InstCombine] Fold abs(-x) -> abs(x)
Parents
rG95ddb9ff6730: [PPC] Adjust run line for hardware-loops-crash.ll
Branches
Unknown
Tags
Unknown