platform/upstream/llvm.git
6 years ago[SystemZ] Directly use CC result of compare-and-swap
Ulrich Weigand [Fri, 19 Jan 2018 20:54:18 +0000 (20:54 +0000)]
[SystemZ] Directly use CC result of compare-and-swap

In order to implement a test whether a compare-and-swap succeeded, the
SystemZ back-end currently emits a rather inefficient sequence of first
converting the CC result into an integer, and then testing that integer
against zero.  This commit changes the back-end to simply directly test
the CC value set by the compare-and-swap instruction.

llvm-svn: 322988

6 years ago[SystemZ] Rework IPM sequence generation
Ulrich Weigand [Fri, 19 Jan 2018 20:52:04 +0000 (20:52 +0000)]
[SystemZ] Rework IPM sequence generation

The SystemZ back-end uses a sequence of IPM followed by arithmetic
operations to implement the SETCC primitive.  This is currently done
early during SelectionDAG.  This patch moves generating those sequences
to much later in SelectionDAG (during PreprocessISelDAG).

This doesn't change much in generated code by itself, but it allows
further enhancements that will be checked-in as follow-on commits.

llvm-svn: 322987

6 years ago[SystemZ] Implement computeKnownBitsForTargetNode
Ulrich Weigand [Fri, 19 Jan 2018 20:49:05 +0000 (20:49 +0000)]
[SystemZ] Implement computeKnownBitsForTargetNode

This provides a computeKnownBits implementation for SystemZ target
nodes.  Currently only SystemZISD::SELECT_CCMASK is supported.

llvm-svn: 322986

6 years ago[SelectionDAG] Teach computeKnownBits about ATOMIC_CMP_SWAP_WITH_SUCCESS boolean...
Ulrich Weigand [Fri, 19 Jan 2018 20:47:14 +0000 (20:47 +0000)]
[SelectionDAG] Teach computeKnownBits about ATOMIC_CMP_SWAP_WITH_SUCCESS boolean return value

The second return value of ATOMIC_CMP_SWAP_WITH_SUCCESS is known to be a
boolean, and should therefore be treated by computeKnownBits just like
the second return values of SMULO / UMULO.

Differential Revision: https://reviews.llvm.org/D42067

llvm-svn: 322985

6 years agoAllow BlockDecl in CXXRecord scope to have no access specifier.
Richard Trieu [Fri, 19 Jan 2018 20:46:19 +0000 (20:46 +0000)]
Allow BlockDecl in CXXRecord scope to have no access specifier.

Using a BlockDecl in a default member initializer causes it to be attached to
CXXMethodDecl without its access specifier being set.  This prevents a crash
where getAccess is called on this BlockDecl, since that method expects any
Decl in CXXRecord scope to have an access specifier.

llvm-svn: 322984

6 years ago[SystemZ] Run branch-12.ll test only if long tests enabled
Ulrich Weigand [Fri, 19 Jan 2018 19:51:38 +0000 (19:51 +0000)]
[SystemZ] Run branch-12.ll test only if long tests enabled

This avoids excessive test run times e.g. with expensive checks enabled.

llvm-svn: 322983

6 years ago[X86] Add goldmont to test/Driver/x86-march.c
Craig Topper [Fri, 19 Jan 2018 19:43:36 +0000 (19:43 +0000)]
[X86] Add goldmont to test/Driver/x86-march.c

llvm-svn: 322982

6 years agotanpi: Port from amd_builtins
Jan Vesely [Fri, 19 Jan 2018 18:57:22 +0000 (18:57 +0000)]
tanpi: Port from amd_builtins

Passes piglit on turks and carrizo.
Passes CTS on carrizo.

Acked-By: Aaron Watry <awatry@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322980

6 years agotan: Port from amd_builtins
Jan Vesely [Fri, 19 Jan 2018 18:57:19 +0000 (18:57 +0000)]
tan: Port from amd_builtins

v2: fixup constant precision
Passes piglit on turks and carrizo.
Passes CTS on carrizo
Fixes half_tan to pass CTS on carrizo

Acked-By: Aaron Watry <awatry@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322979

6 years ago[WebAssembly] MC: Start table at offset 1 rather than 0
Sam Clegg [Fri, 19 Jan 2018 18:57:01 +0000 (18:57 +0000)]
[WebAssembly] MC: Start table at offset 1 rather than 0

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

6 years ago[cmake] Also pass CMAKE_ASM_COMPILER_ID to next stage when bootstrapping
Don Hinton [Fri, 19 Jan 2018 18:31:12 +0000 (18:31 +0000)]
[cmake] Also pass CMAKE_ASM_COMPILER_ID to next stage when bootstrapping

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

6 years ago[WebAssembly] Allow non-zero table offset in input object
Sam Clegg [Fri, 19 Jan 2018 18:21:42 +0000 (18:21 +0000)]
[WebAssembly] Allow non-zero table offset in input object

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

6 years agoMore P0202 constexpr-ifying in <algorithm>. This commit handles replace/replace_if...
Marshall Clow [Fri, 19 Jan 2018 18:07:29 +0000 (18:07 +0000)]
More P0202 constexpr-ifying in <algorithm>. This commit handles replace/replace_if/replace_copy/replace_copy_if.

