[llvm] [RISCV][GISel] Support G_PTRTOINT and G_INTTOPTR (PR #69542)
Amara Emerson via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 18 21:29:37 PDT 2023
================
@@ -122,6 +122,17 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
getActionDefinitionsBuilder(G_PTR_ADD)
.legalFor({{p0, XLenLLT}});
+ getActionDefinitionsBuilder(G_PTRTOINT)
+ .legalFor({XLenLLT, p0})
+ .widenScalarToNextPow2(0, XLen)
+ .clampScalar(0, XLenLLT, XLenLLT);
+
+ getActionDefinitionsBuilder(G_INTTOPTR)
+ .unsupportedIf([&](const LegalityQuery &Query) {
+ return Query.Types[0].getSizeInBits() != Query.Types[1].getSizeInBits();
+ })
----------------
aemerson wrote:
TIL.
https://github.com/llvm/llvm-project/pull/69542
More information about the llvm-commits
mailing list