[PATCH] D82451: [AMDGPU] Fix DPP Combiner:
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 24 09:09:50 PDT 2020
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp:404-410
+ MachineInstr *PrevMI = nullptr;
+ for (auto &Use : Uses) {
+ auto *MI = Use->getParent();
+ if (MI == PrevMI)
+ return MI;
+ PrevMI = MI;
+ }
----------------
vpykhtin wrote:
> arsenm wrote:
> > Why does this need to be a separate function? Can't you determine this over the initial use walk in collectRegUse?
> There're two places where Uses are collected: collectRegUse and collectIndependSubRegUse - I would need to add this code twice. Number of uses is limited to be small and the walk is cheap.
You could early exit out of the whole search if you check up front, it's not really duplication there
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82451/new/
https://reviews.llvm.org/D82451
More information about the llvm-commits
mailing list