[PATCH] D11442: Provide an interface normalizeSuccWeights in MachineBasicBlock to normalize its successors' weights and use it in other places.

Cong Hou congh at google.com
Thu Jul 30 10:57:47 PDT 2015


congh added inline comments.

================
Comment at: lib/CodeGen/IfConversion.cpp:1245
@@ -1242,3 +1244,3 @@
     BBCvt = MBPI->getEdgeWeight(BBI.BB, CvtBBI->BB);
-    SumWeight = MBPI->getSumForBlock(CvtBBI->BB, WeightScale);
+    SumWeight = MBPI->getSumForBlock(CvtBBI->BB);
   }
----------------
davidxl wrote:
> why not move this before getEdgeWeight so that the explicit call to normalize weight is not needed?
This is to explicitly stating that we should normalize the edge weights then get them. I am afraid if we just simply put getSumForBlock() before getEdgeWeight(), some people who are not aware that getSumForBlock() does weights normalization may switch them later by mistake.


http://reviews.llvm.org/D11442







More information about the llvm-commits mailing list