[llvm-dev] MIR instruction size (original) (raw)
Matthias Braun via llvm-dev llvm-dev at lists.llvm.org
Thu Apr 20 14:55:28 PDT 2017
- Previous message: [llvm-dev] MIR instruction size
- Next message: [llvm-dev] Job opening @ Autodesk: Principal Engineer - Compiler Design
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
No, X86 instructions are variable size. Depending on which registers are allocated or what sized immediate an instruction variant takes you may need additional rex/rex.w prefixes immediate bytes etc. There is no API today that would answer that question, and even if there were it would be a dangerous API as later passes could change the size just by swapping some registers.
- Matthias
On Apr 20, 2017, at 11:28 AM, Ilya Skapenko via llvm-dev <llvm-dev at lists.llvm.org> wrote:
Hello, Is there any common way to determine a size of MIR instruction? I've tried both: MachineInstr::getDesc().getSize() and TargetInstrInfo::getInstSizeInBytes(I), and unfortunately, both interfaces can't determine instruction sizes for x8664, though they could do it for arm architecture.
LLVM Developers mailing list llvm-dev at lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
- Previous message: [llvm-dev] MIR instruction size
- Next message: [llvm-dev] Job opening @ Autodesk: Principal Engineer - Compiler Design
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]