[PATCH] D157375: [LV] Pre-commit test case for AnyOf reduction , NFC

Mel Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 00:23:17 PDT 2023


Mel-Chen added a comment.

@michaelmaitland Yes, with this example, the your transformation is possible. 
However, this still remains a challenge that vectorizers need to address because we cannot restrict the input IR that goes into opt.
Therefore, I have provided a new case -- @select_i32_from_icmp_non_const_same_inputs:

  int rdx = a;
  for (i = 0; i < n; ++i)
    if(rdx != c[i])
      rdx = b;

The conclusions we can draw so far are that due to the loop-invariant of the values selected by AnyOf, it possess the following characteristics,

  if all conditions are false:
     rdx = start_value (%a)
  else:
    rdx = new_loop_invariant (%b)

which may allow AnyOf recurrence to include cmp instructions


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157375/new/

https://reviews.llvm.org/D157375



More information about the llvm-commits mailing list