platform/upstream/llvm.git
5 years ago[crt] Use -std=c11 for crtbegin.o/crtend.o
Petr Hosek [Fri, 10 May 2019 19:23:56 +0000 (19:23 +0000)]
[crt] Use -std=c11 for crtbegin.o/crtend.o

The source uses C11 syntax such as comments and some compilers print
warnings without specifying this flag.

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

llvm-svn: 360459

5 years agoDebugInfo: Only move types out of type units if they're named or type united
David Blaikie [Fri, 10 May 2019 19:15:29 +0000 (19:15 +0000)]
DebugInfo: Only move types out of type units if they're named or type united

Follow up to r359122, after a bug was reported in it - the original
change too aggressively tried to move related types out of type units,
which included unnamed types (like array types) which can't reasonably
be declared-but-not-defined.

A step beyond that is that some types in type units can be anonymous, if
they are types with a name for linkage purposes (eg: "typedef struct { }
x;"). So ensure those don't get turned into plain declarations (without
signatures) because, lacking names, they can't be resolved to the
definition.

[Also include a fix for llvm-dwarfdump/libDebugInfoDWARF to pretty print
types in type units]

llvm-svn: 360458

5 years ago[OPENMP][NVPTX]Improve number of threads counter, NFC.
Alexey Bataev [Fri, 10 May 2019 18:56:05 +0000 (18:56 +0000)]
[OPENMP][NVPTX]Improve number of threads counter, NFC.

Summary:
Patch improves performance of the full runtime mode by moving
number-of-threads counter to the shared memory. It also allows to save
global memory.

Reviewers: grokos, gtbercea, kkwli0

Subscribers: guansong, jfb, jdoerfert, openmp-commits, caomhin

Tags: #openmp

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

llvm-svn: 360457

5 years ago[SLP] Refactor VectorizableTree to use unique_ptr.
Simon Pilgrim [Fri, 10 May 2019 18:55:17 +0000 (18:55 +0000)]
[SLP] Refactor VectorizableTree to use unique_ptr.

This patch fixes the TreeEntry dangling pointer issue caused by reallocations of VectorizableTree.

Committed on behalf of @vporpo (Vasileios Porpodas)

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

llvm-svn: 360456

5 years agoReplace 'REQUIRES: nozlib' with '!zlib' because we don't need two ways
Paul Robinson [Fri, 10 May 2019 18:47:39 +0000 (18:47 +0000)]
Replace 'REQUIRES: nozlib' with '!zlib' because we don't need two ways
to say the same thing.

llvm-svn: 360455

5 years ago[ZoneAlgo] Fix PHI inconsistency in invalid contexts.
Michael Kruse [Fri, 10 May 2019 18:38:13 +0000 (18:38 +0000)]
[ZoneAlgo] Fix PHI inconsistency in invalid contexts.

PHI nodes (reads) could point to multiple instances of predecessor
blocks (PHI writes) when in an invalid context. Fix by removing PHI
instances that are in an invalid or ouside assumed context.

This fixes llvm.org/PR41656.

llvm-svn: 360454

5 years ago[NFC][TSan][libdispatch] Tiny CMake file cleanup
Julian Lettner [Fri, 10 May 2019 18:37:30 +0000 (18:37 +0000)]
[NFC][TSan][libdispatch] Tiny CMake file cleanup

llvm-svn: 360453

5 years agoReplace 'REQUIRES: nozlib' with '!zlib' because we don't need two ways
Paul Robinson [Fri, 10 May 2019 18:32:53 +0000 (18:32 +0000)]
Replace 'REQUIRES: nozlib' with '!zlib' because we don't need two ways
to say the same thing.

llvm-svn: 360452

5 years agoRemoving an unused member variable; NFC.
Aaron Ballman [Fri, 10 May 2019 18:29:10 +0000 (18:29 +0000)]
Removing an unused member variable; NFC.

llvm-svn: 360451

5 years ago[clang-tidy] Change the namespace for llvm checkers from 'llvm' to 'llvm_check'
Don Hinton [Fri, 10 May 2019 18:27:09 +0000 (18:27 +0000)]
[clang-tidy] Change the namespace for llvm checkers from 'llvm' to 'llvm_check'

Summary:
Change the namespace for llvm checkers from 'llvm' to
'llvm_check', and modify add_new_check.py and rename_check.py to
support the new namespace. Checker, file, and directory names remain
unchanged.

Used new version of rename_check.py to make the change in existing
llvm checkers, but had to fix LLVMTidyModule.cpp and
LLVMModuleTest.cpp by hand.

The changes made by rename_check.py are idempotent, so if accidentally
run multiple times, it won't do anything.

Reviewed By: aaron.ballman

Tags: #clang, #clang-tools-extra

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

llvm-svn: 360450

5 years agoReplace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that better
Paul Robinson [Fri, 10 May 2019 18:08:02 +0000 (18:08 +0000)]
Replace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that better
expresses the intent of the exclusion.

llvm-svn: 360449

5 years agoFix and test for assertion error in P41835.
Leonard Chan [Fri, 10 May 2019 18:05:15 +0000 (18:05 +0000)]
Fix and test for assertion error in P41835.

llvm-svn: 360448

5 years agoReplace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that better
Paul Robinson [Fri, 10 May 2019 17:57:22 +0000 (17:57 +0000)]
Replace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that better
expresses the intent of the exclusion.

llvm-svn: 360447

5 years ago[Sema] Mark array element destructors referenced during initialization
Erik Pilkington [Fri, 10 May 2019 17:52:26 +0000 (17:52 +0000)]
[Sema] Mark array element destructors referenced during initialization

