[patch] Fix pr14893

Hal Finkel hfinkel at anl.gov
Tue Jan 28 08:09:48 PST 2014


----- Original Message -----
> From: "Rafael EspĂ­ndola" <rafael.espindola at gmail.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "llvm-commits" <llvm-commits at cs.uiuc.edu>
> Sent: Tuesday, January 28, 2014 9:46:12 AM
> Subject: Re: [patch] Fix pr14893
> 
> > This looks useful, thanks.
> >
> > +      // semantic we don't understand.
> > +      // We keep tbaa since the type should still be the same.
> >
> > s/semantic/semantics/
> >
> > Also, to be specific about TBAA, I would say that we're allowed to
> > assume that there are no control dependencies on the load's type
> > information (maybe we should add this to the language reference).
> 
> When I started writing this I realized it was probably not correct:
> 
> union foo {
>   int a;
>   float b;
> };
> bool f(foo *x);
> void use_int(int);
> void use_float(float);
> void g() {
>   foo t;
>   bool b = f(&t);
>   if (b)
>     use_int(t.a);
>   else
>     use_float(t.b);
> }
> 
> If we decide to move the loads (not profitable in the reduce
> example),
> the tbaa flag would no longer be valid.
> 
> The attached patch now explicitly checks that we drop tbaa. I kept
> the
> more general dropUnknownMetadata implementation.

Ah, good point! Thanks! (If you're just looking for a review to clarify the metadata semantics, then LGTM).

 -Hal

> 
> Cheers,
> Rafael
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory




More information about the llvm-commits mailing list