summaryrefslogtreecommitdiff
path: root/include/llvm/IntrinsicInst.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-11-11 15:34:13 +0000
committerDuncan Sands <baldrick@free.fr>2009-11-11 15:34:13 +0000
commita3da922a27da1b5db04bbbe6cbf4848a688b6786 (patch)
treee991ecb4b481a4b412053b02b6a5227a7b1b12e8 /include/llvm/IntrinsicInst.h
parent012397489b564b9ac1e1b4eed31fd7e71f50db9e (diff)
downloadllvm-a3da922a27da1b5db04bbbe6cbf4848a688b6786.tar.gz
llvm-a3da922a27da1b5db04bbbe6cbf4848a688b6786.tar.bz2
llvm-a3da922a27da1b5db04bbbe6cbf4848a688b6786.tar.xz
Don't trivially delete unused calls to llvm.invariant.start. This allows
llvm.invariant.start to be used without necessarily being paired with a call to llvm.invariant.end. If you run the entire optimization pipeline then such calls are in fact deleted (adce does it), but that's actually a good thing since we probably do want them to be zapped late in the game. There should really be an integration test that checks that the llvm.invariant.start call lasts long enough that all passes that do interesting things with it get to do their stuff before it is deleted. But since no passes do anything interesting with it yet this will have to wait for later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/IntrinsicInst.h')
-rw-r--r--include/llvm/IntrinsicInst.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/llvm/IntrinsicInst.h b/include/llvm/IntrinsicInst.h
index 6a8f376392..1e1dca2eba 100644
--- a/include/llvm/IntrinsicInst.h
+++ b/include/llvm/IntrinsicInst.h
@@ -320,6 +320,28 @@ namespace llvm {
}
};
+ /// MemoryUseIntrinsic - This is the common base class for the memory use
+ /// marker intrinsics.
+ ///
+ struct MemoryUseIntrinsic : public IntrinsicInst {
+
+ // 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