Skip to content
  • Puyan Lotfi's avatar
    Yet another patch to reduce compile time for small programs: · efbcf494
    Puyan Lotfi authored
    The aim in this patch is to reduce work that VirtRegRewriter needs to do when
    telling MachineRegisterInfo which physregs are in use. Up until now
    VirtRegRewriter::rewrite has been doing rewriting and populating def info and
    then proceeding to set whether a physreg is used based this info for every
    physreg that the target provides. This can be expensive when a target has an
    unusually high number of supported physregs, and is a noticeable chunk of
    compile time for small programs on such targets.
    
    So to reduce compile time, this patch simply adds the use of a SparseSet to the
    rewrite function that is used to flag each physreg that is encountered in a
    MachineFunction. Afterward, rather than iterating over the set of all physregs
    for a given target to set the physregs used in MachineRegisterInfo, the new way
    is to iterate over the set of physregs that were actually encountered and set
    in the SparseSet. This improves compile time because the existing rewrite
    function was iterating over all MachineOperands already, and because the
    iterations afterward to setPhysRegUsed is reduced by use of the SparseSet data.
    
    llvm-svn: 200919
    efbcf494
Loading