summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-12-11 18:57:54 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-12-11 18:57:54 +0000
commita8ab1b75cb0d84ea61642d7b7c0139e6e367c28e (patch)
treee5c4b89bd21c115664b1be7bb84fa2ea11f8b3bd /llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
parente83876e31d9da26c9e0c11cf7463e4a645e96bc4 (diff)
downloadbcm5719-llvm-a8ab1b75cb0d84ea61642d7b7c0139e6e367c28e.tar.gz
bcm5719-llvm-a8ab1b75cb0d84ea61642d7b7c0139e6e367c28e.zip
[Hexagon] Add support for Hexagon V65
llvm-svn: 320404
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonISelLowering.cpp')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonISelLowering.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
index f6d0239e450..8a44a9ec51e 100644
--- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
@@ -2257,6 +2257,44 @@ const char* HexagonTargetLowering::getTargetNodeName(unsigned Opcode) const {
return nullptr;
}
+/// 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.
+bool HexagonTargetLowering::getTgtMemIntrinsic(IntrinsicInfo &Info,
+ const CallInst &I,
+ unsigned Intrinsic) const {
+ switch (Intrinsic) {
+ case Intrinsic::hexagon_V6_vgathermw:
+ case Intrinsic::hexagon_V6_vgathermw_128B:
+ case Intrinsic::hexagon_V6_vgathermh:
+ case Intrinsic::hexagon_V6_vgathermh_128B:
+ case Intrinsic::hexagon_V6_vgathermhw:
+ case Intrinsic::hexagon_V6_vgathermhw_128B:
+ case Intrinsic::hexagon_V6_vgathermwq:
+ case Intrinsic::hexagon_V6_vgathermwq_128B:
+ case Intrinsic::hexagon_V6_vgathermhq:
+ case Intrinsic::hexagon_V6_vgathermhq_128B:
+ case Intrinsic::hexagon_V6_vgathermhwq:
+ case Intrinsic::hexagon_V6_vgathermhwq_128B: {
+ const Module &M = *I.getParent()->getParent()->getParent();
+ Info.opc = ISD::INTRINSIC_W_CHAIN;
+ Type *VecTy = I.getArgOperand(1)->getType();
+ Info.memVT = MVT::getVT(VecTy);
+ Info.ptrVal = I.getArgOperand(0);
+ Info.offset = 0;
+ Info.align = M.getDataLayout().getTypeAllocSizeInBits(VecTy) / 8;
+ Info.vol = true;
+ Info.readMem = true;
+ Info.writeMem = true;
+ return true;
+ }
+ default:
+ break;
+ }
+ return false;
+}
+
bool HexagonTargetLowering::isTruncateFree(Type *Ty1, Type *Ty2) const {
EVT MTy1 = EVT::getEVT(Ty1);
EVT MTy2 = EVT::getEVT(Ty2);
OpenPOWER on IntegriCloud