diff options
author | Philip Reames <listmail@philipreames.com> | 2016-02-02 00:45:30 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2016-02-02 00:45:30 +0000 |
commit | 2c275cc6860bef6812dfe4f59b356ba917fa3284 (patch) | |
tree | 1a70bb4fe3f19fd07420bfab844371367ac76a59 /llvm/lib | |
parent | 12074509d707d99c767e0d987cfd14c9cdf1963f (diff) | |
download | bcm5719-llvm-2c275cc6860bef6812dfe4f59b356ba917fa3284.tar.gz bcm5719-llvm-2c275cc6860bef6812dfe4f59b356ba917fa3284.zip |
[LVI] Fix a latent bug in getValueAt
This routine was returning Undefined for most queries. This was utterly wrong. Amusingly, we do not appear to have any callers of this which are actually trying to exploit unreachable code or this would have broken the world.
A better approach would be to explicit describe the intersection of facts. That's blocked behind http://reviews.llvm.org/D14476 and I wanted to fix the current bug.
llvm-svn: 259446
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/LazyValueInfo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index abc46c54b83..5d2bc19f00a 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -1128,6 +1128,14 @@ LVILatticeVal LazyValueInfoCache::getValueAt(Value *V, Instruction *CxtI) { Result = getFromRangeMetadata(I); mergeAssumeBlockValueConstantRange(V, Result, CxtI); + // Note: What's actually happening here is that we're starting at overdefined + // and then intersecting two different types of facts. The code is not + // structured that way (FIXME), and we need to take particular care to not + // let the undefined state escape since we have *not* proven the particular + // value to be unreachable at the context instruction. + if (Result.isUndefined()) + Result.markOverdefined(); + DEBUG(dbgs() << " Result = " << Result << "\n"); return Result; } |