[PATCH] D154348: Ignore modified attribute list if it yields invalid IR
Brian Gesiak via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 4 12:55:05 PDT 2023
modocache added inline comments.
================
Comment at: llvm/tools/bugpoint/CrashDebugger.cpp:374
+ Passes.push_back("verify");
+ std::unique_ptr<Module> New = BD.runPassesOn(M.get(), Passes);
+ if (!New)
----------------
Nirhar wrote:
> lattner wrote:
> > Can you use `llvm::verifyModule` instead of running the pass?
> Other parts of the `CrashDebugger` run the pass to verify llvm IR, hence I kept it the same. Let me know if I should still change to `llvm::verifyModule`.
You bring up a good point, @Nirhar -- there's actually a lot of duplication in this file. I count 7 spots where the verifier pass is run, and this makes 8! Here's an example: https://github.com/llvm/llvm-project/blob/b4b532a9562a1ebca347edc566363fba0531115b/llvm/tools/bugpoint/CrashDebugger.cpp#L512-L520
I agree that it would be nicer to use `llvm::verifyModule` here; it accomplishes the same thing, but in a much simpler way.
(And, I think it would be even better, in a separate patch, to change the other 7 spots to use `verifyModule` too -- and, ideally, have them print "verify failed!" and exit, like many of them seem to do.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154348/new/
https://reviews.llvm.org/D154348
More information about the llvm-commits
mailing list