[AMDGPU] Fixed hang during DAG combine
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Tue, 26 Feb 2019 20:56:25 +0000 (20:56 +0000)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Tue, 26 Feb 2019 20:56:25 +0000 (20:56 +0000)
commitda1628eb679d2921e5d683e51cc9ecf6e5750295
treeb925208af4615754ff253253172bae28cb67d0af
parentddc181d2561b14b95e7b3afbacaa0e55d16ea733
[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
llvm/test/CodeGen/AMDGPU/reassoc-scalar.ll