diff options
author | Andrew Trick <atrick@apple.com> | 2011-09-15 01:09:33 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2011-09-15 01:09:33 +0000 |
commit | b1afbac64b7c4c06959350acc175fb3552012f57 (patch) | |
tree | 20d54cdd0eba1c8071a9625fb4236f1eccdfa834 /include/llvm/CodeGen | |
parent | 322ea080ada5608de41f82127f053f754e459910 (diff) | |
download | llvm-b1afbac64b7c4c06959350acc175fb3552012f57.tar.gz llvm-b1afbac64b7c4c06959350acc175fb3552012f57.tar.bz2 llvm-b1afbac64b7c4c06959350acc175fb3552012f57.tar.xz |
[regcoalescing] bug fix for RegistersDefinedFromSameValue.
An improper SlotIndex->VNInfo lookup was leading to unsafe copy removal.
Fixes PR10920 401.bzip2 miscompile with no IV rewrite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/LiveInterval.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index 404117216f..0daaf82fe1 100644 --- a/include/llvm/CodeGen/LiveInterval.h +++ b/include/llvm/CodeGen/LiveInterval.h @@ -411,6 +411,14 @@ namespace llvm { return I == end() ? 0 : I->valno; } + /// getVNInfoBefore - Return the VNInfo that is live up to but not + /// necessarilly including Idx, or NULL. Use this to find the reaching def + /// used by an instruction at this SlotIndex position. + VNInfo *getVNInfoBefore(SlotIndex Idx) const { + const_iterator I = FindLiveRangeContaining(Idx.getPrevIndex()); + return I == end() ? 0 : I->valno; + } + /// FindLiveRangeContaining - Return an iterator to the live range that /// contains the specified index, or end() if there is none. iterator FindLiveRangeContaining(SlotIndex Idx) { |