diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2019-08-22 19:56:14 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2019-08-22 19:56:14 +0000 |
commit | 2452d7030b84d358165f5f76c9270937b4ea1a91 (patch) | |
tree | 86eae755b4033326df037893acdfe1aa3e674f1f /llvm/lib/IR/Verifier.cpp | |
parent | 1aeb27af224e670a9ff40da33c3cdb811220d70b (diff) | |
download | bcm5719-llvm-2452d7030b84d358165f5f76c9270937b4ea1a91.tar.gz bcm5719-llvm-2452d7030b84d358165f5f76c9270937b4ea1a91.zip |
IR. Change strip* family of functions to not look through aliases.
I noticed another instance of the issue where references to aliases were
being replaced with aliasees, this time in InstCombine. In the instance that
I saw it turned out to be only a QoI issue (a symbol ended up being missing
from the symbol table due to the last reference to the alias being removed,
preventing HWASAN from symbolizing a global reference), but it could easily
have manifested as incorrect behaviour.
Since this is the third such issue encountered (previously: D65118, D65314)
it seems to be time to address this common error/QoI issue once and for all
and make the strip* family of functions not look through aliases.
Includes a test for the specific issue that I saw, but no doubt there are
other similar bugs fixed here.
As with D65118 this has been tested to make sure that the optimization isn't
load bearing. I built Clang, Chromium for Linux, Android and Windows as well
as the test-suite and there were no size regressions.
Differential Revision: https://reviews.llvm.org/D66606
llvm-svn: 369697
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 6fa58741be1..0350edb2454 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -673,7 +673,7 @@ void Verifier::visitGlobalVariable(const GlobalVariable &GV) { Assert(InitArray, "wrong initalizer for intrinsic global variable", Init); for (Value *Op : InitArray->operands()) { - Value *V = Op->stripPointerCastsNoFollowAliases(); + Value *V = Op->stripPointerCasts(); Assert(isa<GlobalVariable>(V) || isa<Function>(V) || isa<GlobalAlias>(V), "invalid llvm.used member", V); |