1. Aug 27, 2018
  2. Aug 26, 2018
  3. Aug 25, 2018
    • Sanjay Patel's avatar
      [x86] try harder to use broadcast to load a scalar into vector reg · 8a84c747
      Sanjay Patel authored
      This is a preliminary step for a preliminary step for D50992. 
      I noticed that x86 often misses chances to load a scalar directly 
      into a vector register.
      
      So this patch is just allowing more of those cases to match a 
      broadcast op in lowerBuildVectorAsBroadcast(). The old code comment 
      said it doesn't make sense to use a broadcast when we're loading a 
      single element and everything else is undef, but I think that's the 
      best case in the improved tests in insert-loaded-scalar.ll. We avoid 
      scalar-to-vector-register move and/or less efficient shuffling.
      
      Note that there are some existing types that were already producing 
      a broadcast, but that happens semi-accidentally. Ie, it's not 
      happening as part of lowerBuildVectorAsBroadcast(). The build vector 
      gets expanded into load + shuffle, and then shuffle lowering produces 
      the broadcast.
      
      Description of the other test diffs:
      1. avx-basic.ll - replacing load+shufle is a win.
      2. sse3-avx-addsub-2.ll - vmovddup vs. vbroadcastss is neutral
      3. sse41.ll - don't care - we convert that intrinsic to generic IR now, so this test is deprecated
      4. vector-shuffle-128-v8.ll / vector-shuffle-256-v16.ll - pshufb alternatives with an extra instruction are not obviously bad
      
      Differential Revision: https://reviews.llvm.org/D51125
      
      llvm-svn: 340685
      8a84c747
    • Tim Renouf's avatar
      [AMDGPU] Add support for multi-dword s.buffer.load intrinsic · 904343f8
      Tim Renouf authored
      Summary:
      Patch by Marek Olsak and David Stuttard, both of AMD.
      
      This adds a new amdgcn intrinsic supporting s.buffer.load, in particular
      multiple dword variants. These are convenient to use from some front-end
      implementations.
      
      Also modified the existing llvm.SI.load.const intrinsic to common up the
      underlying implementation.
      
      This modification also requires that we can lower to non-uniform loads correctly
      by splitting larger dword variants into sizes supported by the non-uniform
      versions of the load.
      
      V2: Addressed minor review comments.
      V3: i1 glc is now i32 cachepolicy for consistency with buffer and
          tbuffer intrinsics, plus fixed formatting issue.
      V4: Added glc test.
      
      Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51098
      
      Change-Id: I83a6e00681158bb243591a94a51c7baa445f169b
      llvm-svn: 340684
      904343f8