]> granicus.if.org Git - llvm/commit
IR. Change strip* family of functions to not look through aliases.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 22 Aug 2019 19:56:14 +0000 (19:56 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 22 Aug 2019 19:56:14 +0000 (19:56 +0000)
commit57c068763a07a580d82a2be058d6f4ba369bd329
tree62eb605548bf0674c84eaabc717e9d088e118fba
parent83e3885fb1e383289360e30fbb21083a8be14a11
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369697 91177308-0d34-0410-b5e6-96231b3b80d8
17 files changed:
include/llvm/IR/Value.h
lib/Analysis/ConstantFolding.cpp
lib/Analysis/ModuleSummaryAnalysis.cpp
lib/Analysis/StackSafetyAnalysis.cpp
lib/CodeGen/Analysis.cpp
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/IR/Constants.cpp
lib/IR/Module.cpp
lib/IR/Value.cpp
lib/IR/Verifier.cpp
lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp
lib/Transforms/IPO/ConstantMerge.cpp
lib/Transforms/IPO/GlobalOpt.cpp
test/Transforms/InstCombine/bitcast-alias-function.ll [deleted file]
test/Transforms/InstCombine/bitcast-function.ll [new file with mode: 0644]
test/Transforms/InstCombine/gep-alias.ll [new file with mode: 0644]
test/Transforms/InstCombine/pr39177.ll