llvm-svn: 322975

6 years ago[X86][SSE] Add SSE2 gather tests
Simon Pilgrim [Fri, 19 Jan 2018 17:50:25 +0000 (17:50 +0000)]
[X86][SSE] Add SSE2 gather tests

Check codegen without PEXTRD

llvm-svn: 322974

6 years ago[cmake] Include LLVM_LIBXML2_ENABLED in LLVMConfig.cmake, PR36006
Michal Gorny [Fri, 19 Jan 2018 17:47:03 +0000 (17:47 +0000)]
[cmake] Include LLVM_LIBXML2_ENABLED in LLVMConfig.cmake, PR36006

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

6 years ago[ARM] Fix perf regression in compare optimization.
Joel Galenson [Fri, 19 Jan 2018 17:46:27 +0000 (17:46 +0000)]
[ARM] Fix perf regression in compare optimization.

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

6 years ago[WebAssembly] Fix libcall signature lookup
Derek Schuff [Fri, 19 Jan 2018 17:45:54 +0000 (17:45 +0000)]
[WebAssembly] Fix libcall signature lookup

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

6 years agoMore P0202 constexpr-ifying in <algorithm>. This commit handles 'transform'.
Marshall Clow [Fri, 19 Jan 2018 17:45:39 +0000 (17:45 +0000)]
More P0202 constexpr-ifying in <algorithm>. This commit handles 'transform'.

llvm-svn: 322970

6 years agoAdditional fixes for docs in addition to r322968.
Daniel Neilson [Fri, 19 Jan 2018 17:32:33 +0000 (17:32 +0000)]
Additional fixes for docs in addition to r322968.

llvm-svn: 322969

6 years agoFix docs build break caused by r322965
Daniel Neilson [Fri, 19 Jan 2018 17:24:21 +0000 (17:24 +0000)]
Fix docs build break caused by r322965

llvm-svn: 322968

6 years ago[WebAssembly] Add target flags for sign-ext opcodes.
Dan Gohman [Fri, 19 Jan 2018 17:16:32 +0000 (17:16 +0000)]
[WebAssembly] Add target flags for sign-ext opcodes.

Add -msign-ext and -mno-sign-ext to control the new sign-ext target
feature.

llvm-svn: 322967

6 years ago[WebAssembly] Make sign-extension opcodes a distinct feature.
Dan Gohman [Fri, 19 Jan 2018 17:16:24 +0000 (17:16 +0000)]
[WebAssembly] Make sign-extension opcodes a distinct feature.

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

6 years agoRemove alignment argument from memcpy/memmove/memset in favour of alignment attribute...
Daniel Neilson [Fri, 19 Jan 2018 17:13:12 +0000 (17:13 +0000)]
Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)

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

6 years agoChange memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Daniel Neilson [Fri, 19 Jan 2018 17:12:54 +0000 (17:12 +0000)]
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).

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

6 years agoChange memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Daniel Neilson [Fri, 19 Jan 2018 17:12:48 +0000 (17:12 +0000)]
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).

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

6 years agoFallback option for colorized output when terminfo isn't available
Petr Hosek [Fri, 19 Jan 2018 17:10:55 +0000 (17:10 +0000)]
Fallback option for colorized output when terminfo isn't available

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

6 years ago[x86] add RUN line and auto-generate checks
Sanjay Patel [Fri, 19 Jan 2018 17:09:28 +0000 (17:09 +0000)]
[x86] add RUN line and auto-generate checks

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

6 years ago[x86] regenerate complete checks; NFC
Sanjay Patel [Fri, 19 Jan 2018 17:05:16 +0000 (17:05 +0000)]
[x86] regenerate complete checks; NFC

D42265 will improve something here, but it's not obvious how without more checks.

llvm-svn: 322960

6 years ago[cmake] Fix typo in LLVM_UTILS_INSTALL_DIR definition.
Don Hinton [Fri, 19 Jan 2018 17:02:12 +0000 (17:02 +0000)]
[cmake] Fix typo in LLVM_UTILS_INSTALL_DIR definition.

Differential Revision: https://reviews.llvm.org/D41804

llvm-svn: 322959

6 years agoTest commit
Carey Williams [Fri, 19 Jan 2018 16:55:23 +0000 (16:55 +0000)]
Test commit

llvm-svn: 322958

6 years ago[x86] shrink 'and' immediate values by setting the high bits (PR35907)
Sanjay Patel [Fri, 19 Jan 2018 16:37:25 +0000 (16:37 +0000)]
[x86] shrink 'and' immediate values by setting the high bits (PR35907)

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

6 years ago[clang-format] Adds a canonical delimiter to raw string formatting
Krasimir Georgiev [Fri, 19 Jan 2018 16:18:47 +0000 (16:18 +0000)]
[clang-format] Adds a canonical delimiter to raw string formatting

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

6 years ago[InstSimplify] use m_Specific and commutative matcher to reduce code; NFCI
Sanjay Patel [Fri, 19 Jan 2018 16:12:55 +0000 (16:12 +0000)]
[InstSimplify] use m_Specific and commutative matcher to reduce code; NFCI

