remove the pointless check of MemoryUseIntrinsic from
authorChris Lattner <sabre@nondot.org>
Tue, 30 Nov 2010 02:03:47 +0000 (02:03 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 30 Nov 2010 02:03:47 +0000 (02:03 +0000)
is trivially dead, since these have side effects.  This makes the
(misnamed) MemoryUseIntrinsic class dead, so remove it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120382 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IntrinsicInst.h
lib/Transforms/Utils/Local.cpp

index a17fa9cc5bdd4236ce202aa1f7f49d3739c52e45..78ef70b1a4ef88d355609cd06647cd8773bd54c0 100644 (file)
@@ -55,7 +55,7 @@ namespace llvm {
       return isa<CallInst>(V) && classof(cast<CallInst>(V));
     }
   };
-
+  
   /// DbgInfoIntrinsic - This is the common base class for debug info intrinsics
   ///
   class DbgInfoIntrinsic : public IntrinsicInst {
@@ -297,29 +297,6 @@ namespace llvm {
     }
   };
 
-  /// MemoryUseIntrinsic - This is the common base class for the memory use
-  /// marker intrinsics.
-  ///
-  class MemoryUseIntrinsic : public IntrinsicInst {
-  public:
-
-    // Methods for support type inquiry through isa, cast, and dyn_cast:
-    static inline bool classof(const MemoryUseIntrinsic *) { return true; }
-    static inline bool classof(const IntrinsicInst *I) {
-      switch (I->getIntrinsicID()) {
-      case Intrinsic::lifetime_start:
-      case Intrinsic::lifetime_end:
-      case Intrinsic::invariant_start:
-      case Intrinsic::invariant_end:
-        return true;
-      default: return false;
-      }
-    }
-    static inline bool classof(const Value *V) {
-      return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
-    }
-  };
-
 }
 
 #endif
index 031bb4ba1b10c8992b6be233261061bc3a429895..383efcec10cda894c220315a2892829966630e83 100644 (file)
@@ -209,9 +209,6 @@ bool llvm::isInstructionTriviallyDead(Instruction *I) {
   // We don't want debug info removed by anything this general.
   if (isa<DbgInfoIntrinsic>(I)) return false;
 
-  // Likewise for memory use markers.
-  if (isa<MemoryUseIntrinsic>(I)) return false;
-
   if (!I->mayHaveSideEffects()) return true;
 
   // Special case intrinsics that "may have side effects" but can be deleted