This fixes a crash where we would neglect to mark a destructor referenced for an
__attribute__((no_destory)) array. The destructor is needed though, since if an
exception is thrown we need to cleanup the elements.

rdar://48462498

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

llvm-svn: 360446

5 years ago[CVP] Add tests for abs and nabs spf; NFC
Nikita Popov [Fri, 10 May 2019 17:39:50 +0000 (17:39 +0000)]
[CVP] Add tests for abs and nabs spf; NFC

One half of the bound is already computed correctly for these
tests, the other isn't.

llvm-svn: 360445

5 years ago[LSR] Tweak setup cost depth threshold to 10.
Amara Emerson [Fri, 10 May 2019 17:29:35 +0000 (17:29 +0000)]
[LSR] Tweak setup cost depth threshold to 10.

The original change introduced a depth limit of 7 which caused a 22% regression
in the Swift MapReduceLazyCollection & Ackermann benchmarks. This new threshold
still ensures that the original test case doesn't hang.

rdar://50359639

llvm-svn: 360444

5 years agoFinish renaming CompileUnit -> Unit
Jan Kratochvil [Fri, 10 May 2019 17:14:37 +0000 (17:14 +0000)]
Finish renaming CompileUnit -> Unit

D42892 changed a lot of code to use superclass DWARFUnit instead of its
subclass DWARFCompileUnit.

Finish this change more thoroughly for any *CompileUnit* -> *Unit* names.
Later patch will introduce DWARFTypeUnit which needs to be sometimes different
from DWARFCompileUnit and it would be confusing without this renaming.

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

llvm-svn: 360443

5 years ago[MC][ELF] Copy top 3 bits of st_other to .symver aliases
Fangrui Song [Fri, 10 May 2019 17:09:25 +0000 (17:09 +0000)]
[MC][ELF] Copy top 3 bits of st_other to .symver aliases

On PowerPC64 ELFv2 ABI, the top 3 bits of st_other encode the local
entry offset. A versioned symbol alias created by .symver should copy
the bits from the source symbol.

This partly fixes PR41048. A full fix needs tracking of .set assignments
and updating st_other fields when finish() is called, see D56586.

Patch by Alfredo Dal'Ava JĂșnior

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

llvm-svn: 360442

5 years agoAdjust MachineScheduler to use ProcResource counts
Momchil Velikov [Fri, 10 May 2019 16:54:32 +0000 (16:54 +0000)]
Adjust MachineScheduler to use ProcResource counts

This fix allows the scheduler to take into account the number of instances of
each ProcResource specified. Previously a declaration in a scheduler of
ProcResource<1> would be treated identically to a declaration of
ProcResource<2>. Now the hazard recognizer would report a hazard only after all
of the resource instances are busy.

Patch by Jackson Woodruff and Momchil Velikov.

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

llvm-svn: 360441

5 years ago[llvm-objdump] Print st_other
Fangrui Song [Fri, 10 May 2019 16:24:57 +0000 (16:24 +0000)]
[llvm-objdump] Print st_other

Add support for ".hidden" ".internal" ".protected" and " 0x%02x" for
other st_other bits used by some architectures.

Reviewed By: sfertile

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

llvm-svn: 360439

5 years agoRecommit r360345 with fixes (was reverted in r360348).
Aaron Ballman [Fri, 10 May 2019 16:24:28 +0000 (16:24 +0000)]
Recommit r360345 with fixes (was reverted in r360348).

Add the modernize-use-trailing-return check to rewrite function signatures to use trailing return types.

Patch by Bernhard Manfred Gruber.

llvm-svn: 360438

5 years agoPull r360426 as it is breaking the build bots.
Nemanja Ivanovic [Fri, 10 May 2019 16:03:22 +0000 (16:03 +0000)]
Pull r360426 as it is breaking the build bots.

llvm-svn: 360437

5 years ago[X86] Avoid SFB - Fix inconsistent codegen with/without debug info
Robert Lougher [Fri, 10 May 2019 15:55:06 +0000 (15:55 +0000)]
[X86] Avoid SFB - Fix inconsistent codegen with/without debug info

Fixes https://bugs.llvm.org/show_bug.cgi?id=40969

The functions findPotentiallyBlockedCopies and buildCopy are currently not
accounting for the presence of debug instructions. In the former this results
in the optimization not being trigerred, and in the latter results in
inconsistent codegen.

This patch enables the optimization to be performed in a debug build and
ensures the codegen is consistent with non-debug builds.

Patch by Chris Dawson.

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

llvm-svn: 360436

5 years ago[X86][SSE] Add getHopForBuildVector vector splitting
Simon Pilgrim [Fri, 10 May 2019 15:46:04 +0000 (15:46 +0000)]
[X86][SSE] Add getHopForBuildVector vector splitting

If we only use the lower xmm of a ymm hop, then extract the xmm's (for free), perform the xmm hop and then insert back into a ymm (for free).

Fixes some of the regressions noted in D61782

llvm-svn: 360435

5 years agoAnother attempt to fix the build bot breaks after r360426
Nemanja Ivanovic [Fri, 10 May 2019 15:44:56 +0000 (15:44 +0000)]
Another attempt to fix the build bot breaks after r360426

The test case checks were produced by the update_test_checks.py
scripts and I assumed that is sufficient. However, the behaviour
is different with different default target triples. Specify the
triple explicitly in the test case.

If this doesn't clean up the build bot breaks, I'll remove the test
case until I can get to the bottom of why the behaviour on build bots
is different from my machine.

llvm-svn: 360434

5 years agoFix build break after r360426
Nemanja Ivanovic [Fri, 10 May 2019 15:11:40 +0000 (15:11 +0000)]
Fix build break after r360426

