[LLVMdev] instruction scheduling issue

Sergei Larin slarin at codeaurora.org
Mon Jan 7 12:32:43 PST 2013


Liu,

  This is likely a better solution for you - you do not want to mess with
the scheduler unless you really have to ;)

Sergei

---
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
The Linux Foundation


> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Krzysztof Parzyszek
> Sent: Monday, January 07, 2013 2:26 PM
> To: Xu Liu
> Cc: llvmdev at cs.uiuc.edu
> Subject: Re: [LLVMdev] instruction scheduling issue
> 
> On 1/7/2013 2:15 PM, Xu Liu wrote:
> >
> > This would be ideal. How can I do the instrumentation pass after the
> > instruction scheduling?
> 
> You could derive your own class from TargetPassConfig, and add the
> annotation pass in YourDerivedTargetPassConfig::addPreEmitPass.  This
> will add your annotation pass very late, just before the final code is
> emitted.  If you're using the X86 target, then the class and the
> function is already there:
> 
> lib/Target/X86/X86TargetMachine.cpp:
> 
> bool X86PassConfig::addPreEmitPass() {
>    bool ShouldPrint = false;
>    if (getOptLevel() != CodeGenOpt::None &&
> getX86Subtarget().hasSSE2()) {
>      addPass(createExecutionDependencyFixPass(&X86::VR128RegClass));
>      ShouldPrint = true;
>    }
> 
>    if (getX86Subtarget().hasAVX() && UseVZeroUpper) {
>      addPass(createX86IssueVZeroUpperPass());
>      ShouldPrint = true;
>    }
> 
>    return ShouldPrint;
> }
> 
> 
> 
> -Krzysztof
> 
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> hosted by The Linux Foundation
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list