platform/upstream/llvm.git
6 years ago[X86] Use sse_load_f32/f64 to improve load folding of scalar vfscalefss/sd, vrcp14ss...
Craig Topper [Mon, 13 Nov 2017 08:07:33 +0000 (08:07 +0000)]
[X86] Use sse_load_f32/f64 to improve load folding of scalar vfscalefss/sd, vrcp14ss/sd, rsqrt14ss/sd instructions.

llvm-svn: 318022

6 years ago[X86] Regenerate test. NFC
Craig Topper [Mon, 13 Nov 2017 08:07:31 +0000 (08:07 +0000)]
[X86] Regenerate test. NFC

llvm-svn: 318021

6 years agoMI: Print ranges on MMO
Matt Arsenault [Mon, 13 Nov 2017 07:09:20 +0000 (07:09 +0000)]
MI: Print ranges on MMO

llvm-svn: 318020

6 years ago[X86] Use sse_load_f32/f64 to improve load folding for scalar VFPCLASS intrinsics.
Craig Topper [Mon, 13 Nov 2017 06:46:48 +0000 (06:46 +0000)]
[X86] Use sse_load_f32/f64 to improve load folding for scalar VFPCLASS intrinsics.

llvm-svn: 318019

6 years ago[X86] Add tests for missed opportunities to fold a 128-bit vector load into vfpclasss...
Craig Topper [Mon, 13 Nov 2017 06:46:46 +0000 (06:46 +0000)]
[X86] Add tests for missed opportunities to fold a 128-bit vector load into vfpclassss and vpfpclasssd.

llvm-svn: 318018

6 years agoAMDGPU: Preserve nuw in shl add ptr combine
Matt Arsenault [Mon, 13 Nov 2017 05:33:35 +0000 (05:33 +0000)]
AMDGPU: Preserve nuw in shl add ptr combine

llvm-svn: 318017

6 years ago[X86] Fix SQRTSS/SQRTSD/RCPSS/RCPSD intrinsics to use sse_load_f32/sse_load_f64 to...
Craig Topper [Mon, 13 Nov 2017 05:25:24 +0000 (05:25 +0000)]
[X86] Fix SQRTSS/SQRTSD/RCPSS/RCPSD intrinsics to use sse_load_f32/sse_load_f64 to increase load folding opportunities.

llvm-svn: 318016

6 years ago[X86] Add tests for full vector loads to fold-load-unops.ll.
Craig Topper [Mon, 13 Nov 2017 05:25:23 +0000 (05:25 +0000)]
[X86] Add tests for full vector loads to fold-load-unops.ll.

We should be able to fold a full vector load into a scalar intrinsic. Since it's legal to narrow a load.

llvm-svn: 318015

6 years ago[X86] Regenerate fold-load-unops.ll and add and avx512f command line.
Craig Topper [Mon, 13 Nov 2017 05:25:21 +0000 (05:25 +0000)]
[X86] Regenerate fold-load-unops.ll and add and avx512f command line.

llvm-svn: 318014

6 years agoAMDGPU: Fix multi-use shl/add combine
Matt Arsenault [Mon, 13 Nov 2017 05:11:54 +0000 (05:11 +0000)]
AMDGPU: Fix multi-use shl/add combine

This was using a custom function that didn't handle the
addressing modes properly for private. Use
isLegalAddressingMode to avoid duplicating this.

Additionally, skip the combine if there is only one use
since the standard combine will handle it.

llvm-svn: 318013

6 years agoPut the status in the wrong column
Marshall Clow [Mon, 13 Nov 2017 04:15:39 +0000 (04:15 +0000)]
Put the status in the wrong column

llvm-svn: 318012

6 years agoImplement P0550R2: Transformation Trait remove_cvref
Marshall Clow [Mon, 13 Nov 2017 03:59:22 +0000 (03:59 +0000)]
Implement P0550R2: Transformation Trait remove_cvref

llvm-svn: 318011

6 years ago[X86] Attempt to fix signed and unsigned comparison warning.
Craig Topper [Mon, 13 Nov 2017 02:19:13 +0000 (02:19 +0000)]
[X86] Attempt to fix signed and unsigned comparison warning.

llvm-svn: 318010

6 years ago[X86] Use sse_load_f32/f64 in patterns for the memory forms of VRNDSCALESS/SD.
Craig Topper [Mon, 13 Nov 2017 02:03:01 +0000 (02:03 +0000)]
[X86] Use sse_load_f32/f64 in patterns for the memory forms of VRNDSCALESS/SD.

llvm-svn: 318009

6 years ago[X86] Use EVEX encoded VRNDSCALE instructions to implement the legacy round intrinsics.
Craig Topper [Mon, 13 Nov 2017 02:03:00 +0000 (02:03 +0000)]
[X86] Use EVEX encoded VRNDSCALE instructions to implement the legacy round intrinsics.

The VRNDSCALE instructions implement a superset of the (V)ROUND instructions. They are equivalent if the upper 4-bits of the immediate are 0.

