Commit Graph

330806 Commits

Author SHA1 Message Date
Nathan Ridge b6429cdd65 Refactor getDeclAtPosition() to use SelectionTree + targetDecl()
Summary: This fixes issue #163, among other improvements to go-to-definition.

Reviewers: sammccall

Subscribers: jkorous, mgrang, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69237
2019-10-31 17:37:27 -04:00
Nikita Popov 2f8a43e199 [CVP] Add tests for icmp on local ranges; NFC
We currently don't simplify these, because getPredicateAt() does
not use block values.
2019-10-31 22:24:46 +01:00
Nikita Popov 1cfe3e6df9 [LVI] Regenerate test checks; NFC 2019-10-31 22:24:46 +01:00
Thomas Lively 11850a6305 [WebAssembly] Expand setcc of v2i64
Summary:
The SIMD spec does not include i64x2 comparisons, so they need to be
expanded. Using setOperationAction to expand them also causes f64x2
comparisons to be expanded, so setCondCodeAction needs to be used
instead. But since there are no legal condition codes, the legalizer
does not know how to expand the comparisons. We therefore manually
unroll the operation, taking care to fill each lane with -1 or 0
rather than 1 or 0 for consistency with the other vector comparisons.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69604
2019-10-31 14:22:30 -07:00
Michael Spencer d816d9bdc5 [clang][ScanDeps] Fix issue with multiple commands with the same input.
Previously, given a CompilationDatabase with two commands for the same
source file we would report that file twice with the union of the
dependencies for each command both times.

This was due to the way `ClangTool` runs actions given an input source
file (see the comment in `DependencyScanningTool.cpp`). This commit adds
a `SingleCommandCompilationDatabase` that is created with each
`CompileCommand` in the original CDB, which is then used for each
`ClangTool` invocation. This gives us a single run of
`DependencyScanningAction` per `CompileCommand`.

I looked at using `AllTUsToolExecutor` which is a parallel tool
executor, but I'm not sure it's suitable for `clang-scan-deps` as it
does a lot more sharing of state than `AllTUsToolExecutor` expects.

Differential Revision: https://reviews.llvm.org/D69643
2019-10-31 14:22:01 -07:00
Reid Kleckner 19f1dc7b52 Remove unneeded template alias, causes issues with some MSVC version
I built locally with the latest MSVC in c++14 and c++17, but it does not
complain for me. Osman Zakir on llvm-dev reports that they run into
compile errors here.

In any case, it seems prefereable to reuse clang's LLVM.h header to
bring in llvm::Optional and Expected.
2019-10-31 14:20:54 -07:00
Alex Richardson d9cc7d1408 [update_cc_test_checks.py] Pass the builtin include dir to clang
Summary:
This is required to update tests that make use of builtin headers. To fix
this use the same command expansion as lit does for %clang_cc1. I tested
this by updating clang/test/CodeGen/arm-mve-intrinsics/scalar-shifts.c.
%clang_cc1 will now expand to `clang -cc1 -internal-isystem
$LLVM_BUILD/lib/clang/$VERSION/include -nostdsysteminc`.

Reviewers: MaskRay

Reviewed By: MaskRay

Subscribers: kristof.beyls, dmgreen, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69611
2019-10-31 21:18:33 +00:00
Alex Richardson 8baedb82ba [compiler-rt] Use xcrun instead of xcodebuild to find the SDK directory
Summary:
xcodebuild does not work unless XCode is installed whereas xcrun also work
when only the Command Line Tools are installed. Unlike the check for the
version (D69610), this did not cause an erro for me since the fallback to
/usr/include for the OSX sysroot worked.

Reviewers: yln, delcypher

Reviewed By: yln

Subscribers: dberris, mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D69659
2019-10-31 21:17:56 +00:00
Alex Richardson 52beec76de Fix compiler-rt build on macOS without XCode
Summary:
Starting with 8a5bfbe6db (D68292) this file
unconditionally uses xcodebuild to get the SDK version. On my system this
always fails with
`xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance`

Reviewers: delcypher, yln

Reviewed By: delcypher, yln

Subscribers: dberris, mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D69610
2019-10-31 21:17:24 +00:00
Jason Molenda 54a873b158 Fix typeo in CPU_TYPE_ARM64_32 for older SDKs. 2019-10-31 14:13:57 -07:00
Peter Collingbourne d47133adad gn build: s/target_/current_/g in compiler-rt/lib/{builtins,profile}.
Fixes stage2 cross compilation.

