Add _L to _LZ image intrinsic table mapping to table gen.
In ISelLowering check if image intrinsic has lod and if it's equal
to zero, if so remove lod and change opcode to equivalent mapped _LZ.
Change-Id: Ie24cd7e788e2195d846c7bd256151178cbb9ec71
Paths
| Differential D49483
[AMDGPU] Optimize _L image intrinsic to _LZ when lod is zero ClosedPublic Authored by rtaylor on Jul 18 2018, 6:58 AM.
Details Summary Add _L to _LZ image intrinsic table mapping to table gen. Change-Id: Ie24cd7e788e2195d846c7bd256151178cbb9ec71
Diff Detail
Event TimelineHerald added subscribers: llvm-commits, dexonsmith, steven_wu and 9 others. · View Herald TranscriptJul 18 2018, 6:58 AM
Comment Actions
This could be done in the IR but this avoids a long(er) switch statement (# of combinations) and keeps more of the image intrinsic work in the same place, which seemed per conversations the best way to go. Is there some advantage to moving this to the IR (InstCombine for example)?
Comment Actions I don't think doing this as an IR pass has any advantage, so this is fine. Please add tests for gather intrinsics as well, apart from that it looks good to me.
This revision is now accepted and ready to land.Jul 31 2018, 8:08 AM Closed by commit rL338523: [AMDGPU] Optimize _L image intrinsic to _LZ when lod is zero (authored by rtayl). · Explain WhyAug 1 2018, 5:12 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 157961 lib/Target/AMDGPU/MIMGInstructions.td
lib/Target/AMDGPU/SIISelLowering.cpp
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
test/CodeGen/AMDGPU/llvm.amdgcn.image.sample.ltolz.ll
|
Does this need to check that it is positive zero?