[LLVMdev] Removing metadata in a pass

Hal Finkel hfinkel at anl.gov
Fri Jul 18 09:55:26 PDT 2014


----- Original Message -----
> From: "Mark Heffernan" <meheff at google.com>
> To: "Tim Northover" <t.p.northover at gmail.com>
> Cc: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
> Sent: Friday, July 18, 2014 11:41:56 AM
> Subject: Re: [LLVMdev] Removing metadata in a pass
> 
> 
> 
> 
> 
> On Fri, Jul 18, 2014 at 2:30 AM, Tim Northover <
> t.p.northover at gmail.com > wrote:
> 
> 
> 
> What about dividing the unroll hint by the unroll count and dropping
> it if that's <= 1?
> 
> 
> 
> That would usually get to an unroll factor closer to what the user
> requested, though most of the time they wouldn't be divisible so
> you'd rarely end up with the exact factor in the end. I'm a little
> on the fence about the compiler doing any unrolling if the pragma
> target can't be met. Maybe it should just emit a warning and give
> up. Currently it unrolls as much as possible if the target can't be
> met (it will emit a warning in this case once I finish a patch I'm
> working on). Though I can see bike-shedding arguments for either
> case.

I agree; I think that they'll rarely be divisible. Also, I agree that a warning would be nice.

Since you started by asking a general question, let me answer that: A pass is *required* to remove all metadata on any instructions that it changes and/or moves that it does not know will still be valid after the transformation. Now optimization hints don't necessarily have validity constraints, and so the answer is fuzzy here, but some metadata does, and this is something to keep in mind.

 -Hal

> 
> 
> Mark
> 
> 
> 
> 
> Cheers.
> 
> Tim.
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 

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



More information about the llvm-dev mailing list