llvm-svn: 322955

6 years ago[clang-format] Fix shortening blocks in macros causing merged next line
Krasimir Georgiev [Fri, 19 Jan 2018 16:12:37 +0000 (16:12 +0000)]
[clang-format] Fix shortening blocks in macros causing merged next line

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

6 years ago[X86] Extend load-op-store fusion merge to ADC/SBB.
Nirav Dave [Fri, 19 Jan 2018 15:37:57 +0000 (15:37 +0000)]
[X86] Extend load-op-store fusion merge to ADC/SBB.

Summary: Add handling of EFLAG input to X86 Load-op-store fusion checking.

Reviewers: craig.topper, RKSimon

Subscribers: llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D42128

llvm-svn: 322952

6 years ago[AArch64][SVE] Asm: Add support for RDVL/ADDVL/ADDPL instructions
Sander de Smalen [Fri, 19 Jan 2018 15:22:00 +0000 (15:22 +0000)]
[AArch64][SVE] Asm: Add support for RDVL/ADDVL/ADDPL instructions

Reviewers: fhahn, rengolin, t.p.northover, echristo, olista01, SjoerdMeijer

Reviewed By: SjoerdMeijer

Subscribers: SjoerdMeijer, aemerson, javed.absar, tschuett, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D41900

llvm-svn: 322951

6 years ago[CodeGenCXX] annotate a GEP to a derived class with 'inbounds' (PR35909)
Sanjay Patel [Fri, 19 Jan 2018 15:14:51 +0000 (15:14 +0000)]
[CodeGenCXX] annotate a GEP to a derived class with 'inbounds' (PR35909)

The standard says:
[expr.static.cast] p11: "If the prvalue of type “pointer to cv1 B” points to a B
that is actually a subobject of an object of type D, the resulting pointer points
to the enclosing object of type D. Otherwise, the behavior is undefined."

Therefore, the GEP must be inbounds.

This should solve the failure to optimize away a null check shown in PR35909:
https://bugs.llvm.org/show_bug.cgi?id=35909

Differential Revision: https://reviews.llvm.org/D42249

llvm-svn: 322950

6 years ago[clangd] Fix memcpy(?, null, 0) UB by switching to std::copy
Sam McCall [Fri, 19 Jan 2018 15:03:49 +0000 (15:03 +0000)]
[clangd] Fix memcpy(?, null, 0) UB by switching to std::copy

llvm-svn: 322949

6 years ago[X86][AVX] Add more variable permute tests for source vectors smaller than destination
Simon Pilgrim [Fri, 19 Jan 2018 14:55:22 +0000 (14:55 +0000)]
[X86][AVX] Add more variable permute tests for source vectors smaller than destination

llvm-svn: 322948

6 years agoCorrect typo after r322829
Kamil Rytarowski [Fri, 19 Jan 2018 14:47:49 +0000 (14:47 +0000)]
Correct typo after r322829

llvm-svn: 322947

6 years ago[SLP] Fix vectorization for tree with trunc to minimum required bit width.
Alexey Bataev [Fri, 19 Jan 2018 14:40:13 +0000 (14:40 +0000)]
[SLP] Fix vectorization for tree with trunc to minimum required bit width.

Summary:
If the vectorized tree has truncate to minimum required bit width and
the vector type of the cast operation after the truncation is the same
as the vector type of the cast operands, count cost of the vector cast
operation as 0, because this cast will be later removed.
Also, if the vectorization tree root operations are integer cast operations, do not consider them as candidates for truncation. It will just create extra number of the same vector/scalar operations, which will be removed by instcombiner.

Reviewers: RKSimon, spatel, mkuper, hfinkel, mssimpso

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D41948

llvm-svn: 322946

6 years ago[clangd] Merge index-provided completions with those from Sema.
Sam McCall [Fri, 19 Jan 2018 14:34:02 +0000 (14:34 +0000)]
[clangd] Merge index-provided completions with those from Sema.

Summary:
 - we match on USR, and do a field-by-field merge if both have results
 - scoring is post-merge, with both sets of information available
   (for now, sema priority is used if available, static score for index results)
 - limit is applied to the complete result set (previously index ignored limit)
 - CompletionItem is only produces for the returned results
 - If the user doesn't type a scope, we send the global scope for completion
   (we can improve this after D42073)

Reviewers: ioeric

Subscribers: klimek, ilya-biryukov, mgrang, cfe-commits

Differential Revision: https://reviews.llvm.org/D42181

llvm-svn: 322945

6 years ago[Support] - Check nullptr after allocation with malloc in MallocAllocator - Different...
Klaus Kretzschmar [Fri, 19 Jan 2018 14:17:53 +0000 (14:17 +0000)]
[Support] - Check nullptr after allocation with malloc in MallocAllocator - Differential Revision: reviews.llvm.org/D34753

llvm-svn: 322944

6 years ago[ELF] Keep tests from wrinting to the test directory.
Benjamin Kramer [Fri, 19 Jan 2018 14:15:13 +0000 (14:15 +0000)]
[ELF] Keep tests from wrinting to the test directory.

