File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,7 @@ cc_library(
195195        "//xla/service/cpu:cpu_executable_run_options" ,
196196        "//xla/service/cpu:cpu_runtime" ,
197197        "//xla/service/cpu:cpu_xfeed" ,
198+         "//xla/service/llvm_ir:llvm_command_line_options" ,
198199        "//xla/stream_executor:device_memory" ,
199200        "//xla/tsl/concurrency:async_value" ,
200201        "//xla/tsl/concurrency:ref_count" ,
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ limitations under the License.
9999#include  " xla/service/hlo_module_config.h" 
100100#include  " xla/service/hlo_module_util.h" 
101101#include  " xla/service/hlo_value.h" 
102+ #include  " xla/service/llvm_ir/llvm_command_line_options.h" 
102103#include  " xla/service/maybe_owning_device_memory.h" 
103104#include  " xla/shape.h" 
104105#include  " xla/shape_util.h" 
@@ -744,6 +745,11 @@ static absl::StatusOr<std::unique_ptr<xla::Executable>> JitCompile(
744745  static  constexpr  char  kBeforeOptimizationsDumpName [] = " before_optimizations" 
745746  DumpHloModuleIfEnabled (*hlo_module, kBeforeOptimizationsDumpName );
746747
748+   //  RunHloPasses and RunBackend both look at the LLVM command line options.
749+   auto  llvm_options = llvm_ir::ExtractXlaBackendExtraOptions (
750+       hlo_module->config ().debug_options ().xla_backend_extra_options ());
751+   llvm_ir::LLVMCommandLineOptionsLock llvm_lock (llvm_options);
752+ 
747753  //  Run Hlo Passes
748754  cpu::CpuCompiler compiler;
749755  TF_ASSIGN_OR_RETURN (hlo_module, compiler.RunHloPasses (std::move (hlo_module),
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments