[llvm] [GISel] Lower scalar G_SELECT in LegalizerHelper (PR #79342)

Kai Nacke via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 13:21:16 PST 2024


================
@@ -7972,13 +7971,22 @@ LegalizerHelper::LegalizeResult LegalizerHelper::lowerSelect(MachineInstr &MI) {
       MaskElt = MIRBuilder.buildSExtInReg(MaskTy, MaskElt, 1).getReg(0);
 
     // Continue the sign extension (or truncate) to match the data type.
-    MaskElt = MIRBuilder.buildSExtOrTrunc(DstTy.getElementType(),
-                                          MaskElt).getReg(0);
+    MaskElt =
+        MIRBuilder
+            .buildSExtOrTrunc(DstTy.isVector() ? DstTy.getElementType() : DstTy,
----------------
redstar wrote:

Changed.

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


More information about the llvm-commits mailing list