aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2020-12-18 17:48:01 +0000
committerFlorian Hahn <flo@fhahn.com>2020-12-18 17:59:12 +0000
commita74941da716d29a1d962d17b8112c40a8a45f9e7 (patch)
treeaaa3f68a86c05242d63850941ec6e21e071b376e /llvm/lib/Analysis/BasicAliasAnalysis.cpp
parentfc7b7fc066946f83b04928d80242fcffbf23323e (diff)
downloadllvm-a74941da716d29a1d962d17b8112c40a8a45f9e7.zip
llvm-a74941da716d29a1d962d17b8112c40a8a45f9e7.tar.gz
llvm-a74941da716d29a1d962d17b8112c40a8a45f9e7.tar.bz2
Revert "[BasicAA] Handle two unknown sizes for GEPs"
Temporarily revert commit 8b1c4e310c2f9686cad925ad81d8e2be10a1ef3c. After 8b1c4e310c2f the compile-time for `MultiSource/Benchmarks/MiBench/consumer-lame` dramatically increases with -O3 & LTO, causing issues for builders with that configuration. I filed PR48553 with a smallish reproducer that shows a 10-100x compile time increase.
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/BasicAliasAnalysis.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index 3e22ce8..caa0635 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -1098,22 +1098,6 @@ AliasResult BasicAAResult::aliasGEP(
const GEPOperator *GEP1, LocationSize V1Size, const AAMDNodes &V1AAInfo,
const Value *V2, LocationSize V2Size, const AAMDNodes &V2AAInfo,
const Value *UnderlyingV1, const Value *UnderlyingV2, AAQueryInfo &AAQI) {
- // If both accesses are unknown size, we can only check whether the
- // underlying objects are different.
- if (!V1Size.hasValue() && !V2Size.hasValue()) {
- // If the other operand is a phi/select, let phi/select handling perform
- // this check. Otherwise the same recursive walk is done twice.
- if (!isa<PHINode>(V2) && !isa<SelectInst>(V2)) {
- AliasResult BaseAlias =
- aliasCheck(UnderlyingV1, LocationSize::beforeOrAfterPointer(),
- AAMDNodes(), UnderlyingV2,
- LocationSize::beforeOrAfterPointer(), AAMDNodes(), AAQI);
- if (BaseAlias == NoAlias)
- return NoAlias;
- }
- return MayAlias;
- }
-
DecomposedGEP DecompGEP1 = DecomposeGEPExpression(GEP1, DL, &AC, DT);
DecomposedGEP DecompGEP2 = DecomposeGEPExpression(V2, DL, &AC, DT);
@@ -1172,6 +1156,10 @@ AliasResult BasicAAResult::aliasGEP(
// instruction. If one pointer is a GEP with a non-zero index of the other
// pointer, we know they cannot alias.
+ // If both accesses are unknown size, we can't do anything useful here.
+ if (!V1Size.hasValue() && !V2Size.hasValue())
+ return MayAlias;
+
AliasResult R = aliasCheck(
UnderlyingV1, LocationSize::beforeOrAfterPointer(), AAMDNodes(),
V2, V2Size, V2AAInfo, AAQI, nullptr, UnderlyingV2);