[PATCH] Make it possible for ints/floats to return different values from getBooleanContents()

Hal Finkel hfinkel at anl.gov
Wed Jul 9 12:41:51 PDT 2014


----- Original Message -----
> From: "Daniel Sanders" <daniel.sanders at imgtec.com>
> To: "daniel sanders" <daniel.sanders at imgtec.com>
> Cc: hfinkel at anl.gov, "justin holewinski" <justin.holewinski at gmail.com>, mcrosier at codeaurora.org,
> llvm-commits at cs.uiuc.edu
> Sent: Wednesday, July 9, 2014 2:31:53 PM
> Subject: Re: [PATCH] Make it possible for ints/floats to return different values from getBooleanContents()
> 
> ================
> Comment at: include/llvm/Target/TargetLowering.h:960
> @@ +959,3 @@
> +  /// value from i1 to a wider type.  See getBooleanContents.
> +  void setBooleanFloatContents(BooleanContent Ty) {
> BooleanFloatContents = Ty; }
> +
> ----------------
> hfinkel at anl.gov wrote:
> > I would really like to do this without causing churn to all of the
> > targets (and causing pain for all out-of-tree targets). How about
> > we do this:
> > 
> > void setBooleanContents(BooleanContent Ty) { BooleanContents = Ty;
> > BooleanFloatContents = Ty; }
> > 
> > void setBooleanContents(BooleanContent Ty, BooleanContent FTy) {
> > BooleanContents = Ty; BooleanFloatContents = FTy; }
> > 
> > do that the current target code will continue to do the right
> > thing.
> That makes sense to me. I've made this change in the updated patch.
> I've also added a comment that should ensure that people call
> setBooleanFloatContents() after setBooleanContents().

Now you see I was so speedy with my review, that I submitted it before I saw this reply ;) -- I stand by my preference, however. I think that, even with a comment, someone will manage to incorrectly order these as they refactor code.

Thanks again,
Hal

> 
> http://reviews.llvm.org/D4389
> 
> 
> 

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



More information about the llvm-commits mailing list