[llvm-commits] [llvm] r118787 - /llvm/trunk/lib/Transforms/Scalar/Sink.cpp
Dan Gohman
gohman at apple.com
Thu Nov 11 08:20:28 PST 2010
Author: djg
Date: Thu Nov 11 10:20:28 2010
New Revision: 118787
URL: http://llvm.org/viewvc/llvm-project?rev=118787&view=rev
Log:
It's safe to sink some instructions which are not safe to speculatively
execute. Make Sink's predicate more precise.
Modified:
llvm/trunk/lib/Transforms/Scalar/Sink.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/Sink.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Sink.cpp?rev=118787&r1=118786&r2=118787&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Sink.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Sink.cpp Thu Nov 11 10:20:28 2010
@@ -169,7 +169,10 @@
return false;
}
- return Inst->isSafeToSpeculativelyExecute();
+ if (isa<TerminatorInst>(Inst) || isa<PHINode>(Inst))
+ return false;
+
+ return true;
}
/// SinkInstruction - Determine whether it is safe to sink the specified machine
More information about the llvm-commits
mailing list