[llvm] [LLVM] Add `llvm.masked.compress` intrinsic (PR #92289)

Lawrence Benson via llvm-commits llvm-commits at lists.llvm.org
Fri May 17 06:46:58 PDT 2024


lawben wrote:

@arsenm Thanks. I've added some more code and got it to run for a basic test on AArch64. The GISel path of this PR is still WIP at this stage.

> It's still possible to write a MIR only test that shows your expansion without handling everything

I didn't really want to mix the initial "generic" implementation with target-specific ones for the initial PR. But it seems to me like I need to specify `getActionDefinitionsBuilder` rules for each target and cannot use a "global" version like I did with `SelectionDAG` and `TargetLoweringBase`. I currently have a small hack in `AArch64LegalizerInfo.cpp` for testing (note: there is a "DO NOT COMMIT!" comment here as this should not be committed). 

  **Question:** How can I add (and test) this for now in a way that does not require me to specify all legalizing logic in AArch64, as this intrinsic itself is never legal on AARch64 (except maybe with SVE)? If I only add this to AArch64 now, I guess all other targets will crash with this intrinsic. What is the preferred way to handle this?

I'll add `fewerElementsVector()/moreElementsVector()` in the `LegalizeHelper` once I know how to proceed here.

> and regbankselect for the legal cases

I don't think this makes sense at this point, as there is no legal generic case. I'll need to add the regbankselect once I implement the target-specific versions. Please correct me if I'm wrong.




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


More information about the llvm-commits mailing list