[PATCH] D97407: [LoopUnrollAndJam] Avoid repeated instructions for UAJ analysis

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 13:13:43 PST 2021


dmgreen added a comment.

Am I correct that the old code was accidentally O(2^n) :(

And this cuts that down to something much more reasonable?



================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp:161
+          if (!VisitedInstr.count(II))
+              Worklist.push_back(II);
   }
----------------
Formatting is a bit off here.


================
Comment at: llvm/test/Transforms/LoopUnrollAndJam/unroll-and-jam-many-instr.ll:1
+; ModuleID = 'test.c'
+source_filename = "test.c"
----------------
This needs RUN: lines and some basic CHECKS, maybe with a comment explaining the test for bonus points.

If it requires the aarch64 backend (which it might not) then it would need to be in llvm/test/Transforms/LoopUnrollAndJam/AArch64 directory, so it only runs when the compiler is built with aarch64 as a registered target. It can likely remove the aarch64 though, and rely on the datalayout and command line args.

It might be possible to clean this up quite a bit. My understanding is that for.cond13.preheader (the aft block) needs to contain a lot of instructions to show the timeout. The main() and attributes can often be removed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97407



More information about the llvm-commits mailing list