summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2014-02-24 01:13:09 +0000
committerBob Wilson <bob.wilson@apple.com>2014-02-24 01:13:09 +0000
commit8ab169109129300e9cd7199b7b735ab3bd23760b (patch)
tree6554cbf46bf46836e462f6504dd181160469be13 /clang/lib/CodeGen/CGObjC.cpp
parentfbf741406ef468e8c978549144d7ded5d4428274 (diff)
downloadbcm5719-llvm-8ab169109129300e9cd7199b7b735ab3bd23760b.tar.gz
bcm5719-llvm-8ab169109129300e9cd7199b7b735ab3bd23760b.zip
Do not put instrumentation counters before phis in ObjC for-in loops.
We still don't use the PGO to set branch weights for these loops, but at least this keeps the compiler from crashing. <rdar://problem/16137778> llvm-svn: 202002
Diffstat (limited to 'clang/lib/CodeGen/CGObjC.cpp')
-rw-r--r--clang/lib/CodeGen/CGObjC.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index 7ca10575c12..dcc1074b7d6 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -1525,13 +1525,10 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){
llvm::Value *initialMutations =
Builder.CreateLoad(StateMutationsPtr, "forcoll.initial-mutations");
- RegionCounter Cnt = getPGORegionCounter(&S);
-
// Start looping. This is the point we return to whenever we have a
// fresh, non-empty batch of objects.
llvm::BasicBlock *LoopBodyBB = createBasicBlock("forcoll.loopbody");
EmitBlock(LoopBodyBB);
- Cnt.beginRegion(Builder);
// The current index into the buffer.
llvm::PHINode *index = Builder.CreatePHI(UnsignedLongLTy, 3, "forcoll.index");
@@ -1541,6 +1538,9 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){
llvm::PHINode *count = Builder.CreatePHI(UnsignedLongLTy, 3, "forcoll.count");
count->addIncoming(initialBufferLimit, LoopInitBB);
+ RegionCounter Cnt = getPGORegionCounter(&S);
+ Cnt.beginRegion(Builder);
+
// Check whether the mutations value has changed from where it was
// at start. StateMutationsPtr should actually be invariant between
// refreshes.
OpenPOWER on IntegriCloud