[llvm] [AArch64][GlobalISel] Refactor BITCAST Legalization (PR #80505)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 03:24:54 PST 2024


================
@@ -5342,6 +5380,20 @@ LegalizerHelper::moreElementsVector(MachineInstr &MI, unsigned TypeIdx,
     Observer.changedInstr(MI);
     return Legalized;
   }
+  case TargetOpcode::G_BITCAST: {
+    if (TypeIdx != 0)
+      return UnableToLegalize;
+
+    unsigned SrcScalSize =
+        MRI.getType(MI.getOperand(1).getReg()).getScalarSizeInBits();
+    LLT NewTy =
+        LLT::fixed_vector(MoreTy.getSizeInBits() / SrcScalSize, SrcScalSize);
----------------
arsenm wrote:

Can you keep this in terms of TypeSize and avoid the fixed_vector?

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


More information about the llvm-commits mailing list