aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorAbinaya Saravanan <quic_asaravan@quicinc.com>2025-07-17 17:27:13 +0530
committerGitHub <noreply@github.com>2025-07-17 17:27:13 +0530
commitfcabb53f0c349885167ea3d0e53915e6c42271a7 (patch)
tree9e77a155ba0bac81605dcfaef5f5824e48bb0d03 /llvm/lib
parentfe1941967267e472f7eee15b43712bdfa2b63544 (diff)
downloadllvm-fcabb53f0c349885167ea3d0e53915e6c42271a7.zip
llvm-fcabb53f0c349885167ea3d0e53915e6c42271a7.tar.gz
llvm-fcabb53f0c349885167ea3d0e53915e6c42271a7.tar.bz2
[HEXAGON] Add AssertSext in sign-extended mpy (#149061)
The pattern i32xi32->i64, should be matched to the sign-extended multiply op, instead of explicit sign- extension of the operands followed by non-widening multiply (this takes 4 operations instead of one). Currently, if one of the operands of multiply inside a loop is a constant, the sign-extension of this constant is hoisted out of the loop by LICM pass and this pattern is not matched by the ISEL. This change handles multiply operand with Opcode of the type AssertSext which is seen when the sign-extension is hoisted out-of the loop. Modifies the DetectUseSxtw() to check for this.
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
index 53943de3..e285e04 100644
--- a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
@@ -1640,6 +1640,15 @@ bool HexagonDAGToDAGISel::DetectUseSxtw(SDValue &N, SDValue &R) {
R = N;
break;
}
+ case ISD::AssertSext: {
+ EVT T = cast<VTSDNode>(N.getOperand(1))->getVT();
+ if (T.getSizeInBits() == 32)
+ R = N.getOperand(0);
+ else
+ return false;
+ break;
+ }
+
default:
return false;
}