Skip to content
  1. Apr 12, 2012
  2. Apr 09, 2012
    • Chandler Carruth's avatar
      Cleanup and relax a restriction on the matching of global offsets into · 3779ac10
      Chandler Carruth authored
      x86 addressing modes. This allows PIE-based TLS offsets to fit directly
      into an addressing mode immediate offset, which is the last remaining
      code quality issue from PR12380. With this patch, that PR is completely
      fixed.
      
      To understand why this patch is correct to match these offsets into
      addressing mode immediates, break it down by cases:
      1) 32-bit is trivially correct, and unmodified here.
      2) 64-bit non-small mode is unchanged and never matches.
      3) 64-bit small PIC code which is RIP-relative is handled specially in
         the match to try to fit RIP into the base register. If it fails, it
         now early exits. This behavior is unchanged by the patch.
      4) 64-bit small non-PIC code which is not RIP-relative continues to work
         as it did before. The reason these immediates are safe is because the
         ABI ensures they fit in small mode. This behavior is unchanged.
      5) 64-bit small PIC code which is *not* using RIP-relative addressing.
         This is the only case changed by the patch, and the primary place you
         see it is in TLS, either the win64 section offset TLS or Linux
         local-exec TLS model in a PIC compilation. Here the ABI again ensures
         that the immediates fit because we are in small mode, and any other
         operations required due to the PIC relocation model have been handled
         externally to the Wrapper node (extra loads etc are made around the
         wrapper node in ISelLowering).
      
      I've tested this as much as I can comparing it with GCC's output, and
      everything appears safe. I discussed this with Anton and it made sense
      to him at least at face value. That said, if there are issues with PIC
      code after this patch, yell and we can revert it.
      
      llvm-svn: 154304
      3779ac10
  3. Apr 04, 2012
    • Rafael Espindola's avatar
      Always compute all the bits in ComputeMaskedBits. · ba0a6cab
      Rafael Espindola authored
      This allows us to keep passing reduced masks to SimplifyDemandedBits, but
      know about all the bits if SimplifyDemandedBits fails. This allows instcombine
      to simplify cases like the one in the included testcase.
      
      llvm-svn: 154011
      ba0a6cab
  4. Mar 29, 2012
    • Benjamin Kramer's avatar
      Replace assert(0) with llvm_unreachable to avoid warnings about dropping off... · 8619c37b
      Benjamin Kramer authored
      Replace assert(0) with llvm_unreachable to avoid warnings about dropping off the end of a non-void function in Release builds.
      
      llvm-svn: 153643
      8619c37b
    • Joel Jones's avatar
      For X86, change load/dec-or-inc/store into dec-or-inc, respectively. · 68d59e8a
      Joel Jones authored
      This is a code change to add support for changing instruction sequences of the form:
      
        load
        inc/dec of 8/16/32/64 bits
        store
      
      into the appropriate X86 inc/dec through memory instruction:
      
        inc[qlwb] / dec[qlwb]
      
      The checks that were in X86DAGToDAGISel::Select(SDNode *Node)>>ISD::STORE have been extracted to isLoadIncOrDecStore and reworked to use the better
      named wrappers for getOperand(unsigned) (e.g. getOffset()) and replaced Chain.getNode() with LoadNode.  The comments have also been expanded.
      
      llvm-svn: 153635
      68d59e8a
    • Joel Jones's avatar
      Reverted to revision 153616 to unblock build · b474099e
      Joel Jones authored
      llvm-svn: 153623
      b474099e
    • Joel Jones's avatar
      For X86, change load/dec-or-inc/store into dec-or-inc, respectively. · b88c81fe
      Joel Jones authored
      This is a code change to add support for changing instruction sequences of the form:
      
        load
        inc/dec of 8/16/32/64 bits
        store
      
      into the appropriate X86 inc/dec through memory instruction:
      
        inc[qlwb] / dec[qlwb]
      
      The checks that were in X86DAGToDAGISel::Select(SDNode *Node)>>ISD::STORE have been extracted to isLoadIncOrDecStore and reworked to use the better
      named wrappers for getOperand(unsigned) (e.g. getOffset()) and replaced Chain.getNode() with LoadNode.  The comments have also been expanded.
      
      llvm-svn: 153617
      b88c81fe
  5. Mar 27, 2012
  6. Mar 17, 2012
  7. Mar 09, 2012
  8. Feb 22, 2012
  9. Feb 16, 2012
  10. Feb 15, 2012
  11. Feb 13, 2012
  12. Jan 20, 2012
  13. Jan 12, 2012
    • Chandler Carruth's avatar
      Switch all of the uses of my InsertDAGNode helper to follow the exact · eb21da06
      Chandler Carruth authored
      same pattern. We already had this pattern is a few places, but others
      tried to make a rough approximation of an actual DAG structure. As not
      everywhere went to this trouble, nothing could rely on this being done.
      In fact, I've checked all references to these node Ids, and the ones
      that are using the topo-sort properties are actually satisfied with
      a strict-weak-ordering. The requirement appears to be that Use >= Def.
      
      I've added a big blurb of comments to this bit of the transform to
      clarify why the order is so important for the next reader of the code.
      
      I'm starting with this change as it is very small, and trivially
      reverted if something breaks or the >= above really does need to be >.
      If that proves the case, we can hide the problem by reverting this
      patch, but the problem exists elsewhere as well, and so a more
      comprehensive solution will be needed.
      
      llvm-svn: 148001
      eb21da06
  14. Jan 11, 2012
  15. Jan 09, 2012
    • Chandler Carruth's avatar
      Don't rely on the fact that shift values are never very large, and thus · c16622da
      Chandler Carruth authored
      this substraction will result in small negative numbers at worst which
      become very large positive numbers on assignment and are thus caught by
      the <=4 check on the next line. The >0 check clearly intended to catch
      these as negative numbers.
      
      Spotted by inspection, and impossible to trigger given the shift widths
      that can be used.
      
      llvm-svn: 147773
      c16622da
  16. Nov 16, 2011
  17. Nov 15, 2011
  18. Nov 03, 2011
  19. Oct 29, 2011
  20. Oct 28, 2011
    • Dan Gohman's avatar
      Reapply r143177 and r143179 (reverting r143188), with scheduler · 73057ad2
      Dan Gohman authored
      fixes: Use a separate register, instead of SP, as the
      calling-convention resource, to avoid spurious conflicts with
      actual uses of SP. Also, fix unscheduling of calling sequences,
      which can be triggered by pseudo-two-address dependencies.
      
      llvm-svn: 143206
      73057ad2
    • Duncan Sands's avatar
      Speculatively disable Dan's commits 143177 and 143179 to see if · 225a7037
      Duncan Sands authored
      it fixes the dragonegg self-host (it looks like gcc is miscompiled).
      Original commit messages:
      Eliminate LegalizeOps' LegalizedNodes map and have it just call RAUW
      on every node as it legalizes them. This makes it easier to use
      hasOneUse() heuristics, since unneeded nodes can be removed from the
      DAG earlier.
      
      Make LegalizeOps visit the DAG in an operands-last order. It previously
      used operands-first, because LegalizeTypes has to go operands-first, and
      LegalizeTypes used to be part of LegalizeOps, but they're now split.
      The operands-last order is more natural for several legalization tasks.
      For example, it allows lowering code for nodes with floating-point or
      vector constants to see those constants directly instead of seeing the
      lowered form (often constant-pool loads). This makes some things
      somewhat more complicated today, though it ought to allow things to be
      simpler in the future. It also fixes some bugs exposed by Legalizing
      using RAUW aggressively.
      
      Remove the part of LegalizeOps that attempted to patch up invalid chain
      operands on libcalls generated by LegalizeTypes, since it doesn't work
      with the new LegalizeOps traversal order. Instead, define what
      LegalizeTypes is doing to be correct, and transfer the responsibility
      of keeping calls from having overlapping calling sequences into the
      scheduler.
      
      Teach the scheduler to model callseq_begin/end pairs as having a
      physical register definition/use to prevent calls from having
      overlapping calling sequences. This is also somewhat complicated, though
      there are ways it might be simplified in the future.
      
      This addresses rdar://9816668, rdar://10043614, rdar://8434668, and others.
      Please direct high-level questions about this patch to management.
      
      Delete #if 0 code accidentally left in.
      
      llvm-svn: 143188
      225a7037
    • Dan Gohman's avatar
      Eliminate LegalizeOps' LegalizedNodes map and have it just call RAUW · 4db3f7dd
      Dan Gohman authored
      on every node as it legalizes them. This makes it easier to use
      hasOneUse() heuristics, since unneeded nodes can be removed from the
      DAG earlier.
      
      Make LegalizeOps visit the DAG in an operands-last order. It previously
      used operands-first, because LegalizeTypes has to go operands-first, and
      LegalizeTypes used to be part of LegalizeOps, but they're now split.
      The operands-last order is more natural for several legalization tasks.
      For example, it allows lowering code for nodes with floating-point or
      vector constants to see those constants directly instead of seeing the
      lowered form (often constant-pool loads). This makes some things
      somewhat more complicated today, though it ought to allow things to be
      simpler in the future. It also fixes some bugs exposed by Legalizing
      using RAUW aggressively.
      
      Remove the part of LegalizeOps that attempted to patch up invalid chain
      operands on libcalls generated by LegalizeTypes, since it doesn't work
      with the new LegalizeOps traversal order. Instead, define what
      LegalizeTypes is doing to be correct, and transfer the responsibility
      of keeping calls from having overlapping calling sequences into the
      scheduler.
      
      Teach the scheduler to model callseq_begin/end pairs as having a
      physical register definition/use to prevent calls from having
      overlapping calling sequences. This is also somewhat complicated, though
      there are ways it might be simplified in the future.
      
      This addresses rdar://9816668, rdar://10043614, rdar://8434668, and others.
      Please direct high-level questions about this patch to management.
      
      llvm-svn: 143177
      4db3f7dd
  21. Oct 08, 2011
    • Jakob Stoklund Olesen's avatar
      Add TEST8ri_NOREX pseudo to constrain sub_8bit_hi copies. · 729abd36
      Jakob Stoklund Olesen authored
      In 64-bit mode, sub_8bit_hi sub-registers can only be used by NOREX
      instructions. The COPY created from the EXTRACT_SUBREG DAG node cannot
      target all GR8 registers, only those in GR8_NOREX.
      
      TO enforce this, we ensure that all instructions using the
      EXTRACT_SUBREG are GR8_NOREX constrained.
      
      This fixes PR11088.
      
      llvm-svn: 141499
      729abd36
  22. Aug 01, 2011
  23. Jul 13, 2011
  24. Jul 02, 2011
  25. Jun 30, 2011
  26. May 20, 2011
Loading