llvm-svn: 322943

6 years ago[AMDGPU][MC] Corrected parsing of image modifiers and encoding of image atomics
Dmitry Preobrazhensky [Fri, 19 Jan 2018 13:49:53 +0000 (13:49 +0000)]
[AMDGPU][MC] Corrected parsing of image modifiers and encoding of image atomics

See bugs
    35962: https://bugs.llvm.org/show_bug.cgi?id=35962
    35963: https://bugs.llvm.org/show_bug.cgi?id=35963

Differential Revision: https://reviews.llvm.org/D42184

Reviewers: vpykhtin, artem.tamazov, arsenm
llvm-svn: 322942

6 years ago[XRay] [compiler-rt] fix heap overflow by computing record pointers correctly
Martin Pelikan [Fri, 19 Jan 2018 13:18:40 +0000 (13:18 +0000)]
[XRay] [compiler-rt] fix heap overflow by computing record pointers correctly

Summary:
While there, unify InMemoryRawLog and InMemoryRawLogWithArg's coding style:
- swap libc's memcpy(3) for sanitizer's internal memcpy
- use basic pointer arithmetics to compute offsets from the first record
  entry in the pre-allocated buffer, which is always the appropriate type
  for the given function
- lose the local variable references as the TLD.* names fit just as well

Reviewers: eizan, kpw, dberris, dblaikie

Subscribers: #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D42289

llvm-svn: 322941

6 years agoFix line endings. NFCI.
Simon Pilgrim [Fri, 19 Jan 2018 12:09:17 +0000 (12:09 +0000)]
Fix line endings. NFCI.

llvm-svn: 322940

6 years ago[X86] Add KNL target to slow PMULLD tests
Simon Pilgrim [Fri, 19 Jan 2018 12:07:44 +0000 (12:07 +0000)]
[X86] Add KNL target to slow PMULLD tests

llvm-svn: 322939

6 years ago[X86] Add RDPID schedule test
Simon Pilgrim [Fri, 19 Jan 2018 12:06:49 +0000 (12:06 +0000)]
[X86] Add RDPID schedule test

llvm-svn: 322938

6 years ago[X86] Regenerate RDPMC intrinsic test
Simon Pilgrim [Fri, 19 Jan 2018 12:05:58 +0000 (12:05 +0000)]
[X86] Regenerate RDPMC intrinsic test

llvm-svn: 322937

6 years ago[CodeGen] Unify printing format of debug-location in both MIR and -debug
Francis Visoiu Mistrih [Fri, 19 Jan 2018 11:44:42 +0000 (11:44 +0000)]
[CodeGen] Unify printing format of debug-location in both MIR and -debug

Use "debug-location" instead of "; dbg:" in MI::print.

llvm-svn: 322936

6 years agoRemove Platform references from the Host module
Pavel Labath [Fri, 19 Jan 2018 11:10:54 +0000 (11:10 +0000)]
Remove Platform references from the Host module

Summary:
These were used by Host::LaunchProcess to "resolve" the executable it
was about to launch. The only parts of Platform::ResolveExecutable, which
seem to be relevant here are the FileSpec::ResolvePath and
ResolveExecutableLocation calls.

The rest (most) of that function deals with selecting an architecture
out of a fat binary and making sure we are able to create a Module with that
slice. These are reasonable actions when selecting a binary to debug,
but not for a generic process launching framework (it's technically even
wrong because we should be able to launch a binary with execute
permissions only, but trying to parse such file will obviously fail).

I remove the platform call by inlining the relevant FileSpec calls and
ignoring the rest of the Platform::ResolveExecutable code.  The
architecture found by the slice-searching code is being ignored already
anyway, as we use the one specified in the LaunchInfo, so the only
effect of this should be a different error message in case the
executable does not contain the requested architecture -- before we
would get an error message from the Platform class, but now we will get
an error from the actual posix_spawn syscall (this is only relevant on
mac, as it's the only target supporting fat binaries).

Launching targets for debugging should not be affected as here the
executable is pre-resolved at the point when the Target is created.

Reviewers: jingham, clayborg

Subscribers: lldb-commits, emaste

Differential Revision: https://reviews.llvm.org/D41902

llvm-svn: 322935

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Fri, 19 Jan 2018 10:55:29 +0000 (10:55 +0000)]
[NFC] fix trivial typos in comments

"the the" -> "the"

llvm-svn: 322934

6 years ago[ValueLattice] Use getters instead of direct accesses (NFC).
Florian Hahn [Fri, 19 Jan 2018 10:32:48 +0000 (10:32 +0000)]
[ValueLattice] Use getters instead of direct accesses (NFC).

Reviewers: reames, davide, anna

Reviewed By: reames, davide

Differential Revision: https://reviews.llvm.org/D42270

llvm-svn: 322933

6 years ago[ModRefInfo] Return NoModRef for Must and NoModRef.
Alina Sbirlea [Fri, 19 Jan 2018 10:26:40 +0000 (10:26 +0000)]
[ModRefInfo] Return NoModRef for Must and NoModRef.

