This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix infinite loop in DAG combine with fneg + fma
ClosedPublic

Authored by arsenm on Jun 12 2021, 8:30 AM.

Details

Summary

We were not reporting isFNegFree for v2f32, although it is effectively
free after legalization. The generic combine was pulling fneg out of
the fma source operands, and the AMDGPU combine was doing the
opposite.

Diff Detail

Unit TestsFailed

Event Timeline

arsenm created this revision.Jun 12 2021, 8:30 AM
arsenm requested review of this revision.Jun 12 2021, 8:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2021, 8:30 AM
Herald added a subscriber: wdng. · View Herald Transcript
rampitec accepted this revision.Jun 14 2021, 12:40 PM

LGTM

llvm/test/CodeGen/AMDGPU/fneg-combines.ll
2581

It actually can be free even in packed f32 form with neg_lo/neg_hi with FeaturePackedFP32Ops.

This revision is now accepted and ready to land.Jun 14 2021, 12:40 PM