[PATCH] Allow 0-weight branches in BranchProbabilityInfo.

Diego Novillo dnovillo at google.com
Wed May 6 09:42:50 PDT 2015


On Wed, May 6, 2015 at 12:41 PM, Hans Wennborg <hans at chromium.org> wrote:
> ================
> Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8024
> @@ -8013,1 +8023,3 @@
> +      Weight = std::max(
> +          1u, BPI->getEdgeWeight(SI.getParent(), I.getSuccessorIndex()));
>        assert(Weight <= UINT32_MAX / SI.getNumSuccessors());
> ----------------
> This looks good. I can address this TODO later.
>
> I figured this would be the only change necessary for the switch lowering code. Are the changes to getEdgeWeight() and lowerWorkItem() also necessary?

I don't know. I took the machine gun approach and changed all the
places that called into BPI. I can remove the ones that don't cause
the assertion in the tests, if you want.


Diego.



More information about the llvm-commits mailing list