Skip to content
  1. Jul 31, 2013
  2. Jun 21, 2013
  3. Jun 12, 2013
  4. May 29, 2013
    • Ahmed Bougacha's avatar
      X86: Fix Defs/Uses for insts that imp-def/imp-use both an A-register and EFLAGS. · 00e08db3
      Ahmed Bougacha authored
      This corrects a problem where x86 instructions that implicitly define/use both
      an A-register (RAX, EAX, ..) and EFLAGS were declared as only defining/using
      EFLAGS, because the outer "let Defs/Uses = [EFLAGS]" in the various multiclasses
      overrides the "let Defs/Uses = [areg]" in BinOpAI.
      
      The instructions deriving from BinOpAI were moved out of the "let Defs", and a
      BinOpAI_FF class was created, for instructions that implicitly define and use
      EFLAGS and the A-register (SBC, ADC).
      
      llvm-svn: 182883
      00e08db3
  5. Mar 26, 2013
  6. Mar 20, 2013
  7. Mar 18, 2013
  8. Feb 14, 2013
  9. Feb 01, 2013
    • David Sehr's avatar
      Two changes relevant to LEA and x32: · 8114a7a6
      David Sehr authored
      1) allows the use of RIP-relative addressing in 32-bit LEA instructions under
         x86-64 (ILP32 and LP64)
      2) separates the size of address registers in 64-bit LEA instructions from
         control by ILP32/LP64.
      
      llvm-svn: 174208
      8114a7a6
  10. Jan 07, 2013
  11. Jan 05, 2013
  12. Jan 03, 2013
    • Michael Gottesman's avatar
      Revert "Mark DIV/IDIV instructions hasSideEffects=1 because they can trap when... · 820aac1c
      Michael Gottesman authored
      Revert "Mark DIV/IDIV instructions hasSideEffects=1 because they can trap when dividing by 0. This is needed to keep early if conversion from moving them across basic blocks."
      
      This reverts commit r171461 since it breaks the following tests:
      
      Clang :: Analysis/outofbound-notwork.c
      Clang :: Analysis/string-fail.c
      Clang :: CXX/basic/basic.lookup/basic.lookup.qual/p6-0x.cpp
      Clang :: CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp
      Clang :: CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp
      Clang :: CXX/dcl.dcl/dcl.spec/dcl.stc/p10.cpp
      Clang :: CXX/temp/temp.param/p14.cpp
      Clang :: CXX/temp/temp.res/temp.dep.res/temp.point/p1.cpp
      Clang :: CodeGen/2009-02-13-zerosize-union-field-ppc.c
      Clang :: CodeGen/blocks-2.c
      Clang :: CodeGen/libcalls-d.c
      Clang :: CodeGen/libcalls-ld.c
      Clang :: CodeGenCXX/conversion-function.cpp
      Clang :: CodeGenCXX/debug-info-limit-type.cpp
      Clang :: CodeGenCXX/inheriting-constructor.cpp
      Clang :: FixIt/fixit-errors.c
      Clang :: FixIt/fixit-pmem.cpp
      Clang :: Modules/namespaces.cpp
      Clang :: PCH/changed-files.c
      Clang :: PCH/pr4489.c
      Clang :: PCH/source-manager-stack.c
      Clang :: Parser/cxx-ambig-decl-expr-xfail.cpp
      Clang :: SemaCXX/switch-implicit-fallthrough-cxx98.cpp
      Clang :: SemaTemplate/instantiate-function-1.mm
      
      llvm-svn: 171466
      820aac1c
    • Craig Topper's avatar
      Mark DIV/IDIV instructions hasSideEffects=1 because they can trap when... · 7c27cc9f
      Craig Topper authored
      Mark DIV/IDIV instructions hasSideEffects=1 because they can trap when dividing by 0. This is needed to keep early if conversion from moving them across basic blocks.
      
      llvm-svn: 171461
      7c27cc9f
  13. Dec 27, 2012
  14. Dec 26, 2012
  15. Dec 17, 2012
  16. Aug 08, 2012
    • Manman Ren's avatar
      X86: enable CSE between CMP and SUB · 1be131ba
      Manman Ren authored
      We perform the following:
      1> Use SUB instead of CMP for i8,i16,i32 and i64 in ISel lowering.
      2> Modify MachineCSE to correctly handle implicit defs.
      3> Convert SUB back to CMP if possible at peephole.
      
      Removed pattern matching of (a>b) ? (a-b):0 and like, since they are handled
      by peephole now.
      
      rdar://11873276
      
      llvm-svn: 161462
      1be131ba
  17. Jul 18, 2012
  18. Jul 06, 2012
    • Manman Ren's avatar
      X86: peephole optimization to remove cmp instruction · c9656737
      Manman Ren authored
      For each Cmp, we check whether there is an earlier Sub which make Cmp
      redundant. We handle the case where SUB operates on the same source operands as
      Cmp, including the case where the two source operands are swapped.
      
      llvm-svn: 159838
      c9656737
  19. Jun 03, 2012
  20. Jun 01, 2012
    • Manman Ren's avatar
      X86: peephole optimization to remove cmp instruction · 879ca9d4
      Manman Ren authored
      This patch will optimize the following:
        sub r1, r3
        cmp r3, r1 or cmp r1, r3
        bge L1
      TO
        sub r1, r3
        bge L1 or ble L1
      
      If the branch instruction can use flag from "sub", then we can eliminate
      the "cmp" instruction.
      
      llvm-svn: 157831
      879ca9d4
  21. Apr 09, 2012
  22. Feb 18, 2012
  23. Feb 02, 2012
    • Andrew Trick's avatar
      Instruction scheduling itinerary for Intel Atom. · 8523b16f
      Andrew Trick authored
      Adds an instruction itinerary to all x86 instructions, giving each a default latency of 1, using the InstrItinClass IIC_DEFAULT.
      
      Sets specific latencies for Atom for the instructions in files X86InstrCMovSetCC.td, X86InstrArithmetic.td, X86InstrControl.td, and X86InstrShiftRotate.td. The Atom latencies for the remainder of the x86 instructions will be set in subsequent patches.
      
      Adds a test to verify that the scheduler is working.
      
      Also changes the scheduling preference to "Hybrid" for i386 Atom, while leaving x86_64 as ILP.
      
      Patch by Preston Gurd!
      
      llvm-svn: 149558
      8523b16f
  24. Oct 23, 2011
  25. Oct 14, 2011
  26. 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
  27. Oct 02, 2011
  28. Sep 11, 2011
  29. Apr 15, 2011
  30. Dec 20, 2010
    • Chris Lattner's avatar
      Change the X86 backend to stop using the evil ADDC/ADDE/SUBC/SUBE nodes (which · 846c20d4
      Chris Lattner authored
      their carry depenedencies with MVT::Flag operands) and use clean and beautiful
      EFLAGS dependences instead.
      
      We do this by changing the modelling of SBB/ADC to have EFLAGS input and outputs
      (which is what requires the previous scheduler change) and change X86 ISelLowering
      to custom lower ADDC and friends down to X86ISD::ADD/ADC/SUB/SBB nodes.
      
      With the previous series of changes, this causes no changes in the testsuite, woo.
      
      llvm-svn: 122213
      846c20d4
  31. Dec 05, 2010
    • Chris Lattner's avatar
      it turns out that when ".with.overflow" intrinsics were added to the X86 · 364bb0a0
      Chris Lattner authored
      backend that they were all implemented except umul.  This one fell back
      to the default implementation that did a hi/lo multiply and compared the
      top.  Fix this to check the overflow flag that the 'mul' instruction
      sets, so we can avoid an explicit test.  Now we compile:
      
      void *func(long count) {
            return new int[count];
      }
      
      into:
      
      __Z4funcl:                              ## @_Z4funcl
      	movl	$4, %ecx                ## encoding: [0xb9,0x04,0x00,0x00,0x00]
      	movq	%rdi, %rax              ## encoding: [0x48,0x89,0xf8]
      	mulq	%rcx                    ## encoding: [0x48,0xf7,0xe1]
      	seto	%cl                     ## encoding: [0x0f,0x90,0xc1]
      	testb	%cl, %cl                ## encoding: [0x84,0xc9]
      	movq	$-1, %rdi               ## encoding: [0x48,0xc7,0xc7,0xff,0xff,0xff,0xff]
      	cmoveq	%rax, %rdi              ## encoding: [0x48,0x0f,0x44,0xf8]
      	jmp	__Znam                  ## TAILCALL
      
      instead of:
      
      __Z4funcl:                              ## @_Z4funcl
      	movl	$4, %ecx                ## encoding: [0xb9,0x04,0x00,0x00,0x00]
      	movq	%rdi, %rax              ## encoding: [0x48,0x89,0xf8]
      	mulq	%rcx                    ## encoding: [0x48,0xf7,0xe1]
      	testq	%rdx, %rdx              ## encoding: [0x48,0x85,0xd2]
      	movq	$-1, %rdi               ## encoding: [0x48,0xc7,0xc7,0xff,0xff,0xff,0xff]
      	cmoveq	%rax, %rdi              ## encoding: [0x48,0x0f,0x44,0xf8]
      	jmp	__Znam                  ## TAILCALL
      
      Other than the silly seto+test, this is using the o bit directly, so it's going in the right
      direction.
      
      llvm-svn: 120935
      364bb0a0
  32. Oct 08, 2010
    • Chris Lattner's avatar
      fix a subtle bug I introduced in my refactoring, where we stopped preferring · 35e6ce47
      Chris Lattner authored
      the i8 versions of instructions in some cases.  In test6, we started 
      generating:
      
      	cmpq	$0, -8(%rsp)            ## encoding: [0x48,0x81,0x7c,0x24,0xf8,0x00,0x00,0x00,0x00]
                                              ## <MCInst #478 CMP64mi32
                                              ##  <MCOperand Reg:114>
                                              ##  <MCOperand Imm:1>
                                              ##  <MCOperand Reg:0>
                                              ##  <MCOperand Imm:-8>
                                              ##  <MCOperand Reg:0>
                                              ##  <MCOperand Imm:0>>
      
      instead of:
      
      	cmpq	$0, -8(%rsp)            ## encoding: [0x48,0x83,0x7c,0x24,0xf8,0x00]
                                              ## <MCInst #479 CMP64mi8
                                              ##  <MCOperand Reg:114>
                                              ##  <MCOperand Imm:1>
                                              ##  <MCOperand Reg:0>
                                              ##  <MCOperand Imm:-8>
                                              ##  <MCOperand Reg:0>
                                              ##  <MCOperand Imm:0>>
      
      Fix this and add some comments.
      
      llvm-svn: 116053
      35e6ce47
  33. Oct 07, 2010
Loading