Summary:
In ModRefInfo "Must" was introduced to track presence of MustAlias, but we still want to return NoModRef when there is neither Mod or Ref, even when MustAlias is found. Patch has small fixes to ensure this happens.
Minor cleanup to remove nesting for 2 if statements when calling getModRefInfo for 2 ImmutableCallSites.

Reviewers: sanjoy

Subscribers: jlebar, llvm-commits

Differential Revision: https://reviews.llvm.org/D42209

llvm-svn: 322932

6 years ago[InstCombine] Make foldSelectOpOp able to handle two-operand getelementptr
John Brawn [Fri, 19 Jan 2018 10:05:15 +0000 (10:05 +0000)]
[InstCombine] Make foldSelectOpOp able to handle two-operand getelementptr

Three (or more) operand getelementptrs could plausibly also be handled, but
handling only two-operand fits in easily with the existing BinaryOperator
handling.

Differential Revision: https://reviews.llvm.org/D39958

llvm-svn: 322930

6 years ago[clangd] Collect enum constants in SymbolCollector
Haojian Wu [Fri, 19 Jan 2018 09:35:55 +0000 (09:35 +0000)]
[clangd] Collect enum constants in SymbolCollector

Summary:
* ignore nameless symbols
* include enum constant declarataion

Reviewers: ilya-biryukov, jkorous-apple

Reviewed By: ilya-biryukov

Subscribers: ioeric, cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D42074

llvm-svn: 322929

6 years ago[builtins] Use FlushInstructionCache on windows on aarch64 as well
Martin Storsjo [Fri, 19 Jan 2018 07:34:46 +0000 (07:34 +0000)]
[builtins] Use FlushInstructionCache on windows on aarch64 as well

Generalize this handling to a separate toplevel ifdef (since any
windows case should use the same function), instead of indenting
the aarch64 case one step further.

Differential Revision: https://reviews.llvm.org/D42197

llvm-svn: 322928

6 years agoSplit MachineLICM into EarlyMachineLICM and MachineLICM; NFC
Matthias Braun [Fri, 19 Jan 2018 06:46:10 +0000 (06:46 +0000)]
Split MachineLICM into EarlyMachineLICM and MachineLICM; NFC

This avoids playing games with pseudo pass IDs and avoids using an
unreliable MRI::isSSA() check to determine whether register allocation
has happened.

Note that this renames:
- MachineLICMID -> EarlyMachineLICM
- PostRAMachineLICMID -> MachineLICMID
to be consistent with the EarlyTailDuplicate/TailDuplicate naming.

llvm-svn: 322927

6 years agoSplit TailDuplicatePass into pre- and post-RA variant; NFC
Matthias Braun [Fri, 19 Jan 2018 06:08:17 +0000 (06:08 +0000)]
Split TailDuplicatePass into pre- and post-RA variant; NFC

Split TailDuplicatePass into EarlyTailDuplicate and TailDuplicate. This
avoids playing games with fake pass IDs and using MRI::isSSA() to
determine pre-/post-RA state.

llvm-svn: 322926

6 years agoMove tests to the correct place
Matthias Braun [Fri, 19 Jan 2018 06:08:15 +0000 (06:08 +0000)]
Move tests to the correct place

test/CodeGen/MIR is for testing the MIR parser/printer. Tests for passes
and targets belong to test/CodeGen/TARGETNAME.

llvm-svn: 322925

6 years ago[X86] Make better use of instregex for cmovcc/setcc/jcc instructions in the Intel...
Craig Topper [Fri, 19 Jan 2018 05:47:32 +0000 (05:47 +0000)]
[X86] Make better use of instregex for cmovcc/setcc/jcc instructions in the Intel scheduler models.

Combine all the separate condition codes into a singular expression when possible.

llvm-svn: 322924

6 years agoRevert [CGP] Re-enable Select in complex addressing mode
Serguei Katkov [Fri, 19 Jan 2018 04:52:39 +0000 (04:52 +0000)]
Revert [CGP] Re-enable Select in complex addressing mode

One of buildbots failed. Revert for now till fix the issue.

llvm-svn: 322923

6 years ago[Fuchsia] Tests for the Fuzzer support in Fuchsia driver
Petr Hosek [Fri, 19 Jan 2018 04:08:06 +0000 (04:08 +0000)]
[Fuchsia] Tests for the Fuzzer support in Fuchsia driver

This adds driver tests for the Fuzzer support.

Differential Revision: https://reviews.llvm.org/D42283

llvm-svn: 322922

6 years ago[WebAssembly] Fix variable whose name is also a type name
Sam Clegg [Fri, 19 Jan 2018 03:31:07 +0000 (03:31 +0000)]
[WebAssembly] Fix variable whose name is also a type name

Some compilers don't like this and generate a warning.

llvm-svn: 322921

6 years agoWrote my own version of is_permutation; that was dominating the timings
Marshall Clow [Fri, 19 Jan 2018 03:17:45 +0000 (03:17 +0000)]
Wrote my own version of is_permutation; that was dominating the timings

llvm-svn: 322920

