[llvm] [RISCV][GISEL] Legalize G_EXTRACT_SUBVECTOR (PR #109426)
Thorsten Schütt via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 20 11:48:45 PDT 2024
tschuett wrote:
I retract my comment. With `customIf`, we can mark things as legal based on constants. However, it makes hard for the combiner to optimize G_EXTRACT_SUBVECTOR because there is no `legal` statement. AArch64 does the same for G_UBFX:
https://github.com/llvm/llvm-project/blob/2162a18fb206736c41c9182737b72ae15d5e6bf0/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp#L4464
```
// Note that isLegalOrBeforeLegalizer is stricter and does not take custom
// into account.
if (LI && !LI->isLegalOrCustom({TargetOpcode::G_UBFX, {Ty, ExtractTy}}))
return false;
```
https://github.com/llvm/llvm-project/pull/109426
More information about the llvm-commits
mailing list