[PATCH] D48047: [AMDGPU] findMaskOperands() - prevent hitting Assertion `isReg() && "Wrong MachineOperand accessor"'
Mark Searles via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 11 17:45:48 PDT 2018
This revision was automatically updated to reflect the committed changes.
msearles marked an inline comment as done.
Closed by commit rL334459: [AMDGPU] prevent hitting Assertion `isReg() && "Wrong MachineOperand accessor"' (authored by msearles, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D48047?vs=150829&id=150871#toc
Repository:
rL LLVM
https://reviews.llvm.org/D48047
Files:
llvm/trunk/lib/Target/AMDGPU/SILowerControlFlow.cpp
llvm/trunk/test/CodeGen/AMDGPU/si-lower-control-flow.mir
Index: llvm/trunk/lib/Target/AMDGPU/SILowerControlFlow.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/SILowerControlFlow.cpp
+++ llvm/trunk/lib/Target/AMDGPU/SILowerControlFlow.cpp
@@ -453,8 +453,8 @@
return;
for (const auto &SrcOp : Def->explicit_operands())
- if (SrcOp.isUse() && (!SrcOp.isReg() ||
- TargetRegisterInfo::isVirtualRegister(SrcOp.getReg()) ||
+ if (SrcOp.isReg() && SrcOp.isUse() &&
+ (TargetRegisterInfo::isVirtualRegister(SrcOp.getReg()) ||
SrcOp.getReg() == AMDGPU::EXEC))
Src.push_back(SrcOp);
}
Index: llvm/trunk/test/CodeGen/AMDGPU/si-lower-control-flow.mir
===================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/si-lower-control-flow.mir
+++ llvm/trunk/test/CodeGen/AMDGPU/si-lower-control-flow.mir
@@ -0,0 +1,23 @@
+# RUN: llc -mtriple=amdgcn-amd-amdhsa-amdgizcl -run-pass=si-lower-control-flow -verify-machineinstrs %s -o - | FileCheck -check-prefixes=GCN %s
+
+# Check that assert is not triggered
+# GCN-LABEL: name: si-lower-control-flow{{$}}
+# GCN-CHECK: S_LOAD_DWORD_IMM
+
+--- |
+
+ define amdgpu_kernel void @si-lower-control-flow() {
+ ret void
+ }
+
+...
+---
+name: si-lower-control-flow
+body: |
+ bb.0:
+ %0:sgpr_64 = COPY $sgpr4_sgpr5
+ %1:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %0, 16, 0
+ %2:sreg_32_xm0 = S_AND_B32 %1, 255, implicit-def $scc
+ %3:sreg_32_xm0 = S_AND_B32 65535, %2, implicit-def $scc
+ S_ENDPGM
+...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48047.150871.patch
Type: text/x-patch
Size: 1534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180612/ec466f5b/attachment.bin>
More information about the llvm-commits
mailing list