[llvm] [NFC][AArch64] Refactor AArch64LoopIdiomTransform in preparation for more idioms (PR #78471)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 18:01:31 PST 2024


JeffHDF wrote:

> In a future patch I intend to add support for other types of C loops that do memory comparisons with early exits, e.g.
> 
> ```
>   for (unsigned long i = start; i < end; i++) {
>     if (p1[i] != p2[i])
>       break;
>   }
> ```
> 
> where we compare the loaded values prior to incrementing the induction variable `i`. This requires first refactoring the pass ready to support the new loop structures. I've created a new MemCompareIdiom class with support routines that can be reused by new code required to recognise these new loops.
> 
> I also modified MemCompareIdiom::generateMemCompare to ensure it is ready to support arbitrary induction variable types as well as supporting new comparison predicates when comparing the memory values.

Hi, Where these more scenarios come from? How do you consider this question? As i known, there are some scenarios in sub-item 557.xz of SPEC2017 int. Will you consider to support these scenarios?

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


More information about the llvm-commits mailing list