[llvm] [AArch64] Add a fast-path for AArch64InstrInfo::getInstSizeInBytes (NFC) (PR #221894)
Alexis Engelke via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 8 00:47:18 PDT 2026
================
@@ -204,6 +204,10 @@ static std::optional<unsigned> getLFIInstSizeInBytes(const MachineInstr &MI) {
/// GetInstSize - Return the number of bytes of code the specified
/// instruction may be. This returns the maximum number of bytes.
unsigned AArch64InstrInfo::getInstSizeInBytes(const MachineInstr &MI) const {
+ const MCInstrDesc &Desc = MI.getDesc();
+ if (!Desc.isPseudo() && !Subtarget.isLFI())
+ return 4;
----------------
aengelke wrote:
Is Desc.getSize() used elsewhere or is the tablegen entry in EncodedI now unused? Maybe assert that getSize() == 4 if the ISA ever changes?
https://github.com/llvm/llvm-project/pull/221894
More information about the llvm-commits
mailing list