summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-01-18 23:12:19 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-01-18 23:12:19 +0000
commitde44c9d8579c8c874b7c54204119da69186623ae (patch)
tree64f0cc2ff02acaca8cacfbce71ac4ca20e87508d /llvm/lib/CodeGen
parent954dd8d9ba09dcb634d42e8d7cdd28b94d3ea2dd (diff)
downloadbcm5719-llvm-de44c9d8579c8c874b7c54204119da69186623ae.tar.gz
bcm5719-llvm-de44c9d8579c8c874b7c54204119da69186623ae.zip
Treat segment [B, E) as not overlapping block with boundaries [A, B)
llvm-svn: 292446
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/LiveRangeCalc.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeCalc.cpp b/llvm/lib/CodeGen/LiveRangeCalc.cpp
index fd22c404871..e2ae7c0a0c9 100644
--- a/llvm/lib/CodeGen/LiveRangeCalc.cpp
+++ b/llvm/lib/CodeGen/LiveRangeCalc.cpp
@@ -310,7 +310,12 @@ bool LiveRangeCalc::isDefOnEntry(LiveRange &LR, ArrayRef<SlotIndex> Undefs,
return MarkDefined(B);
SlotIndex Begin, End;
std::tie(Begin, End) = Indexes->getMBBRange(&B);
- LiveRange::iterator UB = std::upper_bound(LR.begin(), LR.end(), End);
+ // Treat End as not belonging to B.
+ // If LR has a segment S that starts at the next block, i.e. [End, ...),
+ // std::upper_bound will return the segment following S. Instead,
+ // S should be treated as the first segment that does not overlap B.
+ LiveRange::iterator UB = std::upper_bound(LR.begin(), LR.end(),
+ End.getPrevSlot());
if (UB != LR.begin()) {
LiveRange::Segment &Seg = *std::prev(UB);
if (Seg.end > Begin) {
OpenPOWER on IntegriCloud