[PATCH] D34085: [PGO] Register promote profile counter updates

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 13:39:56 PDT 2017


vsk added a comment.

I had a look through SSAUpdater and it seems like this is doing something totally reasonable. This lgtm with some changes pointed out inline.



================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:183
+        Builder.CreateAtomicRMW(AtomicRMWInst::Add, Addr, LiveInValue,
+                                AtomicOrdering::SequentiallyConsistent);
+      else {
----------------
There should be some test coverage for the atomic-counter-update-promoted option.


================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:207
+    SmallVector<BasicBlock *, 8> LoopExitBlocks;
+    DenseSet<BasicBlock *> BlockSet;
+    ParentLoop.getExitBlocks(LoopExitBlocks);
----------------
Would a SmallPtrSet<..., 8> be more appropriate here, given the definition for LoopExitBlocks?


https://reviews.llvm.org/D34085





More information about the llvm-commits mailing list