[llvm] cb29705 - AMDGPU/SILoadStoreOptimizer: Fix uninitialized variable error
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 24 22:06:01 PST 2020
Author: Tom Stellard
Date: 2020-01-24T21:53:05-08:00
New Revision: cb297050bb029b147e3c31c4efbd5887f9500f5d
URL: https://github.com/llvm/llvm-project/commit/cb297050bb029b147e3c31c4efbd5887f9500f5d
DIFF: https://github.com/llvm/llvm-project/commit/cb297050bb029b147e3c31c4efbd5887f9500f5d.diff
LOG: AMDGPU/SILoadStoreOptimizer: Fix uninitialized variable error
This was introduced by 86c944d790728891801778b8d98c2c65a83f36a5 and
caught by the sanitizer-x86_64-linux-fast bot.
Added:
Modified:
llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
index 364196b1d6e1..ee207586b0d0 100644
--- a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
+++ b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
@@ -510,6 +510,8 @@ void SILoadStoreOptimizer::CombineInfo::setMI(MachineBasicBlock::iterator MI,
if (InstClass == MIMG) {
DMask = TII.getNamedOperand(*I, AMDGPU::OpName::dmask)->getImm();
+ // Offset is not considered for MIMG instructions.
+ Offset = 0;
} else {
int OffsetIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::offset);
Offset = I->getOperand(OffsetIdx).getImm();
More information about the llvm-commits
mailing list