[PATCH] D58695: [AMDGPU] Fixed hang during DAG combine

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 26 12:55:55 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL354926: [AMDGPU] Fixed hang during DAG combine (authored by rampitec, committed by ).
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D58695?vs=188445&id=188447#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58695/new/

https://reviews.llvm.org/D58695

Files:
  llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
  llvm/trunk/test/CodeGen/AMDGPU/reassoc-scalar.ll


Index: llvm/trunk/test/CodeGen/AMDGPU/reassoc-scalar.ll
===================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/reassoc-scalar.ll
+++ llvm/trunk/test/CodeGen/AMDGPU/reassoc-scalar.ll
@@ -109,5 +109,21 @@
   ret void
 }
 
+ at var = common hidden local_unnamed_addr addrspace(1) global [4 x i32] zeroinitializer, align 4
+
+; GCN-LABEL: reassoc_i32_ga:
+; GCN: s_add_u32 s{{[0-9]+}}, s{{[0-9]+}}, var at rel32@lo+4
+; GCN: s_addc_u32 s{{[0-9]+}}, s{{[0-9]+}}, var at rel32@hi+4
+; GCN: s_endpgm
+define amdgpu_kernel void @reassoc_i32_ga(i64 %x) {
+bb:
+  %tid = tail call i32 @llvm.amdgcn.workitem.id.x()
+  %t64 = zext i32 %tid to i64
+  %add1 = getelementptr [4 x i32], [4 x i32] addrspace(1)* @var, i64 0, i64 %t64
+  %add2 = getelementptr i32, i32 addrspace(1)* %add1, i64 %x
+  store volatile i32 1, i32 addrspace(1)* %add2, align 4
+  ret void
+}
+
 declare i32 @llvm.amdgcn.workitem.id.x()
 declare i32 @llvm.amdgcn.workitem.id.y()
Index: llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
+++ llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -8477,7 +8477,8 @@
 
   // If either operand is constant this will conflict with
   // DAGCombiner::ReassociateOps().
-  if (isa<ConstantSDNode>(Op0) || isa<ConstantSDNode>(Op1))
+  if (DAG.isConstantIntBuildVectorOrConstantInt(Op0) ||
+      DAG.isConstantIntBuildVectorOrConstantInt(Op1))
     return SDValue();
 
   SDLoc SL(N);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58695.188447.patch
Type: text/x-patch
Size: 1539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190226/c44c1ef2/attachment.bin>


More information about the llvm-commits mailing list