{-
pprInstr (SPILL reg slot)
   = hcat [
        text "\tSPILL",
        char ' ',
        pprUserReg reg,
        comma,
        text "SLOT" <> parens (int slot)]

pprInstr (RELOAD slot reg)
   = hcat [
        text "\tRELOAD",
        char ' ',
        text "SLOT" <> parens (int slot),
        comma,
        pprUserReg reg]
-}

-- Replace 'mov $0x0,%reg' by 'xor %reg,%reg', which is smaller and cheaper.
-- The code generator catches most of these already, but not all.
pprInstr (MOV format (OpImm (ImmInt 0)) dst@(OpReg _))
  = pprInstr (XOR format' dst dst)
  where format' = case format of
          II64 -> II32          -- 32-bit version is equivalent, and smaller
          _    -> format
pprInstr (MOV format (OpImm (ImmInt 0)) dst@(OpReg _))
  = pprInstr (XOR format' dst dst)
  where format' = case format of
          II64 -> II32          -- 32-bit version is equivalent, and smaller
          _    -> format
pprInstr (MOV format (OpImm (ImmInt 0)) dst@(OpReg _))
  = pprInstr (XOR format' dst dst)
  where format' = case format of
          II64 -> II32          -- 32-bit version is equivalent, and smaller
          _    -> format