[llvm] 2fea1cc - [RISCV][GISel] Correct the widening predicate for G_SITOFP/G_UITOFP.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 4 14:35:56 PST 2024
Author: Craig Topper
Date: 2024-12-04T14:35:44-08:00
New Revision: 2fea1ccb6221238674562533684c51b63de248d4
URL: https://github.com/llvm/llvm-project/commit/2fea1ccb6221238674562533684c51b63de248d4
DIFF: https://github.com/llvm/llvm-project/commit/2fea1ccb6221238674562533684c51b63de248d4.diff
LOG: [RISCV][GISel] Correct the widening predicate for G_SITOFP/G_UITOFP.
This happened to coincidentally work due to D and Zfh both depending
on the F extension.
It breaks when I tried to add fp128 libcall support.
Added:
Modified:
llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
index 193fbefe421bf6..456ca9894e6a7d 100644
--- a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
+++ b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
@@ -570,10 +570,10 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
[=, &ST](const LegalityQuery &Query) {
return Query.Types[0].isScalar() && Query.Types[1].isScalar() &&
(Query.Types[1].getSizeInBits() < ST.getXLen()) &&
- ((ST.hasStdExtF() && Query.Types[1].getSizeInBits() == 32) ||
- (ST.hasStdExtD() && Query.Types[1].getSizeInBits() == 64) ||
+ ((ST.hasStdExtF() && Query.Types[0].getSizeInBits() == 32) ||
+ (ST.hasStdExtD() && Query.Types[0].getSizeInBits() == 64) ||
(ST.hasStdExtZfh() &&
- Query.Types[1].getSizeInBits() == 16));
+ Query.Types[0].getSizeInBits() == 16));
},
LegalizeMutations::changeTo(1, sXLen))
// Otherwise only promote to s32 since we have si libcalls.
More information about the llvm-commits
mailing list