This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fold fneg into fminnum/fmaxnum
ClosedPublic

Authored by arsenm on Jan 16 2017, 8:32 PM.

Details

Diff Detail

Event Timeline

arsenm created this revision.Jan 16 2017, 8:32 PM
escha accepted this revision.Jan 30 2017, 9:21 AM
This revision is now accepted and ready to land.Jan 30 2017, 9:21 AM

LGTM with minor comment.

lib/Target/AMDGPU/AMDGPUISelLowering.cpp
2991–2992

I think this comments should be:

// fneg (fmaxnum x, y) -> fminnum (fneg x), (fneg y)
// fneg (fminnum x, y) -> fmaxnum (fneg x), (fneg y)
arsenm closed this revision.Feb 2 2017, 4:35 PM

r293968. I had to add a special case to stop folding 0s to avoid a quality regression in shader-db which should be extended to other operations though