[llvm] [Patchpoint] Implement integer result type legalization for patchpoints (PR #97278)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 03:46:59 PDT 2024


================
@@ -5992,6 +5996,26 @@ SDValue DAGTypeLegalizer::PromoteIntRes_VP_REDUCE(SDNode *N) {
                      N->getOperand(1), N->getOperand(2), N->getOperand(3));
 }
 
+SDValue DAGTypeLegalizer::PromoteIntRes_PATCHPOINT(SDNode *N) {
+  EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
+  SDLoc dl(N);
+
+  assert(N->getNumValues() == 3 && "Expected 3 values for PATCHPOINT");
+  SmallVector<EVT, 3> VTs(N->values());
+  VTs[0] = NVT;
+  SDVTList VTList = DAG.getVTList(VTs);
----------------
arsenm wrote:

No need for the temporary vector, you can just hardcode Chain / glue in the one getVTList call 

https://github.com/llvm/llvm-project/pull/97278


More information about the llvm-commits mailing list