[PATCH] D104636: [LoopIdiom] [LoopNest] let the pass deal with runtime memset size

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 21 06:18:03 PDT 2021


xbolva00 added a comment.

I am quite skeptical how useful this can be in practise. Any motivation examples from real world codes/benchmarks?



================
Comment at: llvm/test/Transforms/LoopIdiom/memset-runtime.ll:7
+;	  	for (j=0; j<n; ++j) {
+;	 	  	long index = i*n + j;
+;	 		  ar[index] = 0;
----------------
LoopFlatten pass could convert two loops to one, no? Than you dont need to teach this pass about this pattern.

Btw, is this common pattern? Can you show us some motivation examples? Some hits in benchmarks?


================
Comment at: llvm/test/Transforms/LoopIdiom/memset-runtime.ll:22
+; We need to add runtime checks for this optimization, and version the loop.
+; The optimized IR should be similar to the following:
+; void test(int *ar, long n)
----------------
So we have original loops and memset, which could be expanded to series of stores. Nightmare for codesize..


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104636



More information about the llvm-commits mailing list