[llvm-branch-commits] [llvm-branch] r71682 - in /llvm/branches/Apple/Dib: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/nothrow.ll
Bill Wendling
isanbard at gmail.com
Wed May 13 11:09:32 PDT 2009
Author: void
Date: Wed May 13 13:09:12 2009
New Revision: 71682
URL: http://llvm.org/viewvc/llvm-project?rev=71682&view=rev
Log:
--- Merging r71676 into '.':
A test/Transforms/InstCombine/nothrow.ll
U lib/Transforms/Scalar/InstructionCombining.cpp
calls in nothrow functions can be marked nothrow even if the callee
is not known to be nothrow. This allows readnone/readonly functions
to be deleted even if we don't know whether the callee can throw.
Added:
llvm/branches/Apple/Dib/test/Transforms/InstCombine/nothrow.ll
- copied unchanged from r71676, llvm/trunk/test/Transforms/InstCombine/nothrow.ll
Modified:
llvm/branches/Apple/Dib/lib/Transforms/Scalar/InstructionCombining.cpp
Modified: llvm/branches/Apple/Dib/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Transforms/Scalar/InstructionCombining.cpp?rev=71682&r1=71681&r2=71682&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Transforms/Scalar/InstructionCombining.cpp Wed May 13 13:09:12 2009
@@ -9578,6 +9578,16 @@
/// the heavy lifting.
///
Instruction *InstCombiner::visitCallInst(CallInst &CI) {
+ // If the caller function is nounwind, mark the call as nounwind, even if the
+ // callee isn't.
+ if (CI.getParent()->getParent()->doesNotThrow() &&
+ !CI.doesNotThrow()) {
+ CI.setDoesNotThrow();
+ return &CI;
+ }
+
+
+
IntrinsicInst *II = dyn_cast<IntrinsicInst>(&CI);
if (!II) return visitCallSite(&CI);
More information about the llvm-branch-commits
mailing list