[llvm] [AMDGPU][PromoteAlloca] Whole-function alloca promotion to vector (PR #84735)
Pierre van Houtryve via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 14 03:55:27 PDT 2024
================
@@ -225,6 +249,55 @@ FunctionPass *llvm::createAMDGPUPromoteAllocaToVector() {
return new AMDGPUPromoteAllocaToVector();
}
+static void collectAllocaUses(AllocaInst &Alloca,
+ SmallVectorImpl<Use *> &Uses) {
+ SmallVector<Instruction *, 4> WorkList({&Alloca});
+ while (!WorkList.empty()) {
+ auto *Cur = WorkList.pop_back_val();
+ for (auto &U : Cur->uses()) {
+ Uses.push_back(&U);
+
+ if (isa<GetElementPtrInst>(U.getUser()) || isa<BitCastInst>(U.getUser()))
----------------
Pierre-vh wrote:
I still see a lot of hits for bitcast ptr in the codebase, I think it doesn't hurt to leave it in
https://github.com/llvm/llvm-project/pull/84735
More information about the llvm-commits
mailing list