Skip to content

Commit

Permalink
[AMDGPU] Don't remove short branches over kills
Browse files Browse the repository at this point in the history
Summary:
D68092 introduced a new SIRemoveShortExecBranches optimization pass and
broke some graphics shaders. The problem is that it was removing
branches over KILL pseudo instructions, and the fix is to explicitly
check for that in mustRetainExeczBranch.

Reviewers: critson, arsenm, nhaehnle, cdevadas, hakzsam

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73771

Change-Id: I84d96d165c4f6da4870e125d1b2664b9daad51e0
  • Loading branch information
jayfoad committed Jan 31, 2020
1 parent 7ebe085 commit 0cd3f3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llvm/lib/Target/AMDGPU/SIRemoveShortExecBranches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ bool SIRemoveShortExecBranches::mustRetainExeczBranch(
if (TII->hasUnwantedEffectsWhenEXECEmpty(*I))
return true;

if (TII->isKillTerminator(I->getOpcode()))
return true;

// These instructions are potentially expensive even if EXEC = 0.
if (TII->isSMRD(*I) || TII->isVMEM(*I) || TII->isFLAT(*I) ||
I->getOpcode() == AMDGPU::S_WAITCNT)
Expand Down

0 comments on commit 0cd3f3e

Please sign in to comment.