[PATCH] D152726: [RISCV][GlobalISel] Legalize all ALU instructions, excluding w-instructions
Thorsten via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 6 12:25:25 PDT 2023
tschuett added inline comments.
================
Comment at: llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp:79
+ getActionDefinitionsBuilder({G_ZEXT, G_SEXT, G_ANYEXT})
+ .legalFor({XLenLLT})
+ .clampScalar(0, XLenLLT, XLenLLT)
----------------
arsenm wrote:
> tschuett wrote:
> > craig.topper wrote:
> > > How can G_ZEXT/G_SEXT/G_ANYEXT be legal for any types? The source and destination should be different types, and there is only 1 legal type on RISC-V.
> > The most complete target for Gisel is AArch64. See there legalisation for EXTs:
> > https://github.com/llvm/llvm-project/blob/f70967fdc4736a5c5150db294be55fa9e7792bb8/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp#L513
> I think the AArch64 rules are over-permissive and old. It shouldn't be permitting <= register size, only == register size values through
I found `remark: unable to legalize instruction: %252:_(<16 x s32>) = G_ZEXT %249:_(<16 x s8>) [-Rpass-missed=gisel-legalize]` in the wild. Till today, I have no clue how to legalize it on AArch64.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152726/new/
https://reviews.llvm.org/D152726
More information about the llvm-commits
mailing list