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/CGExprComplex.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/CGExprComplex.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprComplex.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp index ded4bb86172..145d94620ee 100644 --- a/clang/lib/CodeGen/CGExprComplex.cpp +++ b/clang/lib/CodeGen/CGExprComplex.cpp @@ -752,22 +752,28 @@ 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()); eval.begin(CGF); CGF.EmitBlock(LHSBlock); + Cnt.beginRegion(Builder); ComplexPairTy LHS = Visit(E->getTrueExpr()); + Cnt.adjustFallThroughCount(); LHSBlock = Builder.GetInsertBlock(); CGF.EmitBranch(ContBlock); eval.end(CGF); eval.begin(CGF); CGF.EmitBlock(RHSBlock); + Cnt.beginElseRegion(); ComplexPairTy RHS = Visit(E->getFalseExpr()); + Cnt.adjustFallThroughCount(); RHSBlock = Builder.GetInsertBlock(); CGF.EmitBlock(ContBlock); eval.end(CGF); + Cnt.applyAdjustmentsToRegion(); // Create a PHI node for the real part. llvm::PHINode *RealPN = Builder.CreatePHI(LHS.first->getType(), 2, "cond.r"); |