Since there are no ill effects when performing these operations
with undefined elements, they are lowered to the already supported
unpredicated scalable vector equivalents.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I have mixed feelings out this patch. Ideally I would like everything lowered to _PRED nodes and then let ISel decide which instruction best does the job. Unfortunately I could not see a clear way to write a pattern where one of the inputs is ignored. Am I missing something obvious here? if not then I guess this patch will have to do.
I think you're looking for something like immAllOnesV. So you'd use XXX_PRED and pass an all-1s mask. Then a pattern would be needed to match it to the unpredicated instruction. Something roughly like this:
def : Pat<(XOR_PRED (mask_vt immAllOnesV), ZPR:$src1, ZPR:$src2), (XOR ZPR:$src1, ZPR:$src2)>;
Thanks @cameron.mcinally. Yes immAllOnesV is similar to what I'm after but I didn't want to restrict it to the all-1s mask. I had some success creating "any_frag" but then had to implement a bunch of combines and extra lowering which we loose when moving away from the unpredicated ISD nodes. On reflection since SVE already supports most instruction formats when it comes to the logical operations I'm thinking this isn't really the patch to introduce "any_frag" so if it's OK I'd like to promote this patch as the correct way to handle these operations.