diff options
author | James Y Knight <jyknight@google.com> | 2019-02-01 20:44:24 +0000 |
---|---|---|
committer | James Y Knight <jyknight@google.com> | 2019-02-01 20:44:24 +0000 |
commit | 14359ef1b6a0610ac91df5f5a91c88a0b51c187c (patch) | |
tree | 53b7628ce6ecba998379d0d19f875bc9dad3b69a /llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp | |
parent | d9e85a0861b7e9320c34547a2ad7f49c504a9381 (diff) | |
download | llvm-14359ef1b6a0610ac91df5f5a91c88a0b51c187c.zip llvm-14359ef1b6a0610ac91df5f5a91c88a0b51c187c.tar.gz llvm-14359ef1b6a0610ac91df5f5a91c88a0b51c187c.tar.bz2 |
[opaque pointer types] Pass value type to LoadInst creation.
This cleans up all LoadInst creation in LLVM to explicitly pass the
value type rather than deriving it from the pointer's element-type.
Differential Revision: https://reviews.llvm.org/D57172
llvm-svn: 352911
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp index 14b0566..26c4cbc 100644 --- a/llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp @@ -790,7 +790,7 @@ bool EfficiencySanitizer::insertCounterUpdate(Instruction *I, ConstantExpr::getGetElementPtr( ArrayType::get(IRB.getInt64Ty(), getStructCounterSize(StructTy)), CounterArray, Indices); - Value *Load = IRB.CreateLoad(Counter); + Value *Load = IRB.CreateLoad(IRB.getInt64Ty(), Counter); IRB.CreateStore(IRB.CreateAdd(Load, ConstantInt::get(IRB.getInt64Ty(), 1)), Counter); return true; @@ -875,7 +875,8 @@ bool EfficiencySanitizer::instrumentFastpathWorkingSet( // memory access, if they are not already set. Value *ValueMask = ConstantInt::get(ShadowTy, 0x81); // 10000001B - Value *OldValue = IRB.CreateLoad(IRB.CreateIntToPtr(ShadowPtr, ShadowPtrTy)); + Value *OldValue = + IRB.CreateLoad(ShadowTy, IRB.CreateIntToPtr(ShadowPtr, ShadowPtrTy)); // The AND and CMP will be turned into a TEST instruction by the compiler. Value *Cmp = IRB.CreateICmpNE(IRB.CreateAnd(OldValue, ValueMask), ValueMask); Instruction *CmpTerm = SplitBlockAndInsertIfThen(Cmp, I, false); |