[llvm] [AArch64][GlobalISel] Legalize 128-bit types for FABS (PR #104753)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 07:07:40 PDT 2024


================
@@ -8456,6 +8458,26 @@ LegalizerHelper::lowerAbsToCNeg(MachineInstr &MI) {
   return Legalized;
 }
 
+LegalizerHelper::LegalizeResult LegalizerHelper::lowerFAbs(MachineInstr &MI) {
+  Register SrcReg = MI.getOperand(1).getReg();
+  Register DstReg = MI.getOperand(0).getReg();
+
+  LLT Ty = MRI.getType(DstReg);
+  if (MRI.getType(SrcReg) != Ty)
+    return UnableToLegalize;
----------------
arsenm wrote:

Remove this check, the IR is malformed if this happens 

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


More information about the llvm-commits mailing list