[NVPTX] Don't flag StoreRetVal memory chain operands as ReadMem (PR32146)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 12 May 2017 19:56:43 +0000 (19:56 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 12 May 2017 19:56:43 +0000 (19:56 +0000)
This fixes 47 of the 75 NVPTX '-verify-machineinstrs with EXPENSIVE_CHECKS' errors in PR32146.

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

llvm-svn: 302942

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
llvm/test/CodeGen/NVPTX/ctlz.ll
llvm/test/CodeGen/NVPTX/ctpop.ll
llvm/test/CodeGen/NVPTX/cttz.ll

index 2687c15..cca45b1 100644 (file)
@@ -2578,7 +2578,9 @@ NVPTXTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv,
       EVT TheStoreType = ExtendIntegerRetVal ? MVT::i32 : VTs[i];\r
       Chain = DAG.getMemIntrinsicNode(Op, dl, DAG.getVTList(MVT::Other),\r
                                       StoreOperands, TheStoreType,\r
-                                      MachinePointerInfo(), 1);\r
+                                      MachinePointerInfo(), /* Align */ 1,\r
+                                      /* Volatile */ false, /* ReadMem */ false,\r
+                                      /* WriteMem */ true, /* Size */ 0);\r
       // Cleanup vector state.\r
       StoreOperands.clear();\r
     }\r
index 005958b..7aa29fe 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
+; RUN: llc < %s -march=nvptx -mcpu=sm_20 -verify-machineinstrs | FileCheck %s
 
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
 
index b961d4d..69a4f87 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
+; RUN: llc < %s -march=nvptx -mcpu=sm_20 -verify-machineinstrs | FileCheck %s
 
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
 
index 124ba9d..0bfe013 100644 (file)
@@ -1,5 +1,4 @@
-; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
-
+; RUN: llc < %s -march=nvptx -mcpu=sm_20 -verify-machineinstrs | FileCheck %s
 
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"