This is a follow-up to https://reviews.llvm.org/D68476.
Straight-forward pattern matching for while intrinsics.
Paths
| Differential D69059
[SVE][AArch64] Adding patterns for while intrinsics ClosedPublic Authored by mgudim on Oct 16 2019, 11:03 AM.
Details
Diff Detail Event TimelineThis revision is now accepted and ready to land.Oct 30 2019, 7:50 PM
Comment Actions
efriedma, sorry for the late reply. I see in .td files that the intrinsics define the NSCV flags, but I am not sure what you mean by "exposing" them. Could you please clarify? Comment Actions If you look at SVE loop examples from ARM, they generally have a branch using the flags set by something like a whilelt; we should allow the user to replicate that somehow. I was thinking you could make them part of the return value, somehow, so the intrinsic returns two values. Maybe the whole value, or maybe just a boolean for some common use we expect; haven't really thought that part through. Maybe that's not a good idea, though? I guess we could let the user write a regular cmp, and have a pass detect that it's redundant, somehow. Or maybe there's some other similar approach I haven't considered. Comment Actions Hmm, I just dug up some examples using ACLE. It looks like the suggestion there is to use ptest on the result. The ptest can then be optimized away by the backend in common cases. I guess that works.
Comment Actions LGTM
Comment Actions
@c-rhodes I will merge this patch tomorrow. Sorry for my long delay
Revision Contents
Diff 225267 llvm/include/llvm/IR/IntrinsicsAArch64.td
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
llvm/lib/Target/AArch64/SVEInstrFormats.td
llvm/test/CodeGen/AArch64/sve-intrinsics-while.ll
|
These instructions should not be removed. (This is also guarded by the assembler/disassembler tests)