Skip to content
  • Jakob Stoklund Olesen's avatar
    Rewrite MachineInstr::addOperand() to avoid NumImplicitOps. · 2318d1e0
    Jakob Stoklund Olesen authored
    The function needs to scan the implicit operands anyway, so no
    performance is won by caching the number of implicit operands added to
    an instruction.
    
    This also fixes a bug when adding operands after an implicit operand has
    been added manually.  The NumImplicitOps count wasn't kept up to date.
    
    MachineInstr::addOperand() will now consistently place all explicit
    operands before all the implicit operands, regardless of the order they
    are added.  It is possible to change an MI opcode and add additional
    explicit operands.  They will be inserted before any existing implicit
    operands.
    
    The only exception is inline asm instructions where operands are never
    reordered.  This is because of a hack that marks explicit clobber regs
    on inline asm as <implicit-def> to please the fast register allocator.
    This hack can go away when InstrEmitter and FastIsel can add exact
    <dead> flags to physreg defs.
    
    llvm-svn: 140744
    2318d1e0
Loading