This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Don't use offen if it is 0
ClosedPublic

Authored by arsenm on Sep 15 2016, 8:49 PM.

Details

Summary

This removes many re-initializations of a base register to 0.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 71592.Sep 15 2016, 8:49 PM
arsenm retitled this revision from to AMDGPU: Don't use offen if it is 0.
arsenm updated this object.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.

The computation of NewOffset should be shared between the load and store paths.

I guess changing the MachineInstr could also be shared using MachineInstr::RemoveOperand, but the resulting code might not be much cleaner.

The rest looks good to me.

The computation of NewOffset should be shared between the load and store paths.

I guess changing the MachineInstr could also be shared using MachineInstr::RemoveOperand, but the resulting code might not be much cleaner.

The rest looks good to me.

Ma original plan was to just re-use buildScratchLoadStore which is what D24630 was for, but that changes from scavenging a VGPR to an SGPR and I wasn't sure what the consequences of that might be

arsenm updated this revision to Diff 71770.Sep 18 2016, 10:42 PM

Refactor. buildScratchLoadStore is different enough that its should be separate

kzhuravl accepted this revision.Sep 30 2016, 9:07 AM
kzhuravl added a reviewer: kzhuravl.

LGTM

This revision is now accepted and ready to land.Sep 30 2016, 9:07 AM
arsenm closed this revision.Sep 30 2016, 6:46 PM

r282999