This patch lowers the legacy intrinsics to the VRNDSCALE ISD node and masks the upper bits of the immediate to 0. This allows us to take advantage of the larger register encoding space.

We should maybe consider converting VRNDSCALE back to VROUND in the EVEX to VEX pass if the extended registers are not being used.

I notice some load folding opportunities being missed for the VRNDSCALESS/SD instructions that I'll try to fix in future patches.

llvm-svn: 318008

6 years ago[X86] Split VRNDSCALE/VREDUCE/VGETMANT/VRANGE ISD nodes into versions with and withou...
Craig Topper [Mon, 13 Nov 2017 02:02:58 +0000 (02:02 +0000)]
[X86] Split VRNDSCALE/VREDUCE/VGETMANT/VRANGE ISD nodes into versions with and without the rounding operand. NFCI

I want to reuse the VRNDSCALE node for the legacy SSE rounding intrinsics so that those intrinsics can use EVEX instructions. All of these nodes share tablegen multiclasses so I split them all so that they all remain similar in their implementations.

llvm-svn: 318007

6 years agoFix some misc. -enable-var-scope violations
Matt Arsenault [Mon, 13 Nov 2017 01:47:52 +0000 (01:47 +0000)]
Fix some misc. -enable-var-scope violations

llvm-svn: 318006

6 years agoAMDGPU: Select d16 loads into low component of register
Matt Arsenault [Mon, 13 Nov 2017 00:22:09 +0000 (00:22 +0000)]
AMDGPU: Select d16 loads into low component of register

llvm-svn: 318005

6 years agoAMDGPU: Fix -enable-var-scope violations
Matt Arsenault [Sun, 12 Nov 2017 23:53:44 +0000 (23:53 +0000)]
AMDGPU: Fix -enable-var-scope violations

llvm-svn: 318004

6 years agoAMDGPU: Fix missing gfx9 atomic inc/dec tests
Matt Arsenault [Sun, 12 Nov 2017 23:40:12 +0000 (23:40 +0000)]
AMDGPU: Fix missing gfx9 atomic inc/dec tests

The global instructions weren't tested. Plus there
were also some -enable-var-scope violations and
broken check prefixes.

llvm-svn: 318003

6 years ago[sanitizer] Simplify stack check in accert.cc
Vitaly Buka [Sun, 12 Nov 2017 21:15:19 +0000 (21:15 +0000)]
[sanitizer] Simplify stack check in accert.cc
Somehow on arm bots stack does not include main.

llvm-svn: 318002

6 years ago[sanitizer] Try to see test output on armv7
Vitaly Buka [Sun, 12 Nov 2017 20:25:14 +0000 (20:25 +0000)]
[sanitizer] Try to see test output on armv7

llvm-svn: 318001

6 years agoTwo more papers from Albuquerque
Marshall Clow [Sun, 12 Nov 2017 18:52:16 +0000 (18:52 +0000)]
Two more papers from Albuquerque

llvm-svn: 318000

6 years ago[X86] Add an X86ISD::RANGES opcode to use for the scalar intrinsics.
Craig Topper [Sun, 12 Nov 2017 18:51:09 +0000 (18:51 +0000)]
[X86] Add an X86ISD::RANGES opcode to use for the scalar intrinsics.

This fixes a bug where we selected packed instructions for scalar intrinsics.

llvm-svn: 317999

6 years ago[X86] Add test cases and command lines demonstrating how we accidentally select vrang...
Craig Topper [Sun, 12 Nov 2017 18:51:08 +0000 (18:51 +0000)]
[X86] Add test cases and command lines demonstrating how we accidentally select vrangeps/vrangepd from vrangess/vrangesd instrinsics when the rounding mode is CUR_DIRECTION

llvm-svn: 317998

6 years ago[X86] Remove some no longer needed intrinsic lowering code.
Craig Topper [Sun, 12 Nov 2017 18:51:06 +0000 (18:51 +0000)]
[X86] Remove some no longer needed intrinsic lowering code.

llvm-svn: 317997

6 years agoUpdated C++2a status page with new features/defects approved in Albuquerque.
Marshall Clow [Sun, 12 Nov 2017 18:48:42 +0000 (18:48 +0000)]
Updated C++2a status page with new features/defects approved in Albuquerque.

llvm-svn: 317996

6 years ago[llvm] Remove redundant return [NFC]
Mandeep Singh Grang [Sun, 12 Nov 2017 03:47:50 +0000 (03:47 +0000)]
[llvm] Remove redundant return [NFC]

Reviewers: davidxl, olista01, Eugene.Zelenko

Reviewed By: Eugene.Zelenko

Subscribers: sdardis, javed.absar, llvm-commits

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

llvm-svn: 317995

6 years ago[InstCombine] Teach visitICmpInst to not break integer absolute value idioms
Craig Topper [Sun, 12 Nov 2017 02:28:21 +0000 (02:28 +0000)]
[InstCombine] Teach visitICmpInst to not break integer absolute value idioms

