summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
diff options
context:
space:
mode:
authorNicolai Haehnle <nhaehnle@gmail.com>2016-07-06 08:35:17 +0000
committerNicolai Haehnle <nhaehnle@gmail.com>2016-07-06 08:35:17 +0000
commite40530ea7b594d80decb6feca902f02cc9d620f6 (patch)
treeb4b163f417a68a05096f637aa5c0407f01126850 /llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
parent971fbfda1ed184a7a515d5d8d8e42d840756cd34 (diff)
downloadbcm5719-llvm-e40530ea7b594d80decb6feca902f02cc9d620f6.tar.gz
bcm5719-llvm-e40530ea7b594d80decb6feca902f02cc9d620f6.zip
AMDGPU: Fix return of non-void-returning shaders
Summary: Since "AMDGPU: Fix verifier errors in SILowerControlFlow", the logic that ensures that a non-void-returning shader falls off the end of the last basic block was effectively disabled, since SI_RETURN is now used. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96731 Reviewers: arsenm, tstellarAMD Subscribers: arsenm, kzhuravl, llvm-commits Differential Revision: http://reviews.llvm.org/D21975 llvm-svn: 274612
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp b/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
index ae23a96b621..f65d7d87aae 100644
--- a/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
+++ b/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
@@ -729,14 +729,13 @@ bool SILowerControlFlow::runOnMachineFunction(MachineFunction &MF) {
break;
- case AMDGPU::S_ENDPGM: {
- if (MF.getInfo<SIMachineFunctionInfo>()->returnsVoid())
- break;
+ case AMDGPU::SI_RETURN: {
+ assert(!MF.getInfo<SIMachineFunctionInfo>()->returnsVoid());
// Graphics shaders returning non-void shouldn't contain S_ENDPGM,
// because external bytecode will be appended at the end.
if (BI != --MF.end() || I != MBB.getFirstTerminator()) {
- // S_ENDPGM is not the last instruction. Add an empty block at
+ // SI_RETURN is not the last instruction. Add an empty block at
// the end and jump there.
if (!EmptyMBBAtEnd) {
EmptyMBBAtEnd = MF.CreateMachineBasicBlock();
@@ -746,9 +745,8 @@ bool SILowerControlFlow::runOnMachineFunction(MachineFunction &MF) {
MBB.addSuccessor(EmptyMBBAtEnd);
BuildMI(*BI, I, MI.getDebugLoc(), TII->get(AMDGPU::S_BRANCH))
.addMBB(EmptyMBBAtEnd);
+ I->eraseFromParent();
}
-
- I->eraseFromParent();
break;
}
}
OpenPOWER on IntegriCloud