aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenPGO.h
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2025-02-02 22:00:48 +0900
committerNAKAMURA Takumi <geek4civic@gmail.com>2025-02-02 22:00:48 +0900
commit8eff226c98bdcfcd1366120699a42e0c4c73375c (patch)
tree97da77aef099412a0c173ad46716651503c40a40 /clang/lib/CodeGen/CodeGenPGO.h
parentd414f29ed8732c77fdcd05cc3b066e9ee0d9de07 (diff)
downloadllvm-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.h14
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,