This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: Correct specification of PHI nodes
ClosedPublic

Authored by MatzeB on Mar 22 2016, 8:35 PM.

Details

Summary

They do have a def machine operand.

Fixing the definition is necessary for an upcoming patch.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 51379.Mar 22 2016, 8:35 PM
MatzeB retitled this revision from to CodeGen: Correct specification of PHI nodes.
MatzeB updated this object.
MatzeB added reviewers: tstellarAMD, arsenm.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added subscribers: llvm-commits, qcolombet.

I am posting this for review, because I did not expect the change in the AMDGPU test being necessary.

It would be nice if someone familiar with AMDGPU could double check the AMDGPU testcase change. Looking through the AMDGPU code my guess would be that SIFixSGPRLiveRanges.cpp missed PHI instruction definitions before this patch, as the phi def operands where not part of the MachineInstr::defs() iterator before this fix.

Reading the comment in that code, I'd also recommend to change the code to loop over all MachineInstr::operands(), there is nothing preventing implicit-defs to address vregs as well (though this may not happen in the AMDGPU backend today).

tstellarAMD accepted this revision.Mar 28 2016, 7:06 AM
tstellarAMD edited edge metadata.

Thanks for diagnosing the issue with the AMDGPU backend. I don't think I'm going to have time to look into this in the next few days, so I don't mind dealing with any problems in a post-commit review. You can commit when ready.

This revision is now accepted and ready to land.Mar 28 2016, 7:06 AM
This revision was automatically updated to reflect the committed changes.