1. Jul 16, 2015
  2. Jul 15, 2015
    • Bill Schmidt's avatar
      [PPC64LE] Fix vec_sld semantics for little endian · 8da737a1
      Bill Schmidt authored
      The vec_sld interface provides access to the vsldoi instruction.
      Unlike most of the vec_* interfaces, we do not attempt to change the
      generated code for vec_sld based on the endian mode.  It is too
      difficult to correctly infer the desired semantics because of
      different element types, and the corrected instruction sequence is
      expensive, involving loading a permute control vector and performing a
      generalized permute.
      
      For GCC, this was implemented as "Don't touch the vec_sld"
      implementation.  When it came time for the LLVM implementation, I did
      the same thing.  However, this was hasty and incorrect.  In LLVM's
      version of altivec.h, vec_sld was previously defined in terms of the
      vec_perm interface.  Because vec_perm semantics are adjusted for
      little endian, this means that leaving vec_sld untouched causes it to
      generate something different for LE than for BE.  Not good.
      
      This patch adjusts the form of vec_perm that is used for vec_sld and
      vec_vsldoi, effectively undoing the modifications so that the same
      vsldoi instruction will be generated for both BE and LE.
      
      There is an accompanying back-end patch to take care of some small
      ripple effects caused by these changes.
      
      llvm-svn: 242297
      8da737a1
    • Bill Schmidt's avatar
      [PPC64LE] Fix vec_sld semantics for little endian · 1e77bb12
      Bill Schmidt authored
      The vec_sld interface provides access to the vsldoi instruction.
      Unlike most of the vec_* interfaces, we do not attempt to change the
      generated code for vec_sld based on the endian mode.  It is too
      difficult to correctly infer the desired semantics because of
      different element types, and the corrected instruction sequence is
      expensive, involving loading a permute control vector and performing a
      generalized permute.
      
      For GCC, this was implemented as "Don't touch the vec_sld"
      implementation.  When it came time for the LLVM implementation, I did
      the same thing.  However, this was hasty and incorrect.  In LLVM's
      version of altivec.h, vec_sld was previously defined in terms of the
      vec_perm interface.  Because vec_perm semantics are adjusted for
      little endian, this means that leaving vec_sld untouched causes it to
      generate something different for LE than for BE.  Not good.
      
      This back-end patch accompanies the changes to altivec.h that change
      vec_sld's behavior for little endian.  Those changes mean that we see
      slightly different code in the back end when trying to recognize a
      VSLDOI instruction in isVSLDOIShuffleMask.  In particular, a
      ShuffleKind of 1 (where the two inputs are identical) must now be
      treated the same way as a ShuffleKind of 2 (little endian with
      different inputs) when little endian mode is in force.  This is
      because ShuffleKind of 1 is defined using big-endian numbering.
      
      This has a ripple effect on LowerBUILD_VECTOR, where we create our own
      internal VSLDOI instructions.  Because these are a ShuffleKind of 1,
      they will now have their shift amounts subtracted from 16 when
      recognizing the shuffle mask.  To avoid problems we have to subtract
      them from 16 again before creating the VSLDOI instructions.
      
      There are a couple of other uses of BuildVSLDOI, but these do not need
      to be modified because the shift amount is 8, which is unchanged when
      subtracted from 16.
      
      llvm-svn: 242296
      1e77bb12
    • Bruno Cardoso Lopes's avatar
      Look through PHIs to find additional register sources · fadd4fef
      Bruno Cardoso Lopes authored
      - Teaches the ValueTracker in the PeepholeOptimizer to look through PHI
      instructions.
      - Add findNextSourceAndRewritePHI method to lookup into multiple sources
      returnted by the ValueTracker and rewrite PHIs with new sources.
      
      With these changes we can find more register sources and rewrite more
      copies to allow coaslescing of bitcast instructions. Hence, we eliminate
      unnecessary VR64 <-> GR64 copies in x86, but it could be extended to
      other archs by marking "isBitcast" on target specific instructions. The
      x86 example follows:
      
      A:
        psllq %mm1, %mm0
        movd  %mm0, %r9
        jmp C
      
      B:
        por %mm1, %mm0
        movd  %mm0, %r9
        jmp C
      
      C:
        movd  %r9, %mm0
        pshufw  $238, %mm0, %mm0
      
      Becomes:
      
      A:
        psllq %mm1, %mm0
        jmp C
      
      B:
        por %mm1, %mm0
        jmp C
      
      C:
        pshufw  $238, %mm0, %mm0
      
      Differential Revision: http://reviews.llvm.org/D11197
      
      rdar://problem/20404526
      
      llvm-svn: 242295
      fadd4fef
    • Bruno Cardoso Lopes's avatar
      Refactor optimizeUncoalescable logic · bd68a095
      Bruno Cardoso Lopes authored
      - Create a new CopyRewriter for Uncoalescable copy-like instructions
      - Change the ValueTracker to return a ValueTrackerResult
      
      This makes optimizeUncoalescable looks more like optimizeCoalescable and
      use the CopyRewritter infrastructure.
      
      This is also the preparation for looking up into PHI nodes in the
      ValueTracker.
      
      Differential Revision: http://reviews.llvm.org/D11195
      
      llvm-svn: 242294
      bd68a095
    • Rafael Espindola's avatar
      Set comdat when an available_externally thunk is converted to linkonce_odr. · 6bedf4a7
      Rafael Espindola authored
      Fixes pr24130.
      
      llvm-svn: 242293
      6bedf4a7
    • Yaron Keren's avatar
      Add support for armv7-windows-gnu targets to the clang front end. · 321249cb
      Yaron Keren authored
      http://reviews.llvm.org/D11071
      
      Patch by Martell Malone
      Reviewed by Reid Kleckner
      
      llvm-svn: 242292
      321249cb
    • Andrew Wilkins's avatar
      [llgo] update libgo-llgo.so version to match libtool_VERSION · e5a7b93e
      Andrew Wilkins authored
      Summary:
      libtool_VERSION was changed in gofrontend a while ago,
      but CMakeLists.txt in llgo wasn't updated, and so the
      install target fails. Not sure how this went unnoticed
      for so long.
      
      Reviewers: pcc
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D11118
      
      llvm-svn: 242291
      e5a7b93e
    • Andrew Wilkins's avatar
      [llgo] set function personality with SetPersonality · fec95af7
      Andrew Wilkins authored
      Summary:
      If a function requires a landing pad, set the personality function.
      
      Requires D11116.
      
      Reviewers: pcc
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D11117
      
      llvm-svn: 242290
      fec95af7