[PATCH] bugpoint Enhancement.

Richard Diamond wichard at vitalitystudios.com
Sun Apr 5 16:35:59 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: tools/bugpoint/CrashDebugger.cpp:49
@@ +48,3 @@
+  cl::opt<bool>
+  DontReducePassList("dont-reduce-pass-list",
+                     cl::desc("Skip pass list reduction steps"),
----------------
jfb wrote:
> `disable-pass-list-reduction` would be more idiomatic.
You're right; done!

================
Comment at: tools/bugpoint/CrashDebugger.cpp:209
@@ +208,3 @@
+  if (!UsedVar || !UsedVar->hasInitializer()) return;
+  if (isa<ConstantAggregateZero>(UsedVar->getInitializer())) {
+    assert(UsedVar->use_empty());
----------------
jfb wrote:
> Isn't this always false? At least `InstrProfiling.cpp` does `cast<ConstantArray>(LLVMUsed->getInitializer())` so one of these is wrong :-)
No, because LLVM will replace an array with zeroinitializer when the last non-null value is replaced with null.

================
Comment at: tools/bugpoint/CrashDebugger.cpp:216
@@ +215,3 @@
+  std::vector<Constant*> Used;
+  for(auto OpIt : OldUsedVal->operand_values()) {
+    Constant *Op = cast<Constant>(OpIt->stripPointerCasts());
----------------
jfb wrote:
> Using `Value *V` is clearer.
Done.

================
Comment at: tools/bugpoint/CrashDebugger.cpp:298
@@ +297,3 @@
+    RemoveFunctionReferences(M, "llvm.used");
+    RemoveFunctionReferences(M, "llvm.compiler.used");
+  }
----------------
jfb wrote:
> Can you instead replace all uses of the function with `Undef` of that type before deleting the function?
`undef` isn't considered a null value, meaning isNullValue would return false. It's not impossible to do, but I'm guessing it would change quite a bit of behavior and given that calling either null or undef is undefined behavior, I'd rather not mess with it post-mortem.

http://reviews.llvm.org/D8555

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list