[PATCH] D144053: [LICM] Ensure LICM can hoist invariant.group

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 00:25:50 PST 2023


nikic added a reviewer: aeubanks.
nikic added a comment.

I think this is correct, but I'm not very familiar with `invariant.group` nuances.



================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:1205
+      }
+    }
+
----------------
Can we move this logic into pointerInvalidatedByLoop? It looks like the only difference for the invariant.group case is the last check for the clobber being the loop header MemoryPhi, right?


================
Comment at: llvm/test/Transforms/LICM/invariant.group.ll:3
+; RUN: opt -passes=licm < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,require<opt-remark-emit>,loop-mssa(licm)' < %s -S | FileCheck %s
+
----------------
Second RUN line is unnecessary.


================
Comment at: llvm/test/Transforms/LICM/invariant.group.ll:25
+  %tmp6 = phi i64 [ 0, %bb2 ], [ %tmp10, %bb5 ]
+  %tmp3 = load i32, i32* %arg1, align 4, !invariant.group !0
+  %tmp7 = getelementptr inbounds i32, ptr %arg, i64 %tmp6
----------------
`i32*` -> `ptr`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144053



More information about the llvm-commits mailing list