diff options
author | Hal Finkel <hfinkel@anl.gov> | 2014-01-25 19:24:54 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2014-01-25 19:24:54 +0000 |
commit | 397cd32bc2f5d7618b26af04da45b615a32d291f (patch) | |
tree | 39888b0e01c3376df2d80925c094a83ff214782f /lib/CodeGen/ScheduleDAGInstrs.cpp | |
parent | 55604d97163ef8141e081fb7d66ae596796da8b8 (diff) |
Disable the use of TBAA when using AA in CodeGen
There are currently two issues, of which I currently know, that prevent TBAA
from being correctly usable in CodeGen:
1. Stack coloring does not update TBAA when merging allocas. This is easy
enough to fix, but is not the largest problem.
2. CGP inserts ptrtoint/inttoptr pairs when sinking address computations.
Because BasicAA does not handle inttoptr, we'll often miss basic type punning
idioms that we need to catch so we don't miscompile real-world code (like LLVM).
I don't yet have a small test case for this, but this fixes self hosting a
non-asserts build of LLVM on PPC64 when using -enable-aa-sched-mi and -misched=shuffle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200093 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ScheduleDAGInstrs.cpp')
-rw-r--r-- | lib/CodeGen/ScheduleDAGInstrs.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/CodeGen/ScheduleDAGInstrs.cpp b/lib/CodeGen/ScheduleDAGInstrs.cpp index 93ee38bc0bf..f0de7982b12 100644 --- a/lib/CodeGen/ScheduleDAGInstrs.cpp +++ b/lib/CodeGen/ScheduleDAGInstrs.cpp @@ -45,6 +45,15 @@ static cl::opt<bool> EnableAASchedMI("enable-aa-sched-mi", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Enable use of AA during MI GAD construction")); +// FIXME: Enable the use of TBAA. There are two known issues preventing this: +// 1. Stack coloring does not update TBAA when merging allocas +// 2. CGP inserts ptrtoint/inttoptr pairs when sinking address computations. +// Because BasicAA does not handle inttoptr, we'll often miss basic type +// punning idioms that we need to catch so we don't miscompile real-world +// code. +static cl::opt<bool> UseTBAA("use-tbaa-in-sched-mi", cl::Hidden, + cl::init(false), cl::desc("Enable use of TBAA during MI GAD construction")); + ScheduleDAGInstrs::ScheduleDAGInstrs(MachineFunction &mf, const MachineLoopInfo &mli, const MachineDominatorTree &mdt, @@ -556,9 +565,9 @@ static bool MIsNeedChainEdge(AliasAnalysis *AA, const MachineFrameInfo *MFI, AliasAnalysis::AliasResult AAResult = AA->alias( AliasAnalysis::Location(MMOa->getValue(), Overlapa, - MMOa->getTBAAInfo()), + UseTBAA ? MMOa->getTBAAInfo() : 0), AliasAnalysis::Location(MMOb->getValue(), Overlapb, - MMOb->getTBAAInfo())); + UseTBAA ? MMOb->getTBAAInfo() : 0)); return (AAResult != AliasAnalysis::NoAlias); } |