[PATCH] D80400: [DwarfEHPrepare] Don't prune unreachable resumes at optnone

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 22 13:57:32 PDT 2020


nikic marked 4 inline comments as done.
nikic added inline comments.


================
Comment at: include/llvm/CodeGen/Passes.h:343
   /// adapted to code generation.  Required if using dwarf exception handling.
-  FunctionPass *createDwarfEHPass();
+  FunctionPass *createDwarfEHPass(bool PruneUnreachableResumes);
 
----------------
rnk wrote:
> IMO it makes more sense to pass in the optimization level, and then let the pass decide what that means it should do, so the caller doesn't have to think as much about the meaning of this parameter. It will simplify the call site as well.
I was a bit on the fence about this one, as "optimization level" seems like a higher-level concept to make, that should be managed by the pipeline builder, not individual passes. But it looks like all machine passes get passed the optimization level implicitly, so probably this view doesn't really match reality where the backend is concerned.


================
Comment at: test/CodeGen/X86/O0-pipeline.ll:30
 ; CHECK-NEXT:       Expand indirectbr instructions
 ; CHECK-NEXT:     Rewrite Symbols
 ; CHECK-NEXT:     FunctionPass Manager
----------------
rnk wrote:
> As a separate issue, this module pass between all the function passes is probably bad for cache locality. My understanding is that it acts as a barrier. We'll get these loops:
>   for all functions:
>     for some passes:
>       run fn passes
>   run rewrite symbol pass
>   for all functions
>     for remaining passes:
>       run fn pass
> 
> Instead of this loop:
>   for all functions:
>     for all fn passes:
>       run fn pass
> 
> I bet we can make createRewriteSymbolsPass return null if the YAML file option is not set, and then remove this from the standard pipeline.
> 
> @compnerd
Good point. I might look into it if no one beats me to it...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80400/new/

https://reviews.llvm.org/D80400





More information about the llvm-commits mailing list