The length of a scalable vector is unknown during compilation. When vectorising loops the runtime length is required to update induction variables and thus a representation is required within the IR. This patch introduces the 'vscale' identifier to represent the scaling factor 'n' of a scalable vector of the form '<n x #elements x ty>'. In use, induction variable updates for scalable vectorisation become: ; i += number_of_elements(<n x 4 x i32) %i.next = add i32 %i, mul (i32 vscale, i32 4)
We should have a comment before the enum.
Also we could we have a unittest for this:
// Check that enum values don't change if (LLVMArgumentValueKind != 0) report_fatal_error("Enum changed value") If (.... )
static_assert(LLVMArgumentValueKind != 0, "C-API Enum value changed");
Assuming we're all happy with vscale, and all noted concerns are addressed, I don't see anything wrong with this patch.
Just reminding, this is not an approval. As we discussed on the list, any final IR change decision will be taken on the list, after extensive review by more than just the few folks that are looking at these patches.
Ouch, ok, this is a separate thing that can be done now, independent of vscale. Please move this to a different patch and propose it on a new review on its own.