[PATCH] D100970: [Evaluator] Bitcast result of pointer stripping
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 21 13:37:11 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb606e2df4dd4: [Evaluator] Bitcast result of pointer stripping (authored by aeubanks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100970/new/
https://reviews.llvm.org/D100970
Files:
llvm/lib/Transforms/Utils/Evaluator.cpp
llvm/test/Transforms/GlobalOpt/invariant.group.ll
Index: llvm/test/Transforms/GlobalOpt/invariant.group.ll
===================================================================
--- llvm/test/Transforms/GlobalOpt/invariant.group.ll
+++ llvm/test/Transforms/GlobalOpt/invariant.group.ll
@@ -32,9 +32,10 @@
%0 = bitcast i32* %valptr to i8*
%barr = call i8* @llvm.launder.invariant.group(i8* %0)
- %1 = bitcast i8* %barr to i32*
+ %1 = getelementptr i8, i8* %barr, i32 0
+ %2 = bitcast i8* %1 to i32*
- %val2 = load i32, i32* %1
+ %val2 = load i32, i32* %2
store i32 %val2, i32* @tmp2
ret void
}
Index: llvm/lib/Transforms/Utils/Evaluator.cpp
===================================================================
--- llvm/lib/Transforms/Utils/Evaluator.cpp
+++ llvm/lib/Transforms/Utils/Evaluator.cpp
@@ -566,6 +566,7 @@
<< "Stripped pointer casts for alias analysis for "
"intrinsic call.\n");
StrippedPointerCastsForAliasAnalysis = true;
+ InstResult = ConstantExpr::getBitCast(InstResult, II->getType());
} else {
LLVM_DEBUG(dbgs() << "Unknown intrinsic. Cannot evaluate.\n");
return false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100970.339370.patch
Type: text/x-patch
Size: 1170 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210421/c3b14e27/attachment.bin>
More information about the llvm-commits
mailing list