[PATCH] D93174: [amdgpu] Fix a crash case when `V_CNDMASK` could be simplified.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 07:24:15 PST 2020


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIFoldOperands.cpp:1260
 
+  SmallPtrSet<MachineInstr *, 16> Folded;
   for (FoldCandidate &Fold : FoldList) {
----------------
hliao wrote:
> arsenm wrote:
> > Doesn't this add a second mechanism to avoid the same problem? We already check isUseMIInFoldList to avoid revisiting
> That one is used to prevent adding a commuted instr into the candidate list. But the case here is that both operands could be folded. Also, if used here, that check is too expensive? That candidate list will be scanned in square times.
Should we just use a SetVector for FoldList then?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93174



More information about the llvm-commits mailing list