6 years agoAArch64: Fix emergency spillslot being out of reach for large callframes
Matthias Braun [Fri, 19 Jan 2018 03:16:36 +0000 (03:16 +0000)]
AArch64: Fix emergency spillslot being out of reach for large callframes

Re-commit of r322200: The testcase shouldn't hit machineverifiers
anymore with r322917 in place.

Large callframes (calls with several hundreds or thousands or
parameters) could lead to situations in which the emergency spillslot is
out of range to be addressed relative to the stack pointer.
This commit forces the use of a frame pointer in the presence of large
callframes.

This commit does several things:
- Compute max callframe size at the end of instruction selection.
- Add mirFileLoaded target callback. Use it to compute the max callframe size
  after loading a .mir file when the size wasn't specified in the file.
- Let TargetFrameLowering::hasFP() return true if there exists a
  callframe > 255 bytes.
- Always place the emergency spillslot close to FP if we have a frame
  pointer.
- Note that `useFPForScavengingIndex()` would previously return false
  when a base pointer was available leading to the emergency spillslot
  getting allocated late (that's the whole effect of this callback).
  Which made no sense to me so I took this case out: Even though the
  emergency spillslot is technically not referenced by FP in this case
  we still want it allocated early.

Differential Revision: https://reviews.llvm.org/D40876

llvm-svn: 322919

6 years ago[Refactor] Use enum instead of magic number in handleX86ForceAlignArgPointerAttr...
Hongbin Zheng [Fri, 19 Jan 2018 03:07:00 +0000 (03:07 +0000)]
[Refactor] Use enum instead of magic number in handleX86ForceAlignArgPointerAttr, NFC

Differential revision: https://reviews.llvm.org/D42227

llvm-svn: 322918

6 years agoAArch64: Omit callframe setup/destroy when not necessary
Matthias Braun [Fri, 19 Jan 2018 02:45:38 +0000 (02:45 +0000)]
AArch64: Omit callframe setup/destroy when not necessary

Do not create CALLSEQ_START/CALLSEQ_END when there is no callframe to
setup and the callframe size is 0.

- Fixes an invalid callframe nesting for byval arguments, which would
  look like this before this patch (as in `big-byval.ll`):
    ...
    ADJCALLSTACKDOWN 32768, 0, ...   # Setup for extfunc
    ...
    ADJCALLSTACKDOWN 0, 0, ...  # setup for memcpy
    ...
    BL &memcpy ...
    ADJCALLSTACKUP 0, 0, ...    # destroy for memcpy
    ...
    BL &extfunc
    ADJCALLSTACKUP 32768, 0, ...   # destroy for extfunc

- Saves us two instructions in the common case of zero-sized stackframes.
- Remove an unnecessary scheduling barrier (hence the small unittest
  changes).

Differential Revision: https://reviews.llvm.org/D42006

llvm-svn: 322917

6 years ago[Fuchsia] Enable Fuzzer as a supported sanitizer on Fuchsia
Petr Hosek [Fri, 19 Jan 2018 01:58:26 +0000 (01:58 +0000)]
[Fuchsia] Enable Fuzzer as a supported sanitizer on Fuchsia

libFuzzer has been ported to Fuchsia so enable it in the driver.

Differential Revision: https://reviews.llvm.org/D42275

llvm-svn: 322916

6 years ago[WebAssembly] Add test expectations for gcc C++ tests (gcc/testsuite/g++.dg)
Sam Clegg [Fri, 19 Jan 2018 01:40:52 +0000 (01:40 +0000)]
[WebAssembly] Add test expectations for gcc C++ tests (gcc/testsuite/g++.dg)

Differential Revision: https://reviews.llvm.org/D42226

llvm-svn: 322915

6 years ago[ORC] Revert r322913 while I investigate an ASan failure.
Lang Hames [Fri, 19 Jan 2018 01:40:26 +0000 (01:40 +0000)]
[ORC] Revert r322913 while I investigate an ASan failure.

llvm-svn: 322914

6 years ago[ORC] Redesign the JITSymbolResolver interface to support bulk queries.
Lang Hames [Fri, 19 Jan 2018 01:12:40 +0000 (01:12 +0000)]
[ORC] Redesign the JITSymbolResolver interface to support bulk queries.

Bulk queries reduce IPC/RPC overhead for cross-process JITing and expose
opportunities for parallel compilation.

The two new query methods are lookupFlags, which finds the flags for each of a
set of symbols; and lookup, which finds the address and flags for each of a
set of symbols. (See doxygen comments for more details.)

The existing JITSymbolResolver class is renamed LegacyJITSymbolResolver, and
modified to extend the new JITSymbolResolver class using the following scheme:

- lookupFlags is implemented by calling findSymbolInLogicalDylib for each of the
symbols, then returning the result of calling getFlags() on each of these
symbols. (Importantly: lookupFlags does NOT call getAddress on the returned
symbols, so lookupFlags will never trigger materialization, and lookupFlags will
never call findSymbol, so only symbols that are part of the logical dylib will
return results.)

- lookup is implemented by calling findSymbolInLogicalDylib for each symbol and
falling back to findSymbol if findSymbolInLogicalDylib returns a null result.
Assuming a symbol is found its getAddress method is called to materialize it and
the result (if getAddress succeeds) is stored in the result map, or the error
(if getAddress fails) is returned immediately from lookup. If any symbol is not
found then lookup returns immediately with an error.

This change will break any out-of-tree derivatives of JITSymbolResolver. This
can be fixed by updating those classes to derive from LegacyJITSymbolResolver
instead.

llvm-svn: 322913

6 years ago[X86] Add missing check for RDSEED to ICL, CNL, SKX sections of test/Preprocessor...
Craig Topper [Fri, 19 Jan 2018 00:28:42 +0000 (00:28 +0000)]
[X86] Add missing check for RDSEED to ICL, CNL, SKX sections of test/Preprocessor/predefined-arch-macros.c

llvm-svn: 322912

6 years ago[WebAssembly] Export the stack pointer when using --emit-relocs
Sam Clegg [Thu, 18 Jan 2018 23:57:55 +0000 (23:57 +0000)]
[WebAssembly] Export the stack pointer when using --emit-relocs

This solves the problem that --emit-relocs needs the stack-pointer
to be exported, in order to write out any relocations that reference
the __stack_pointer symbol by its symbol index.

Patch by Nicholas Wilson!

Differential Revision: https://reviews.llvm.org/D42237

llvm-svn: 322911

6 years ago[X86] Add intrinsic support for the RDPID instruction
Craig Topper [Thu, 18 Jan 2018 23:52:31 +0000 (23:52 +0000)]
[X86] Add intrinsic support for the RDPID instruction

This adds a new instrinsic to support the rdpid instruction. The implementation is a bit weird because the intrinsic is defined as always returning 32-bits, but the assembler support thinks the instruction produces a 64-bit register in 64-bit mode. But really it zeros the upper 32 bits. So I had to add separate patterns where 64-bit mode uses an extract_subreg.

Differential Revision: https://reviews.llvm.org/D42205

llvm-svn: 322910

6 years agoAdd a missing file header.
Rui Ueyama [Thu, 18 Jan 2018 23:46:28 +0000 (23:46 +0000)]
Add a missing file header.

llvm-svn: 322909

6 years ago[WebAssembly] Add missing function exports and SYM_INFO to --relocatable output
Sam Clegg [Thu, 18 Jan 2018 23:40:49 +0000 (23:40 +0000)]
[WebAssembly] Add missing function exports and SYM_INFO to --relocatable output

When writing relocatable files we were exporting for all globals
(including file-local syms), but not for functions. Oops. To be
consistent with non-relocatable output, all symbols (file-local
and global) should be exported. Any symbol targetted by further
relocations needs to be exported. The lack of local function
exports was just an omission, I think.

Second bug: Local symbol names can collide, causing an illegal
Wasm file to be generated! Oops again. This only previously affected
producing relocatable output from two files, where each had a global
with the same name. We need to "budge" the symbol names for locals
that are exported on relocatable output.

Third bug: LLD's relocatable output wasn't writing out any symbol
flags! Thus the local globals weren't being marked as local, and
the hidden flag was also stripped...

Added tests to exercise colliding local names with/without
relocatable flag

Patch by Nicholas Wilson!

Differential Revision: https://reviews.llvm.org/D42105

llvm-svn: 322908

6 years ago[InstSimplify] regenerate checks and add tests for commutes; NFC
Sanjay Patel [Thu, 18 Jan 2018 23:11:24 +0000 (23:11 +0000)]
[InstSimplify] regenerate checks and add tests for commutes; NFC

llvm-svn: 322907

6 years agoAMDGPU/SI: Fix typos in d16 support patch the buffer intrinsics.
Changpeng Fang [Thu, 18 Jan 2018 22:57:57 +0000 (22:57 +0000)]
AMDGPU/SI: Fix typos in d16 support patch the buffer intrinsics.

llvm-svn: 322906

6 years ago[CodeView] Add line numbers for inlined call sites
Reid Kleckner [Thu, 18 Jan 2018 22:55:43 +0000 (22:55 +0000)]
[CodeView] Add line numbers for inlined call sites

We did this for inline call site line tables, but we hadn't done it for
regular function line tables yet. This patch copies that logic from
encodeInlineLineTable.

llvm-svn: 322905

6 years ago[CodeView] Sink complex inline functions to .cpp file, NFC
Reid Kleckner [Thu, 18 Jan 2018 22:55:14 +0000 (22:55 +0000)]
[CodeView] Sink complex inline functions to .cpp file, NFC

I'm cleaning up this code before I attempt to fix a line table bug.

llvm-svn: 322904

6 years agoAMDGPU/SI: Add d16 support for image intrinsics.
Changpeng Fang [Thu, 18 Jan 2018 22:08:53 +0000 (22:08 +0000)]
AMDGPU/SI: Add d16 support for image intrinsics.

Summary:
  This patch implements d16 support for image load, image store and image sample intrinsics.

Reviewers:
  Matt, Brian.

Differential Revision:
  https://reviews.llvm.org/D3991

llvm-svn: 322903

6 years agoTypo fix SIBABRT -> SIGABRT.
Eric Christopher [Thu, 18 Jan 2018 21:45:51 +0000 (21:45 +0000)]
Typo fix SIBABRT -> SIGABRT.

Based on a patch by Henry Wong!

llvm-svn: 322902

6 years agoRemove TautologicalInRangeCompare from Extra and TautologicalCompare.
Nico Weber [Thu, 18 Jan 2018 21:40:27 +0000 (21:40 +0000)]
Remove TautologicalInRangeCompare from Extra and TautologicalCompare.

This removes the following (already default-off) warnings from -Wextra:
  -Wtautological-type-limit-compare,
  -Wtautological-unsigned-zero-compare
  -Wtautological-unsigned-enum-zero-compare

On the thread "[cfe-dev] -Wtautological-constant-compare issues", clang
code owners Richard Smith, John McCall, and Reid Kleckner as well as
libc++ code owner Marshall Clow stated that these new warnings are not
yet ready for prime time and shouldn't be part of -Wextra.

Furthermore, Vedant Kumar (Apple), Peter Hosek (Fuchsia), and me (Chromium)
expressed the same concerns (Vedant on that thread, Peter on
https://reviews.llvm.org/D39462, me on https://reviews.llvm.org/D41512).

So remove them from -Wextra, and remove TautologicalInRangeCompare from
TautologicalCompare too until they're usable with real-world code.

llvm-svn: 322901

6 years ago[test] Actually check the common parts in CodeGen/ARM/global-merge-external.ll. NFC.
Martin Storsjo [Thu, 18 Jan 2018 21:21:48 +0000 (21:21 +0000)]
[test] Actually check the common parts in CodeGen/ARM/global-merge-external.ll. NFC.

Previously, these parts weren't ever checked. The label patterns
need to be extended to match successfully on macho.

Differential Revision: https://reviews.llvm.org/D42126

llvm-svn: 322900

6 years agohalf_divide: Implement using x/y
Jan Vesely [Thu, 18 Jan 2018 21:12:06 +0000 (21:12 +0000)]
half_divide: Implement using x/y

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322899

6 years agohalf_tan: Implement using tan
Jan Vesely [Thu, 18 Jan 2018 21:12:04 +0000 (21:12 +0000)]
half_tan: Implement using tan

v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322898

6 years agohalf_sin: Implement using sin
Jan Vesely [Thu, 18 Jan 2018 21:12:01 +0000 (21:12 +0000)]
half_sin: Implement using sin

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322897

6 years agohalf_recip: Implement using 1/x
Jan Vesely [Thu, 18 Jan 2018 21:11:58 +0000 (21:11 +0000)]
half_recip: Implement using 1/x

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322896

6 years agohalf_log2: Implement using log2
Jan Vesely [Thu, 18 Jan 2018 21:11:56 +0000 (21:11 +0000)]
half_log2: Implement using log2

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322895

6 years agohalf_log10: Implement using log10
Jan Vesely [Thu, 18 Jan 2018 21:11:53 +0000 (21:11 +0000)]
half_log10: Implement using log10

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322894

6 years agohalf_log: Implement using log
Jan Vesely [Thu, 18 Jan 2018 21:11:50 +0000 (21:11 +0000)]
half_log: Implement using log

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322893

6 years agohalf_exp10: Implement using exp10
Jan Vesely [Thu, 18 Jan 2018 21:11:48 +0000 (21:11 +0000)]
half_exp10: Implement using exp10

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322892

6 years agohalf_exp2: Implement using exp2
Jan Vesely [Thu, 18 Jan 2018 21:11:45 +0000 (21:11 +0000)]
half_exp2: Implement using exp2

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322891

6 years agohalf_exp: Implement using exp
Jan Vesely [Thu, 18 Jan 2018 21:11:43 +0000 (21:11 +0000)]
half_exp: Implement using exp

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322890

6 years agohalf_cos: Implement using cos
Jan Vesely [Thu, 18 Jan 2018 21:11:40 +0000 (21:11 +0000)]
half_cos: Implement using cos

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322889

6 years agohalf_sqrt: Cleanup implementation
Jan Vesely [Thu, 18 Jan 2018 21:11:38 +0000 (21:11 +0000)]
half_sqrt: Cleanup implementation

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322888

6 years agohalf_rsqrt: Cleanup implementation
Jan Vesely [Thu, 18 Jan 2018 21:11:35 +0000 (21:11 +0000)]
half_rsqrt: Cleanup implementation

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322887

6 years ago[clang-tidy objc-property-declaration] Expand list of ObjC acronyms
Ben Hamilton [Thu, 18 Jan 2018 20:51:24 +0000 (20:51 +0000)]
[clang-tidy objc-property-declaration] Expand list of ObjC acronyms

Summary:
We were missing some pretty common acronyms in the camelCase
property name check objc-property-declaration.

This expands the list and sorts it lexicographically, so we can
avoid duplicates.

Test Plan: make -j12 check-clang-tools

Reviewers: Wizard, hokein, klimek

Reviewed By: Wizard

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D42253

llvm-svn: 322886