aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InstructionSimplify.cpp
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2014-12-04 14:22:27 +0000
committerAlexander Potapenko <glider@google.com>2014-12-04 14:22:27 +0000
commit76770e49305c64d67e2e22830a34e6b6d8fa84e6 (patch)
treec77b34b86537a7d3d1beab478f5d82b236dea533 /llvm/lib/Analysis/InstructionSimplify.cpp
parent5403da456968e9c45c14bf552ba34bdd8c4b0f76 (diff)
downloadllvm-76770e49305c64d67e2e22830a34e6b6d8fa84e6.zip
llvm-76770e49305c64d67e2e22830a34e6b6d8fa84e6.tar.gz
llvm-76770e49305c64d67e2e22830a34e6b6d8fa84e6.tar.bz2
Revert r223347 which has caused crashes on bootstrap bots.
llvm-svn: 223364
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
-rw-r--r--llvm/lib/Analysis/InstructionSimplify.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index 51a295a..85ebf69 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -2026,22 +2026,12 @@ static Constant *computePointerICmp(const DataLayout *DL,
};
// Is the set of underlying objects all things which must be disjoint from
- // noalias calls. For allocas, we consider only static ones (dynamic
- // allocas might be transformed into calls to malloc not simultaneously
- // live with the compared-to allocation). For globals, we exclude symbols
- // that might be resolve lazily to symbols in another dynamically-loaded
- // library (and, thus, could be malloc'ed by the implementation).
+ // noalias calls.
auto IsAllocDisjoint = [](SmallVectorImpl<Value *> &Objects) {
return std::all_of(Objects.begin(), Objects.end(),
[](Value *V){
- if (const AllocaInst *AI = dyn_cast<AllocaInst>(V))
- return AI->isStaticAlloca();
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
- return (GV->hasLocalLinkage() ||
- GV->hasHiddenVisibility() ||
- GV->hasProtectedVisibility() ||
- GV->hasUnnamedAddr()) &&
- !GV->isThreadLocal();
+ if (isa<AllocaInst>(V) || isa<GlobalValue>(V))
+ return true;
if (const Argument *A = dyn_cast<Argument>(V))
return A->hasByValAttr();
return false;