summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/IfConversion.cpp
diff options
context:
space:
mode:
authorCong Hou <congh@google.com>2015-08-06 18:17:29 +0000
committerCong Hou <congh@google.com>2015-08-06 18:17:29 +0000
commitec105872056880da9689cfffdb296e32ca1ba876 (patch)
tree5363b408f75223b073c2cef8c7cba8cdd9d61735 /llvm/lib/CodeGen/IfConversion.cpp
parentf032c956de59891e0c64e8d85a3f68533ddc8de6 (diff)
downloadbcm5719-llvm-ec105872056880da9689cfffdb296e32ca1ba876.tar.gz
bcm5719-llvm-ec105872056880da9689cfffdb296e32ca1ba876.zip
Revert r244154 which causes some build failure. See https://llvm.org/bugs/show_bug.cgi?id=24377.
llvm-svn: 244239
Diffstat (limited to 'llvm/lib/CodeGen/IfConversion.cpp')
-rw-r--r--llvm/lib/CodeGen/IfConversion.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp
index 8896cdbb176..ee0532bfc63 100644
--- a/llvm/lib/CodeGen/IfConversion.cpp
+++ b/llvm/lib/CodeGen/IfConversion.cpp
@@ -1232,17 +1232,15 @@ bool IfConverter::IfConvertTriangle(BBInfo &BBI, IfcvtKind Kind) {
bool HasEarlyExit = CvtBBI->FalseBB != nullptr;
uint64_t CvtNext = 0, CvtFalse = 0, BBNext = 0, BBCvt = 0, SumWeight = 0;
+ uint32_t WeightScale = 0;
if (HasEarlyExit) {
// Get weights before modifying CvtBBI->BB and BBI.BB.
- // Explictly normalize the weights of all edges from CvtBBI->BB so that we
- // are aware that the edge weights obtained below are normalized.
- CvtBBI->BB->normalizeSuccWeights();
CvtNext = MBPI->getEdgeWeight(CvtBBI->BB, NextBBI->BB);
CvtFalse = MBPI->getEdgeWeight(CvtBBI->BB, CvtBBI->FalseBB);
BBNext = MBPI->getEdgeWeight(BBI.BB, NextBBI->BB);
BBCvt = MBPI->getEdgeWeight(BBI.BB, CvtBBI->BB);
- SumWeight = MBPI->getSumForBlock(CvtBBI->BB);
+ SumWeight = MBPI->getSumForBlock(CvtBBI->BB, WeightScale);
}
if (CvtBBI->BB->pred_size() > 1) {
@@ -1279,8 +1277,8 @@ bool IfConverter::IfConvertTriangle(BBInfo &BBI, IfcvtKind Kind) {
// New_Weight(BBI.BB, CvtBBI->FalseBB) =
// Weight(BBI.BB, CvtBBI->BB) * Weight(CvtBBI->BB, CvtBBI->FalseBB)
- uint64_t NewNext = BBNext * SumWeight + BBCvt * CvtNext;
- uint64_t NewFalse = BBCvt * CvtFalse;
+ uint64_t NewNext = BBNext * SumWeight + (BBCvt * CvtNext) / WeightScale;
+ uint64_t NewFalse = (BBCvt * CvtFalse) / WeightScale;
// We need to scale down all weights of BBI.BB to fit uint32_t.
// Here BBI.BB is connected to CvtBBI->FalseBB and will fall through to
// the next block.
OpenPOWER on IntegriCloud