From da1628eb679d2921e5d683e51cc9ecf6e5750295 Mon Sep 17 00:00:00 2001 From: Stanislav Mekhanoshin Date: Tue, 26 Feb 2019 20:56:25 +0000 Subject: [AMDGPU] Fixed hang during DAG combine SITargetLowering::reassociateScalarOps() does not touch constants so that DAGCombiner::ReassociateOps() does not revert the combine. However a global address is not a ConstantSDNode. Switched to the method used by DAGCombiner::ReassociateOps() itself to detect constants. Differential Revision: https://reviews.llvm.org/D58695 llvm-svn: 354926 --- llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Target/AMDGPU/SIISelLowering.cpp') diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp index 83d7711e801..adb9ed41662 100644 --- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp @@ -8477,7 +8477,8 @@ SDValue SITargetLowering::reassociateScalarOps(SDNode *N, // If either operand is constant this will conflict with // DAGCombiner::ReassociateOps(). - if (isa(Op0) || isa(Op1)) + if (DAG.isConstantIntBuildVectorOrConstantInt(Op0) || + DAG.isConstantIntBuildVectorOrConstantInt(Op1)) return SDValue(); SDLoc SL(N); -- cgit v1.2.3