This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Select mad patterns to v_mac_f32
ClosedPublic

Authored by tstellarAMD on Jul 9 2015, 7:08 AM.

Details

Summary

The two-address instruction pass will convert these back to v_mad_f32
if necessary.

Diff Detail

Event Timeline

tstellarAMD retitled this revision from to AMDGPU/SI: Select mad patterns to v_mac_f32.
tstellarAMD updated this object.
tstellarAMD added a reviewer: arsenm.
tstellarAMD added a subscriber: llvm-commits.
arsenm accepted this revision.Jul 9 2015, 9:56 AM
arsenm edited edge metadata.

LGTM

lib/Target/AMDGPU/SIFoldOperands.cpp
131

FoldList seems like it should be a set or map instead

This revision is now accepted and ready to land.Jul 9 2015, 9:56 AM
tstellarAMD added inline comments.Jul 9 2015, 5:26 PM
lib/Target/AMDGPU/SIFoldOperands.cpp
131

A map with UseMI as the Key and FoldCandidate as the value?

arsenm added inline comments.Jul 9 2015, 5:58 PM
lib/Target/AMDGPU/SIFoldOperands.cpp
131

Yes. Is there a reason FoldList will be known to be small?

tstellarAMD added inline comments.Jul 9 2015, 6:24 PM
lib/Target/AMDGPU/SIFoldOperands.cpp
131

The size of FoldList is the number of unique uses of a register, so it will usually be small.

tstellarAMD added inline comments.Jul 9 2015, 7:15 PM
lib/Target/AMDGPU/SIFoldOperands.cpp
131

Actually, we can' t use a map, because it is possible to have the same UseMI in the list twice. We only disallow it if we need to commute the UseMI in order to fold an operand into it.

This revision was automatically updated to reflect the committed changes.