Summary:
This patch adds an early out to visitICmpInst if we are looking at a compare as part of an integer absolute value idiom. Similar is already done for min/max.

In the particular case I observed in a benchmark we had an absolute value of a load from an indexed global. We simplified the compare using foldCmpLoadFromIndexedGlobal into a magic bit vector, a shift, and an and. But the load result was still used for the select and the negate part of the absolute valute idiom. So we overcomplicated the code and lost the ability to recognize it as an absolute value.

I've chosen a simpler case for the test here.

Reviewers: spatel, davide, majnemer

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 317994

6 years agoFix AST matcher documentation typo
Dave Lee [Sat, 11 Nov 2017 23:53:27 +0000 (23:53 +0000)]
Fix AST matcher documentation typo

llvm-svn: 317993

6 years agoAdd ObjC exception statement AST matchers
Dave Lee [Sat, 11 Nov 2017 22:46:15 +0000 (22:46 +0000)]
Add ObjC exception statement AST matchers

Summary: Add AST matchers for Objective-C @throw, @try, @catch and @finally.

Reviewers: aaron.ballman, malcolm.parsons, alexshap, compnerd

Reviewed By: aaron.ballman

Subscribers: cfe-commits, klimek

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

llvm-svn: 317992

6 years ago[X86] Use vrndscaleps/pd for 128/256 ffloor/ftrunc/fceil/fnearbyint/frint when avx512...
Craig Topper [Sat, 11 Nov 2017 21:44:51 +0000 (21:44 +0000)]
[X86] Use vrndscaleps/pd for 128/256 ffloor/ftrunc/fceil/fnearbyint/frint when avx512vl is enabled.

This matches what we do for scalar and 512-bit types.

llvm-svn: 317991

6 years ago[X86] Remove avx512-round.ll. The 512-bit rounding tests are now in vec_floor.ll...
Craig Topper [Sat, 11 Nov 2017 21:44:50 +0000 (21:44 +0000)]
[X86] Remove avx512-round.ll. The 512-bit rounding tests are now in vec_floor.ll with 128/256 sizes.

llvm-svn: 317990

6 years ago[X86] Add avx512vl command line to vec_floor.ll. Add 512-bit test cases.
Craig Topper [Sat, 11 Nov 2017 21:44:49 +0000 (21:44 +0000)]
[X86] Add avx512vl command line to vec_floor.ll. Add 512-bit test cases.

llvm-svn: 317989

6 years ago[X86] Add avx512f command line to rounding-ops.ll
Craig Topper [Sat, 11 Nov 2017 21:44:48 +0000 (21:44 +0000)]
[X86] Add avx512f command line to rounding-ops.ll

llvm-svn: 317988

6 years ago[X86] Regenerate rounding-ops.ll with update_llc_test_checks.py
Craig Topper [Sat, 11 Nov 2017 21:44:47 +0000 (21:44 +0000)]
[X86] Regenerate rounding-ops.ll with update_llc_test_checks.py

llvm-svn: 317987

6 years ago[python] [tests] Fix test_linkage for unique external linkage
Michal Gorny [Sat, 11 Nov 2017 20:01:41 +0000 (20:01 +0000)]
[python] [tests] Fix test_linkage for unique external linkage

Starting with r314037, anonymous namespaces no longer give
unique-external linkage to variables. However, this linkage can still be
achieved by using a type which is not exterally visible,
e.g. through being declared in an anonymous namespace but used outside
it. Fix the test to take advantage of that.

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

llvm-svn: 317986

6 years ago[X86] Attempt to match multiple binary reduction ops at once. NFCI
Simon Pilgrim [Sat, 11 Nov 2017 18:16:55 +0000 (18:16 +0000)]
[X86] Attempt to match multiple binary reduction ops at once. NFCI

matchBinOpReduction currently matches against a single opcode, but we already have a case where we repeat calls to try to match against AND/OR and I'll be shortly adding another case for SMAX/SMIN/UMAX/UMIN (D39729).

This NFCI patch alters matchBinOpReduction to try and pattern match against any of the provided list of candidate bin ops at once to save time.

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

llvm-svn: 317985

6 years agoAdjust r316292 - remove the anonymous union for sharing a bitfield in FunctionDecl.
Faisal Vali [Sat, 11 Nov 2017 18:02:29 +0000 (18:02 +0000)]
Adjust r316292 - remove the anonymous union for sharing a bitfield in FunctionDecl.

The anonymous union did NOT save us storage, but instead behaved as if we added an additional integer data member to FunctionDecl.

For additional context, the anonymous union renders the bit fields as non-adjacent and prevents them from sharing the same 'memory location' (i.e. bit-storage) by requiring the anonymous union object to be appropriately aligned.

This was confirmed through discussion with Richard Smith in Albuquerque (ISO C++ Meeting)

https://reviews.llvm.org/rL316292

llvm-svn: 317984

