forked from OSchip/llvm-project
AMDGPU/SI: Remove ending s_endpgm from non-void functions
Reviewers: tstellarAMD, arsenm Subscribers: arsenm Differential Revision: http://reviews.llvm.org/D16035 llvm-svn: 257623
This commit is contained in:
parent
8e9cc63bfb
commit
3c0ebc71f1
|
@ -494,6 +494,14 @@ bool SIInsertWaits::runOnMachineFunction(MachineFunction &MF) {
|
|||
|
||||
// Wait for everything at the end of the MBB
|
||||
Changes |= insertWait(MBB, MBB.getFirstTerminator(), LastIssued);
|
||||
|
||||
// Functions returning something shouldn't contain S_ENDPGM, because other
|
||||
// bytecode will be appended after it.
|
||||
if (!ReturnsVoid) {
|
||||
MachineBasicBlock::iterator I = MBB.getFirstTerminator();
|
||||
if (I != MBB.end() && I->getOpcode() == AMDGPU::S_ENDPGM)
|
||||
I->eraseFromParent();
|
||||
}
|
||||
}
|
||||
|
||||
return Changes;
|
||||
|
|
Loading…
Reference in New Issue