1. Jan 20, 2018
    • Jan Vesely's avatar
      tan: Port from amd_builtins · 03937bde
      Jan Vesely authored
      
      
      v2: fixup constant precision
      Passes piglit on turks and carrizo.
      Passes CTS on carrizo
      Fixes half_tan to pass CTS on carrizo
      
      Acked-By: default avatarAaron Watry <awatry@gmail.com>
      Tested-By: default avatarAaron Watry <awatry@gmail.com>
      Signed-off-by: default avatarJan Vesely <jan.vesely@rutgers.edu>
      llvm-svn: 322979
      03937bde
    • Sam Clegg's avatar
      [WebAssembly] MC: Start table at offset 1 rather than 0 · 30e1bbc1
      Sam Clegg authored
      Summary:
      For consistency with the output of lld.
      
      This is useful in runnable binaries as can them be sure the
      null function pointer will never be a valid argument
      call_indirect.
      
      Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D42284
      
      llvm-svn: 322978
      30e1bbc1
    • Don Hinton's avatar
      [cmake] Also pass CMAKE_ASM_COMPILER_ID to next stage when bootstrapping · 976f0516
      Don Hinton authored
      Summary:
      When setting CMAKE_ASM_COMPILER=clang, we also need to set
      CMAKE_ASM_COMPILER_ID=Clang.
      
      This is needed because cmake won't set CMAKE_ASM_COMPILER_ID if
      CMAKE_ASM_COMPILER is already set.
      
      Without CMAKE_ASM_COMPILER_ID, cmake can't set
      CMAKE_ASM_COMPILER_OPTIONS_TARGET either, which means
      CMAKE_ASM_COMPILER_TARGET is ignored, causing cross compiling to fail,
      i.e., `--target=${CMAKE_ASM_COMPILER_TARGET}` isn't passed.
      
      Differential Revision: https://reviews.llvm.org/D42232
      
      llvm-svn: 322977
      976f0516
    • Sam Clegg's avatar
      [WebAssembly] Allow non-zero table offset in input object · 272c7017
      Sam Clegg authored
      Summary: This change enables D42284 to land without breaking lld
      
      Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D42285
      
      llvm-svn: 322976
      272c7017
    • Marshall Clow's avatar
      More P0202 constexpr-ifying in <algorithm>. This commit handles... · 12c7423f
      Marshall Clow authored
      More P0202 constexpr-ifying in <algorithm>. This commit handles replace/replace_if/replace_copy/replace_copy_if.
      
      llvm-svn: 322975
      12c7423f
    • Simon Pilgrim's avatar
      [X86][SSE] Add SSE2 gather tests · 969a432b
      Simon Pilgrim authored
      Check codegen without PEXTRD 
      
      llvm-svn: 322974
      969a432b
    • Michal Gorny's avatar
      [cmake] Include LLVM_LIBXML2_ENABLED in LLVMConfig.cmake, PR36006 · 92061bef
      Michal Gorny authored
      Include the LLVM_LIBXML2_ENABLED cache variable in LLVMConfig.cmake
      in order to make it available for other LLVM packages to query. This
      is necessary to fix stand-alone testing of LLD.
      
      Differential Revision: https://reviews.llvm.org/D42252
      
      llvm-svn: 322973
      92061bef
    • Joel Galenson's avatar
      [ARM] Fix perf regression in compare optimization. · dbc724f7
      Joel Galenson authored
      Fix a performance regression caused by r322737.
      
      While trying to make it easier to replace compares with existing adds and
      subtracts, I accidentally stopped it from doing so in some cases.  This should
      fix that.  I'm also fixing another potential bug in that commit.
      
      Differential Revision: https://reviews.llvm.org/D42263
      
      llvm-svn: 322972
      dbc724f7
    • Derek Schuff's avatar
      [WebAssembly] Fix libcall signature lookup · bfb02aec
      Derek Schuff authored
      RuntimeLibcallSignatures previously manually initialized all the libcall
      names into an array and searched it linearly for the first match to lookup
      the corresponding index.
      r322802 switched that to initializing a map keyed by the libcall name.
      Neither of these approaches works correctly because some libcall numbers use
      the same name on different platforms (e.g. the "l" suffixed functions
      use f80 or f128 or ppcf128).
      
      This change fixes that by ensuring that each name only goes into the map
      once. It also adds tests.
      
      Differential Revision: https://reviews.llvm.org/D42271
      
      llvm-svn: 322971
      bfb02aec
    • Marshall Clow's avatar
      99894b61
    • Daniel Neilson's avatar
      Additional fixes for docs in addition to r322968. · aac0f8f3
      Daniel Neilson authored
      llvm-svn: 322969
      aac0f8f3
    • Daniel Neilson's avatar
      Fix docs build break caused by r322965 · 39eb6a50
      Daniel Neilson authored
      llvm-svn: 322968
      39eb6a50
    • Dan Gohman's avatar
      [WebAssembly] Add target flags for sign-ext opcodes. · d0c4e1e9
      Dan Gohman authored
      Add -msign-ext and -mno-sign-ext to control the new sign-ext target
      feature.
      
      llvm-svn: 322967
      d0c4e1e9
    • Dan Gohman's avatar
      [WebAssembly] Make sign-extension opcodes a distinct feature. · 5d2b9354
      Dan Gohman authored
      Sign-extension opcodes have been split into a separate proposal from
      the main threads proposal, so switch them to their own target
      feature. See:
      
      https://github.com/WebAssembly/sign-extension-ops
      
      llvm-svn: 322966
      5d2b9354
    • Daniel Neilson's avatar
      Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) · 1e68724d
      Daniel Neilson authored
      Summary:
       This is a resurrection of work first proposed and discussed in Aug 2015:
         http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
      and initially landed (but then backed out) in Nov 2015:
         http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html
      
       The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
      which is required to be a constant integer. It represents the alignment of the
      dest (and source), and so must be the minimum of the actual alignment of the
      two.
      
       This change is the first in a series that allows source and dest to each
      have their own alignments by using the alignment attribute on their arguments.
      
       In this change we:
      1) Remove the alignment argument.
      2) Add alignment attributes to the source & dest arguments. We, temporarily,
         require that the alignments for source & dest be equal.
      
       For example, code which used to read:
        call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
      will now read
        call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
      
       Downstream users may have to update their lit tests that check for
      @llvm.memcpy/memmove/memset call/declaration patterns. The following extended sed script
      may help with updating the majority of your tests, but it does not catch all possible
      patterns so some manual checking and updating will be required.
      
      s~declare void @llvm\.mem(set|cpy|move)\.p([^(]*)\((.*), i32, i1\)~declare void @llvm.mem\1.p\2(\3, i1)~g
      s~call void @llvm\.memset\.p([^(]*)i8\(i8([^*]*)\* (.*), i8 (.*), i8 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i8(i8\2* \3, i8 \4, i8 \5, i1 \6)~g
      s~call void @llvm\.memset\.p([^(]*)i16\(i8([^*]*)\* (.*), i8 (.*), i16 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i16(i8\2* \3, i8 \4, i16 \5, i1 \6)~g
      s~call void @llvm\.memset\.p([^(]*)i32\(i8([^*]*)\* (.*), i8 (.*), i32 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i32(i8\2* \3, i8 \4, i32 \5, i1 \6)~g
      s~call void @llvm\.memset\.p([^(]*)i64\(i8([^*]*)\* (.*), i8 (.*), i64 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i64(i8\2* \3, i8 \4, i64 \5, i1 \6)~g
      s~call void @llvm\.memset\.p([^(]*)i128\(i8([^*]*)\* (.*), i8 (.*), i128 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i128(i8\2* \3, i8 \4, i128 \5, i1 \6)~g
      s~call void @llvm\.memset\.p([^(]*)i8\(i8([^*]*)\* (.*), i8 (.*), i8 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i8(i8\2* align \6 \3, i8 \4, i8 \5, i1 \7)~g
      s~call void @llvm\.memset\.p([^(]*)i16\(i8([^*]*)\* (.*), i8 (.*), i16 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i16(i8\2* align \6 \3, i8 \4, i16 \5, i1 \7)~g
      s~call void @llvm\.memset\.p([^(]*)i32\(i8([^*]*)\* (.*), i8 (.*), i32 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i32(i8\2* align \6 \3, i8 \4, i32 \5, i1 \7)~g
      s~call void @llvm\.memset\.p([^(]*)i64\(i8([^*]*)\* (.*), i8 (.*), i64 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i64(i8\2* align \6 \3, i8 \4, i64 \5, i1 \7)~g
      s~call void @llvm\.memset\.p([^(]*)i128\(i8([^*]*)\* (.*), i8 (.*), i128 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i128(i8\2* align \6 \3, i8 \4, i128 \5, i1 \7)~g
      s~call void @llvm\.mem(cpy|move)\.p([^(]*)i8\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i8 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i8(i8\3* \4, i8\5* \6, i8 \7, i1 \8)~g
      s~call void @llvm\.mem(cpy|move)\.p([^(]*)i16\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i16 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i16(i8\3* \4, i8\5* \6, i16 \7, i1 \8)~g
      s~call void @llvm\.mem(cpy|move)\.p([^(]*)i32\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i32 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i32(i8\3* \4, i8\5* \6, i32 \7, i1 \8)~g
      s~call void @llvm\.mem(cpy|move)\.p([^(]*)i64\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i64 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i64(i8\3* \4, i8\5* \6, i64 \7, i1 \8)~g
      s~call void @llvm\.mem(cpy|move)\.p([^(]*)i128\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i128 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i128(i8\3* \4, i8\5* \6, i128 \7, i1 \8)~g
      s~call void @llvm\.mem(cpy|move)\.p([^(]*)i8\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i8 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i8(i8\3* align \8 \4, i8\5* align \8 \6, i8 \7, i1 \9)~g
      s~call void @llvm\.mem(cpy|move)\.p([^(]*)i16\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i16 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i16(i8\3* align \8 \4, i8\5* align \8 \6, i16 \7, i1 \9)~g
      s~call void @llvm\.mem(cpy|move)\.p([^(]*)i32\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i32 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i32(i8\3* align \8 \4, i8\5* align \8 \6, i32 \7, i1 \9)~g
      s~call void @llvm\.mem(cpy|move)\.p([^(]*)i64\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i64 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i64(i8\3* align \8 \4, i8\5* align \8 \6, i64 \7, i1 \9)~g
      s~call void @llvm\.mem(cpy|move)\.p([^(]*)i128\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i128 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i128(i8\3* align \8 \4, i8\5* align \8 \6, i128 \7, i1 \9)~g
      
       The remaining changes in the series will:
      Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
         source and dest alignments.
      Step 3) Update Clang to use the new IRBuilder API.
      Step 4) Update Polly to use the new IRBuilder API.
      Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
              and those that use use MemIntrinsicInst::[get|set]Alignment() to use
              getDestAlignment() and getSourceAlignment() instead.
      Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
              MemIntrinsicInst::[get|set]Alignment() methods.
      
      Reviewers: pete, hfinkel, lhames, reames, bollu
      
      Reviewed By: reames
      
      Subscribers: niosHD, reames, jholewinski, qcolombet, jfb, sanjoy, arsenm, dschuff, dylanmckay, mehdi_amini, sdardis, nemanjai, david2050, nhaehnle, javed.absar, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, asb, rbar, johnrusso, simoncook, jordy.potman.lists, apazos, sabuasal, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D41675
      
      llvm-svn: 322965
      1e68724d
    • Daniel Neilson's avatar
      Change memcpy/memove/memset to have dest and source alignment attributes (Step 1). · 6e938eff
      Daniel Neilson authored
      Summary:
        Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
      intrinsics. This change updates the Clang tests for this change.
      
        The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
      which is required to be a constant integer. It represents the alignment of the
      dest (and source), and so must be the minimum of the actual alignment of the
      two.
      
       This change removes the alignment argument in favour of placing the alignment
      attribute on the source and destination pointers of the memory intrinsic call.
      
       For example, code which used to read:
         call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
      will now read
         call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
      
       At this time the source and destination alignments must be the same (Step 1).
      Step 2 of the change, to be landed shortly, will relax that contraint and allow
      the source and destination to have different alignments.
      
      llvm-svn: 322964
      6e938eff
    • Daniel Neilson's avatar
      Change memcpy/memove/memset to have dest and source alignment attributes (Step 1). · 751a2ceb
      Daniel Neilson authored
      Summary:
       Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
      intrinsics. This change updates the polly tests for this change.
      
       The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
      which is required to be a constant integer. It represents the alignment of the
      dest (and source), and so must be the minimum of the actual alignment of the
      two.
      
       This change removes the alignment argument in favour of placing the alignment
      attribute on the source and destination pointers of the memory intrinsic call.
      
       For example, code which used to read:
        call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
      will now read
        call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
      
       At this time the source and destination alignments must be the same (Step 1).
      Step 2 of the change, to be landed shortly, will relax that contraint and allow
      the source and destination to have different alignments.
      
      llvm-svn: 322963
      751a2ceb
    • Petr Hosek's avatar
      Fallback option for colorized output when terminfo isn't available · cc7a8f14
      Petr Hosek authored
      Try to detect the terminal color support by checking the value of the
      TERM environment variable. This is not great, but it's better than
      nothing when terminfo library isn't available, which may still be the
      case on some Linux distributions.
      
      Differential Revision: https://reviews.llvm.org/D42055
      
      llvm-svn: 322962
      cc7a8f14
    • Sanjay Patel's avatar
      [x86] add RUN line and auto-generate checks · 4c8382ee
      Sanjay Patel authored
      There were checks for a 32-bit target here, but no RUN line
      corresponding to that prefix. I don't know what the intent
      of these tests is, but at least now we can see what happens
      for both targets.
      
      llvm-svn: 322961
      4c8382ee
    • Sanjay Patel's avatar
      [x86] regenerate complete checks; NFC · 6b0fd436
      Sanjay Patel authored
      D42265 will improve something here, but it's not obvious how without more checks.
      
      llvm-svn: 322960
      6b0fd436
    • Don Hinton's avatar
      [cmake] Fix typo in LLVM_UTILS_INSTALL_DIR definition. · 435d650e
      Don Hinton authored
      Differential Revision: https://reviews.llvm.org/D41804
      
      llvm-svn: 322959
      435d650e
    • Carey Williams's avatar
      Test commit · 22c49c64
      Carey Williams authored
      llvm-svn: 322958
      22c49c64
    • Sanjay Patel's avatar
      [x86] shrink 'and' immediate values by setting the high bits (PR35907) · 74a1eef7
      Sanjay Patel authored
        
      Try to reverse the constant-shrinking that happens in SimplifyDemandedBits()
      for 'and' masks when it results in a smaller sign-extended immediate.
      
      We are also able to detect dead 'and' ops here (the mask is all ones). In
      that case, we replace and return without selecting the 'and'.
      
      Other targets might want to share some of this logic by enabling this under a
      target hook, but I didn't see diffs for simple cases with PowerPC or AArch64,
      so they may already have some specialized logic for this kind of thing or have
      different needs.
      
      This should solve PR35907:
      https://bugs.llvm.org/show_bug.cgi?id=35907
      
      Differential Revision: https://reviews.llvm.org/D42088
      
      llvm-svn: 322957
      74a1eef7
    • Krasimir Georgiev's avatar
      [clang-format] Adds a canonical delimiter to raw string formatting · 412ed095
      Krasimir Georgiev authored
      Summary:
      This patch adds canonical delimiter support to the raw string formatting.
      This allows matching delimiters to be updated to the canonical one.
      
      Reviewers: bkramer
      
      Reviewed By: bkramer
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D42187
      
      llvm-svn: 322956
      412ed095
    • Sanjay Patel's avatar
      33cb8457
    • Krasimir Georgiev's avatar
      [clang-format] Fix shortening blocks in macros causing merged next line · bf4cddaa
      Krasimir Georgiev authored
      Summary:
      This patch addresses bug 36002, where a combination of options causes the line
      following a short block in macro to be merged with that macro.
      
      Reviewers: bkramer
      
      Reviewed By: bkramer
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D42298
      
      llvm-svn: 322954
      bf4cddaa
  2. Jan 19, 2018