Skip to content

Commit f8bbb21

Browse files
authored
AMDGPU: Handle invariant when lowering global loads (#168914)
Global with invariant should be treated identically to constant.
1 parent c687660 commit f8bbb21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11944,7 +11944,7 @@ SDValue SITargetLowering::LowerLOAD(SDValue Op, SelectionDAG &DAG) const {
1194411944
AS == AMDGPUAS::CONSTANT_ADDRESS_32BIT ||
1194511945
(AS == AMDGPUAS::GLOBAL_ADDRESS &&
1194611946
Subtarget->getScalarizeGlobalBehavior() && Load->isSimple() &&
11947-
isMemOpHasNoClobberedMemOperand(Load))) {
11947+
(Load->isInvariant() || isMemOpHasNoClobberedMemOperand(Load)))) {
1194811948
if ((!Op->isDivergent() || AMDGPU::isUniformMMO(MMO)) &&
1194911949
Alignment >= Align(4) && NumElements < 32) {
1195011950
if (MemVT.isPow2VectorType() ||

0 commit comments

Comments
 (0)