llvm-svn: 360433

5 years agominidump: Don't eagerly resolve module paths read from the minidump
Pavel Labath [Fri, 10 May 2019 15:05:26 +0000 (15:05 +0000)]
minidump: Don't eagerly resolve module paths read from the minidump

This can cause us to return paths to files on the local filesystem even
if we don't end up using that file (for instance because the file is not
a real module).

llvm-svn: 360432

5 years ago[InferAddressSpaces] Enhance the handling of cosntexpr.
Michael Liao [Fri, 10 May 2019 14:57:42 +0000 (14:57 +0000)]
[InferAddressSpaces] Enhance the handling of cosntexpr.

Summary:
- Constant expressions may not be added in strict postorder as the
  forward instruction scan order. Thus, for a constant express (CE0), if
  its operand (CE1) is used in an previous instruction, they are not in
  postorder. However, different from
  `cloneInstructionWithNewAddressSpace`,
  `cloneConstantExprWithNewAddressSpace` doesn't bookkeep uninferred
  instructions for later resolving. That results in failure of inferring
  constant address.
- This patch adds the support to infer constant expression operand
  recursively, since there won't be loop, if that operand is another
  constant expression.

Reviewers: arsenm

Subscribers: jholewinski, jvesely, wdng, nhaehnle, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 360431

5 years agoFix some gcc warnings in compiler-rt
Nico Weber [Fri, 10 May 2019 14:15:13 +0000 (14:15 +0000)]
Fix some gcc warnings in compiler-rt

- Several "warning: extra ';' [-Wpedantic]"
- One "C++ style comments are not allowed in ISO C90 [enabled by default]"
  in a file that uses C style comments everywhere but in one place

llvm-svn: 360430

5 years ago[PowerPC] custom lower `v2f64 fpext v2f32`
Lei Huang [Fri, 10 May 2019 14:04:06 +0000 (14:04 +0000)]
[PowerPC] custom lower `v2f64 fpext v2f32`

Reduces scalarization overhead via custom lowering of v2f64 fpext v2f32.

eg. For the following IR
  %0 = load <2 x float>, <2 x float>* %Ptr, align 8
  %1 = fpext <2 x float> %0 to <2 x double>
  ret <2 x double> %1

Pre custom lowering:
  ld r3, 0(r3)
  mtvsrd f0, r3
  xxswapd vs34, vs0
  xscvspdpn f0, vs0
  xxsldwi vs1, vs34, vs34, 3
  xscvspdpn f1, vs1
  xxmrghd vs34, vs0, vs1

After custom lowering:
  lfd f0, 0(r3)
  xxmrghw vs0, vs0, vs0
  xvcvspdp vs34, vs0

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

llvm-svn: 360429

5 years ago[libclang] Forward isInline for NamespaceDecl to libclang
Nikolai Kosjar [Fri, 10 May 2019 13:58:34 +0000 (13:58 +0000)]
[libclang] Forward isInline for NamespaceDecl to libclang

llvm-svn: 360428

5 years agoAdd name comments for bools passed to getObjCEncodingForTypeImpl()
Nico Weber [Fri, 10 May 2019 13:56:56 +0000 (13:56 +0000)]
Add name comments for bools passed to getObjCEncodingForTypeImpl()

No behavior change. Medium term, probably want to use a bitmask instead
of 8 distinct bool parameters, but let's make the call sites easier to
read first.

llvm-svn: 360427

5 years ago[Pass Pipeline][NFC] Add a test prior to committing D61726
Nemanja Ivanovic [Fri, 10 May 2019 13:47:00 +0000 (13:47 +0000)]
[Pass Pipeline][NFC] Add a test prior to committing D61726

This patch just adds a test case to show the differences in code emitted
by opt before and after https://reviews.llvm.org/D61726.

llvm-svn: 360426

5 years agoReplace lit feature keyword 'non-ms-sdk' with 'ms-sdk'; eliminate
Paul Robinson [Fri, 10 May 2019 13:40:17 +0000 (13:40 +0000)]
Replace lit feature keyword 'non-ms-sdk' with 'ms-sdk'; eliminate
'non-ps4-sdk' and use just 'ps4'.

llvm-svn: 360425

5 years agoPre-commit InstCombine::visitFNeg(...) test.
Cameron McInally [Fri, 10 May 2019 13:18:57 +0000 (13:18 +0000)]
Pre-commit InstCombine::visitFNeg(...) test.

llvm-svn: 360424

5 years ago[lldb] [lit] Fix clobbers in x86_64 register test
Michal Gorny [Fri, 10 May 2019 13:12:36 +0000 (13:12 +0000)]
[lldb] [lit] Fix clobbers in x86_64 register test

llvm-svn: 360423

5 years ago[llvm-objcopy] Add additional testing for various cases
James Henderson [Fri, 10 May 2019 12:58:52 +0000 (12:58 +0000)]
[llvm-objcopy] Add additional testing for various cases

This patch adds a number of tests to test various cases not covered by
existing tests. All of them work correctly, with no need to change
llvm-objcopy itself, although some do indicate possible areas for
improvement.

Reviewed by: MaskRay

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

llvm-svn: 360422

5 years agoSelectionDAG: accommodate atomic floating stores.
Tim Northover [Fri, 10 May 2019 11:23:04 +0000 (11:23 +0000)]
SelectionDAG: accommodate atomic floating stores.

We were applying a pointer truncation to floating types, which crashed LLVM.
That is Not A Good Thing(TM).

llvm-svn: 360421

