diff options
author | Mon P Wang <wangmp@apple.com> | 2008-11-01 20:24:53 +0000 |
---|---|---|
committer | Mon P Wang <wangmp@apple.com> | 2008-11-01 20:24:53 +0000 |
commit | 3efcd4a65cdf41ec72205757421dca6026e92a19 (patch) | |
tree | 9c463e2aec6560d10a98815913844488752ca551 /include/llvm/Target/TargetLowering.h | |
parent | de5b06b3e15be85b92ffef65413acf7d3262069e (diff) | |
download | external_llvm-3efcd4a65cdf41ec72205757421dca6026e92a19.zip external_llvm-3efcd4a65cdf41ec72205757421dca6026e92a19.tar.gz external_llvm-3efcd4a65cdf41ec72205757421dca6026e92a19.tar.bz2 |
Added interface to allow clients to create a MemIntrinsicNode for
target intrinsics that touches memory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58548 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetLowering.h')
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index e6499d8..b5cc14e 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -24,6 +24,7 @@ #include "llvm/Constants.h" #include "llvm/InlineAsm.h" +#include "llvm/Instructions.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/ADT/APFloat.h" @@ -263,7 +264,27 @@ public: MVT &IntermediateVT, unsigned &NumIntermediates, MVT &RegisterVT) const; - + + /// getTgtMemIntrinsic: Given an intrinsic, checks if on the target the + /// intrinsic will need to map to a MemIntrinsicNode (touches memory). If + /// this is the case, it returns true and store the intrinsic + /// information into the IntrinsicInfo that was passed to the function. + typedef struct IntrinsicInfo { + unsigned opc; // target opcode + MVT memVT; // memory VT + const Value* ptrVal; // value representing memory location + int offset; // offset off of ptrVal + unsigned align; // alignment + bool vol; // is volatile? + bool readMem; // reads memory? + bool writeMem; // writes memory? + } IntrinisicInfo; + + virtual bool getTgtMemIntrinsic(IntrinsicInfo& Info, + CallInst &I, unsigned Intrinsic) { + return false; + } + /// getWidenVectorType: given a vector type, returns the type to widen to /// (e.g., v7i8 to v8i8). If the vector type is legal, it returns itself. /// If there is no vector type that we want to widen to, returns MVT::Other |