[llvm] [AArch64][GlobalISel] Legalize ptr shuffle vector to s64 (PR #116013)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 16:40:33 PST 2024


================
@@ -3697,6 +3697,41 @@ LegalizerHelper::bitcastConcatVector(MachineInstr &MI, unsigned TypeIdx,
   return Legalized;
 }
 
+// This bitcasts a shuffle vector to a different type currently of the same
+// element size. Mostly used to legalize ptr vectors, where ptrtoint/inttoptr
+// will be used instead.
+//
+// <16 x p0> = G_CONCAT_VECTORS <4 x p0>, <4 x p0>, mask
+// ===>
+// <4 x s64> = G_PTRTOINT <4 x p0>
+// <4 x s64> = G_PTRTOINT <4 x p0>
+// <16 x s64> = G_CONCAT_VECTORS <4 x s64>, <4 x s64>, mask
+// <16 x p0> = G_INTTOPTR <16 x s64>
+LegalizerHelper::LegalizeResult
+LegalizerHelper::bitcastShuffleVector(MachineInstr &MI, unsigned TypeIdx,
+                                      LLT CastTy) {
+  auto ShuffleMI = dyn_cast<GShuffleVector>(&MI);
----------------
arsenm wrote:

Use `cast<>`

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


More information about the llvm-commits mailing list