Commit Graph

303103 Commits

Author SHA1 Message Date
Simon Pilgrim ab74ab2184 Fix unused variable warning. NFCI.
llvm-svn: 346657
2018-11-12 14:48:39 +00:00
Simon Pilgrim 631f2bf51e [CostModel] Add more realistic SK_ExtractSubvector generic costs.
Instead of defaulting to a cost = 1, expand to element extract/insert like we do for other shuffles.

This exposes an issue in LoopVectorize which could call SK_ExtractSubvector with a scalar subvector type.

llvm-svn: 346656
2018-11-12 14:25:23 +00:00
Alex Bradbury 9c03e4cacd [RISCV] Support .option relax and .option norelax
This extends the .option support from D45864 to enable/disable the relax 
feature flag from D44886

During parsing of the relax/norelax directives, the RISCV::FeatureRelax 
feature bits of the SubtargetInfo stored in the AsmParser are updated 
appropriately to reflect whether relaxation is currently enabled in the 
parser. When an instruction is parsed, the parser checks if relaxation is 
currently enabled and if so, gets a handle to the AsmBackend and sets the 
ForceRelocs flag. The AsmBackend uses a combination of the original 
RISCV::FeatureRelax feature bits set by e.g -mattr=+/-relax and the 
ForceRelocs flag to determine whether to emit relocations for symbol and 
branch diffs. Diff relocations should therefore only not be emitted if the 
relax flag was not set on the command line and no instruction was ever parsed 
in a section with relaxation enabled to ensure correct diffs are emitted.

Differential Revision: https://reviews.llvm.org/D46423
Patch by Lewis Revill.

llvm-svn: 346655
2018-11-12 14:25:07 +00:00
Nirav Dave a395e2df56 [DAGCombiner] Fix load-store forwarding of indexed loads.
Summary:
Handle extra output from index loads in cases where we wish to
forward a load value directly from a preceeding store.

Fixes PR39571.

Reviewers: peter.smith, rengolin

Subscribers: javed.absar, hiraditya, arphaman, llvm-commits

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

llvm-svn: 346654
2018-11-12 14:05:40 +00:00
Ilya Biryukov ac7c4f1db3 Add a test checking clang-tidy can find libc++ on Mac
Reviewers: sammccall, arphaman, EricWF

Reviewed By: sammccall

Subscribers: christof, cfe-commits

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

llvm-svn: 346653
2018-11-12 13:56:09 +00:00
Ilya Biryukov d8ebe7951d Make clang-based tools find libc++ on MacOS
Summary:
When they read compiler args from compile_commands.json.
This change allows to run clang-based tools, like clang-tidy or clangd,
built from head using the compile_commands.json file produced for XCode
toolchains.

On MacOS clang can find the C++ standard library relative to the
compiler installation dir.

The logic to do this was based on resource dir as an approximation of
where the compiler is installed. This broke the tools that read
'compile_commands.json' and don't ship with the compiler, as they
typically change resource dir.

To workaround this, we now use compiler install dir detected by the driver
to better mimic the behavior of the original compiler when replaying the
compilations using other tools.

Reviewers: sammccall, arphaman, EricWF

Reviewed By: sammccall

Subscribers: ioeric, christof, kadircet, cfe-commits

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

llvm-svn: 346652
2018-11-12 13:55:55 +00:00
Alexander Kornienko 87ab8f316f Fix an unused variable warning. NFC
llvm-svn: 346651
2018-11-12 13:41:42 +00:00
Andrea Di Biagio dda9032314 [llvm-mca] Correctly update the resource strategy for processor resources with multiple units.
When looking at the tests committed by Roman at r346587, I noticed that numbers
reported by the resource pressure for PdAGU01 were wrong.

In particular, according to the aut-generated CHECK lines in tests
memcpy-like-test.s and store-throughput.s, resource pressure for PdAGU01
was not uniformly distributed among the two AGEN pipes.

It turns out that the reason why pressure was not correctly distributed, was
because the "resource selection strategy" object associated with PdAGU01 was not
correctly updated on the event of AGEN pipe used.
As a result, llvm-mca was not simulating a round-robin pipeline allocation for
PdAGU01. Instead, PdAGU1 was always prioritized over PdAGU0.

This patch fixes the issue; now processor resource strategy objects for
resources declaring multiple units, are correctly notified in the event of
"resource used".

