[PATCH] D131606: [Loop Fusion] Sink/hoist memory instructions between loop fusion candidates

Congzhe Cao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 13:28:17 PDT 2022


congzhe added a comment.

The changes made in this patch, notably `canHoistInst()` and `canSinkInst()`  seems to have duplicate functionality from `CodeMoverUtils.cpp`. I'm wondering if we can reuse the code from `CodeMoverUtils.cpp`? Or is there something that `canHoistInst()` and `canSinkInst()` can do but functions from `CodeMoverUtils.cpp` cannot do?



================
Comment at: llvm/test/Transforms/LoopFusion/simple.ll:537
   store i32 2, i32* %Aj, align 4
-  %inc.j = add nsw i64 %j, 1
+  %inc.j = add nsw i64 %j, %add
   %cmp.j = icmp slt i64 %inc.j, 100
----------------
Why change from adding 1 to adding `%add`?


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

https://reviews.llvm.org/D131606



More information about the llvm-commits mailing list