[llvm] d4e08c9 - [NewPM] Set -enable-npm-optnone to true by default

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 18:42:44 PDT 2020


Author: Arthur Eubanks
Date: 2020-10-05T18:42:32-07:00
New Revision: d4e08c95e500bc813b24b146be29f17e7c08fa2a

URL: https://github.com/llvm/llvm-project/commit/d4e08c95e500bc813b24b146be29f17e7c08fa2a
DIFF: https://github.com/llvm/llvm-project/commit/d4e08c95e500bc813b24b146be29f17e7c08fa2a.diff

LOG: [NewPM] Set -enable-npm-optnone to true by default

This makes the NPM skip not required passes on functions marked optnone.

If this causes a pass that should be required but has not been marked
required to be skipped, add
`static bool isRequired() { return true; }`
to the pass class. AlwaysInlinerPass is an example.

clang/test/CodeGen/O0-no-skipped-passes.c is useful for checking that
no passes are skipped under -O0.

The -enable-npm-optnone option will be removed once this has been stable
for long enough without issues.

Reviewed By: ychen, asbirlea

Differential Revision: https://reviews.llvm.org/D87869

Added: 
    

Modified: 
    llvm/lib/Passes/StandardInstrumentations.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp
index d2ef2cd4ed61..06aa3868fd6d 100644
--- a/llvm/lib/Passes/StandardInstrumentations.cpp
+++ b/llvm/lib/Passes/StandardInstrumentations.cpp
@@ -33,7 +33,7 @@ using namespace llvm;
 
 // TODO: remove once all required passes are marked as such.
 static cl::opt<bool>
-    EnableOptnone("enable-npm-optnone", cl::init(false),
+    EnableOptnone("enable-npm-optnone", cl::init(true),
                   cl::desc("Enable skipping optional passes optnone functions "
                            "under new pass manager"));
 


        


More information about the llvm-commits mailing list