Differential Revision: https://reviews.llvm.org/D69680
2019-10-31 14:03:39 -07:00
Fangrui Song 44d0c3d947 [PGO][PGSO] Fix -DBUILD_SHARED_LIBS=on builds after D69580/llvmorg-10-init-8797-g0d987e411ac
Move TargetLoweringBase::isSuitableForJumpTable from
llvm/CodeGen/TargetLowering.h to .cpp, to avoid the undefined reference
from all LLVM${Target}ISelLowering.cpp.

Another fix is to add a dependency on TransformUtils to all
lib/Target/$Target/LLVMBuild.txt, but that is too disruptive.
2019-10-31 14:02:29 -07:00
Evgenii Stepanov cd751bcd52 [asan] Fix lint failure in asan_interface.h 2019-10-31 13:58:55 -07:00
Evgenii Stepanov 13e04607f7 [asan] Provide an interface to update an allocation stack trace.
Summary:
Sometimes an allocation stack trace is not very informative. Provide a
way to replace it with a stack trace of the user's choice.

Reviewers: pcc, kcc

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D69208
2019-10-31 13:54:46 -07:00
Craig Topper a0aef63208 [X86] Remove FSIN/FCOS isel patterns and the pseudo instructions that they selected for the FP stackifier.
We always expand these to libcalls so get rid of the last vestiges
of using the instructions.
2019-10-31 13:42:01 -07:00
Nico Weber d6bb256b44 Revert "gn build: (manually) merge ec66603ac7"
This reverts commit df899f2272.
Looks like ec66603ac7 was reverted recently.
2019-10-31 16:30:01 -04:00
Nico Weber df899f2272 gn build: (manually) merge ec66603ac7 2019-10-31 16:28:50 -04:00
Evandro Menezes f9af4ccb8a [AArch64] Update for Exynos
Fix the costs of `add` and `orr` with an immediate operand.
2019-10-31 15:25:22 -05:00
Hiroshi Yamauchi 0d987e411a [PGO][PGSO] TargetLowering/TargetTransformationInfo/SwitchLoweringUtils part.
Summary:
(Split of off D67120)

TargetLowering/TargetTransformationInfo/SwitchLoweringUtils changes for profile
guided size optimization.

Reviewers: davidxl

Subscribers: eraman, hiraditya, haicheng, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69580
2019-10-31 13:22:56 -07:00
Johannes Doerfert eb4f41dfe5 [Attributor] Really use the executed-context
Before we did not follow casts and geps when we looked at the users of a
pointer in the pointers must-be-executed-context. This caused us to fail
to determine if it was accessed for sure. With this change we follow
such users now.

The above extension exposed problems in getKnownNonNullAndDerefBytesForUse
which did not always check what the base pointer was. We also did not
handle negative offsets as conservative as we have to without explicit
loop handling. Finally, we should not derive a huge number if we access
a pointer that was traversed backwards first.

The problems exposed by this functional change are already tested in the
existing test cases as is the functional change.

Differential Revision: https://reviews.llvm.org/D69647
2019-10-31 15:09:45 -05:00
Alexey Bataev 70ad617dd6 [SLP] Vectorize jumbled stores.
Summary:
Patch adds support for vectorization of the jumbled stores. The value
operands are vectorized and then shuffled in the right order before
store.

Reviewers: RKSimon, spatel, hfinkel, mkuper

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D43339
2019-10-31 16:02:25 -04:00
Johannes Doerfert 2d6d651e8c [Attributor] Make AANonNull perform context sensitive queries
Summary:
In order to get context sensitivity from isKnownNonZero we need to
provide a context instruction *and* a dominator tree. The latter is
passed now to which actually allows to remove some initialization code.

Tests taken from PR43833.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69595
2019-10-31 14:47:06 -05:00
Johannes Doerfert 57dd4b03e4 [ValueTracking] Allow context-sensitive nullness check for non-pointers
Same as D60846 but with a fix for the problem encountered there which
was a missing context adjustment in the handling of PHI nodes.

The test that caused D60846 to be reverted was added in e15ab8f277.

