diff options
author | Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> | 2021-09-20 10:29:11 +0200 |
---|---|---|
committer | Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> | 2021-10-05 12:15:55 +0200 |
commit | 1896fb2cfffcf120eb28cefb67ac3d56035adc43 (patch) | |
tree | ce10622e2ec3b6f8c49ae60a15ca3af538bb864d /llvm/lib/Object/XCOFFObjectFile.cpp | |
parent | d009f6e51cae7e7a155d083c9170723554f2e776 (diff) | |
download | llvm-1896fb2cfffcf120eb28cefb67ac3d56035adc43.zip llvm-1896fb2cfffcf120eb28cefb67ac3d56035adc43.tar.gz llvm-1896fb2cfffcf120eb28cefb67ac3d56035adc43.tar.bz2 |
[SelectionDAG] Assume that a GlobalAlias may alias other global values
This fixes a bug detected in DAGCombiner when using global alias
variables. Here is an example:
@foo = global i16 0, align 1
@aliasFoo = alias i16, i16 * @foo
define i16 @bar() {
...
store i16 7, i16 * @foo, align 1
store i16 8, i16 * @aliasFoo, align 1
...
}
BaseIndexOffset::computeAliasing would incorrectly derive NoAlias
for the two accesses in the example above, resulting in DAGCombiner
miscompiles.
This patch fixes the problem by a defensive approach letting
BaseIndexOffset::computeAliasing return false, i.e. that the aliasing
couldn't be determined, when comparing two global values and at least
one is a GlobalAlias. In the future we might improve this with a
deeper analysis to look at the aliasee for the GlobalAlias etc. But
that is a bit more complicated considering that we could have
'local_unnamed_addr' and situations with several 'alias' variables.
Fixes PR51878.
Differential Revision: https://reviews.llvm.org/D110064
Diffstat (limited to 'llvm/lib/Object/XCOFFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions