Page MenuHomePhabricator

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

Authored by craig.topper on Fri, Jul 31, 4:05 PM.



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.

Diff Detail

Event Timeline

craig.topper created this revision.Fri, Jul 31, 4:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptFri, Jul 31, 4:05 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
craig.topper requested review of this revision.Fri, Jul 31, 4:05 PM
nikic accepted this revision.Sat, Aug 1, 1:09 AM

LG. I was wondering if we can use any of our more powerful negation machinery here, but I don't think so, because it would end up looping infinitely.

This revision is now accepted and ready to land.Sat, Aug 1, 1:09 AM
This revision was automatically updated to reflect the committed changes.