[PATCH] D139525: Add implementation isTargetCanonicalConstantNode for hexagon.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 7 03:20:58 PST 2022


hokein created this revision.
hokein added reviewers: dmgreen, reames.
Herald added a subscriber: hiraditya.
Herald added a project: All.
hokein requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This fixes an infinite compiling loop caused by https://reviews.llvm.org/D137140


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139525

Files:
  llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
  llvm/lib/Target/Hexagon/HexagonISelLowering.h


Index: llvm/lib/Target/Hexagon/HexagonISelLowering.h
===================================================================
--- llvm/lib/Target/Hexagon/HexagonISelLowering.h
+++ llvm/lib/Target/Hexagon/HexagonISelLowering.h
@@ -169,6 +169,8 @@
   bool isExtractSubvectorCheap(EVT ResVT, EVT SrcVT,
       unsigned Index) const override;
 
+  bool isTargetCanonicalConstantNode(SDValue Op) const override;
+
   bool isShuffleMaskLegal(ArrayRef<int> Mask, EVT VT) const override;
   LegalizeTypeAction getPreferredVectorAction(MVT VT) const override;
   LegalizeAction getCustomOperationAction(SDNode &Op) const override;
Index: llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
===================================================================
--- llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
+++ llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
@@ -2162,6 +2162,11 @@
   return SrcTy.getVectorNumElements() <= 8;
 }
 
+bool HexagonTargetLowering::isTargetCanonicalConstantNode(SDValue Op) const {
+  return Op.getOpcode() == ISD::CONCAT_VECTORS ||
+         TargetLowering::isTargetCanonicalConstantNode(Op);
+}
+
 bool HexagonTargetLowering::isShuffleMaskLegal(ArrayRef<int> Mask,
                                                EVT VT) const {
   return true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139525.480837.patch
Type: text/x-patch
Size: 1261 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221207/0659f731/attachment.bin>


More information about the cfe-commits mailing list