diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-02-02 22:00:48 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-02-02 22:00:48 +0900 |
commit | 8eff226c98bdcfcd1366120699a42e0c4c73375c (patch) | |
tree | 97da77aef099412a0c173ad46716651503c40a40 /clang/lib/CodeGen/CodeGenPGO.h | |
parent | d414f29ed8732c77fdcd05cc3b066e9ee0d9de07 (diff) | |
download | llvm-users/chapuni/mcdc/nest/logopstack.zip llvm-users/chapuni/mcdc/nest/logopstack.tar.gz llvm-users/chapuni/mcdc/nest/logopstack.tar.bz2 |
[MC/DC] Prune MCDCLogOpStack and use CGF.isMCDCDecisionExprusers/chapuni/mcdc/nest/logopstack
`MCDCLogOpStack` is used only for detection of the Decision root. It
can be detected with `MCDC::State::DecisionByStmt`.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenPGO.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenPGO.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.h b/clang/lib/CodeGen/CodeGenPGO.h index 1944b64..0cbea64 100644 --- a/clang/lib/CodeGen/CodeGenPGO.h +++ b/clang/lib/CodeGen/CodeGenPGO.h @@ -111,6 +111,20 @@ private: public: std::pair<bool, bool> getIsCounterPair(const Stmt *S) const; + + bool isMCDCDecisionExpr(const Expr *E) const { + if (!RegionMCDCState) + return false; + auto I = RegionMCDCState->DecisionByStmt.find(E); + if (I == RegionMCDCState->DecisionByStmt.end()) + return false; + return I->second.isValid(); + } + + bool isMCDCBranchExpr(const Expr *E) const { + return (RegionMCDCState && RegionMCDCState->BranchByStmt.contains(E)); + } + void emitCounterSetOrIncrement(CGBuilderTy &Builder, const Stmt *S, llvm::Value *StepV); void emitMCDCTestVectorBitmapUpdate(CGBuilderTy &Builder, const Expr *S, |