llvm-svn: 346650
2018-11-12 13:09:39 +00:00
Philip Pfaffe e194c02849 [newpm] Fix r346645: Missing consume of the Error return by the pipeline parser
llvm-svn: 346649
2018-11-12 12:27:58 +00:00
Eric Liu 961024f174 [clangd] Remember to serialize AnyScope in FuzzyFindRequest json.
llvm-svn: 346648
2018-11-12 12:24:08 +00:00
Philip Pfaffe 2d4effb25c Add an OptimizerLast EP
Summary:
It turns out that we need an OptimizerLast PassBuilder extension point
after all. I missed the relevance of this EP the first time. By legacy PM magic,
function passes added at this EP get added to the last _Function_ PM, which is a
feature we lost when dropping this EP for the new PM.

A key difference between this and the legacy PassManager's OptimizerLast
callback is that this extension point is not triggered at O0. Extensions
to the O0 pipeline should append their passes to the end of the overall
pipeline.

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

llvm-svn: 346645
2018-11-12 11:17:07 +00:00
Calixte Denizet 2c7f3d3282 [GCOV] fix test after patch rL346642
Summary:
Test is failing under windows, so fix it.
Should fix:
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/1390/steps/stage%201%20check/logs/stdio

Reviewers: marco-c

Reviewed By: marco-c

Subscribers: cfe-commits, sylvestre.ledru, marco-c

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

llvm-svn: 346644
2018-11-12 09:52:14 +00:00
Max Kazantsev 7d49a3a816 [LICM] Hoist guards from non-header blocks
This patch relaxes overconservative checks on whether or not we could write
memory before we execute an instruction. This allows us to hoist guards out of
loops even if they are not in the header block.

Differential Revision: https://reviews.llvm.org/D50891
Reviewed By: fedor.sergeev

llvm-svn: 346643
2018-11-12 09:29:58 +00:00
Calixte Denizet cedcc73d93 [Clang] Add options -fprofile-filter-files and -fprofile-exclude-files to filter the files to instrument with gcov
Summary:
These options are taking regex separated by colons to filter files.
- if both are empty then all files are instrumented
- if -fprofile-filter-files is empty then all the filenames matching any of the regex from exclude are not instrumented
- if -fprofile-exclude-files is empty then all the filenames matching any of the regex from filter are instrumented
- if both aren't empty then all the filenames which match any of the regex in filter and which don't match all the regex in filter are instrumented
- this patch is a follow-up of https://reviews.llvm.org/D52033

Reviewers: marco-c, vsk

Reviewed By: marco-c, vsk

Subscribers: cfe-commits, sylvestre.ledru

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

llvm-svn: 346642
2018-11-12 09:12:27 +00:00
Calixte Denizet c6fabeac11 [GCOV] Add options to filter files which must be instrumented.
Summary:
When making code coverage, a lot of files (like the ones coming from /usr/include) are removed when post-processing gcno/gcda so finally they doen't need to be instrumented nor to appear in gcno/gcda.
The goal of the patch is to be able to filter the files we want to instrument, there are several advantages to do that:
- improve speed (no overhead due to instrumentation on files we don't care)
- reduce gcno/gcda size
- it gives the possibility to easily instrument only few files (e.g. ones modified in a patch) without changing the build system
- need to accept this patch to be enabled in clang: https://reviews.llvm.org/D52034

Reviewers: marco-c, vsk

Reviewed By: marco-c

Subscribers: llvm-commits, sylvestre.ledru

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

llvm-svn: 346641
2018-11-12 09:01:43 +00:00
Hans Wennborg a97c4e3eee Release notes: Mention clang-cl's /Zc:dllexportInlines- flag
llvm-svn: 346640
2018-11-12 08:42:21 +00:00
Hans Wennborg 96a7860f79 clang-cl: Add documentation for /Zc:dllexportInlines-
Differential revision: https://reviews.llvm.org/D54319

llvm-svn: 346639
2018-11-12 08:38:10 +00:00
Sam McCall 8443f881bf [clangd] Fix compile on very old glibc
llvm-svn: 346638
2018-11-12 08:17:49 +00:00
Jonas Paulsson c0ee028dc3 [SystemZ] Replicate the load with most uses in buildVector()
Iterate over all elements and count the number of uses among them for each
used load. Then make sure to REPLICATE the load which has the most uses in
order to minimize the number of needed element insertions.

Review: Ulrich Weigand
https://reviews.llvm.org/D54322

llvm-svn: 346637
2018-11-12 08:12:20 +00:00
Fangrui Song 5014540a63 [llvm-objdump] add more constraints for tests
Patch by Higuoxing (Xing)

Reviewers: jhenderson

Reviewed By: jhenderson

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

llvm-svn: 346636
2018-11-12 08:10:14 +00:00
Jan Kratochvil ca71cc9c5a Fix compatibility with z3-4.8.1
With z3-4.8.1:
../tools/clang/lib/StaticAnalyzer/Core/Z3ConstraintManager.cpp:49:40: error:
'Z3_get_error_msg_ex' was not declared in this scope
../tools/clang/lib/StaticAnalyzer/Core/Z3ConstraintManager.cpp:49:40: note:
suggested alternative: 'Z3_get_error_msg'

Formerly used Z3_get_error_msg_ex() as one could find in z3-4.7.1 states:
	"Retained function name for backwards compatibility within v4.1"
And it is implemented only as a forwarding call:
	return Z3_get_error_msg(c, err);

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

llvm-svn: 346635
2018-11-12 06:48:02 +00:00
Marshall Clow a87fe7a345 Update to-do list with new work from WG21 meeting in San Diego
llvm-svn: 346634
2018-11-12 04:58:00 +00:00
Michael Wu 260e962402 Support Swift in platform availability attribute
Summary: This adds support for Swift platform availability attributes. It's largely a port of the changes made to https://github.com/apple/swift-clang/ for Swift availability attributes. Specifically, 84b5a21c31 and e5b87f265a . The implementation of attribute_availability_swift is a little different and additional tests in test/Index/availability.c were added.

Reviewers: manmanren, friss, doug.gregor, arphaman, jfb, erik.pilkington, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: aaron.ballman, ColinKinloch, jrmuizel, cfe-commits

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

llvm-svn: 346633
2018-11-12 02:44:33 +00:00
Philip Reames 8b48ceac80 [GC] Remove unused configuration variable
The custom root mechanism didn't actually do anything.  ShadowStackGC, the only one which used it, just removed the gcroots before they reached the normal lowering in SelectionDAG.  As a result, the state flag had no value.

llvm-svn: 346632
2018-11-12 02:34:54 +00:00
Philip Reames 1559021751 [GC] Minor style modernization
llvm-svn: 346631
2018-11-12 02:26:26 +00:00
Louis Dionne cdaf2b8dce [NFC] Reformat std::optional tests
llvm-svn: 346630
2018-11-12 01:38:30 +00:00
Louis Dionne d9247890da [NFC] Fix typo in <tuple>
llvm-svn: 346629
2018-11-12 01:28:07 +00:00
Kristina Brooks 7349d90b74 [CodeGen][CXX]: Fix no_destroy CG bug under specific circumstances
Summary:

Class with no user-defined destructor that has an inherited member that has a
non-trivial destructor and a non-default constructor will attempt to emit a
destructor despite being marked as __attribute((no_destroy)) in which case it
would trigger an assertion due to an incorrect assumption. 

In addition this adds missing test coverage for IR generation for no_destroy.

(Note that here use of no_destroy is synonymous with its global flag 
counterpart `-fno-c++-static-destructors` being enabled)

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

llvm-svn: 346628
2018-11-12 01:19:16 +00:00
Fangrui Song 4f9b470029 [IPSCCP] Delete two forward declarations
Summary: Use forward declaration as the reviewer is in favor of #include and delete a redundant declaration of Function.

Reviewers: fhahn

Reviewed By: fhahn

Subscribers: llvm-commits

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

llvm-svn: 346627
2018-11-11 23:17:46 +00:00
Jonas Devlieghere ceff6644bb Remove header grouping comments.
This patch removes the comments grouping header includes. They were
added after running IWYU over the LLDB codebase. However they add little
value, are often outdates and burdensome to maintain.

llvm-svn: 346626
2018-11-11 23:17:06 +00:00
Jonas Devlieghere 672d2c1255 Remove comments after header includes.
This patch removes the comments following the header includes. They were
added after running IWYU over the LLDB codebase. However they add little
value, are often outdates and burdensome to maintain.

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

llvm-svn: 346625
2018-11-11 23:16:43 +00:00
Jonas Devlieghere ba17b96bed [llvm-nm] Use WithColor for error reporting
Use helpers from Support/WithError.h to print errors.

llvm-svn: 346624
2018-11-11 22:12:21 +00:00
Jonas Devlieghere e787efd929 [llvm-objdump] Use WithColor for error reporting
Use helpers from Support/WithError.h to print errors.

llvm-svn: 346623
2018-11-11 22:12:04 +00:00
Jonas Devlieghere bada60aa6b [llvm-undname] Use WithColor for error reporting
Use helpers from Support/WithError.h to print errors.

llvm-svn: 346622
2018-11-11 22:11:47 +00:00
Philip Reames 18945d6c99 [GCRoot] Remove some unneccessary complexity
The GCStrategy provides three configuration options were are largely redundant.

1) Support for conditionally lowering gcread and gcwrite to loads and stores.  This is redundant since any GC which wished to use these abstractions would lower them out of existance before the built in lowering anyways.  As such, there's no need to have the lowering being conditional.
2) Conditional initialization for allocas marked via gcroot.  Semantically, roots have to be initialized before first potential use.  Arguably, the frontend really should have responsibility for that, but the old API allowed the frontend to ignore this detail.  Only one builtin GC used the non-initializing mode.  Since no one to my knowledge actually uses the ErlangGC strategy, I decide the slight pessimization was worth the simplicity.  If that turns out to be problematic, we can always improve the insertion algorithm to detect more existing initializing stores.

llvm-svn: 346621
2018-11-11 21:13:09 +00:00
Florian Hahn d345e9cff5 [IPSCCP] Use forward declaration.
llvm-svn: 346620
2018-11-11 20:57:04 +00:00
Fangrui Song 2712dc79bb [IPSCCP,PM] Add missing #include in rL346618
llvm-svn: 346619
2018-11-11 20:44:13 +00:00
Florian Hahn 9026d4ee9b [IPSCCP,PM] Preserve PDT in the new pass manager.
Reviewers: kuhar, chandlerc, NutshellySima, brzycki

Reviewed By: NutshellySima, brzycki

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

llvm-svn: 346618
2018-11-11 20:22:45 +00:00
Fangrui Song 5093b41d8a [MC] Fix 3 objdump tests after rL346610
llvm-svn: 346617
2018-11-11 19:15:27 +00:00
Fangrui Song 31be2f15a6 [ELF] Change GnuPub{Names,Types}Section from StringRef to LLDDWARFSection
Summary:
The debug_info_offset value may be relocated.

This is lld side change of D54375.

Reviewers: ruiu, dblaikie, grimar, espindola

Subscribers: emaste, arichardson, JDevlieghere, llvm-commits

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

llvm-svn: 346616
2018-11-11 18:57:35 +00:00
Fangrui Song 158b26213f [DWARF] Change pubnames to use DWARFSection instead of StringRef
Summary: The debug_info_offset values in .debug_{,gnu_}pub{name,types} may be relocated. Change it to DWARFSection so that we can get relocated values.

Reviewers: ruiu, dblaikie, grimar, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: aprantl, JDevlieghere, llvm-commits

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

llvm-svn: 346615
2018-11-11 18:57:28 +00:00
Fangrui Song f8f140dd55 [ELF] Fix relocation-common.s after rL346610
llvm-svn: 346614
2018-11-11 18:54:58 +00:00
Fangrui Song bdd036abeb [ELF] Fix objdump tests after rL346610
llvm-svn: 346613
2018-11-11 18:49:05 +00:00
Kristina Brooks 8e719269ea [lld][test] Update tests using objdump
Followup fix for LLD test for new format in rL346610. 

llvm-svn: 346612
2018-11-11 18:42:59 +00:00
Kristina Brooks c0d5d5c05d [llvm][test] Update tests using objdump
Update tests using llvm-objdump since check strings don't
match anymore due to the extra `O` in place. This is a 
followup for rL346610. 
 

llvm-svn: 346611
2018-11-11 18:40:33 +00:00
Kristina Brooks 0674f9d739 [llvm-objdump] Add symbol 'O' for object data
Improve compatibility with GNU objdump by showing `O` next to
global symbol names, instead of a blank space.

Patch by Higuoxing (Xing).

Reviewers: MaskRay

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

llvm-svn: 346610
2018-11-11 17:47:13 +00:00
Sanjay Patel 622b71d40a [x86] auto-generate complete checks; NFC
llvm-svn: 346609
2018-11-11 14:57:26 +00:00
Benjamin Kramer 0c0592bb67 [clangd] Make ClangdFuzzer compile again.
llvm-svn: 346608
2018-11-11 11:09:58 +00:00
Nico Weber 966c180ad2 Port LLVM r346606 to libcxxabi.
llvm-svn: 346607
2018-11-11 10:09:06 +00:00
Nico Weber 6808bc0f45 Make initializeOutputStream() return false on error and true on success.
As discussed in https://reviews.llvm.org/D52104

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

llvm-svn: 346606
2018-11-11 10:04:00 +00:00