summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-10-18 19:08:31 +0000
committerJim Laskey <jlaskey@mac.com>2006-10-18 19:08:31 +0000
commit07a2709e9de7c619edc26d97b3491c48ccae55ef (patch)
tree87d9ca5fa6466ea2f619b0414b071f637e851383
parent91897778690a7d683497ba3f4040ebf09345f08a (diff)
downloadllvm-07a2709e9de7c619edc26d97b3491c48ccae55ef.tar.gz
llvm-07a2709e9de7c619edc26d97b3491c48ccae55ef.tar.bz2
llvm-07a2709e9de7c619edc26d97b3491c48ccae55ef.tar.xz
Add option for controlling inclusion of global AA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31040 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 3c260d310c..a4d3c54e1c 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -51,6 +51,10 @@ namespace {
CombinerAA("combiner-alias-analysis", cl::Hidden,
cl::desc("Turn on alias analysis during testing"));
+ static cl::opt<bool>
+ CombinerGlobalAA("combiner-global-alias-analysis", cl::Hidden,
+ cl::desc("Include global information in alias analysis"));
+
//------------------------------ DAGCombiner ---------------------------------//
class VISIBILITY_HIDDEN DAGCombiner {
@@ -4036,13 +4040,15 @@ bool DAGCombiner::isAlias(SDOperand Ptr1, int64_t Size1,
// If we know both bases then they can't alias.
if (KnownBase1 && KnownBase2) return false;
- // Use alias analysis information.
- int Overlap1 = Size1 + SrcValueOffset1 + Offset1;
- int Overlap2 = Size2 + SrcValueOffset2 + Offset2;
- AliasAnalysis::AliasResult AAResult =
+ if (CombinerGlobalAA) {
+ // Use alias analysis information.
+ int Overlap1 = Size1 + SrcValueOffset1 + Offset1;
+ int Overlap2 = Size2 + SrcValueOffset2 + Offset2;
+ AliasAnalysis::AliasResult AAResult =
AA.alias(SrcValue1, Overlap1, SrcValue2, Overlap2);
- if (AAResult == AliasAnalysis::NoAlias)
- return false;
+ if (AAResult == AliasAnalysis::NoAlias)
+ return false;
+ }
// Otherwise we have to assume they alias.
return true;