Skip to content
  1. Dec 03, 2012
  2. Nov 30, 2012
    • Sebastian Pop's avatar
      Codegen failure for vmull with small vectors · a204f722
      Sebastian Pop authored
      Codegen was failing with an assertion because of unexpected vector
      operands when legalizing the selection DAG for a MUL instruction.
      
      The asserting code was legalizing multiplies for vectors of size 128
      bits. It uses a custom lowering to try and detect cases where it can
      use a VMULL instruction instead of a VMOVL + VMUL.  The code was
      looking for input operands to the MUL that had been sign or zero
      extended. If it found the extended operands it would drop the
      sign/zero extension and use the original vector size as input to a
      VMULL instruction.
      
      The code assumed that the original input vector was 64 bits so that
      after dropping the extension it would fit directly into a D register
      and could be used as an operand of a VMULL instruction. The input
      code that trigger the failure used a vector of <4 x i8> that was
      sign extended to <4 x i32>. It was not safe to drop the sign
      extension in this case because the original vector is only 32 bits
      wide. The fix is to insert a sign extension for the vector to reach
      the required 64 bit size. In this particular example, the vector would
      need to be sign extented to a <4 x i16>.
      
      llvm-svn: 169024
      a204f722
    • Jyotsna Verma's avatar
      Use multiclass for the load instructions with MEMri operand. · a77c054e
      Jyotsna Verma authored
      llvm-svn: 169018
      a77c054e
    • Adhemerval Zanella's avatar
      This patch fixes the Altivec addend construction for the fused multiply-add · 812410f2
      Adhemerval Zanella authored
      instruction (vmaddfp) to conform with IEEE to ensure the sign of a zero
      result when resulting product is -0.0.
      
      The -0.0 vector addend to vmaddfp is generated by a creating a vector
      with full bits sets and then shifting each elements by 31-bits to the
      left, resulting in a vector of 0x80000000 (or -0.0 as float).
      
      The 'buildvec_canonicalize.ll' was adjusted to reflect this change and
      the 'vec_mul.ll' was complemented with the float vector multiplication
      test.
      
      llvm-svn: 168998
      812410f2
    • Chandler Carruth's avatar
      Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES. · f12e3a67
      Chandler Carruth authored
      Rationale:
      1) This was the name in the comment block. ;]
      2) It matches Clang's __has_feature naming convention.
      3) It matches other compiler-feature-test conventions.
      
      Sorry for the noise. =]
      
      I've also switch the comment block to use a \brief tag and not duplicate
      the name.
      
      llvm-svn: 168996
      f12e3a67
    • Jyotsna Verma's avatar
      Use multiclass for the store instructions with MEMri operand. · b950ea61
      Jyotsna Verma authored
      llvm-svn: 168983
      b950ea61
    • Jyotsna Verma's avatar
      Use multiclass for the load instructions with 'base + register offset' · ede608cc
      Jyotsna Verma authored
      addressing mode.
      
      llvm-svn: 168976
      ede608cc
    • Kevin Enderby's avatar
      Fixed the arm disassembly of invalid BFI instructions to not build a bad MCInst · 136d6746
      Kevin Enderby authored
      which would then cause an assert when printed.  rdar://11437956
      
      llvm-svn: 168960
      136d6746
  3. Nov 29, 2012
  4. Nov 28, 2012
  5. Nov 27, 2012
    • Chad Rosier's avatar
      [arm fast-isel] Appease the machine verifier by using the proper register · b4ac423e
      Chad Rosier authored
      classes.  The vast majority of the remaining issues are due to uses of
      invalid registers, which are defined by getRegForValue().  Those will be
      a little more challenging to cleanup.
      rdar://12719844
      
      llvm-svn: 168735
      b4ac423e
    • Chad Rosier's avatar
      0c007580
    • Chad Rosier's avatar
      [arm fast-isel] Appease the machine verifier by using the proper register · 2ec7db09
      Chad Rosier authored
      classes.  Also a bit of cleanup.
      rdar://12719844
      
      llvm-svn: 168728
      2ec7db09
    • Manman Ren's avatar
      X86: do not fold load instructions such as [V]MOVS[S|D] to other instructions · 5b462820
      Manman Ren authored
      when the destination register is wider than the memory load.
      
      These load instructions load from m32 or m64 and set the upper bits to zero,
      while the folded instructions may accept m128.
      
      rdar://12721174
      
      llvm-svn: 168710
      5b462820
    • Bill Schmidt's avatar
      This patch implements medium code model support for 64-bit PowerPC. · 34627e34
      Bill Schmidt authored
      The default for 64-bit PowerPC is small code model, in which TOC entries
      must be addressable using a 16-bit offset from the TOC pointer.  Additionally,
      only TOC entries are addressed via the TOC pointer.
      
      With medium code model, TOC entries and data sections can all be addressed
      via the TOC pointer using a 32-bit offset.  Cooperation with the linker
      allows 16-bit offsets to be used when these are sufficient, reducing the
      number of extra instructions that need to be executed.  Medium code model
      also does not generate explicit TOC entries in ".section toc" for variables
      that are wholly internal to the compilation unit.
      
      Consider a load of an external 4-byte integer.  With small code model, the
      compiler generates:
      
      	ld 3, .LC1@toc(2)
      	lwz 4, 0(3)
      
      	.section	.toc,"aw",@progbits
      .LC1:
      	.tc ei[TC],ei
      
      With medium model, it instead generates:
      
      	addis 3, 2, .LC1@toc@ha
      	ld 3, .LC1@toc@l(3)
      	lwz 4, 0(3)
      
      	.section	.toc,"aw",@progbits
      .LC1:
      	.tc ei[TC],ei
      
      Here .LC1@toc@ha is a relocation requesting the upper 16 bits of the
      32-bit offset of ei's TOC entry from the TOC base pointer.  Similarly,
      .LC1@toc@l is a relocation requesting the lower 16 bits.  Note that if
      the linker determines that ei's TOC entry is within a 16-bit offset of
      the TOC base pointer, it will replace the "addis" with a "nop", and
      replace the "ld" with the identical "ld" instruction from the small
      code model example.
      
      Consider next a load of a function-scope static integer.  For small code
      model, the compiler generates:
      
      	ld 3, .LC1@toc(2)
      	lwz 4, 0(3)
      
      	.section	.toc,"aw",@progbits
      .LC1:
      	.tc test_fn_static.si[TC],test_fn_static.si
      	.type	test_fn_static.si,@object
      	.local	test_fn_static.si
      	.comm	test_fn_static.si,4,4
      
      For medium code model, the compiler generates:
      
      	addis 3, 2, test_fn_static.si@toc@ha
      	addi 3, 3, test_fn_static.si@toc@l
      	lwz 4, 0(3)
      
      	.type	test_fn_static.si,@object
      	.local	test_fn_static.si
      	.comm	test_fn_static.si,4,4
      
      Again, the linker may replace the "addis" with a "nop", calculating only
      a 16-bit offset when this is sufficient.
      
      Note that it would be more efficient for the compiler to generate:
      
      	addis 3, 2, test_fn_static.si@toc@ha
              lwz 4, test_fn_static.si@toc@l(3)
      
      The current patch does not perform this optimization yet.  This will be
      addressed as a peephole optimization in a later patch.
      
      For the moment, the default code model for 64-bit PowerPC will remain the
      small code model.  We plan to eventually change the default to medium code
      model, which matches current upstream GCC behavior.  Note that the different
      code models are ABI-compatible, so code compiled with different models will
      be linked and execute correctly.
      
      I've tested the regression suite and the application/benchmark test suite in
      two ways:  Once with the patch as submitted here, and once with additional
      logic to force medium code model as the default.  The tests all compile
      cleanly, with one exception.  The mandel-2 application test fails due to an
      unrelated ABI compatibility with passing complex numbers.  It just so happens
      that small code model was incredibly lucky, in that temporary values in 
      floating-point registers held the expected values needed by the external
      library routine that was called incorrectly.  My current thought is to correct
      the ABI problems with _Complex before making medium code model the default,
      to avoid introducing this "regression."
      
      Here are a few comments on how the patch works, since the selection code
      can be difficult to follow:
      
      The existing logic for small code model defines three pseudo-instructions:
      LDtoc for most uses, LDtocJTI for jump table addresses, and LDtocCPT for
      constant pool addresses.  These are expanded by SelectCodeCommon().  The
      pseudo-instruction approach doesn't work for medium code model, because
      we need to generate two instructions when we match the same pattern.
      Instead, new logic in PPCDAGToDAGISel::Select() intercepts the TOC_ENTRY
      node for medium code model, and generates an ADDIStocHA followed by either
      a LDtocL or an ADDItocL.  These new node types correspond naturally to
      the sequences described above.
      
      The addis/ld sequence is generated for the following cases:
       * Jump table addresses
       * Function addresses
       * External global variables
       * Tentative definitions of global variables (common linkage)
      
      The addis/addi sequence is generated for the following cases:
       * Constant pool entries
       * File-scope static global variables
       * Function-scope static variables
      
      Expanding to the two-instruction sequences at select time exposes the
      instructions to subsequent optimization, particularly scheduling.
      
      The rest of the processing occurs at assembly time, in
      PPCAsmPrinter::EmitInstruction.  Each of the instructions is converted to
      a "real" PowerPC instruction.  When a TOC entry needs to be created, this
      is done here in the same manner as for the existing LDtoc, LDtocJTI, and
      LDtocCPT pseudo-instructions (I factored out a new routine to handle this).
      
      I had originally thought that if a TOC entry was needed for LDtocL or
      ADDItocL, it would already have been generated for the previous ADDIStocHA.
      However, at higher optimization levels, the ADDIStocHA may appear in a 
      different block, which may be assembled textually following the block
      containing the LDtocL or ADDItocL.  So it is necessary to include the
      possibility of creating a new TOC entry for those two instructions.
      
      Note that for LDtocL, we generate a new form of LD called LDrs.  This
      allows specifying the @toc@l relocation for the offset field of the LD
      instruction (i.e., the offset is replaced by a SymbolLo relocation).
      When the peephole optimization described above is added, we will need
      to do similar things for all immediate-form load and store operations.
      
      The seven "mcm-n.ll" test cases are kept separate because otherwise the
      intermingling of various TOC entries and so forth makes the tests fragile
      and hard to understand.
      
      The above assumes use of an external assembler.  For use of the
      integrated assembler, new relocations are added and used by
      PPCELFObjectWriter.  Testing is done with "mcm-obj.ll", which tests for
      proper generation of the various relocations for the same sequences
      tested with the external assembler.
      
      llvm-svn: 168708
      34627e34
    • Bill Wendling's avatar
      Remove the dependent libraries feature. · ee5984df
      Bill Wendling authored
      The dependent libraries feature was never used and has bit-rotted. Remove it.
      
      llvm-svn: 168694
      ee5984df
    • Chad Rosier's avatar
      [arm fast-isel] Appease the machine verifier by using the proper register · 2e82ad12
      Chad Rosier authored
      classes.  The associated test case still doesn't pass, but it does have far
      fewer issues.
      rdar://12719844
      
      llvm-svn: 168657
      2e82ad12
  6. Nov 26, 2012
  7. Nov 24, 2012
  8. Nov 23, 2012
  9. Nov 22, 2012
    • Meador Inge's avatar
      Add more functions to the target library information. · 780a1861
      Meador Inge authored
      I discovered a few more missing functions while migrating optimizations
      from the simplify-libcalls pass to the instcombine (I already added some
      in r167659).
      
      llvm-svn: 168501
      780a1861
    • Jack Carter's avatar
      Mips direct object xgot support · b05cb67b
      Jack Carter authored
      This patch provides support for the MIPS relocations:
      
          *)  R_MIPS_GOT_HI16
          *)  R_MIPS_GOT_LO16
          *)  R_MIPS_CALL_HI16
          *)  R_MIPS_CALL_LO16
      
      These are used for large GOT instruction sequences.
      
      Contributer: Jack Carter
      llvm-svn: 168471
      b05cb67b
Loading