6 years ago[cxx_status] Add resolution of CWG issue 1581, since it's an important, visible change.
Richard Smith [Sat, 11 Nov 2017 18:00:16 +0000 (18:00 +0000)]
[cxx_status] Add resolution of CWG issue 1581, since it's an important, visible change.

llvm-svn: 317983

6 years ago[cxx_status] Update for moved Albuquerque papers.
Richard Smith [Sat, 11 Nov 2017 17:54:46 +0000 (17:54 +0000)]
[cxx_status] Update for moved Albuquerque papers.

llvm-svn: 317982

6 years ago[coroutines] Promote cleanup.dest.slot allocas to registers to avoid storing it in...
Gor Nishanov [Sat, 11 Nov 2017 17:00:43 +0000 (17:00 +0000)]
[coroutines] Promote cleanup.dest.slot allocas to registers to avoid storing it in the coroutine frame

Summary:
We don't want to store cleanup dest slot saved into the coroutine frame (as some of the cleanup code may
access them after coroutine frame destroyed).

This is an alternative to https://reviews.llvm.org/D37093

It is possible to do this for all functions, but, cursory check showed that in -O0, we get slightly longer function (by 1-3 instructions), thus, we are only limiting cleanup.dest.slot elimination to coroutines.

Reviewers: rjmccall, hfinkel, eric_niebler

Reviewed By: eric_niebler

Subscribers: EricWF, cfe-commits

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

llvm-svn: 317981

6 years ago[OMPT] Provide initialization for Mac OS X
Jonas Hahnfeld [Sat, 11 Nov 2017 13:59:48 +0000 (13:59 +0000)]
[OMPT] Provide initialization for Mac OS X

Traditionally, the library had a weak symbol for ompt_start_tool()
that served as fallback and disabled OMPT if called. Tools could
provide their own version and replace the default implementation
to register callbacks and lookup functions. This mechanism has
worked reasonably well on Linux systems where this interface was
initially developed.

On Darwin / Mac OS X the situation is a bit more complicated and
the weak symbol doesn't work out-of-the-box. In my tests, the
library with the tool needed to link against the OpenMP runtime
to make the process work. This would effectively mean that a tool
needed to choose a runtime library whereas one design goal of the
interface was to allow tools that are agnostic of the runtime.

The solution is to use dlsym() with the argument RTLD_DEFAULT so
that static implementations of ompt_start_tool() are found in the
main executable. This works because the linker on Mac OS X includes
all symbols of an executable in the global symbol table by default.
To use the same code path on Linux, the application would need to
be built with -Wl,--export-dynamic. To avoid this restriction, we
continue to use weak symbols on Linux systems as before.

Finally this patch extends the existing test to cover all possible
ways of initializing the tool as described by the standard. It
also fixes ompt_finalize() to not call omp_get_thread_num() when
the library is shut down which resulted in hangs on Darwin.
The changes have been tested on Linux to make sure that it passes
the current tests as well as the newly extended one.

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

llvm-svn: 317980

6 years ago[libomptarget] Build all libraries in libomptarget/
Jonas Hahnfeld [Sat, 11 Nov 2017 13:59:45 +0000 (13:59 +0000)]
[libomptarget] Build all libraries in libomptarget/

In standalone build, plugins where previously built in their
subdirectory in plugins/ and tests couldn't find them.

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

llvm-svn: 317979

6 years agoCorrect NetBSD build issue
Kamil Rytarowski [Sat, 11 Nov 2017 09:29:21 +0000 (09:29 +0000)]
Correct NetBSD build issue

Cast SIG_IGN to (uptr).

SIG_IGN is defined on NetBSD as a function pointer and cannot be
assigned to an integer as it is.

sys/signal.h:#define       SIG_IGN         ((void (*)(int))  1)

llvm-svn: 317978

6 years ago[X86] Add scalar register class versions of VRNDSCALE instructions and rename the...
Craig Topper [Sat, 11 Nov 2017 08:24:15 +0000 (08:24 +0000)]
[X86] Add scalar register class versions of VRNDSCALE instructions and rename the existing versions to _Int.

This is consistent with out normal implementation of scalar instructions.

While there disable load folding for the patterns with IMPLICIT_DEF unless optimizing for size which is also our standard practice.

llvm-svn: 317977

6 years ago[X86] Regenerate avx512-round.ll test.
Craig Topper [Sat, 11 Nov 2017 08:24:13 +0000 (08:24 +0000)]
[X86] Regenerate avx512-round.ll test.

llvm-svn: 317976

6 years ago[X86] Inline some SDNode operand multiclass operands that don't vary. NFC
Craig Topper [Sat, 11 Nov 2017 08:24:12 +0000 (08:24 +0000)]
[X86] Inline some SDNode operand multiclass operands that don't vary. NFC

llvm-svn: 317975

6 years ago[X86] Set the execution domain for VFPCLASS to SSEPackedSingle/Double.
Craig Topper [Sat, 11 Nov 2017 06:57:44 +0000 (06:57 +0000)]
[X86] Set the execution domain for VFPCLASS to SSEPackedSingle/Double.

