[BOLT] Skip the validation of CFG after it is finalized
When current state is `CFG_Finalized`, function `validateCFG()` should return true directly. Reviewed By: maksfb, yota9, Kepontry Differential Revision: https://reviews.llvm.org/D159410
This commit is contained in:
parent
5e4e2a5aae
commit
16fd879980
@ -3156,6 +3156,10 @@ void BinaryFunction::dumpGraphToFile(std::string Filename) const {
|
||||
}
|
||||
|
||||
bool BinaryFunction::validateCFG() const {
|
||||
// Skip the validation of CFG after it is finalized
|
||||
if (CurrentState == State::CFG_Finalized)
|
||||
return true;
|
||||
|
||||
bool Valid = true;
|
||||
for (BinaryBasicBlock *BB : BasicBlocks)
|
||||
Valid &= BB->validateSuccessorInvariants();
|
||||
|
8
bolt/test/verify-cfg.test
Normal file
8
bolt/test/verify-cfg.test
Normal file
@ -0,0 +1,8 @@
|
||||
# Verify if the `--verify-cfg` option might produce incorrect alerts.
|
||||
|
||||
REQUIRES: system-linux
|
||||
|
||||
RUN: %clang %cflags %p/Inputs/hello.c -o %t -Wl,-q
|
||||
RUN: llvm-bolt %t -o %t.bolt --verify-cfg 2>&1 | FileCheck %s
|
||||
|
||||
CHECK-NOT: BOLT-ERROR: Invalid CFG detected after pass {{.*}}
|
Loading…
x
Reference in New Issue
Block a user