[LLVMdev] Random question about the x86 backend (and backends in general I suppose)

Hal Finkel hfinkel at anl.gov
Wed Jan 8 09:53:03 PST 2014


----- Original Message -----
> From: "Philip Reames" <listmail at philipreames.com>
> To: "Hal Finkel" <hfinkel at anl.gov>, "Owen Anderson" <resistor at mac.com>
> Cc: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
> Sent: Wednesday, January 8, 2014 11:44:01 AM
> Subject: Re: [LLVMdev] Random question about the x86 backend (and	backends in general I suppose)
> 
> On 1/7/14 11:25 AM, Hal Finkel wrote:
> > ----- Original Message -----
> >
> > I'd like to second this. The problem with the current inference
> > scheme is that it is not consistent: instructions sometimes get
> > inferred flags, depending on how their patterns are specified, and
> > sometimes don't. Furthermore, auditing those inferred flags is not
> > easy, and because this is a correctness issue, they do need to be
> > checked.
> >
> Is there an easy way to inspect the resulting flags after inference
> has
> run? 

Sure. You can look, in the build directory, at the lib/Target/*/*GenInstrInfo.inc file. You'll see a big array of structure initializers, one for each instruction, and a flags variable that will have something like:

0|(1<<MCID::Pseudo)|(1<<MCID::Call)|(1<<MCID::MayLoad)|(1<<MCID::UsesCustomInserter)

It's just not very user-friendly ;)

 -Hal

> It seems like this would be the best format for auditing
> correctness.  If this doesn't already exist, adding a documentation
> generator which lists all the instructions, their inferred/explicit
> flags, and where they're defined could be a useful project.
> 
> Philip
> 

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



More information about the llvm-dev mailing list