summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-08-27 16:32:11 +0000
committerDan Gohman <gohman@apple.com>2007-08-27 16:32:11 +0000
commit9625d812c950ec38aefe87e1493ef14fcc1f6444 (patch)
treeefefbe0cffe86eca3c0c4a821bf82f4cfa027fd2 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent90064ed445667f7789e5facf12ba22d7c56794df (diff)
downloadbcm5719-llvm-9625d812c950ec38aefe87e1493ef14fcc1f6444.tar.gz
bcm5719-llvm-9625d812c950ec38aefe87e1493ef14fcc1f6444.zip
Make DAGCombiner's global alias analysis query more precise in the case
where both pointers have non-zero offsets. llvm-svn: 41491
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index fda0589a6de..0514bc181be 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -4606,8 +4606,9 @@ bool DAGCombiner::isAlias(SDOperand Ptr1, int64_t Size1,
if (CombinerGlobalAA) {
// Use alias analysis information.
- int Overlap1 = Size1 + SrcValueOffset1;
- int Overlap2 = Size2 + SrcValueOffset2;
+ int64_t MinOffset = std::min(SrcValueOffset1, SrcValueOffset2);
+ int64_t Overlap1 = Size1 + SrcValueOffset1 - MinOffset;
+ int64_t Overlap2 = Size2 + SrcValueOffset2 - MinOffset;
AliasAnalysis::AliasResult AAResult =
AA.alias(SrcValue1, Overlap1, SrcValue2, Overlap2);
if (AAResult == AliasAnalysis::NoAlias)
OpenPOWER on IntegriCloud