[PATCH] D137540: [AMDGPU] Add & use `hasNamedOperand`, NFC
Pierre van Houtryve via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 7 03:54:45 PST 2022
Pierre-vh created this revision.
Pierre-vh added a reviewer: arsenm.
Herald added subscribers: kosarev, foad, kerbowa, kbarton, hiraditya, tpr, dstuttard, yaxunl, jvesely, nemanjai, kzhuravl.
Herald added a project: All.
Pierre-vh requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
In a lot of places, we were just calling `getNamedOperandIdx` to check if the result was != or == to -1.
This is fine in itself, but it's verbose and doesn't make the intention clear, IMHO. I added a `hasNamedOperand` and replaced all cases I could find (with regexes)
Regexes used:
Search: AMDGPU::getNamedOperandIdx(.*)\s+==\s+-1
Replace: !AMDGPU::hasNamedOperand$1
Search: AMDGPU::getNamedOperandIdx(.*)\s+!=\s+-1
Replace: AMDGPU::hasNamedOperand$1
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D137540
Files:
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp
llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp
llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137540.473615.patch
Type: text/x-patch
Size: 26497 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221107/a4eb2e52/attachment.bin>
More information about the llvm-commits
mailing list