5 years ago[Object] Fix macho-invalid.test
Fangrui Song [Fri, 10 May 2019 10:47:30 +0000 (10:47 +0000)]
[Object] Fix macho-invalid.test

llvm-svn: 360420

5 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Fri, 10 May 2019 10:36:37 +0000 (10:36 +0000)]
Fix Wdocumentation warning. NFCI.

llvm-svn: 360419

5 years ago[Preamble] Stop circular inclusion of main file when building preamble
Nikolai Kosjar [Fri, 10 May 2019 10:25:35 +0000 (10:25 +0000)]
[Preamble] Stop circular inclusion of main file when building preamble

If a header file was processed for the second time, we could end up with a
wrong conditional stack and skipped ranges:

In the particular example, if the header guard is evaluated the second time and
it is decided to skip the conditional block, the corresponding "#endif" is
never seen since the preamble does not include it and we end up in the
Tok.is(tok::eof) case with a wrong conditional stack.

Detect the circular inclusion, emit a diagnostic and stop processing the
inclusion.

llvm-svn: 360418

5 years ago[cmake] Remove MSVC C4800 override
Simon Pilgrim [Fri, 10 May 2019 10:22:13 +0000 (10:22 +0000)]
[cmake] Remove MSVC C4800 override

Remove C4800 : ''type' : forcing value to bool 'true' or 'false' (performance warning)' from the list of forced disabled warnings.

I'm not seeing any regressions in VS2017/VS2019 llvm/clang builds from removing this.

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

llvm-svn: 360417

5 years ago[Object] Move ELF specific ObjectFile::getBuildAttributes to ELFObjectFileBase
Fangrui Song [Fri, 10 May 2019 10:19:08 +0000 (10:19 +0000)]
[Object] Move ELF specific ObjectFile::getBuildAttributes to ELFObjectFileBase

Change the return type from std::error_code to Error and make the
function protected.

llvm-svn: 360416

5 years ago[DebugInfo] Use zero linenos for debug intrinsics when promoting dbg.declare
Jeremy Morse [Fri, 10 May 2019 10:03:41 +0000 (10:03 +0000)]
[DebugInfo] Use zero linenos for debug intrinsics when promoting dbg.declare

