diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-01-06 22:27:43 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-01-06 22:27:43 +0000 |
commit | ef512b992943dbd5619176f770b5bac8efa33dd0 (patch) | |
tree | e106c2ceca70e12d0f2205b00bd2e02deb70f887 /clang/lib/CodeGen/CGExprAgg.cpp | |
parent | 6a9d2cfadd9cf8964b75436940a9e16fbc8a9417 (diff) | |
download | bcm5719-llvm-ef512b992943dbd5619176f770b5bac8efa33dd0.tar.gz bcm5719-llvm-ef512b992943dbd5619176f770b5bac8efa33dd0.zip |
CodeGen: Initial instrumentation based PGO implementation
llvm-svn: 198640
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprAgg.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index 35e6988e462..1a6274e8284 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -892,15 +892,18 @@ VisitAbstractConditionalOperator(const AbstractConditionalOperator *E) { // Bind the common expression if necessary. CodeGenFunction::OpaqueValueMapping binding(CGF, E); + RegionCounter Cnt = CGF.getPGORegionCounter(E); CodeGenFunction::ConditionalEvaluation eval(CGF); - CGF.EmitBranchOnBoolExpr(E->getCond(), LHSBlock, RHSBlock); + CGF.EmitBranchOnBoolExpr(E->getCond(), LHSBlock, RHSBlock, Cnt.getCount()); // Save whether the destination's lifetime is externally managed. bool isExternallyDestructed = Dest.isExternallyDestructed(); eval.begin(CGF); CGF.EmitBlock(LHSBlock); + Cnt.beginRegion(Builder); Visit(E->getTrueExpr()); + Cnt.adjustFallThroughCount(); eval.end(CGF); assert(CGF.HaveInsertPoint() && "expression evaluation ended with no IP!"); @@ -914,10 +917,13 @@ VisitAbstractConditionalOperator(const AbstractConditionalOperator *E) { eval.begin(CGF); CGF.EmitBlock(RHSBlock); + Cnt.beginElseRegion(); Visit(E->getFalseExpr()); + Cnt.adjustFallThroughCount(); eval.end(CGF); CGF.EmitBlock(ContBlock); + Cnt.applyAdjustmentsToRegion(); } void AggExprEmitter::VisitChooseExpr(const ChooseExpr *CE) { |