[PATCH] D65316: AMDGPU/SILoadStoreOptimizer: Make some functions const
Tom Stellard via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 25 20:20:40 PDT 2019
tstellar created this revision.
tstellar added reviewers: arsenm, pendingchaos, rampitec.
Herald added subscribers: hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D65316
Files:
llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
Index: llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
+++ llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
@@ -165,9 +165,9 @@
static unsigned getNewOpcode(const CombineInfo &CI);
static std::pair<unsigned, unsigned> getSubRegIdxs(const CombineInfo &CI);
const TargetRegisterClass *getTargetRegisterClass(const CombineInfo &CI);
- unsigned getOpcodeWidth(const MachineInstr &MI);
- InstClassEnum getInstClass(unsigned Opc);
- unsigned getRegs(unsigned Opc);
+ unsigned getOpcodeWidth(const MachineInstr &MI) const;
+ InstClassEnum getInstClass(unsigned Opc) const;
+ unsigned getRegs(unsigned Opc) const;
bool findMatchingInst(CombineInfo &CI);
@@ -384,7 +384,7 @@
}
}
-unsigned SILoadStoreOptimizer::getOpcodeWidth(const MachineInstr &MI) {
+unsigned SILoadStoreOptimizer::getOpcodeWidth(const MachineInstr &MI) const {
const unsigned Opc = MI.getOpcode();
if (TII->isMUBUF(MI)) {
@@ -403,7 +403,7 @@
}
}
-InstClassEnum SILoadStoreOptimizer::getInstClass(unsigned Opc) {
+InstClassEnum SILoadStoreOptimizer::getInstClass(unsigned Opc) const {
if (TII->isMUBUF(Opc)) {
const int baseOpcode = AMDGPU::getMUBUFBaseOpcode(Opc);
@@ -454,7 +454,7 @@
}
}
-unsigned SILoadStoreOptimizer::getRegs(unsigned Opc) {
+unsigned SILoadStoreOptimizer::getRegs(unsigned Opc) const {
if (TII->isMUBUF(Opc)) {
unsigned result = 0;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65316.211873.patch
Type: text/x-patch
Size: 1501 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190726/2de72439/attachment.bin>
More information about the llvm-commits
mailing list