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

Xinliang David Li davidxl at google.com
Thu Jul 30 11:05:12 PDT 2015


On Thu, Jul 30, 2015 at 10:57 AM, Cong Hou <congh at google.com> wrote:
> 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.
>

This is actually an example that current interface is hard to use it right :)

David


>
> http://reviews.llvm.org/D11442
>
>
>




More information about the llvm-commits mailing list