[PATCH] D104863: [LSV] Teach LSV to handle atomic ops.
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 6 06:08:16 PDT 2021
arsenm added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:700-714
+ auto IsAtomicBarrier = [](Instruction *I) {
+ if (!I->isAtomic())
+ return false;
+ if (auto *LD = dyn_cast<LoadInst>(I))
+ return isStrongerThanMonotonic(LD->getOrdering());
+ if (auto *ST = dyn_cast<StoreInst>(I))
+ return isStrongerThanMonotonic(ST->getOrdering());
----------------
It seems like this should be a global utility function somewhere
================
Comment at: llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:800-810
+ auto getPointerOperand = [](const Instruction *I) -> const Value * {
+ if (auto *Load = dyn_cast<LoadInst>(I))
+ return Load->getPointerOperand();
+ if (auto *Store = dyn_cast<StoreInst>(I))
+ return Store->getPointerOperand();
+ if (auto *RMW = dyn_cast<AtomicRMWInst>(I))
+ return RMW->getPointerOperand();
----------------
I think there's a utility for this osmewhere already (that also will handle the intrinsic calls)
================
Comment at: llvm/test/Transforms/LoadStoreVectorizer/atomic.ll:8-9
+; CHECK-LABEL: t0
+; CHECK: load <4 x float>
+; CHECK: store <4 x float>
+define void @t0(float* noalias %p, i32* noalias %q) {
----------------
Should check more, should show the relation to the atomics
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104863/new/
https://reviews.llvm.org/D104863
More information about the llvm-commits
mailing list