Reverts wrong modification to MachineBlockPlacement & BranchFolding; uses a new strat...
[oota-llvm.git] / lib / CodeGen / MachineBasicBlock.cpp
index f2876ab265b07be1e37ef5b2279e4659289265be..4219016874296873120e8e8e67d08e602bf0d7fd 100644 (file)
@@ -27,6 +27,7 @@
 #include "llvm/IR/ModuleSlotTracker.h"
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCContext.h"
+#include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Target/TargetInstrInfo.h"
@@ -39,7 +40,7 @@ using namespace llvm;
 #define DEBUG_TYPE "codegen"
 
 MachineBasicBlock::MachineBasicBlock(MachineFunction &MF, const BasicBlock *B)
-    : BB(B), Number(-1), xParent(&MF) {
+    : BB(B), Number(-1), xParent(&MF), canEliminateMachineBB(true) {
   Insts.Parent = this;
 }
 
@@ -514,7 +515,7 @@ void MachineBasicBlock::validateSuccProbs() const {
   // Due to precision issue, we assume that the sum of probabilities is one if
   // the difference between the sum of their numerators and the denominator is
   // no greater than the number of successors.
-  assert(std::abs<uint64_t>(Sum - BranchProbability::getDenominator()) <=
+  assert((uint64_t)std::abs(Sum - BranchProbability::getDenominator()) <=
              Probs.size() &&
          "The sum of successors's probabilities exceeds one.");
 #endif // NDEBUG
@@ -1181,7 +1182,7 @@ MachineBasicBlock::getProbabilityIterator(MachineBasicBlock::succ_iterator I) {
 
 /// Return whether (physical) register "Reg" has been <def>ined and not <kill>ed
 /// as of just before "MI".
-/// 
+///
 /// Search is localised to a neighborhood of
 /// Neighborhood instructions before (searching for defs or kills) and N
 /// instructions after (searching just for defs) MI.