[llvm] [X86] Add MI-layer routine for getting the index of the first address operand. NFC (PR #78019)
Nicholas Mosier via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 13 18:39:50 PST 2024
================
@@ -289,10 +289,8 @@ static unsigned getYMMtoXMMStoreOpcode(unsigned StoreOpcode) {
}
static int getAddrOffset(const MachineInstr *MI) {
- const MCInstrDesc &Descl = MI->getDesc();
- int AddrOffset = X86II::getMemoryOperandNo(Descl.TSFlags);
+ const int AddrOffset = X86::getFirstAddrOperandIdx(*MI);
----------------
nmosier wrote:
Is it just a stylstic preference? Or why doesn't declaring `AddrOffset` as `const` work here?
https://github.com/llvm/llvm-project/pull/78019
More information about the llvm-commits
mailing list