[PATCH] D103431: [AMDGPU] Fix missing lowering of LDS used in global scope.
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 10 01:28:41 PDT 2021
foad added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.cpp:65
+ SmallPtrSet<const User *, 8> Visited;
+ SmallVector<const User *, 16> Stack(GV->users());
+
----------------
For future reference, SetVector can be useful in cases like this, so that you don't need to declare both a set and a vector and keep them in sync.
================
Comment at: llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.cpp:134
+ for (auto *G : GlobalUsers)
+ Ret |= hasUserInstruction(G);
}
----------------
Could "return true" early here if any G has instruction users, or use std::any_of which will return early for you.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103431/new/
https://reviews.llvm.org/D103431
More information about the llvm-commits
mailing list