[llvm] r368645 - [AMDGPU] Fix msan failure in printf lowering
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 12 18:07:27 PDT 2019
Author: rampitec
Date: Mon Aug 12 18:07:27 2019
New Revision: 368645
URL: http://llvm.org/viewvc/llvm-project?rev=368645&view=rev
Log:
[AMDGPU] Fix msan failure in printf lowering
Modified:
llvm/trunk/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp?rev=368645&r1=368644&r2=368645&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp Mon Aug 12 18:07:27 2019
@@ -537,8 +537,8 @@ bool AMDGPUPrintfRuntimeBinding::lowerPr
} else {
WhatToStore.push_back(Arg);
}
- for (auto W : WhatToStore) {
- Value *TheBtCast = W;
+ for (unsigned I = 0, E = WhatToStore.size(); I != E; ++I) {
+ Value *TheBtCast = WhatToStore[I];
unsigned ArgSize =
TD->getTypeAllocSizeInBits(TheBtCast->getType()) / 8;
SmallVector<Value *, 1> BuffOffset;
@@ -551,9 +551,7 @@ bool AMDGPUPrintfRuntimeBinding::lowerPr
LLVM_DEBUG(dbgs() << "inserting store to printf buffer:\n"
<< *StBuff << '\n');
(void)StBuff;
- ++W;
- if (W == *WhatToStore.end() &&
- ArgCount + 1 == CI->getNumArgOperands())
+ if (I + 1 == E && ArgCount + 1 == CI->getNumArgOperands())
break;
BufferIdx = dyn_cast<GetElementPtrInst>(GetElementPtrInst::Create(
nullptr, BufferIdx, BuffOffset, "PrintBuffNextPtr", Brnch));
More information about the llvm-commits
mailing list