llvm-svn: 317974

6 years ago[X86] Set the execution domain for vptest instruction to the integer domain.
Craig Topper [Sat, 11 Nov 2017 06:19:12 +0000 (06:19 +0000)]
[X86] Set the execution domain for vptest instruction to the integer domain.

llvm-svn: 317973

6 years ago[globalisel][tablegen] Import signextload and zeroextload.
Daniel Sanders [Sat, 11 Nov 2017 03:23:44 +0000 (03:23 +0000)]
[globalisel][tablegen] Import signextload and zeroextload.

Allow a pattern rewriter to be installed in CodeGenDAGPatterns and use it to
correct situations where SelectionDAG and GlobalISel disagree on
representation. For example, it would rewrite:
  (sextload:i32 $ptr)<<unindexedload>><<sextload>><<sextloadi16>
to:
  (sext:i32 (load:i16 $ptr)<<unindexedload>>)

I'd have preferred to replace the fragments and have the expansion happen
naturally as part of PatFrag expansion but the type inferencing system can't
cope with loads of types narrower than those mentioned in register classes.
This is because the SDTCisInt's on the sext constrain both the result and
operand to the 'legal' integer types (where legal is defined as 'a register
class can contain the type') which immediately rules the narrower types out.
Several targets (those with only one legal integer type) would then go on to
crash on the SDTCisOpSmallerThanOp<> when it removes all the possible types
for the result of the extend.

Also, improve isObviouslySafeToFold() slightly to automatically return true for
neighbouring instructions. There can't be any re-ordering problems if
re-ordering isn't happenning. We'll need to improve it further to handle
sign/zero-extending loads when the extend and load aren't immediate neighbours
though.

llvm-svn: 317971

6 years ago[msan] Fix signal chaining
Vitaly Buka [Sat, 11 Nov 2017 03:03:34 +0000 (03:03 +0000)]
[msan] Fix signal chaining

Return internally stored handlers only if handlers is set to wrapper

llvm-svn: 317970

6 years ago[ubsan-minimal] Get rid of the libc++ dependency.
Evgeniy Stepanov [Sat, 11 Nov 2017 02:32:02 +0000 (02:32 +0000)]
[ubsan-minimal] Get rid of the libc++ dependency.

Summary:
Use -nodefaultlibs.
Replace std:atomic with sanitizer atomics.

Reviewers: vitalybuka, kongyi, EricWF

Subscribers: mgorny, llvm-commits

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

llvm-svn: 317969

6 years ago[X86] Correct the execution domain on ROUND/VROUND instructions.
Craig Topper [Sat, 11 Nov 2017 02:26:05 +0000 (02:26 +0000)]
[X86] Correct the execution domain on ROUND/VROUND instructions.

llvm-svn: 317968

6 years ago[X86] Remove the default for one of the arguments to some tablegen multiclasses. NFC
Craig Topper [Sat, 11 Nov 2017 02:26:02 +0000 (02:26 +0000)]
[X86] Remove the default for one of the arguments to some tablegen multiclasses. NFC

No one ever uses this default and probably shouldn't since it sets the execution domain to generic.

llvm-svn: 317967

6 years agollvm/Support/TargetParser.h: Fix -fmodules build in rL317900.
NAKAMURA Takumi [Sat, 11 Nov 2017 02:05:47 +0000 (02:05 +0000)]
llvm/Support/TargetParser.h: Fix -fmodules build in rL317900.

llvm-svn: 317966

6 years agoSimplify. NFC.
Rafael Espindola [Sat, 11 Nov 2017 01:59:47 +0000 (01:59 +0000)]
Simplify. NFC.

copyFrom doesn't copy the Binding, so this was a nop.

llvm-svn: 317965

6 years agoRemove unused argument from RUN line.
Rafael Espindola [Sat, 11 Nov 2017 01:56:45 +0000 (01:56 +0000)]
Remove unused argument from RUN line.

llvm-svn: 317964

6 years ago[sanitizer] Include stack trace check into signal tests
Vitaly Buka [Sat, 11 Nov 2017 01:30:03 +0000 (01:30 +0000)]
[sanitizer] Include stack trace check into signal tests

llvm-svn: 317963

6 years ago[CUDA] Fix std::min on device side to return the min, not the max.
Justin Lebar [Sat, 11 Nov 2017 01:25:44 +0000 (01:25 +0000)]
[CUDA] Fix std::min on device side to return the min, not the max.

Summary:
How embarrassing.

This is tested in the test-suite -- fix to come there in a separate
patch.

Reviewers: tra

Subscribers: sanjoy, cfe-commits

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

llvm-svn: 317961

6 years agoAdd CLANG_DEFAULT_OBJCOPY to allow Clang to use llvm-objcopy for dwarf fission
Jake Ehrlich [Sat, 11 Nov 2017 01:15:41 +0000 (01:15 +0000)]
Add CLANG_DEFAULT_OBJCOPY to allow Clang to use llvm-objcopy for dwarf fission

llvm-objcopy is getting to where it can be used in non-trivial ways
(such as for dwarf fission in clang). It now supports dwarf fission but
this feature hasn't been thoroughly tested yet. This change allows
people to optionally build clang to use llvm-objcopy rather than GNU
objcopy. By default GNU objcopy is still used so nothing should change.

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

llvm-svn: 317960

6 years agoRevert "[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang"
Teresa Johnson [Sat, 11 Nov 2017 01:06:41 +0000 (01:06 +0000)]
Revert "[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang"

This reverts commit r317951 and r317952. The new test is aborting on
some bots and I'll need to investigate later.

llvm-svn: 317959

6 years ago[ubsan] Fix ubsan tests broken by linking as C instead of C++
Vitaly Buka [Sat, 11 Nov 2017 01:01:09 +0000 (01:01 +0000)]
[ubsan] Fix ubsan tests broken by linking as C instead of C++

llvm-svn: 317958

6 years agoHandle lambda captures of variable length arrays in profiling and printing.
Richard Trieu [Sat, 11 Nov 2017 00:54:25 +0000 (00:54 +0000)]
Handle lambda captures of variable length arrays in profiling and printing.

From http://reviews.llvm.org/D4368 these cases were thought to not be reachable
and the checks removed before the rest of the code was committed in r216649.
However, these cases are reachable and the checks are added back.

llvm-svn: 317957

6 years agoDon't produce a duplicated __wrap_foo if there is no __real_foo.
Rafael Espindola [Sat, 11 Nov 2017 00:53:52 +0000 (00:53 +0000)]
Don't produce a duplicated __wrap_foo if there is no __real_foo.

This fixes a regression from r317426.

llvm-svn: 317956

6 years ago[AMDGPU] Correct targets that support XNACK
Tony Tye [Sat, 11 Nov 2017 00:50:32 +0000 (00:50 +0000)]
[AMDGPU] Correct targets that support XNACK

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

llvm-svn: 317955

6 years agoRemove unused option in test. NFC.
Rafael Espindola [Sat, 11 Nov 2017 00:39:32 +0000 (00:39 +0000)]
Remove unused option in test. NFC.

llvm-svn: 317954

6 years ago[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings;...
Eugene Zelenko [Sat, 11 Nov 2017 00:08:50 +0000 (00:08 +0000)]
[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 317953

6 years agoAdd x86-registered-target to REQUIRES for new test
Teresa Johnson [Sat, 11 Nov 2017 00:05:39 +0000 (00:05 +0000)]
Add x86-registered-target to REQUIRES for new test

Should fix test added in r317951.

llvm-svn: 317952

6 years ago[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang
Teresa Johnson [Fri, 10 Nov 2017 23:37:39 +0000 (23:37 +0000)]
[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang

Summary:
The LTO Config field wasn't being set when invoking a ThinLTO backend
via clang (i.e. for distributed builds).

Reviewers: danielcdh

Subscribers: mehdi_amini, inglorion, eraman, cfe-commits

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

llvm-svn: 317951

6 years ago[SelectionDAG] Make getUniformBase in SelectionDAGBuilder fail if any of the middle...
Craig Topper [Fri, 10 Nov 2017 23:36:56 +0000 (23:36 +0000)]
[SelectionDAG] Make getUniformBase in SelectionDAGBuilder fail if any of the middle GEP indices are non-constant.

This is a fix for a bug in r317947. We were supposed to check that all the indices are are constant 0, but instead we're only make sure that indices that are constant are 0. Non-constant indices are being ignored.

llvm-svn: 317950

6 years agoUpdate test_debuginfo.pl script to point to new tree location.
Zachary Turner [Fri, 10 Nov 2017 23:13:14 +0000 (23:13 +0000)]
Update test_debuginfo.pl script to point to new tree location.

llvm-svn: 317949

6 years ago[sanitizer] Remove unnecessary attribute hidden.
Evgeniy Stepanov [Fri, 10 Nov 2017 22:52:44 +0000 (22:52 +0000)]
[sanitizer] Remove unnecessary attribute hidden.

This should fix windows build of compiler-rt broken in r317943.

The attribute is unnecessary because since GetMaxVirtualAddress was split in two,
we no longer use common_flags() in the ifunc resolver context.

llvm-svn: 317948

6 years ago[SelectionDAG] Teach SelectionDAGBuilder's getUniformBase for gather/scatter handling...
Craig Topper [Fri, 10 Nov 2017 22:50:50 +0000 (22:50 +0000)]
[SelectionDAG] Teach SelectionDAGBuilder's getUniformBase for gather/scatter handling to accept GEPs with more than 2 operands if the middle operands are all 0s

Currently we can only get a uniform base from a simple GEP with 2 operands. This causes us to miss address folding opportunities for simple global array accesses as the test case shows.

This patch adds support for larger GEPs if the other indices are 0 since those don't require any additional computations to be inserted.

We may also want to handle constant splats of zero here, but I'm leaving that for future work when I have a real world example.

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

llvm-svn: 317947

6 years ago[tsan] Move out more types to sanitizer_common
Vitaly Buka [Fri, 10 Nov 2017 22:41:52 +0000 (22:41 +0000)]
[tsan] Move out more types to sanitizer_common

https://github.com/google/sanitizers/issues/637

llvm-svn: 317946

6 years agoAdded a way to dump the full paths to all source files in a module that has debug...
Greg Clayton [Fri, 10 Nov 2017 22:39:07 +0000 (22:39 +0000)]
Added a way to dump the full paths to all source files in a module that has debug info.

llvm-svn: 317945

6 years agoRemove declaration of EmitMCountInstrumentation(). NFC
Hans Wennborg [Fri, 10 Nov 2017 22:34:23 +0000 (22:34 +0000)]
Remove declaration of EmitMCountInstrumentation(). NFC

The definition was removed in r280355.

llvm-svn: 317944

6 years ago[asan] Use dynamic shadow on 32-bit Android.
Evgeniy Stepanov [Fri, 10 Nov 2017 22:27:48 +0000 (22:27 +0000)]
[asan] Use dynamic shadow on 32-bit Android.

Summary:
The following kernel change has moved ET_DYN base to 0x4000000 on arm32:
https://marc.info/?l=linux-kernel&m=149825162606848&w=2

Switch to dynamic shadow base to avoid such conflicts in the future.

Reserve shadow memory in an ifunc resolver, but don't use it in the instrumentation
until PR35221 is fixed. This will eventually let use save one load per function.

Reviewers: kcc

Subscribers: aemerson, srhines, kubamracek, kristof.beyls, hiraditya, llvm-commits

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

llvm-svn: 317943

6 years ago[llvm-cvtres] Add support for ARM64
Martin Storsjo [Fri, 10 Nov 2017 22:27:41 +0000 (22:27 +0000)]
[llvm-cvtres] Add support for ARM64

Also change some default cases into llvm_unreachable in
WindowsResourceCOFFWriter, to make it easier to find if they
are triggerd from within e.g. lld, which supported ARM64 earlier
than llvm-cvtres did.

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

llvm-svn: 317942

6 years agonative_exp10: Switch implementation to llvm intrinsic
Jan Vesely [Fri, 10 Nov 2017 22:16:41 +0000 (22:16 +0000)]
native_exp10: Switch implementation to llvm intrinsic

v2: Use native_log2 instead of wrong constant

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317941

6 years agonative_sqrt: Switch implementation to llvm intrinsic
Jan Vesely [Fri, 10 Nov 2017 22:16:39 +0000 (22:16 +0000)]
native_sqrt: Switch implementation to llvm intrinsic

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317940

6 years agonative_sin: Switch implementation to llvm intrinsic
Jan Vesely [Fri, 10 Nov 2017 22:16:36 +0000 (22:16 +0000)]
native_sin: Switch implementation to llvm intrinsic

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317939

6 years agonative_cos: Switch implementation to llvm intrinsic
Jan Vesely [Fri, 10 Nov 2017 22:16:33 +0000 (22:16 +0000)]
native_cos: Switch implementation to llvm intrinsic

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317938

6 years agonative_exp2: Switch implementation to llvm intrinsic
Jan Vesely [Fri, 10 Nov 2017 22:16:31 +0000 (22:16 +0000)]
native_exp2: Switch implementation to llvm intrinsic

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317937

6 years agonative_exp: Switch implementation to llvm intrinsic
Jan Vesely [Fri, 10 Nov 2017 22:16:28 +0000 (22:16 +0000)]
native_exp: Switch implementation to llvm intrinsic

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317936

6 years agoamdgpu: Add workaround for unimplemented llvm.exp intrinsic
Jan Vesely [Fri, 10 Nov 2017 22:16:25 +0000 (22:16 +0000)]
amdgpu: Add workaround for unimplemented llvm.exp intrinsic

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317935

6 years agonative_log10: Switch to generic native intrinsic inc file
Jan Vesely [Fri, 10 Nov 2017 22:16:22 +0000 (22:16 +0000)]
native_log10: Switch to generic native intrinsic inc file

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317934

6 years agonative_log: Switch to generic native intrinsic inc file
Jan Vesely [Fri, 10 Nov 2017 22:16:20 +0000 (22:16 +0000)]
native_log: Switch to generic native intrinsic inc file

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317933

6 years agonative_log2: Switch to generic native intrinsic inc file
Jan Vesely [Fri, 10 Nov 2017 22:16:15 +0000 (22:16 +0000)]
native_log2: Switch to generic native intrinsic inc file

v2: Add __CLC_XCONCAT instead of function name redirection
    Use __CLC_XCONCAT for intrinsic functions as well

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317932

6 years agoFix for skipped CMake configuration on debuginfo-tests.
Zachary Turner [Fri, 10 Nov 2017 22:12:04 +0000 (22:12 +0000)]
Fix for skipped CMake configuration on debuginfo-tests.

This should have been part of the change to debuginfo-tests, but
it was left out.  This should get the buildbots green.

llvm-svn: 317931

6 years agosanitizer_common: Try looking up symbols with RTLD_DEFAULT if RTLD_NEXT does not...
Peter Collingbourne [Fri, 10 Nov 2017 22:09:37 +0000 (22:09 +0000)]
sanitizer_common: Try looking up symbols with RTLD_DEFAULT if RTLD_NEXT does not work.

If the lookup using RTLD_NEXT failed, the sanitizer runtime library
is later in the library search order than the DSO that we are trying
to intercept, which means that we cannot intercept this function. We
still want the address of the real definition, though, so look it up
using RTLD_DEFAULT.

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

llvm-svn: 317930

6 years ago[compiler-rt] Fix const and volatile qualifier warnings
Kuba Mracek [Fri, 10 Nov 2017 21:19:20 +0000 (21:19 +0000)]
[compiler-rt] Fix const and volatile qualifier warnings

Building with a new clang produces a bunch of warnings about dropped 'const' and 'volatile' qualifiers on pointers. Let's fix them.

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

llvm-svn: 317929

6 years ago[OMPT] Fix assertion for OpenMP code generated with outdated compilers
Joachim Protze [Fri, 10 Nov 2017 21:07:01 +0000 (21:07 +0000)]
[OMPT] Fix assertion for OpenMP code generated with outdated compilers

For up-to-date compilers, this assertion is reasonable, but it breaks
compatibility with the typical compiler installed on most systems.
This patch changes the default value to what we had when there was no
compiler support. A warning about the outdated compiler is printed during
runtime, when this point is reached.

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

llvm-svn: 317928

6 years ago[cfi-verify] Made FileAnalysis operate on a GraphResult rather than build one and...
Mitch Phillips [Fri, 10 Nov 2017 21:00:22 +0000 (21:00 +0000)]
[cfi-verify] Made FileAnalysis operate on a GraphResult rather than build one and validate it.

Refactors the behaviour of building graphs out of FileAnalysis, allowing for analysis of the GraphResult by the callee without having to rebuild the graph. Means when we want to analyse the constructed graph (planned for later revisions), we don't do repeated work.

Also makes CFI verification in FileAnalysis now return an enum that allows us to differentiate why something failed, not just that it did/didn't fail.

Reviewers: vlad.tsyrklevich

Subscribers: kcc, pcc, llvm-commits

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

llvm-svn: 317927

6 years ago[DAGcombine] Do not replace truncate node by itself when doing constant folding,...
Amaury Sechet [Fri, 10 Nov 2017 20:59:53 +0000 (20:59 +0000)]
[DAGcombine] Do not replace truncate node by itself when doing constant folding, this trigger needless extra rounds of combine for nothing. NFC

llvm-svn: 317926

6 years ago[debuginfo-tests] Make debuginfo-tests work in a standard configuration.
Zachary Turner [Fri, 10 Nov 2017 20:57:57 +0000 (20:57 +0000)]
[debuginfo-tests] Make debuginfo-tests work in a standard configuration.

Previously, debuginfo-tests was expected to be checked out into
clang/test and then the tests would automatically run as part of
check-clang.  This is not a standard workflow for handling
external projects, and it brings with it some serious drawbacks
such as the inability to depend on things other than clang, which
we will need going forward.

The goal of this patch is to migrate towards a more standard
workflow.  To ease the transition for build bot maintainers,
this patch tries not to break the existing workflow, but instead
simply deprecate it to give maintainers a chance to update
the build infrastructure.

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

llvm-svn: 317925

6 years ago[AMDGPU] AMDGPUUsage.rst minor corrections
Tony Tye [Fri, 10 Nov 2017 20:51:43 +0000 (20:51 +0000)]
[AMDGPU] AMDGPUUsage.rst minor corrections

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

llvm-svn: 317924

6 years ago[SimplifyCFG] Use auto * when the type is obvious. NFCI.
Davide Italiano [Fri, 10 Nov 2017 20:46:21 +0000 (20:46 +0000)]
[SimplifyCFG] Use auto * when the type is obvious. NFCI.

llvm-svn: 317923

6 years ago[polly] Remove redundant return [NFC]
Mandeep Singh Grang [Fri, 10 Nov 2017 20:33:08 +0000 (20:33 +0000)]
[polly] Remove redundant return [NFC]

Reviewers: grosser, bollu

Reviewed By: grosser

Subscribers: nemanjai, kbarton, llvm-commits

Tags: #polly

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

llvm-svn: 317922

6 years agoRecommit r317904: [Hexagon] Create HexagonISelDAGToDAG.h, NFC
Krzysztof Parzyszek [Fri, 10 Nov 2017 20:09:46 +0000 (20:09 +0000)]
Recommit r317904: [Hexagon] Create HexagonISelDAGToDAG.h, NFC

The Windows builder did not reconstruct the HexagonGenDAGISel.inc file
after the TableGen binary has changed.

llvm-svn: 317921