Commit Graph

303243 Commits

Author SHA1 Message Date
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
Craig Topper 2eab39f77b [X86] Use DAG.getConstant instead of getZeroVector.
llvm-svn: 346605
2018-11-11 07:24:36 +00:00
Jonas Devlieghere 45eb84f340 [Support] Make error banner optional in logAllUnhandledErrors
In a lot of places an empty string was passed as the ErrorBanner to
logAllUnhandledErrors. This patch makes that argument optional to
simplify the call sites.

llvm-svn: 346604
2018-11-11 01:46:03 +00:00
Craig Topper ef33a190bc [X86] Replace calls to getOnesVector/getZeroVector with getConstant.
getConstant will create a BUILD_VECTOR for us and use a legal type if necessary. So just create the simple node and let BUILD_VECTOR legalization do the canonicalization.

llvm-svn: 346603
2018-11-11 01:40:04 +00:00
Jonas Devlieghere ed75efa5cd [llvm-cxxdump] Use error reporting helpers from support
This patch makes llvm-cxxdump use the error reporting helpers from
Support/WithColor.h

llvm-svn: 346602
2018-11-11 01:24:02 +00:00
Jonas Devlieghere 64a2630825 Pass the function type instead of the return type to FunctionDecl::Create
Fix places where the return type of a FunctionDecl was being used in
place of the function type

FunctionDecl::Create() takes as its T parameter the type of function
that should be created, not the return type. Passing in the return type
looks to have been copypasta'd around a bit, but the number of correct
usages outweighs the incorrect ones so I've opted for keeping what T is
the same and fixing up the call sites instead.

This fixes a crash in Clang when attempting to compile the following
snippet of code with -fblocks -fsanitize=function -x objective-c++ (my
original repro case):

  void g(void(^)());
  void f()
  {
      __block int a = 0;
        g(^(){ a++; });
  }

as well as the following which only requires -fsanitize=function -x c++:

  void f(char * buf)
  {
      __builtin_os_log_format(buf, "");
  }

Patch by: Ben (bobsayshilol)

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

llvm-svn: 346601
2018-11-11 00:56:15 +00:00
Craig Topper d23cdbbeb2 [DAGCombiner] Make tryToFoldExtendOfConstant return an SDValue instead of an SDNode*. NFC
Removes the need to call getNode internally and to recreate an SDValue after the call.

llvm-svn: 346600
2018-11-10 23:46:03 +00:00
Jonas Devlieghere f8d480b12c Add missing include
llvm-svn: 346599
2018-11-10 22:54:44 +00:00
Jonas Devlieghere 1cc0714c68 Extract construction of DataBufferLLVM into FileSystem
This moves construction of data buffers into the FileSystem class. Like
some of the previous refactorings we don't translate the path yet
because the functionality hasn't been landed in LLVM yet.

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

llvm-svn: 346598
2018-11-10 22:44:06 +00:00
Jan Vesely 3889c36d3f r600: Add datalayout to image builtin implementation
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry
llvm-svn: 346597
2018-11-10 21:43:40 +00:00
Sanjay Patel 4a12aa9791 [InstCombine] simplify code for merging stores; NFCI
llvm-svn: 346596
2018-11-10 20:29:25 +00:00