[llvm-commits] PATCH: BasicBlock metadata
Ralf Karrenberg
karrenberg at cdl.uni-saarland.de
Wed May 9 00:00:04 PDT 2012
Hi,
sorry for the last message - there were some things missing, the patch did not compile.
Here is the corrected version.
Sorry again,
Ralf
----- Original Message -----
> From: "Ralf Karrenberg" <karrenberg at cdl.uni-saarland.de>
> To: "Richard Osborne" <richard at xmos.com>
> Cc: llvm-commits at cs.uiuc.edu
> Sent: Dienstag, 8. Mai 2012 23:18:10
> Subject: Re: [llvm-commits] PATCH: BasicBlock metadata
>
> > 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.
>
> That makes sense. I attached the updated patch.
>
> > -- John T.
> >
> > > Ah sorry, I totally misread this bit of the code. It looks fine
> > > to me.
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: basicblock_metadata.patch
Type: text/x-patch
Size: 25117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120509/09317691/attachment.bin>
More information about the llvm-commits
mailing list