[PATCH] D19435: [LowerExpectIntrinsic] pin default likely/unlikely weights to min/max values

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 14:19:28 PDT 2016


spatel added a comment.



> > But that is not the only reason: builtin_expect() is a programmer override that should affect BB placement too (although this doesn't work today AFAIK). We should set the weights to the extreme values to ensure that happens regardless of other weights that are based on profile data or heuristics. I noticed this could be a problem while looking at test/Transforms/LoopUnswitch/cold-loop.ll (notice the "100000000" branch weight).

> 




> It should work as the BB layout uses 80% as the threshold to follow successors. Do you have evidence that it does not work for block layout?


I don't have hard evidence, but the LoopUnswitch heuristics made me nervous and (sorry to ping-pong between this and the other patch) I noticed that x86 codegen, at least, wasn't affected whether I made it highly likely true or highly likely false for a simple case.


http://reviews.llvm.org/D19435





More information about the llvm-commits mailing list