Reviewers: nikic, nlopes, mkazantsev,spatel, dlrobertson, uabelho, hakzsam

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69571
2019-10-31 14:37:38 -05:00
Simon Pilgrim 04813ded98 Revert rG0e252ae19ff8d99a59d64442c38eeafa5825d441 : [X86] Enable YMM memcmp with AVX1
Breaks build bots

Differential Revision: https://reviews.llvm.org/D69658
2019-10-31 19:05:04 +00:00
Alex Langford db542455dc [Symbol] Change ClangASTContext::GetCXXClassName return type
Summary:
Instead of filling out a std::string and returning a bool to indicate
success, returning a std::string directly and testing to see if it's
empty seems like a cleaner solution overall.

Differential Revision: https://reviews.llvm.org/D69641
2019-10-31 11:57:37 -07:00
Johannes Doerfert e15ab8f277 [InstCombine] Add the test that triggered the D60846 revert
This is in preparation of D69571.
2019-10-31 13:49:16 -05:00
Johannes Doerfert 4de09e0f44 [Utils][FIX] Unbreak update_XXX_test_checks after 3598b81002
The users of build_function_body_dictionary and add_checks need to be
adjusted after the changes in UpdateTestChecks/common.py.
2019-10-31 13:43:27 -05:00
Julian Lettner 20bb48c7a7 [lit] Extract Display.print_header function 2019-10-31 11:43:20 -07:00
Julian Lettner bbebdbbd20 [lit] Always print newline before test time/summary
Slightly decreases the time I need to parse the test summary.
2019-10-31 11:43:20 -07:00
Joel E. Denny 0d4e6519c5 [lit] Fix internal env calling other internal commands
Without this patch, when using lit's internal shell, if `env` on a lit
RUN line calls `cd`, `mkdir`, or any of the other in-process shell
builtins that lit implements, lit accidentally searches for the latter
as an external executable.

This patch puts such builtins in a map so that boilerplate for them
need be implemented only once.  This patch moves that handling after
processing of `env` so that `env` calling such a builtin can be
detected.  Finally, because such calls appear to be useless, this
patch takes the safe approach of diagnosing them rather than
supporting them.

Reviewed By: probinson, mgorny, rnk

Differential Revision: https://reviews.llvm.org/D66506
2019-10-31 14:37:51 -04:00
Adrian Prantl 8e40620441 XFAIL dexter tests on Darwin.
These fail parsing command line arguments.
2019-10-31 11:22:19 -07:00
David Zarzycki 0e252ae19f [X86] Enable YMM memcmp with AVX1
Update TargetTransformInfo to allow AVX1 to use YMM registers for memcmp.

This is a follow up to D68632 which enabled XOR compares which made this possible.

https://reviews.llvm.org/D69658
2019-10-31 20:07:07 +02:00
Sanjay Patel 1b57f0213f [InstCombine] add fast-math-flags for better test coverage; NFC
In all cases, we currently unintentionally drop the FMF on the new select.
2019-10-31 14:04:28 -04:00
Simon Pilgrim 3842b94c4e Revert rG57ee0435bd47f23f3939f402914c231b4f65ca5e - [TII] Use optional destination and source pair as a return value; NFC
This is breaking MSVC builds: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/20375
2019-10-31 18:00:29 +00:00
Evgenii Stepanov 05a2d70d96 Sort HWASAN_RTL_SOURCES alphabetically (NFC). 2019-10-31 10:56:50 -07:00
Craig Topper 6773435624 [IPCP] Bail on extractvalue's with more than 1 index.
The replacement code only looks at the first index of the
extractvalue. If there are additional indices we'll end
up doing a bad replacement.

This only happens if the function returns a nested struct. Not
sure if clang ever generates such code. The original report came
from ispc.

Fixes PR43857

Differential Revision: https://reviews.llvm.org/D69656
2019-10-31 10:55:20 -07:00
Amy Huang fdd0815eac Fix initialization-order-fiasco error in "Add a heap alloc site marker field to the ExtraInfo in MachineInstrs" 2019-10-31 10:52:53 -07:00
David Green 2179867ddc [AArch64] Select saturating Neon instructions
This adds some extra patterns to select AArch64 Neon SQADD, UQADD, SQSUB
and UQSUB from the existing target independent sadd_sat, uadd_sat,
ssub_sat and usub_sat nodes.

