[PATCH] D130278: [LAA] Handle forked pointers with add/sub instructions

Graham Hunter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 02:01:08 PDT 2022


huntergr added inline comments.


================
Comment at: llvm/lib/Analysis/LoopAccessAnalysis.cpp:827
 
+  auto GetBinOpExpr = [&SE](unsigned Opcode, const SCEV* L, const SCEV* R) {
+    switch (Opcode) {
----------------
fhahn wrote:
> Are you planning to support additional bin-ops in the future here? Or could this be moved to the scope in the corresponding switch case?
I plan to support multiply in a future patch; it seems to need a little more work that add and sub.

Though there's plenty of codebases which can benefit from this work, one of the main cases we considered is https://github.com/HydroBench/Hydro/ -- specifically the loops in riemann.c

There's a few other problems I need to deal with for hydro (openmp runtime functions not being annotated by default, lack of vectorization using masked functions) before I can finish off the rest of this work. But there's at least a few more operations to add to this switch statement -- multiplies as mentioned above, zero and sign extends, and phis used for non-SAR purposes in the loop (e.g. if-then)


================
Comment at: llvm/lib/Analysis/LoopAccessAnalysis.cpp:927
+      ScevList.push_back(std::make_pair(Scev, NeedsFreeze));
+      break;
+    }
----------------
fhahn wrote:
> Not directly related to this patch, but given that we return after the switch it might be simpler to follow if we would just return instead of break in the switch?
Yes, I'll add that in a follow-on patch along with the extra test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130278



More information about the llvm-commits mailing list