Verifier: Call verifyModule() from llc and opt
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 27 Mar 2015 22:04:28 +0000 (22:04 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 27 Mar 2015 22:04:28 +0000 (22:04 +0000)
commitde89228dfbe492c06f3fda6629e036643348f457
treec1792030863c059c68d6545c56c1d97f57b412b1
parent527745e789d49d6b3d3004d74265d2eb79cf5bd4
Verifier: Call verifyModule() from llc and opt

Change `llc` and `opt` to run `verifyModule()`.  This ensures that we
check the full module before `FunctionPass::doInitialization()` ever
gets called (I was getting crashes in `DwarfDebug` instead of verifier
failures when testing a WIP patch that checks operands of compile
units).  In `opt`, also move up debug-info-stripping so that it still
runs before verification.

There was a fair bit of broken code that was sitting in tree.
Interestingly, some were cases of a `select` that referred to itself in
`-instcombine` tests (apparently an intermediate result).  I split them
off to `*-noverify.ll` tests with RUN lines like this:

    opt < %s -S -disable-verify -instcombine | opt -S | FileCheck %s

This avoids verifying the input file (so we can get the broken code into
`-instcombine), but still verifies the output with a second call to
`opt` (to verify that `-instcombine` will clean it up like it should).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233432 91177308-0d34-0410-b5e6-96231b3b80d8
18 files changed:
test/Transforms/DeadStoreElimination/simple.ll
test/Transforms/GlobalOpt/blockaddress.ll
test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll
test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll
test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll
test/Transforms/InstCombine/call-intrinsics.ll
test/Transforms/InstCombine/objsize-noverify.ll [new file with mode: 0644]
test/Transforms/InstCombine/objsize.ll
test/Transforms/InstCombine/select-crash-noverify.ll [new file with mode: 0644]
test/Transforms/InstCombine/select-crash.ll
test/Transforms/InstCombine/select.ll
test/Transforms/InstCombine/vec_demanded_elts.ll
test/Transforms/LoopSimplify/dup-preds.ll
test/Transforms/LowerInvoke/2003-12-10-Crash.ll
test/Transforms/ObjCARC/move-and-merge-autorelease.ll
test/Transforms/SimplifyCFG/UnreachableEliminate.ll
tools/llc/llc.cpp
tools/opt/opt.cpp