It does not attempt to replace the existing int_aarch64_neon_uqadd
intrinsic nodes as they are apparently used for both scalar and vector,
and need to be legal on scalar types for some of the patterns to work.
The int_aarch64_neon_uqadd on scalar would move the two integers into
floating point registers, perform a Neon uqadd and move the value back.
I don't believe this is good idea for uadd_sat to do the same as the
scalar alternative is simpler (an adds with a csinv). For signed it may
be smaller, but I'm not sure about it being better.

So this just adds some extra patterns for the existing vector
instructions, matching on the _sat nodes.

Differential Revision: https://reviews.llvm.org/D69374
2019-10-31 17:28:36 +00:00
Julian Lettner 62c0746896 [lit] Rename ProgressDisplay -> Display 2019-10-31 10:23:19 -07:00
Evgenii Stepanov 2f856a36e0 [msan] Blacklist __gxx_personality_v0.
Summary:
Fixes https://bugs.llvm.org/show_bug.cgi?id=31877.
Fixes https://github.com/google/sanitizers/issues/1155.

Enables exceptions in msan/tsan buid of libcxx, and in msan tests.

-fdepfile-entry stuff is a workaround for
https://reviews.llvm.org/D69290 (default blacklist missing from -MMD
output).

Reviewers: pcc, dvyukov

Subscribers: mgorny, christof, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D69587
2019-10-31 10:22:52 -07:00
Johannes Doerfert cb19ea45a7 [FIX] Make LSan happy by *not* leaking memory
I left a memory leak in a printer pass which made LSan sad so I remove
the memory leak now to make LSan happy.

Reported and tested by vlad.tsyrklevich.
2019-10-31 12:16:54 -05:00
JonChesterfield 764c8420e4 [nfc][libomptarget] Reorganise support header
Summary:
[nfc][libomptarget] Reorganise support header

All functions defined in support implementation are now declared in support.h
Reordered functions in support implementation to match the sequence in support.h
Added include guards to support.h
Added #include interface to support.h to provide kmp_Ident declaration
Move supporti.h to support.cu and s/INLINE/EXTERN/g
Add remaining includes to support.cu

A minor side effect is to change the name mangling of the support functions to
extern "C". If this matters another macro along the lines of INLINE/EXTERN
can be added - perhaps DEVICE as that's the obvious implementation.

Reviewers: jdoerfert, ABataev, grokos

Reviewed By: jdoerfert

Subscribers: mgorny, jfb, openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D69652
2019-10-31 17:15:02 +00:00
Sanjay Patel a2240f57e7 [InstCombine] simplify fcmp+select canonicalization; NFCI
We had 2 blocks of code that are nearly identical. Existing
regression tests should cover both of the patterns.
2019-10-31 13:13:32 -04:00
Jeremy Morse 984fad243d Reapply "Import Dexter to debuginfo-tests""
This reverts commit cb935f3456.

Discussion in D68708 advises that green dragon is being briskly
refurbished, and it's good to have this patch up testing it.
2019-10-31 16:51:53 +00:00
Michał Górny 34f3c0fc44 [lldb] [test/API] Fix testcases symlink 2019-10-31 17:43:18 +01:00
Adrian Prantl aafe01fed4 Upstream diff from swift-lldb.
This is very likely untested, but it looks like an obviously correct change.
2019-10-31 09:25:36 -07:00
Jeremy Morse cb935f3456 Revert "Import Dexter to debuginfo-tests"
This reverts commit f78c236efd.

Green dragon breakage was observed; I'll take a look at why.
2019-10-31 16:22:10 +00:00
Sanne Wouda f2cb9c0eab Fix missing memcpy, memmove and memset tail calls
Summary:
If a wrapper around one of the mem* stdlib functions bitcasts the returned
pointer value before returning it (e.g. to a wchar_t*), LLVM does not emit a
tail call.

Add a check for this scenario so that we emit a tail call.

Reviewers: wmi, mkuper, ramred01, dmgreen

Reviewed By: wmi, dmgreen

Subscribers: hiraditya, sanwou01, javed.absar, lebedev.ri, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59078
2019-10-31 16:13:29 +00:00
Fangrui Song 27cb352fd2 [llvm-objcopy] --add-symbol: address post-commit reviews of D69093
* Improve comments.
* Reorder the assignment to Obj.SectionNames before the symbol table
  creation code. Add a test.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D69526
2019-10-31 09:12:06 -07:00
Sanjay Patel 136918676e [InstCombine] regenerate test checks; NFC 2019-10-31 11:33:24 -04:00