summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-04-22 19:14:26 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-04-22 19:14:26 +0000
commitf84ce75cd1c4847803f50ae0a4e95ca295dac30d (patch)
tree63123aa3eaf5beea0d47826832ba68fd493a56fe /llvm/lib
parente3f7074c7e95551c86bfc489ca0f5e23d7a64dcc (diff)
downloadbcm5719-llvm-f84ce75cd1c4847803f50ae0a4e95ca295dac30d.tar.gz
bcm5719-llvm-f84ce75cd1c4847803f50ae0a4e95ca295dac30d.zip
AMDGPU: Skip debug instructions in assert
These are inserted after branch relaxation, and for some reason it's decided to put them in the long branch expansion block. It's probably not great to rely on the source block address, so this should probably be switched to being PC relative instead of relying on the block address llvm-svn: 358909
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp b/llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp
index 24674f0e59d..e32c05f554b 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp
@@ -100,8 +100,13 @@ const MCExpr *AMDGPUMCInstLower::getLongBranchBlockExpr(
= MCSymbolRefExpr::create(MO.getMBB()->getSymbol(), Ctx);
const MCExpr *SrcBBSym = MCSymbolRefExpr::create(SrcBB.getSymbol(), Ctx);
- assert(SrcBB.front().getOpcode() == AMDGPU::S_GETPC_B64 &&
- ST.getInstrInfo()->get(AMDGPU::S_GETPC_B64).Size == 4);
+ // FIXME: The first half of this assert should be removed. This should
+ // probably be PC relative instead of using the source block symbol, and
+ // therefore the indirect branch expansion should use a bundle.
+ assert(
+ skipDebugInstructionsForward(SrcBB.begin(), SrcBB.end())->getOpcode() ==
+ AMDGPU::S_GETPC_B64 &&
+ ST.getInstrInfo()->get(AMDGPU::S_GETPC_B64).Size == 4);
// s_getpc_b64 returns the address of next instruction.
const MCConstantExpr *One = MCConstantExpr::create(4, Ctx);
OpenPOWER on IntegriCloud