[llvm] [LoongArch] Type legalize v2f32 loads by using an f64 load and a scalar_to_vector (PR #164943)

Zhaoxin Yang via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 27 21:01:29 PDT 2025


================
@@ -4668,6 +4670,32 @@ void LoongArchTargetLowering::ReplaceNodeResults(
            "Unexpected custom legalisation");
     Results.push_back(customLegalizeToWOp(N, DAG, 2));
     break;
+  case ISD::LOAD: {
+    // Use an f64 load and a scalar_to_vector for v2f32 loads. This avoids
+    // scalarizing in 32-bit mode. In 64-bit mode this avoids a int->fp
----------------
ylzsx wrote:

Thanks, I will add some tests.

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


More information about the llvm-commits mailing list