Add option for controlling inclusion of global AA.

llvm-svn: 31040
This commit is contained in:
Jim Laskey 2006-10-18 19:08:31 +00:00
parent f4aeff00c2
commit 55e4dcad36
1 changed files with 12 additions and 6 deletions

View File

@ -51,6 +51,10 @@ namespace {
CombinerAA("combiner-alias-analysis", cl::Hidden, CombinerAA("combiner-alias-analysis", cl::Hidden,
cl::desc("Turn on alias analysis during testing")); 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 ---------------------------------// //------------------------------ DAGCombiner ---------------------------------//
class VISIBILITY_HIDDEN 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 we know both bases then they can't alias.
if (KnownBase1 && KnownBase2) return false; if (KnownBase1 && KnownBase2) return false;
// Use alias analysis information. if (CombinerGlobalAA) {
int Overlap1 = Size1 + SrcValueOffset1 + Offset1; // Use alias analysis information.
int Overlap2 = Size2 + SrcValueOffset2 + Offset2; int Overlap1 = Size1 + SrcValueOffset1 + Offset1;
AliasAnalysis::AliasResult AAResult = int Overlap2 = Size2 + SrcValueOffset2 + Offset2;
AliasAnalysis::AliasResult AAResult =
AA.alias(SrcValue1, Overlap1, SrcValue2, Overlap2); AA.alias(SrcValue1, Overlap1, SrcValue2, Overlap2);
if (AAResult == AliasAnalysis::NoAlias) if (AAResult == AliasAnalysis::NoAlias)
return false; return false;
}
// Otherwise we have to assume they alias. // Otherwise we have to assume they alias.
return true; return true;