Deleted Added
full compact
24d23
< #include "llvm/CodeGen/RegAllocRegistry.h"
40,44d38
< static cl::opt<bool>
< SplitEdges("split-phi-edges",
< cl::desc("Split critical edges during phi elimination"),
< cl::init(false), cl::Hidden);
<
51,61d44
< namespace llvm { FunctionPass *createLocalRegisterAllocator(); }
<
< // Should we run edge splitting?
< static bool shouldSplitEdges() {
< // Edge splitting breaks the local register allocator. It cannot tolerate
< // LiveVariables being run.
< if (RegisterRegAlloc::getDefault() == createLocalRegisterAllocator)
< return false;
< return SplitEdges;
< }
<
65,70c48,49
< if (shouldSplitEdges()) {
< AU.addRequired<LiveVariables>();
< } else {
< AU.setPreservesCFG();
< AU.addPreservedID(MachineLoopInfoID);
< }
---
> // rdar://7401784 This would be nice:
> // AU.addPreservedID(MachineLoopInfoID);
82c61
< if (shouldSplitEdges())
---
> if (LiveVariables *LV = getAnalysisIfAvailable<LiveVariables>())
84c63
< Changed |= SplitPHIEdges(Fn, *I);
---
> Changed |= SplitPHIEdges(Fn, *I, *LV);
364c343,344
< MachineBasicBlock &MBB) {
---
> MachineBasicBlock &MBB,
> LiveVariables &LV) {
367c347
< LiveVariables &LV = getAnalysis<LiveVariables>();
---
>