Skip to content
Commit ee8d6acb authored by Xinliang David Li's avatar Xinliang David Li
Browse files

[Profile] Fix builtin_expect lowering bug

The lowerer wrongly assumes the ICMP instruction 
 1) always has a constant operand;
 2) the operand has value 0.

It also assumes the expected value can only be one, thus
other values other than one will be considered 'zero'.

This leads to wrong profile annotation when other integer values
are used other than 0, 1 in the comparison or in the expect intrinsic.

Also missing is handling of equal predicate.

This patch fixes all the above problems.

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

llvm-svn: 304453
parent 0a0acbcf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment