Commit Graph

308588 Commits

Author SHA1 Message Date
Fangrui Song ae82599a30 [ELF] Simplify. NFC
llvm-svn: 352499
2019-01-29 14:24:35 +00:00
Ilya Biryukov cce67a32cf [clangd] Interfaces for writing code tweaks
Summary:
The code tweaks are an implementation of mini-refactorings exposed
via the LSP code actions. They run in two stages:
  - Stage 1. Decides whether the action is available to the user and
    collects all the information required to finish the action.
    Should be cheap, since this will run over all the actions known to
    clangd on each textDocument/codeAction request from the client.

  - Stage 2. Uses information from stage 1 to produce the actual edits
    that the code action should perform. This stage can be expensive and
    will only run if the user chooses to perform the specified action in
    the UI.

One unfortunate consequence of this change is increased latency of
processing the textDocument/codeAction requests, which now wait for an
AST. However, we cannot avoid this with what we have available in the LSP
today.

Reviewers: kadircet, ioeric, hokein, sammccall

Reviewed By: sammccall

Subscribers: mgrang, mgorny, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 352494
2019-01-29 14:17:36 +00:00
Hans Wennborg 81675c8f3b Revert r351833 and r352250.
They were breaking the Windows build when using MSBuild, see the
discussion on D56781.

r351833: "Use response file when generating LLVM-C.dll"

> Use response file when generating LLVM-C.dll
>
> As discovered in D56774 the command line gets to long, so use a response file to give the script the libs. This change has been tested and is confirmed working for me.
>
> Commited on behalf of Jakob Bornecrantz
>
> Differential Revision: https://reviews.llvm.org/D56781

r352250: "Build LLVM-C.dll by default on windows and enable in release package"

>  Build LLVM-C.dll by default on windows and enable in release package
>
>  With the fixes to the building of LLVM-C.dll in D56781 this should now
>  be safe to land. This will greatly simplify dealing with LLVM for people
>  that just want to use the C API on windows. This is a follow up from
>  D35077.
>
>  Patch by Jakob Bornecrantz!
>
>  Differential revision: https://reviews.llvm.org/D56774

llvm-svn: 352492
2019-01-29 13:43:22 +00:00
Yaxun Liu d442500f5d [CUDA][HIP] Do not diagnose use of _Float16
r352221 caused regressions in CUDA/HIP since device function may use _Float16 whereas host does not support it.
In this case host compilation should not diagnose usage of _Float16 in device functions or variables.

For now just do not diagnose _Float16 for CUDA/HIP. In the future we should have more precise check.

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

llvm-svn: 352488
2019-01-29 13:20:23 +00:00
Jeremy Morse b0d7cf5df4 Add 'REQUIRES: zlib' to a fuzzer test
Fixes tests on build environments that don't have zlib. See also r352483.

llvm-svn: 352487
2019-01-29 13:06:17 +00:00
Bruno Ricci 1ec7fd35ce Re-commit "[AST] Introduce GenericSelectionExpr::Association"
This time with a fix to make gcc 4.8 happy.

llvm-svn: 352486
2019-01-29 12:57:11 +00:00
Haojian Wu e30d87ecea [clangd] dlog clang-tidy configuration
vlog seems to be too spammy in unittests.

llvm-svn: 352485
2019-01-29 12:32:32 +00:00
Ayonam Ray 4272af9b3e [CodeGen] Omit range checks from jump tables when lowering switches with unreachable default
During the lowering of a switch that would result in the generation of a 
jump table, a range check is performed before indexing into the jump 
table, for the switch value being outside the jump table range and a 
conditional branch is inserted to jump to the default block. In case the 
default block is unreachable, this conditional jump can be omitted. This 
patch implements omitting this conditional branch for unreachable 
defaults.

Review ID: D52002
Reviewers: Hans Wennborg, Eli Freidman, Roman Lebedev

llvm-svn: 352484
2019-01-29 12:01:32 +00:00
Jeremy Morse 2601aa5406 Add zlib feature test to lit configuration
Some new tests in libfuzzer have dependencies on zlib: add a feature test
for zlib so that we can add a REQUIRES field to the relevant tests.

Patch by Matthew Voss.

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

llvm-svn: 352483
2019-01-29 12:00:01 +00:00
George Rimar ff193c473e [ELF] - Remove dead `readBfdName` declaration. NFC.
`readBfdName` was removed recently.

llvm-svn: 352482
2019-01-29 11:46:00 +00:00
Kadir Cetinkaya 249ea33ddf [clangd] Make USRs for macros to be position independent
Summary:
USRs for macros were not cannonical due to usage of cursor location
instead of definition location.

Reviewers: jkorous

Subscribers: ilya-biryukov, ioeric, MaskRay, arphaman, cfe-commits

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

llvm-svn: 352481
2019-01-29 11:19:15 +00:00
Simon Pilgrim 4293ad8ab2 [X86] Add PR40483 test case
llvm-svn: 352480
2019-01-29 10:58:42 +00:00
Dan Gohman 4684f824d4 [WebAssembly] Re-enable main-function signature rewriting
Re-enable the code to rewrite main-function signatures into
"int main(int argc, char *argv[])", but limited to only handling
the case of "int main(void)", so that it doesn't silently strip
an argument in the "int main(int argc, char *argv[], char *envp[])"
case.

This allows main to be called by C startup code, since WebAssembly
requires caller and callee signatures to match, so it can't rely
on passing main a different number of arguments than it expects.

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

llvm-svn: 352479
2019-01-29 10:53:42 +00:00
Aleksandr Urakov 2cdb2bd82b [NativePDB] Fix lldb-x64-windows-ninja after r352464
llvm-svn: 352478
2019-01-29 10:46:28 +00:00
James Henderson 6f39f6ace7 [llvm-symbolizer][doc] Tweak wording of --adjust-vma switch description
The address isn't dynamically relocated. The object is.

llvm-svn: 352477
2019-01-29 10:43:48 +00:00
Simon Pilgrim 06a342b2d6 [X86] Fix linux32 pic tests to use correct relocation model (PR39684)
Differential Revision: https://reviews.llvm.org/D57301

llvm-svn: 352476
2019-01-29 10:41:48 +00:00
David Green 54b0115547 [ARM] Use sub for negative offset load/store in thumb1
This attempts to optimise negative values used in load/store operands
a little. We currently try to selct them as rr, materialising the
negative constant using a MOV/MVN pair. This instead selects ri with
an immediate of 0, forcing the add node to become a simpler sub.

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

llvm-svn: 352475
2019-01-29 10:40:31 +00:00
Simon Pilgrim 0b7fce6d72 [X86] Regenerate abi-isel.ll test
Adds note requested in D57301 and fixes some missing GOTPCREL addressmath checks

llvm-svn: 352474
2019-01-29 10:39:02 +00:00
Gabor Horvath f41e3d0873 [analyzer] Toning down invalidation a bit
When a function takes the address of a field the analyzer will no longer
assume that the function will change other fields of the enclosing structs.

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

llvm-svn: 352473
2019-01-29 10:27:14 +00:00
David Green 5c33c5da1a [ARM] Add extra testcases for D57121. NFC
llvm-svn: 352472
2019-01-29 10:25:56 +00:00
Jeremy Morse ba467024f4 Remove 'XFAIL: powerpc64' from a debuginfo test
This test started XPASSing with r352467, and the change in behaviour
performed by that patch does appear to fix the cause of the original XFAIL
(missing FrameIndex DBG_VALUE), which I've replicated locally with
-mtriple=powerpc64--.

I'll write this up in PR21881 which documents the XFAIL, and seek
confirmation I haven't overlooked something here.

llvm-svn: 352471
2019-01-29 10:23:43 +00:00
Gabor Horvath 6591b6ae85 [analyzer] Added a checklist to help checker authors and reviewers
Differential Revision: https://reviews.llvm.org/D52984

llvm-svn: 352470
2019-01-29 10:21:49 +00:00
Bjorn Pettersson d014d576a9 [IPCP] Don't crash due to arg count/type mismatch between caller/callee
Summary:
This patch avoids an assert in IPConstantPropagation when
there is a argument count/type mismatch between the caller and
the callee.

While this is actually UB on C-level (clang emits a warning),
the IR verifier seems to accept it. I'm not sure what other
frontends/languages might think about this, so simply bailing out
to avoid hitting an assert (in CallSiteBase<>::getArgOperand or
Value::doRAUW) seems like a simple solution.

The problem is exposed by the fact that AbstractCallSites will look
through a bitcast at the callee position of a call/invoke.

Reviewers: jdoerfert, reames, efriedma

Reviewed By: jdoerfert, efriedma

Subscribers: eli.friedman, efriedma, llvm-commits

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

llvm-svn: 352469
2019-01-29 10:19:44 +00:00
Gabor Horvath 2c3d49b718 [analyzer] Fix a typo in docs
llvm-svn: 352468
2019-01-29 10:15:52 +00:00
Jeremy Morse 66ac86b58d [DebugInfo][DAG] Process FrameIndex dbg.values unconditionally
A FrameIndex should be valid throughout a block regardless of what instructions
get selected in that block -- therefore we shouldn't harness dbg.values that
refer to FrameIndexes to an SDNode. There are numerous codegen reasons why
an SDNode never appears or doesn't become a location that a DBG_VALUE can
refer to. None of them actually affect the variable location.

Therefore, before any other tests to encode dbg_values in a SelectionDAG,
identify FrameIndex operands and encode them unattached to any SDNode.

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

llvm-svn: 352467
2019-01-29 09:40:05 +00:00
Max Kazantsev 23e642248d [NFC] Use ArrayRef instead of SmallVectorImpl where possible
llvm-svn: 352466
2019-01-29 09:39:15 +00:00
Martin Storsjo f5884d255e [COFF, ARM64] Don't put jump table into a separate COFF section for EK_LabelDifference32
Windows ARM64 has PIC relocation model and uses jump table kind
EK_LabelDifference32. This produces jump table entry as
".word LBB123 - LJTI1_2" which represents the distance between the block
and jump table.

A new relocation type (IMAGE_REL_ARM64_REL32) is needed to do the fixup
correctly if they are in different COFF section.

This change saves the jump table to the same COFF section as the
associated code. An ideal fix could be utilizing IMAGE_REL_ARM64_REL32
relocation type.

Patch by Tom Tan!

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

llvm-svn: 352465
2019-01-29 09:36:48 +00:00
Aleksandr Urakov ee7c61f10e [NativePDB] Add basic support of methods recostruction in AST
Summary:
This patch adds the basic support of methods reconstruction by native PDB
plugin. It contains only most obvious changes (it processes LF_ONEMETHOD and
LF_METHOD records), some things still remain unsolved:

- mangled names retrieving;
- support of template methods.

Reviewers: zturner, labath, lemo, stella.stamenova

Reviewed by: zturner

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

llvm-svn: 352464
2019-01-29 09:32:23 +00:00
Sam Parker 015f97db8b [AArch64] Update int64_t ACLE builtin arguments
Re-applying r351740 with fixes (changing LL to W).

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

llvm-svn: 352463
2019-01-29 09:04:03 +00:00
Jonas Paulsson 5ed4d4638f [CodeGenPrepare] Handle all debug calls in dupRetToEnableTailCallOpts()
This patch makes sure that a debug value that is after the bitcast in
dupRetToEnableTailCallOpts() is also skipped.

The reduced test case is from SPEC-2006 on SystemZ.

Review: Vedant Kumar, Wolfgang Pieb
https://reviews.llvm.org/D57050

llvm-svn: 352462
2019-01-29 09:03:35 +00:00
Martin Storsjo d27bec4854 Don't define unw_fpreg_t to uint64_t for __ARM_DWARF_EH__
The existing typedef of unw_fpreg_t to uint64_t might work and be
correct for the ARM_EHABI case, but for dwarf, some cases in e.g.
DwarfInstructions.hpp convert between double and unw_fpreg_t.

When converting implicitly between double and unw_fpreg_t (uint64_t),
the values get interpreted as integers and converted to float and vice
versa, while the correct thing would be to keep the same bit pattern.

Avoid the whole issue by using the same definition of unw_fpreg_t
as all other architectures, when using dwarf unwinding on ARM.

Change assembler functions to take a void pointer instead of
unw_fpreg_t pointer, to avoid having a different mangled symbol name
depending on the actual value of this typedef.

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

llvm-svn: 352461
2019-01-29 09:00:32 +00:00
Jeremy Morse 27631cc670 Fix an incorrectly configured test.
This should have had a target triple in it, my mistake.

llvm-svn: 352460
2019-01-29 08:41:44 +00:00
Martin Storsjo 5d1862b76c [MinGW] Ignore the --plugin and --plugin-opt option
GCC can use LLD with -fuse-ld=lld for MinGW these days, but by
default these options are passed to the linker (unless -fno-lto
is passed to the GCC driver).

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

llvm-svn: 352459
2019-01-29 08:38:48 +00:00
Mikael Holmen c1c97aa22d Remove unused variable to silence compiler warning
llvm-svn: 352456
2019-01-29 06:53:31 +00:00
Mikael Holmen b792627ce9 Fix compiler warning when using clang 3.6.0
Without the fix we get the following (with -Werror):

../lib/Target/X86/X86ISelLowering.cpp:14181:58: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
  SmallVector<std::array<int, 2>, 2> LaneSrcs(NumLanes, {-1, -1});
                                                         ^~~~~~
                                                         {     }
