[PATCH] D90505: [AMDGPU] Improve FLAT scratch detection

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 09:10:54 PST 2020


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.h:580
+    return isSegmentSpecificFLAT(MI) &&
+           AMDGPU::getFlatScratchInst(MI.getOpcode()) >= 0;
   }
----------------
rampitec wrote:
> foad wrote:
> > rampitec wrote:
> > > foad wrote:
> > > > If getFlatScratchInst is just a table lookup, is there any need to do the isSegmentSpecificFLAT test first?
> > > I have reetored it to have O(1) in most cases, table lookup will only run if it is already known segmented flat. It is purely optimization.
> > I see. I thought the table lookup was a direct O(1) lookup. I didn't realise it is a binary chop.
> Right, it is O(log(N)). N is small but still.
I think using a bit here is fine. We're not out, and there are other bits we could prune out that are less important


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

https://reviews.llvm.org/D90505



More information about the llvm-commits mailing list