[llvm] [VPlan] Replace ExtractFromEnd with Extract(Last|Penultimate)Lane (NFC). (PR #137030)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 23 16:01:14 PDT 2025


https://github.com/ayalz commented:

Specializing to two distinct opcodes with suitable names LGTM!
ExtractFromEnd works for all vectors, naturally limiting its offset to at most 2.
The usages of last vs. penultimate are conceptually distinct, naturally limiting its offset to be an immediate/immutable value.

Another option is to encode the immediate offset using an IRFlags flag (1 bit suffices), given that both extracts need no other flag. Would that be better?

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


More information about the llvm-commits mailing list