1 error generated.

llvm-svn: 352455
2019-01-29 06:51:28 +00:00
Philip Reames 3cfd351efc Correct contents for r352453
I had a local change I hadn't realized when submitting that auto-update.  As such, the auto-update was wrong.  This should fix it, and with that, it's clearly time to stop submitting changes and go to bed.

llvm-svn: 352454
2019-01-29 06:40:02 +00:00
Philip Reames 2ddf96db50 [Tests] Regen to remove future test diffs
This file appears to have been manually editted at some point after being auto-updated. A future change adjusts this file slightly, and all of the updates makes the diff super confusing.

llvm-svn: 352453
2019-01-29 06:34:46 +00:00
Philip Reames 3846b9b443 [Test] Add tests for gather/maked.load demanded elements, and convert the whole file to auto generated checks.
llvm-svn: 352452
2019-01-29 05:58:32 +00:00
Max Kazantsev 468ad52213 [SCEV] Take correct loop in AddRec simplification. PR40420
The code of AddRec simplification is using wrong loop when it creates a new
AddRecExpr. It should be using AddRecLoop which we have saved and against which
all gate checks are made, and not calling AddRec->getLoop() over and over
again because AddRec may change and become an AddRecurrency from outer loop
during the transform iterations.

Considering this change trivial, commiting for postcommit review.

llvm-svn: 352451
2019-01-29 05:37:59 +00:00
Max Kazantsev d4de606ddb [NFC] Merge failing test from PR40420
llvm-svn: 352450
2019-01-29 05:12:40 +00:00
Petr Hosek 6868d537e3 [CMake][Fuchsia] Temporarily disable modules for second stage
This is breaking some of builders, disable modules until it's resolved.

llvm-svn: 352449
2019-01-29 03:38:26 +00:00
Igor Kudrin 0f13000958 [compiler-rt] Fix reporting unrecognized flags in unit tests.
Previously, the warning messages might be issued within a wrong test case.

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

llvm-svn: 352447
2019-01-29 02:31:57 +00:00
Teresa Johnson 87cc05055a Try to make new test more resilient to different orderings
New test added in r352441 getting a bot failure which I believe is
due to different ordering in the dumping which isn't being handled
well. Try to make test more resilient to ordering differences.

llvm-svn: 352446
2019-01-29 02:04:01 +00:00
Sam Clegg b54927cc48 [WebAssembly] Handle more types of uses in WebAssemblyAddMissingPrototypes
Previously we were only handling bitcast operations, however
prototypeless functions can also appear in other places such as
comparisons and as function params.

Switch to using replaceAllUsesWith() to replace the prototype-less
function uses.  This new approach results in some redundant bitcasting
but is much simpler and handles all cases.

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

llvm-svn: 352445
2019-01-29 00:30:46 +00:00
Reid Kleckner 85e72c3d56 [PPC] Include tablegenerated PPCGenCallingConv.inc once
Move the CC analysis implementation to its own .cpp file instead of
duplicating it and artificually using functions in PPCISelLowering.cpp
and PPCFastISel.cpp. Follow-up to the same change done for X86, ARM, and
AArch64.

llvm-svn: 352444
2019-01-29 00:30:35 +00:00
Matt Arsenault b72888647b AMDGPU: Add ds append/consume builtins
llvm-svn: 352443
2019-01-28 23:59:18 +00:00
Thomas Lively 33f87b8aef [WebAssembly] Expand BUILD_PAIR nodes
Reviewers: aheejin

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

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

llvm-svn: 352442
2019-01-28 23:44:31 +00:00
Teresa Johnson 2f616e479b [ThinLTO] Add option to dump per-module summary dot graph
Summary:
I found that there currently isn't a way to invoke exportToDot from
the command line for a per-module summary index, and therefore no
testing of that case. Add an internal option and use it to test dumping
of per module summary indexes.

In particular, I am looking at fixing the limitation that causes the
aliasee GUID in the per-module summary to be 0, and want to be able to
test that change.

Reviewers: evgeny777

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 352441
2019-01-28 23:43:26 +00:00
Philip Reames 6c5341bc5a Demanded elements support for vector GEPs
GEPs can produce either scalar or vector results. If we're extracting only a subset of the vector lanes, simplifying the operands is helpful in eliminating redundant computation, and (eventually) allowing further optimizations

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

llvm-svn: 352440
2019-01-28 23:24:49 +00:00
Eli Friedman f0e676819f [docs] Fix a couple spelling errors.
llvm-svn: 352439
2019-01-28 23:03:41 +00:00