
This commit adds a new pass gate that allows selective disabling of one or more passes via the clang command line using the `-opt-disable` option. Passes to be disabled should be specified as a comma-separated list of their names. The implementation resides in the same file as the bisection tool. The `getGlobalPassGate()` function returns the currently enabled gate. Example: `-opt-disable="PassA,PassB"` Pass names are matched using case-insensitive comparisons. However, note that special characters, including spaces, must be included exactly as they appear in the pass names. Additionally, a `-opt-disable-enable-verbosity` flag has been introduced to enable verbose output when this functionality is in use. When enabled, it prints the status of all passes (either running or NOT running), similar to the default behavior of `-opt-bisect-limit`. This flag is disabled by default, which is the opposite of the `-opt-bisect-verbose` flag (which defaults to enabled). To validate this functionality, a test file has also been provided. It reuses the same infrastructure as the opt-bisect test, but disables three specific passes and checks the output to ensure the expected behavior. --------- Co-authored-by: Nikita Popov <github@npopov.com>
13 lines
389 B
C
13 lines
389 B
C
// REQUIRES: x86-registered-target
|
|
|
|
// Make sure opt-bisect works through both pass managers
|
|
//
|
|
// RUN: %clang_cc1 -triple x86_64-linux-gnu -O1 %s -mllvm -opt-bisect-limit=-1 -emit-obj -o /dev/null 2>&1 | FileCheck %s
|
|
|
|
// CHECK: BISECT: running pass (1)
|
|
// CHECK-NOT: BISECT: running pass (1)
|
|
// Make sure that legacy pass manager is running
|
|
// CHECK: -isel
|
|
|
|
int func(int a) { return a; }
|