allow branch weight metadata on select instructions (PR26636)
authorSanjay Patel <spatel@rotateright.com>
Mon, 14 Mar 2016 20:18:59 +0000 (20:18 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 14 Mar 2016 20:18:59 +0000 (20:18 +0000)
commitee52b6e77db149b4a256ed0f993499f2bb093e20
tree0698316f41625b6c3d0a95255a86b5f5f6c56a33
parent9d943978599267b458d55ef0be0c3f5253aa0455
allow branch weight metadata on select instructions (PR26636)

As noted in:
https://llvm.org/bugs/show_bug.cgi?id=26636

This doesn't accomplish anything on its own. It's the first step towards preserving
and using branch weights with selects.

The next step would be to make sure we're propagating the info in all of the other
places where we create selects (SimplifyCFG, InstCombine, etc). I don't think there's
an easy fix to make this happen; we have to look at each transform individually to
determine how to correctly propagate the weights.

Along with that step, we need to then use the weights when making subsequent transform
decisions such as discussed in http://reviews.llvm.org/D16836.

The inliner test is independent but closely related. It verifies that metadata is
preserved when both branches and selects are cloned.

Differential Revision: http://reviews.llvm.org/D18133

llvm-svn: 263482
llvm/include/llvm/IR/IRBuilder.h
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/Inline/profile-meta.ll [new file with mode: 0644]
llvm/test/Transforms/SimplifyCFG/PhiEliminate2.ll