[PATCH] D22841: Add a pass to bugpoint to make it transform conditional jumps into unconditional jumps.

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 18:42:19 PDT 2016


majnemer added inline comments.

================
Comment at: tools/bugpoint/CrashDebugger.cpp:446
@@ +445,3 @@
+    ConstantFoldTerminator(BB);
+    MergeBlockIntoPredecessor(BB);
+  }
----------------
Is it possible for `MergeBlockIntoPredecessor` to destroy a block that we haven't yet processed in  `BBs`?

================
Comment at: tools/bugpoint/CrashDebugger.cpp:506-507
@@ +505,4 @@
+  SmallPtrSet<const BasicBlock *, 8> Blocks;
+  for (unsigned i = 0, e = BBs.size(); i != e; ++i)
+    Blocks.insert(cast<BasicBlock>(VMap[BBs[i]]));
+
----------------
Range-based for loop?

================
Comment at: tools/bugpoint/CrashDebugger.cpp:521-522
@@ +520,4 @@
+  // Loop over and delete any hack up any blocks that are not listed...
+  for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
+    for (Function::iterator BB = I->begin(), E = I->end(); BB != E; ++BB)
+      if (!Blocks.count(&*BB)) {
----------------
Range-based for loops?

================
Comment at: tools/bugpoint/CrashDebugger.cpp:524
@@ +523,3 @@
+      if (!Blocks.count(&*BB)) {
+        BranchInst *BR = dyn_cast<BranchInst>(BB->getTerminator());
+        if (!BR || !BR->isConditional())
----------------
`auto *`

================
Comment at: tools/bugpoint/CrashDebugger.cpp:539
@@ +538,3 @@
+
+  for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
+    SmallVector<BasicBlock *, 16> BBs;
----------------
Range-based for loops?

================
Comment at: tools/bugpoint/CrashDebugger.cpp:540
@@ +539,3 @@
+  for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
+    SmallVector<BasicBlock *, 16> BBs;
+    for (auto &BB : *I)
----------------
Hoist this out of the loop and clear on every iteration?

================
Comment at: tools/bugpoint/CrashDebugger.cpp:565
@@ +564,3 @@
+    const ValueSymbolTable &GST = M->getValueSymbolTable();
+    for (unsigned i = 0, e = BlockInfo.size(); i != e; ++i) {
+      Function *F = cast<Function>(GST.lookup(BlockInfo[i].first));
----------------
Range-based for loop?

================
Comment at: tools/bugpoint/CrashDebugger.cpp:566
@@ +565,3 @@
+    for (unsigned i = 0, e = BlockInfo.size(); i != e; ++i) {
+      Function *F = cast<Function>(GST.lookup(BlockInfo[i].first));
+      ValueSymbolTable &ST = F->getValueSymbolTable();
----------------
`auto *`


https://reviews.llvm.org/D22841





More information about the llvm-commits mailing list