[llvm-commits] [llvm] r100640 - in /llvm/trunk: include/llvm/Target/TargetMachine.h lib/CodeGen/LLVMTargetMachine.cpp

Chris Lattner clattner at apple.com
Wed Apr 7 11:21:06 PDT 2010


On Apr 7, 2010, at 11:18 AM, Anton Korobeynikov wrote:

> Author: asl
> Date: Wed Apr  7 13:18:42 2010
> New Revision: 100640
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=100640&view=rev
> Log:
> Add hook to insert late LLVM=>LLVM passes just before isel

This hook should return void if you're going to ignore the result :).

> 
> Modified:
>    llvm/trunk/include/llvm/Target/TargetMachine.h
>    llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
> 
> Modified: llvm/trunk/include/llvm/Target/TargetMachine.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=100640&r1=100639&r2=100640&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Target/TargetMachine.h (original)
> +++ llvm/trunk/include/llvm/Target/TargetMachine.h Wed Apr  7 13:18:42 2010
> @@ -264,10 +264,15 @@
>                                           bool DisableVerify = true);
> 
>   /// Target-Independent Code Generator Pass Configuration Options.
> -  
> -  /// addInstSelector - This method should add any "last minute" LLVM->LLVM
> -  /// passes, then install an instruction selector pass, which converts from
> -  /// LLVM code to machine instructions.
> +
> +  /// addPreISelPasses - This method should add any "last minute" LLVM->LLVM
> +  /// passes (which are run just before instruction selector).
> +  virtual bool addPreISel(PassManagerBase &, CodeGenOpt::Level) {
> +    return true;
> +  }
> +
> +  /// addInstSelector - This method should install an instruction selector pass,
> +  /// which converts from LLVM code to machine instructions.
>   virtual bool addInstSelector(PassManagerBase &, CodeGenOpt::Level) {
>     return true;
>   }
> 
> Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=100640&r1=100639&r2=100640&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
> +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Wed Apr  7 13:18:42 2010
> @@ -268,6 +268,8 @@
> 
>   PM.add(createStackProtectorPass(getTargetLowering()));
> 
> +  addPreISel(PM, OptLevel);
> +
>   if (PrintISelInput)
>     PM.add(createPrintFunctionPass("\n\n"
>                                    "*** Final LLVM Code input to ISel ***\n",
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list