[llvm-commits] PATCH: BasicBlock metadata

John Criswell criswell at illinois.edu
Tue May 8 07:12:28 PDT 2012


On 5/8/12 7:07 AM, Richard Osborne wrote:
> On 08/05/12 11:29, Ralf Karrenberg wrote:
>> On 5/8/12 11:40 AM, Richard Osborne wrote:
>>>> Cheers,
>>>> Ralf
>>>>     /// hasAddressTaken - returns true if there are any uses of this basic block
>>>>     /// other than direct branches, switches, etc. to it.
>>>> -  bool hasAddressTaken() const { return getSubclassDataFromValue() != 0; }
>>>> +  bool hasAddressTaken() const {
>>>> +    return (getSubclassDataFromValue()&  ~HasMetadataBit) != 0;
>>>> +  }
>>> I think this will result in basic block metadata effecting 
>>> optimizations. What would happen if you just ignored metadata here?
>> It will always treat a block that has metadata attached as a block 
>> whose address has been taken, which results in a crash at a later 
>> point (don't remember exactly where) because the address was never taken.

I think you might want to update the comment explaining what you said 
above and providing a justification for it.  Developers misunderstanding 
code seems like a flag for a better comment, IMHO.

-- John T.

> Ah sorry, I totally misread this bit of the code. It looks fine to me.


>
> -- 
> Richard Osborne | XMOS
> http://www.xmos.com
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

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


More information about the llvm-commits mailing list