[PATCH] D20852: [AMDGPU] Remove exit-on-error in test (PR27761)

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 06:13:56 PDT 2016


rovka updated this revision to Diff 59711.
rovka added a comment.

...with the initial changes too, ofc.


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.
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.getIntPtrConstant(0, SDLoc()), Op.getOperand(0)};
+  return DAG.getMergeValues(Ops, SDLoc());
 }
 
 SDValue AMDGPUTargetLowering::LowerOperation(SDValue Op,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20852.59711.patch
Type: text/x-patch
Size: 3245 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160606/44d9a9f7/attachment.bin>


More information about the llvm-commits mailing list