[PATCH] D20852: [AMDGPU] Remove exit-on-error in test (PR27761)
Diana Picus via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 7 03:34:51 PDT 2016
rovka updated this revision to Diff 59850.
rovka added a comment.
Using the -1 constant causes some assertions later on, but 0 works like a charm.
Updated the test, too.
Thanks.
http://reviews.llvm.org/D20852
Files:
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
lib/Target/AMDGPU/AMDGPUInstrInfo.cpp
test/CodeGen/AMDGPU/dynamic_stackalloc.ll
test/CodeGen/AMDGPU/private-memory-broken.ll
test/CodeGen/AMDGPU/promote-alloca-bitcast-function.ll
Index: test/CodeGen/AMDGPU/promote-alloca-bitcast-function.ll
===================================================================
--- test/CodeGen/AMDGPU/promote-alloca-bitcast-function.ll
+++ test/CodeGen/AMDGPU/promote-alloca-bitcast-function.ll
@@ -1,4 +1,4 @@
-; RUN: not llc -march=amdgcn -exit-on-error < %s 2>&1 | FileCheck %s
+; RUN: not llc -march=amdgcn < %s 2>&1 | FileCheck %s
; Make sure that AMDGPUPromoteAlloca doesn't crash if the called
; function is a constantexpr cast of a function.
@@ -13,6 +13,7 @@
ret void
}
+; CHECK: in function crash_call_constexpr_cast{{.*}}: unsupported call to function foo.varargs
define void @crash_call_constexpr_cast_varargs() #0 {
%alloca = alloca i32
call void bitcast (void (...)* @foo.varargs to void (i32*)*)(i32* %alloca) #0
Index: test/CodeGen/AMDGPU/private-memory-broken.ll
===================================================================
--- test/CodeGen/AMDGPU/private-memory-broken.ll
+++ test/CodeGen/AMDGPU/private-memory-broken.ll
@@ -1,5 +1,5 @@
-; RUN: not llc -verify-machineinstrs -march=amdgcn -mcpu=SI -exit-on-error %s -o /dev/null 2>&1 | FileCheck %s
-; RUN: not llc -verify-machineinstrs -march=amdgcn -mcpu=tonga -exit-on-error %s -o /dev/null 2>&1 | FileCheck %s
+; RUN: not llc -verify-machineinstrs -march=amdgcn -mcpu=SI %s -o /dev/null 2>&1 | FileCheck %s
+; RUN: not llc -verify-machineinstrs -march=amdgcn -mcpu=tonga %s -o /dev/null 2>&1 | FileCheck %s
; Make sure promote alloca pass doesn't crash
Index: test/CodeGen/AMDGPU/dynamic_stackalloc.ll
===================================================================
--- test/CodeGen/AMDGPU/dynamic_stackalloc.ll
+++ test/CodeGen/AMDGPU/dynamic_stackalloc.ll
@@ -1,6 +1,6 @@
-; RUN: not llc -march=amdgcn -mcpu=tahiti -mattr=+promote-alloca -verify-machineinstrs -exit-on-error < %s 2>&1 | FileCheck %s
-; RUN: not llc -march=amdgcn -mcpu=tahiti -mattr=-promote-alloca -verify-machineinstrs -exit-on-error < %s 2>&1 | FileCheck %s
-; RUN: not llc -march=r600 -mcpu=cypress -exit-on-error < %s 2>&1 | FileCheck %s
+; RUN: not llc -march=amdgcn -mcpu=tahiti -mattr=+promote-alloca -verify-machineinstrs < %s 2>&1 | FileCheck %s
+; RUN: not llc -march=amdgcn -mcpu=tahiti -mattr=-promote-alloca -verify-machineinstrs < %s 2>&1 | FileCheck %s
+; RUN: not llc -march=r600 -mcpu=cypress < %s 2>&1 | FileCheck %s
; CHECK: in function test_dynamic_stackalloc{{.*}}: unsupported dynamic alloca
Index: lib/Target/AMDGPU/AMDGPUInstrInfo.cpp
===================================================================
--- lib/Target/AMDGPU/AMDGPUInstrInfo.cpp
+++ lib/Target/AMDGPU/AMDGPUInstrInfo.cpp
@@ -103,7 +103,9 @@
const MachineFrameInfo *MFI = MF.getFrameInfo();
// Variable sized objects are not supported
- assert(!MFI->hasVarSizedObjects());
+ if (MFI->hasVarSizedObjects()) {
+ return -1;
+ }
if (MFI->getNumObjects() == 0) {
return -1;
Index: lib/Target/AMDGPU/AMDGPUISelLowering.cpp
===================================================================
--- lib/Target/AMDGPU/AMDGPUISelLowering.cpp
+++ lib/Target/AMDGPU/AMDGPUISelLowering.cpp
@@ -689,7 +689,8 @@
DiagnosticInfoUnsupported NoDynamicAlloca(Fn, "unsupported dynamic alloca",
SDLoc(Op).getDebugLoc());
DAG.getContext()->diagnose(NoDynamicAlloca);
- return SDValue();
+ auto Ops = {DAG.getConstant(0, SDLoc(), Op.getValueType()), Op.getOperand(0)};
+ return DAG.getMergeValues(Ops, SDLoc());
}
SDValue AMDGPUTargetLowering::LowerOperation(SDValue Op,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20852.59850.patch
Type: text/x-patch
Size: 3549 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160607/db6da75c/attachment.bin>
More information about the llvm-commits
mailing list