[cfe-commits] r130163 - in /cfe/trunk: lib/CodeGen/CGBuiltin.cpp test/CodeGen/builtin-expect.c

jahanian fjahanian at apple.com
Mon Apr 25 16:16:06 PDT 2011


On Apr 25, 2011, at 3:54 PM, Chris Lattner wrote:

> 
> On Apr 25, 2011, at 3:30 PM, Fariborz Jahanian wrote:
> 
>> Author: fjahanian
>> Date: Mon Apr 25 17:30:02 2011
>> New Revision: 130163
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=130163&view=rev
>> Log:
>> Ir-gen the side-effect(s) when __builtin_expect is
>> constant-folded. // rdar://9330105
> 
> Hi Fariborz,
> 
> I don't think that this is the right approach, because other evaluatable expressions can have side effects as well.  Does something like this work:
> 
> if (E->Evaluate(Result, CGM.getContext()) &&
>    !Result.hasSideEffects()) {
> ...
>    if (Result.Val.isInt())

Yes, a general solution. In r130172.

- Thanks, Fariborz

> 
> 
> -Chris
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110425/c36ed871/attachment.html>


More information about the cfe-commits mailing list