In certain circumstances, optimizations pick line numbers from debug
intrinsic instructions as the new location for altered instructions. This
is problematic because the line number of a debugging intrinsic is
meaningless (it doesn't produce any machine instruction), only the scope
information is valid. The result can be the line number of a variable
declaration "leaking" into real code from debugging intrinsics, making the
line table un-necessarily jumpy, and potentially different with / without
variable locations.

Fix this by using zero line numbers when promoting dbg.declare intrinsics
into dbg.values: this is safe for debug intrinsics as their line numbers
are meaningless, and reduces the scope for damage / misleading stepping
when optimizations pick locations from the wrong place.

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

llvm-svn: 360415

5 years ago[Object] Change SymbolicFile::printSymbolName to use Error
Fangrui Song [Fri, 10 May 2019 09:59:04 +0000 (09:59 +0000)]
[Object] Change SymbolicFile::printSymbolName to use Error

llvm-svn: 360414

5 years ago[cmake] Remove MSVC C4355 override
Simon Pilgrim [Fri, 10 May 2019 09:54:42 +0000 (09:54 +0000)]
[cmake] Remove MSVC C4355 override

Remove C4355 : ''this' : used in base member initializer list' from the list of forced disabled warnings.

I'm not seeing any regressions in VS2017/VS2019 llvm/clang builds from removing this.

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

llvm-svn: 360413

5 years agoMinidump: use ThreadList parsing code from llvm/Object
Pavel Labath [Fri, 10 May 2019 09:36:11 +0000 (09:36 +0000)]
Minidump: use ThreadList parsing code from llvm/Object

llvm-svn: 360412

5 years agoRevert "Revert "[clang-format] Keep protobuf "package" statement on one line""
Krasimir Georgiev [Fri, 10 May 2019 09:15:11 +0000 (09:15 +0000)]
Revert "Revert "[clang-format] Keep protobuf "package" statement on one line""

Summary:
Top-level "package" and "import" statements should generally be kept on
one line, for all languages.

----

This reverts commit rL356912.
The regression from rL356835 was fixed via rC358275.

Reviewers: krasimir, sammccall, MyDeveloperDay, xinz, dchai, klimek

Reviewed By: krasimir, xinz, dchai

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 360411

5 years agoRemove an unnecessary header from SROA.h.
Eric Christopher [Fri, 10 May 2019 07:58:47 +0000 (07:58 +0000)]
Remove an unnecessary header from SROA.h.

llvm-svn: 360410

5 years agoFuncUnwinders: Add a new "SymbolFile" unwind plan
Pavel Labath [Fri, 10 May 2019 07:54:37 +0000 (07:54 +0000)]
FuncUnwinders: Add a new "SymbolFile" unwind plan

Summary:
some unwind formats are specific to a single symbol file and so it does
not make sense for their parsing code live in the general Symbol library
(as is the case with eh_frame for instance). This is the case for the
unwind information in breakpad files, but the same will probably be true
for PDB unwind info (once we are able to parse that).

This patch adds the ability to fetch an unwind plan provided by a symbol
file plugin, as discussed in the RFC at
<http://lists.llvm.org/pipermail/lldb-dev/2019-February/014703.html>.
I've kept the set of changes to a minimum, as there is no way to test
them until we have a symbol file which implements this API -- that is
comming in a follow-up patch, which will also implicitly test this
change.

The interesting part here is the introduction of the
"RegisterInfoResolver" interface. The reason for this is that breakpad
needs to be able to resolve register names (which are present as strings
in the file) into register enums so that it can construct the unwind
plan. This is normally done via the RegisterContext class, handing this
over to the SymbolFile plugin would mean that it has full access to the
debugged process, which is not something we want it to have. So instead,
I create a facade, which only provides the ability to query register
names, and hide the RegisterContext behind the facade.

Also note that this only adds the ability to dump the unwind plan
created by the symbol file plugin -- the plan is not used for unwinding
yet -- this will be added in a third patch, which will add additional
tests which makes sure the unwinding works as a whole.

Reviewers: jasonmolenda, clayborg

Subscribers: markmentovai, amccarth, lldb-commits

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

llvm-svn: 360409

5 years agoDelete write-only HasQualifiers after rC360370
Fangrui Song [Fri, 10 May 2019 06:59:50 +0000 (06:59 +0000)]
Delete write-only HasQualifiers after rC360370

llvm-svn: 360408

5 years agoRevert "Disable the step over skipping calls feature since buildbots are not happy."
Pavel Labath [Fri, 10 May 2019 06:57:25 +0000 (06:57 +0000)]
Revert "Disable the step over skipping calls feature since buildbots are not happy."

While this fixed the windows bot failures, it also broke all other bots.

Upon closer inspection, it turns out that the windows bots were "broken"
because two tests were unexpectedly passing -- i.e., the original patch
(r360375) actually improved our stepping support on windows.

So instead, I remove the relevant XFAILs.

This reverts commit r360397.

llvm-svn: 360407

5 years agoAdded an assert in `isConstantInitializer`: initializer lists must be in semantic...
Dmitri Gribenko [Fri, 10 May 2019 06:39:20 +0000 (06:39 +0000)]
Added an assert in `isConstantInitializer`: initializer lists must be in semantic form

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 360406

5 years ago[PPC64] Define getThunkSectionSpacing() based on the range of R_PPC64_REL24
Fangrui Song [Fri, 10 May 2019 05:51:00 +0000 (05:51 +0000)]
[PPC64] Define getThunkSectionSpacing() based on the range of R_PPC64_REL24

Suggested by Sean Fertile and Peter Smith.

Thunk section spacing decrease the total number of thunks. I measured a
decrease of 1% or less in some large programs, with no perceivable
slowdown in link time. Override getThunkSectionSpacing() to enable it.
0x2000000 is the farthest point R_PPC64_REL24 can reach. I tried several
numbers and found 0x2000000 works the best. Numbers near 0x2000000 work
as well but let's just use the simpler number.

As demonstrated by the updated tests, this essentially changes placement
of most thunks to the end of the output section. We leverage this
property to fix PR40740 reported by Alfredo Dal'Ava JĂșnior:

The output section .init consists of input sections from several object
files (crti.o crtbegin.o crtend.o crtn.o). Sections other than the last
one do not have a terminator. With this patch, we create the thunk after
the last .init input section and thus fix the issue. This is not
foolproof but works quite well for such sections (with no terminator) in
practice.

Reviewed By: ruiu, sfertile

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

llvm-svn: 360405

5 years agoAssume `__cxa_allocate_exception` returns an under-aligned memory on
Akira Hatanaka [Fri, 10 May 2019 02:16:37 +0000 (02:16 +0000)]
Assume `__cxa_allocate_exception` returns an under-aligned memory on
Darwin if the version of libc++abi isn't new enough to include the fix
in r319123

This patch resurrects r264998, which was committed to work around a bug
in libc++abi that was causing _cxa_allocate_exception to return a memory
that wasn't double-word aligned.

http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160328/154332.html

In addition, this patch makes clang issue a warning if the type of the
thrown object requires an alignment that is larger than the minimum
guaranteed by the target C++ runtime.

rdar://problem/49864414

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

llvm-svn: 360404

5 years agoChange -gz and -Wa,--compress-debug-sections to use gABI compression (SHF_COMPRESSED)
Fangrui Song [Fri, 10 May 2019 02:08:21 +0000 (02:08 +0000)]
Change -gz and -Wa,--compress-debug-sections to use gABI compression (SHF_COMPRESSED)

Since July 15, 2015 (binutils-gdb commit
19a7fe52ae3d0971e67a134bcb1648899e21ae1c, included in 2.26), gas
--compress-debug-sections=zlib (gcc -gz) means zlib-gabi:
SHF_COMPRESSED. Before that it meant zlib-gnu (.zdebug).

clang's -gz was introduced in rC306115 (Jun 2017) to indicate zlib-gnu. It
is 2019 now and it is not unreasonable to assume users of the new
feature to have new linkers (ld.bfd/gold >= 2.26, lld >= rLLD273661).

Change clang's default accordingly to improve standard conformance.
zlib-gnu becomes out of fashion and gets poorer toolchain support.
Its mangled names confuse tools and are more likely to cause problems.

Reviewed By: compnerd

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

llvm-svn: 360403

5 years ago[WebAssembly] Don't assume that strongly defined symbols are DSO-local
Sam Clegg [Fri, 10 May 2019 01:52:08 +0000 (01:52 +0000)]
[WebAssembly] Don't assume that strongly defined symbols are DSO-local

The current PIC model for WebAssembly is more like ELF in that it
allows symbol interposition.

This means that more functions end up being addressed via the GOT
and fewer directly added to the wasm table.

One effect is a reduction in the number of wasm table entries similar
to the previous attempt in https://reviews.llvm.org/D61539 which was
reverted.

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

llvm-svn: 360402

5 years ago[WebAssembly] Remove friend18.C from list of known gcc torture test failures. NFC.
Sam Clegg [Fri, 10 May 2019 01:45:34 +0000 (01:45 +0000)]
[WebAssembly] Remove friend18.C from list of known gcc torture test failures. NFC.

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

llvm-svn: 360401

5 years ago[libFuzzer] code refactoring; NFC
Kostya Serebryany [Fri, 10 May 2019 01:34:26 +0000 (01:34 +0000)]
[libFuzzer] code refactoring; NFC

llvm-svn: 360400

5 years ago[libFuzzer] small refactoring in the driver; dummy implementation of collect_data_flo...
Kostya Serebryany [Fri, 10 May 2019 00:59:32 +0000 (00:59 +0000)]
[libFuzzer] small refactoring in the driver; dummy implementation of collect_data_flow; attempt to fix the windows bot

llvm-svn: 360399

5 years ago[Docs] Fix table formatting in Pytho reference
Jonas Devlieghere [Fri, 10 May 2019 00:23:02 +0000 (00:23 +0000)]
[Docs] Fix table formatting in Pytho reference

llvm-svn: 360398

5 years agoDisable the step over skipping calls feature since buildbots are not happy.
Greg Clayton [Fri, 10 May 2019 00:13:03 +0000 (00:13 +0000)]
Disable the step over skipping calls feature since buildbots are not happy.

llvm-svn: 360397

5 years ago[llvm] X86DiscriminateMemOps: insert debug info when missing
Mircea Trofin [Fri, 10 May 2019 00:12:51 +0000 (00:12 +0000)]
[llvm] X86DiscriminateMemOps: insert debug info when missing

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: aprantl, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 360396

5 years ago[AMDGPU] Pattern for v_xor3_b32
Stanislav Mekhanoshin [Fri, 10 May 2019 00:09:01 +0000 (00:09 +0000)]
[AMDGPU] Pattern for v_xor3_b32

This also allows three op patterns to use increased constant bus
limit of GFX10.

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

llvm-svn: 360395

5 years ago[compiler-rt] Migrate to _zx_clock_get_new/_zx_clock_get_monotonic
Petr Hosek [Thu, 9 May 2019 23:42:58 +0000 (23:42 +0000)]
[compiler-rt] Migrate to _zx_clock_get_new/_zx_clock_get_monotonic

This is part of the soft-transition to the new _zx_clock_get signature.

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

llvm-svn: 360394

5 years ago[X86] Improve lowering of idemptotent RMW operations
Philip Reames [Thu, 9 May 2019 23:23:42 +0000 (23:23 +0000)]
[X86] Improve lowering of idemptotent RMW operations

The current lowering uses an mfence. mfences are substaintially higher latency than the locked operations originally requested, but we do want to avoid contention on the original cache line. As such, use a locked instruction on a cache line assumed to be thread local.

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

llvm-svn: 360393

5 years ago[JITLink] Fixed a signedness bug when processing X86_64_RELOC_SUBTRACTOR.
Lang Hames [Thu, 9 May 2019 23:17:41 +0000 (23:17 +0000)]
[JITLink] Fixed a signedness bug when processing X86_64_RELOC_SUBTRACTOR.

Subtractor relocation addends are signed, so we need to read them via signed
int pointers. Accidentally treating 32-bit addends as unsigned leads to
out-of-range errors when we try to add very large (>INT32_MAX) bogus addends.

llvm-svn: 360392

5 years agoCompile time tweak for libcall lookup
Philip Reames [Thu, 9 May 2019 23:13:09 +0000 (23:13 +0000)]
Compile time tweak for libcall lookup

If we have a large module which is mostly intrinsics, we hammer the lib call lookup path from CodeGenPrepare.  Adding a fastpath reduces compile by 15% for one such example.

The problem is really more general than intrinsics - a module with lots of non-intrinsics non-libcall calls has the same problem - but we might as well avoid an easy case quickly.

llvm-svn: 360391

5 years ago[libFuzzer] Unpoison parameters before calling user callback.
Matt Morehouse [Thu, 9 May 2019 22:48:46 +0000 (22:48 +0000)]
[libFuzzer] Unpoison parameters before calling user callback.

Summary:
Fixes an MSan false positive when compiling with
-fsanitize=memory,fuzzer.

See https://github.com/google/oss-fuzz/issues/2369 for more details.

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits, metzman, eugenis

Tags: #llvm

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

llvm-svn: 360390

5 years ago[NFC][compiler-rt][builtins] Tidy and match comments for floating point operations
Leonard Chan [Thu, 9 May 2019 22:48:30 +0000 (22:48 +0000)]
[NFC][compiler-rt][builtins] Tidy and match comments for floating point operations

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

llvm-svn: 360389

5 years ago[TSan][libdispatch] Enable test that supposedly deadlocks on bot
Julian Lettner [Thu, 9 May 2019 22:47:19 +0000 (22:47 +0000)]
[TSan][libdispatch] Enable test that supposedly deadlocks on bot

Re-enable test that was disabled because it deadlocks when running on
the bot, but was never enabled again. Can't reproduce deadlock locally
so trying to investigate by re-enabling test.

llvm-svn: 360388

5 years agoRemember to decay arrays to pointers before checking whether the
Richard Smith [Thu, 9 May 2019 22:22:48 +0000 (22:22 +0000)]
Remember to decay arrays to pointers before checking whether the
left-hand side of an -> operator is a pointer to class type.

llvm-svn: 360387

5 years ago[Docs] Port python reference page
Jonas Devlieghere [Thu, 9 May 2019 22:14:14 +0000 (22:14 +0000)]
[Docs] Port python reference page

I somehow forgot to port over this page from the old website. Thank you
Jim for the heads up!

llvm-svn: 360386

5 years ago[libFuzzer] perform more agressive value profiling in memcmp
Kostya Serebryany [Thu, 9 May 2019 22:09:25 +0000 (22:09 +0000)]
[libFuzzer] perform more agressive value profiling in memcmp

llvm-svn: 360385

5 years ago[ORC] Simplify logic for updating edges when should-discard atoms are pruned.
Lang Hames [Thu, 9 May 2019 22:03:58 +0000 (22:03 +0000)]
[ORC] Simplify logic for updating edges when should-discard atoms are pruned.

llvm-svn: 360384

5 years ago[JITLink] Improve/fix some JITLink debugging output.
Lang Hames [Thu, 9 May 2019 22:03:57 +0000 (22:03 +0000)]
[JITLink] Improve/fix some JITLink debugging output.

Adds full edge details (rather than just edge targets) when out-of-range errors
are generated. Also fixes a bug where debugging output accessed an invalidated
DenseMap iterator by moving the debugging output above the invalidation point.

llvm-svn: 360383

5 years ago[ORC] Fix a formatting bug.
Lang Hames [Thu, 9 May 2019 22:03:53 +0000 (22:03 +0000)]
[ORC] Fix a formatting bug.

llvm-svn: 360382

5 years agoAdd ".dword" directive
Bill Wendling [Thu, 9 May 2019 21:57:44 +0000 (21:57 +0000)]
Add ".dword" directive

Summary:
The ".dword" directive is a synonym for ".xword" and is used used
by klibc, a minimalistic libc subset for initramfs.

Reviewers: t.p.northover, nickdesaulniers

Reviewed By: nickdesaulniers

Subscribers: nickdesaulniers, javed.absar, llvm-commits

Tags: #llvm

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

llvm-svn: 360381

5 years agollvm-dwarfdump: Add dwo parsing to --statistics.
Caroline Tice [Thu, 9 May 2019 21:53:33 +0000 (21:53 +0000)]
llvm-dwarfdump: Add dwo parsing to --statistics.

Add check for, and parsing of, .dwo files to Statistics.cpp; create a new getNon
SkeletonUnitDie function for DWARFUnit.h

Reviewers: dblaikie

Differential Revision: https://review.llvm.org/D61755

llvm-svn: 360380

5 years ago[MSan] Introduce __msan_unpoison_param().
Matt Morehouse [Thu, 9 May 2019 21:50:57 +0000 (21:50 +0000)]
[MSan] Introduce __msan_unpoison_param().

Summary:
This allows libFuzzer to unpoison parameter shadow before calling
LLVMFuzzerTestOneInput to eliminate the false positives described
in https://github.com/google/oss-fuzz/issues/2369.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: llvm-commits, metzman, kcc

Tags: #llvm

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

llvm-svn: 360379

5 years ago[libFuzzer] implement -focus_function=auto, to be used with Data Flow Traces
Kostya Serebryany [Thu, 9 May 2019 21:29:45 +0000 (21:29 +0000)]
[libFuzzer] implement -focus_function=auto, to be used with Data Flow Traces

llvm-svn: 360378

5 years agoDebugInfo/DWARF: Minor expression simplification
David Blaikie [Thu, 9 May 2019 21:23:40 +0000 (21:23 +0000)]
DebugInfo/DWARF: Minor expression simplification

llvm-svn: 360377

5 years ago[COFF] Simplify Chunk::writeTo and remove OutputSectionOff, NFC
Reid Kleckner [Thu, 9 May 2019 21:21:22 +0000 (21:21 +0000)]
[COFF] Simplify Chunk::writeTo and remove OutputSectionOff, NFC

Summary:
Prior to this change, every implementation of writeTo would add
OutputSectionOff to the output section buffer start before writing data.
Instead, do this math in the caller, so that it can be written once
instead of many times.

The output section offset is always equivalent to the difference between
the chunk RVA and the output section RVA, so we can replace the one
remaining usage of OutputSectionOff with that subtraction.

This doesn't change the size of SectionChunk because of alignment
requirements, but I will rearrange the fields in a follow-up change to
accomplish that.

Reviewers: ruiu, aganea

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 360376

5 years agoImprove step over performance by not stopping at branches that are function calls...
Greg Clayton [Thu, 9 May 2019 20:39:34 +0000 (20:39 +0000)]
Improve step over performance by not stopping at branches that are function calls and stepping into and them out of each one

Currently when we single step over a source line, we run and stop at every branch in the source line range. We can reduce the number of times we stop when stepping over by figuring out if any of these branches are function calls, and if so, ignore these branches. Since we are stepping over we can safely ignore these calls since they will return to the next instruction. Currently the step logic would stop at those branches (1st stop), single step into the branch (2nd stop), and then set a breakpoint at the return address (3rd stop), and then continue.

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

llvm-svn: 360375

5 years agoNFC, make XFAIL work on macOS correctly for test/Driver/XRay/xray-instrument-os.c
Alex Lorenz [Thu, 9 May 2019 20:35:41 +0000 (20:35 +0000)]
NFC, make XFAIL work on macOS correctly for test/Driver/XRay/xray-instrument-os.c

The test 'test/Driver/XRay/xray-instrument-os.c' is supposed to XFAIL on -darwin triples.
However, LLVM can be configured to be built with a -macos triple instead, which is equivalent
to -darwin. This commit updates the XFAIL condition to also XFAIL with a -macos host triple.

llvm-svn: 360374

5 years agoUse UNSUPPORTED: windows in shtest-timeout.py. Apparently system-windows does not...
Stella Stamenova [Thu, 9 May 2019 20:22:02 +0000 (20:22 +0000)]
Use UNSUPPORTED: windows in shtest-timeout.py. Apparently system-windows does not cover all cases either and the case it doesn't cover affects one of the buildbots.

llvm-svn: 360373

5 years ago[libFuzzer] simplify value-profile-mem.test a little bit
Kostya Serebryany [Thu, 9 May 2019 20:20:36 +0000 (20:20 +0000)]
[libFuzzer] simplify value-profile-mem.test a little bit

llvm-svn: 360372

5 years agoFix TestVSCode_attach on Linux
Stella Stamenova [Thu, 9 May 2019 19:49:26 +0000 (19:49 +0000)]
Fix TestVSCode_attach on Linux

The test is failing sometimes because the debugger is failing to attach for lack of permissions. The fix is to call lldb_enable_attach inside the inferior main function

llvm-svn: 360371

5 years agoDR1872: don't allow any calls to virtual functions in constant
Richard Smith [Thu, 9 May 2019 19:45:49 +0000 (19:45 +0000)]
DR1872: don't allow any calls to virtual functions in constant
evaluation.

Not even in cases where we would not actually perform virtual dispatch.

llvm-svn: 360370

5 years agoSimplify tracking of end of consumed decl-specifier sequence.
Richard Smith [Thu, 9 May 2019 19:45:46 +0000 (19:45 +0000)]
Simplify tracking of end of consumed decl-specifier sequence.

Patch by Tyker!

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

llvm-svn: 360369

5 years agoUse UNSUPPORTED: system-windows instead of REQUIRES: nowindows or UNSUPPORTED: window...
Stella Stamenova [Thu, 9 May 2019 19:40:21 +0000 (19:40 +0000)]
Use UNSUPPORTED: system-windows instead of REQUIRES: nowindows or UNSUPPORTED: windows. nowindows is not currently defined and windows does not cover all cases. system-windows is also consistent with how other platforms are used.

llvm-svn: 360368

5 years agoRevert "[WebAssembly] Don't generate unused table entries."
Sam Clegg [Thu, 9 May 2019 19:34:32 +0000 (19:34 +0000)]
Revert "[WebAssembly] Don't generate unused table entries."

This reverts commit b33fdb7768e5de5fbeb23f65d8d455e7ca88b021.

This change apparently broke am emscripten test.

llvm-svn: 360367

5 years ago[CodeGen] Add comment about FSUB <-> FNEG xforms
Cameron McInally [Thu, 9 May 2019 19:28:52 +0000 (19:28 +0000)]
[CodeGen] Add comment about FSUB <-> FNEG xforms

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

llvm-svn: 360366

5 years ago[OPENMP]Fix PR41767: diagnose DSA for variables in clauses with default(none).
Alexey Bataev [Thu, 9 May 2019 18:44:53 +0000 (18:44 +0000)]
[OPENMP]Fix PR41767: diagnose DSA for variables in clauses with default(none).

If the combined directive has default(none) clause and has clauses for
inner directive that reference some variables, for which data-sharing
attributes are not specified, the error messages should be emitted for
such variables.

llvm-svn: 360365

5 years ago[AMDGPU] gfx1010 v_interp_* instructions
Stanislav Mekhanoshin [Thu, 9 May 2019 18:38:55 +0000 (18:38 +0000)]
[AMDGPU] gfx1010 v_interp_* instructions

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

llvm-svn: 360364

5 years agoSpecify target triple to fix the tests I committed in r360359 that are
Akira Hatanaka [Thu, 9 May 2019 18:32:16 +0000 (18:32 +0000)]
Specify target triple to fix the tests I committed in r360359 that are
still failing.

llvm-svn: 360363

5 years ago[OPENMP]Fix PR41768: check DSA for globals with default(none) clauses.
Alexey Bataev [Thu, 9 May 2019 18:14:57 +0000 (18:14 +0000)]
[OPENMP]Fix PR41768: check DSA for globals with default(none) clauses.

If the default(none) was specified for the construct, we might miss
diagnostic for the globals without explicitly specified data-sharing
attributes. Patch fixes this problem.

llvm-svn: 360362

5 years agoSpecify ObjC runtime to fix the tests I committed in r360359 that are
Akira Hatanaka [Thu, 9 May 2019 18:05:17 +0000 (18:05 +0000)]
Specify ObjC runtime to fix the tests I committed in r360359 that are
failing.

llvm-svn: 360361

5 years ago[X86][SSE] Fold add(shuffle(),shuffle()) to hadd on 'slow' targets (PR39920)
Simon Pilgrim [Thu, 9 May 2019 17:45:01 +0000 (17:45 +0000)]
[X86][SSE] Fold add(shuffle(),shuffle()) to hadd on 'slow' targets (PR39920)

As reported on PR39920, "slow horizontal ops" targets tend to internally expand to 2*shuffle+add/sub - so if we can reduce 2*shuffle+add/sub to a hadd/sub then we should do it - similar port usage but reduced instruction count.

This works out in most cases, although the "PR22377" regression in vector-shuffle-combining.ll is annoying - going from 2*shuffle+add+shuffle to hadd+2*shuffle - I've opened PR41813 to cover this.

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

llvm-svn: 360360

5 years ago[CodeGen][ObjC] Remove the leading `l_` from ObjC symbols and make
Akira Hatanaka [Thu, 9 May 2019 17:43:52 +0000 (17:43 +0000)]
[CodeGen][ObjC] Remove the leading `l_` from ObjC symbols and make
private symbols in the __DATA segment internal.

This prevents the linker from removing the symbol names. Keeping the
symbols visible enables tools to collect various information about the
symbols, for example, tools that discover whether or not a symbol gets
dirtied.

rdar://problem/48887111

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

llvm-svn: 360359