diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-25 17:11:47 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-25 17:11:47 +0000 |
commit | 3769fe149bb47dfdaa8ac39b7a4c26cf98ec503e (patch) | |
tree | 3b6f81ade44460101257ea285f2fa1cafe3ea71e /lib/VMCore | |
parent | e8742d084c54e9cd230fa03d368f0fedac2106cb (diff) | |
download | external_llvm-3769fe149bb47dfdaa8ac39b7a4c26cf98ec503e.zip external_llvm-3769fe149bb47dfdaa8ac39b7a4c26cf98ec503e.tar.gz external_llvm-3769fe149bb47dfdaa8ac39b7a4c26cf98ec503e.tar.bz2 |
improve optimization of invoke instructions:
- simplifycfg: invoke undef/null -> unreachable
- instcombine: invoke new -> invoke expect(0, 0) (an arbitrary NOOP intrinsic; only done if the allocated memory is unused, of course)
- verifier: allow invoke of intrinsics (to make the previous step work)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 477b81d..9a9b0b7 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1636,7 +1636,8 @@ void Verifier::visitInstruction(Instruction &I) { if (Function *F = dyn_cast<Function>(I.getOperand(i))) { // Check to make sure that the "address of" an intrinsic function is never // taken. - Assert1(!F->isIntrinsic() || (i + 1 == e && isa<CallInst>(I)), + CallSite CS(&I); + Assert1(!F->isIntrinsic() || (CS && i == (CS.isCall() ? e-1 : 2)), "Cannot take the address of an intrinsic!", &I); Assert1(F->getParent() == Mod, "Referencing function in another module!", &I); |