[llvm-commits] [llvm] r45245 - /llvm/trunk/lib/CodeGen/MachineLICM.cpp
Bill Wendling
isanbard at gmail.com
Wed Dec 19 17:08:11 PST 2007
Author: void
Date: Wed Dec 19 19:08:10 2007
New Revision: 45245
URL: http://llvm.org/viewvc/llvm-project?rev=45245&view=rev
Log:
Updated comments to reflect what "side effects" means in this situation.
Modified:
llvm/trunk/lib/CodeGen/MachineLICM.cpp
Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=45245&r1=45244&r2=45245&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Wed Dec 19 19:08:10 2007
@@ -249,8 +249,8 @@
/// IsLoopInvariantInst - Returns true if the instruction is loop
/// invariant. I.e., all virtual register operands are defined outside of the
-/// loop, physical registers aren't accessed (explicitly or implicitly), and the
-/// instruction is hoistable.
+/// loop, physical registers aren't accessed explicitly, and there are no side
+/// effects that aren't captured by the operands or other flags.
///
bool MachineLICM::IsLoopInvariantInst(MachineInstr &I) {
DEBUG({
@@ -281,13 +281,6 @@
DOUT << " * Instruction has side effects.\n";
});
-#if 0
- // FIXME: Don't hoist if this instruction implicitly reads physical registers.
- if (I.getInstrDescriptor()->ImplicitUses ||
- I.getInstrDescriptor()->ImplicitDefs)
- return false;
-#endif
-
// The instruction is loop invariant if all of its operands are loop-invariant
for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
const MachineOperand &MO = I.getOperand(i);
@@ -309,7 +302,7 @@
return false;
}
- // Don't hoist something that has side effects.
+ // Don't hoist something that has unmodelled side effects.
if (TII->hasUnmodelledSideEffects(&I)) return false;
// If we got this far, the instruction is loop invariant!
More information about the llvm-commits
mailing list