[PATCH] D30190: [LoopRotate] Update dbg.value calls

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 13:40:22 PST 2017


aprantl added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopRotation.cpp:182
+
+  // Map existing PHI nodes to their dbg.values
+  for(auto I = OrigHeader->begin(), E = OrigHeader->end(); I != E; ++I) {
----------------
'.' at the end :-)


================
Comment at: lib/Transforms/Scalar/LoopRotation.cpp:183
+  // Map existing PHI nodes to their dbg.values
+  for(auto I = OrigHeader->begin(), E = OrigHeader->end(); I != E; ++I) {
+    if (auto DbgII = dyn_cast<DbgInfoIntrinsic>(I)) {
----------------
clang-format, range-based-for?


================
Comment at: lib/Transforms/Scalar/LoopRotation.cpp:197
+         VI != VE; ++VI) {
+      if (DbgValueMap.count(*VI)) {
+        DbgInfoIntrinsic *DbgII =
----------------
this is doing the lookup twice if successful. Maybe better to use find() instead?


https://reviews.llvm.org/D30190





More information about the llvm-commits mailing list