[llvm-commits] [llvm] r41491 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Dan Gohman djg at cray.com
Mon Aug 27 09:32:12 PDT 2007


Author: djg
Date: Mon Aug 27 11:32:11 2007
New Revision: 41491

URL: http://llvm.org/viewvc/llvm-project?rev=41491&view=rev
Log:
Make DAGCombiner's global alias analysis query more precise in the case
where both pointers have non-zero offsets.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=41491&r1=41490&r2=41491&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Aug 27 11:32:11 2007
@@ -4606,8 +4606,9 @@
 
   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)





More information about the llvm-commits mailing list