Don't attribute in file headers anymore. See llvmdev for the
[oota-llvm.git] / include / llvm / Target / TargetInstrInfo.h
index 28a08b28bfdb114a9a9425bbebec55d70129001c..01aa96b00f742340fb16740da69d3c6ba5c08eb6 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -314,6 +314,16 @@ public:
            isReallyTriviallyReMaterializable(MI);
   }
 
+  /// hasUnmodelledSideEffects - Returns true if the instruction has side
+  /// effects that are not captured by any operands of the instruction or other
+  /// flags.
+  bool hasUnmodelledSideEffects(MachineInstr *MI) const {
+    const TargetInstrDescriptor *TID = MI->getInstrDescriptor();
+    if (!(TID->Flags & M_NEVER_HAS_SIDE_EFFECTS ||
+          TID->Flags & M_MAY_HAVE_SIDE_EFFECTS)) return true;
+    if (TID->Flags & M_NEVER_HAS_SIDE_EFFECTS) return false;
+    return !isReallySideEffectFree(MI); // May have side effects
+  }
 protected:
   /// isReallyTriviallyReMaterializable - For instructions with opcodes for
   /// which the M_REMATERIALIZABLE flag is set, this function tests whether the
@@ -329,7 +339,7 @@ protected:
 
   /// isReallySideEffectFree - If the M_MAY_HAVE_SIDE_EFFECTS flag is set, this
   /// method is called to determine if the specific instance of this
-  /// instructions has side effects. This is useful in cases of instructions,
+  /// instruction has side effects. This is useful in cases of instructions,
   /// like loads, which generally always have side effects. A load from a
   /// constant pool doesn't have side effects, though. So we need to
   /// differentiate it from the general case.