platform/upstream/llvm.git
5 years ago[builtins] Use libtool for builtins when building for Apple platform
Petr Hosek [Tue, 4 Jun 2019 02:38:15 +0000 (02:38 +0000)]
[builtins] Use libtool for builtins when building for Apple platform

compiler-rt already uses libtool instead of ar when building for
Apple platform, but that's not being used when builtins are being
built separately e.g. as part of the runtimes build. This change
extracts the logic setting up libtool into a separate file and uses
it from both the compiler-rt and standalone builtins build.

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

llvm-svn: 362466

5 years agoWe had a _LIBCPP_ASSERT commented out because gcc 4.9 didn't like it. We (LLVM) now...
Marshall Clow [Tue, 4 Jun 2019 02:07:11 +0000 (02:07 +0000)]
We had a _LIBCPP_ASSERT commented out because gcc 4.9 didn't like it. We (LLVM) now require GCC 5.1, so that's not a problem any more. Re-enable the assertion. Fixes PR#36863

llvm-svn: 362465

5 years agoAdd a release note entry for the change made in r362034.
Akira Hatanaka [Mon, 3 Jun 2019 23:48:14 +0000 (23:48 +0000)]
Add a release note entry for the change made in r362034.

llvm-svn: 362464

5 years agoFix windows build for commit r362459
Alex Lorenz [Mon, 3 Jun 2019 23:17:21 +0000 (23:17 +0000)]
Fix windows build for commit r362459

llvm-svn: 362463

5 years agoRemove test/CodeGen/builtin-stackaddress.c as it duplicates
Eric Christopher [Mon, 3 Jun 2019 23:16:06 +0000 (23:16 +0000)]
Remove test/CodeGen/builtin-stackaddress.c as it duplicates
test/CodeGen/2004-02-13-BuiltinFrameReturnAddress.c.

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

llvm-svn: 362462

5 years ago[Target] Generalize some behavior in Target::SymbolsDidLoad
Alex Langford [Mon, 3 Jun 2019 23:12:11 +0000 (23:12 +0000)]
[Target] Generalize some behavior in Target::SymbolsDidLoad

Summary:
SymbolsDidLoad is currently only implemented for ObjCLanguageRuntime,
but that doesn't mean that it couldn't be useful for other Langauges. Although
this change seems like it's generalizing for the sake of purity, this removes
Target's dependency on ObjCLanguageRuntime.

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

llvm-svn: 362461

5 years ago[NFC][X86] Fixup FileCheck prefixes - drop duplicates
Roman Lebedev [Mon, 3 Jun 2019 23:00:51 +0000 (23:00 +0000)]
[NFC][X86] Fixup FileCheck prefixes - drop duplicates

llvm-svn: 362460

5 years agoAdd clang source minimizer that reduces source to directives
Alex Lorenz [Mon, 3 Jun 2019 22:59:17 +0000 (22:59 +0000)]
Add clang source minimizer that reduces source to directives
that might affect the dependency list for a compilation

This commit introduces a dependency directives source minimizer to clang
that minimizes header and source files to the minimum necessary preprocessor
directives for evaluating includes. It reduces the source down to #define, #include,

The source minimizer works by lexing the input with a custom fast lexer that recognizes
the preprocessor directives it cares about, and emitting those directives in the minimized source.
It ignores source code, comments, and normalizes whitespace. It gives up and fails if seems
any directives that it doesn't recognize as valid (e.g. #define 0).

In addition to the source minimizer this patch adds a
-print-dependency-directives-minimized-source CC1 option that allows you to invoke the minimizer
from clang directly.

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

llvm-svn: 362459

5 years ago[Target] Move ObjCLanguageRuntime::LookupRuntimeSymbol into LanguageRuntime
Alex Langford [Mon, 3 Jun 2019 22:41:48 +0000 (22:41 +0000)]
[Target] Move ObjCLanguageRuntime::LookupRuntimeSymbol into LanguageRuntime

Summary:
LookupRuntimeSymbol seems like a general LanguageRuntime method.
Although no other language runtime currently implements this, there's no
reason another language runtime couldn't use this.

Additionally, this breaks IRExecutionUnit's dependency on
ObjCLanguageRuntime.

Reviewers: compnerd, labath, JDevlieghere, davide

Subscribers: lldb-commits

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

llvm-svn: 362458

5 years ago[X86] Add test cases for 32 and 64 bit versions of PR42118. NFC
Craig Topper [Mon, 3 Jun 2019 22:34:15 +0000 (22:34 +0000)]
[X86] Add test cases for 32 and 64 bit versions of PR42118. NFC

llvm-svn: 362457

5 years agoAdd support for mid-function epilogues on x86 that end in a non-local jump.
Jason Molenda [Mon, 3 Jun 2019 22:34:12 +0000 (22:34 +0000)]
Add support for mid-function epilogues on x86 that end in a non-local jump.

The x86 assembly inspection engine has code to support detecting a
mid-function epilogue that ends in a RET instruction; add support for
recognizing an epilogue that ends in a JMP, and add a check that the
unwind state has been restored to the original stack setup; reinstate
the post-prologue unwind state after this JMP instruction.

The assembly inspection engine used for other architectures,
UnwindAssemblyInstEmulation, detects mid-function epilogues by
tracking branch instructions within the function and "forwards"
the current unwind state to the targets of the branches.  If
an epilogue unwinds the stack and exits, followed by a branch
target, we get back to the correct unwind state.  The x86
unwinder should move to this same algorithm, or possibly even
look at implementing an x86 instruction emulation plugin and
get UnwindAssemblyInstEmulation to work for x86 too.  I added
a branch instruction recognizier method that will be necessary
if we want to switch the algorithm.

Differential Revision: https://reviews.llvm.org/D62764
<rdar://problem/51074422>

llvm-svn: 362456

5 years ago[NFC][Codegen] Add tests for hoisting and-by-const from "logical shift", when then...
Roman Lebedev [Mon, 3 Jun 2019 22:30:18 +0000 (22:30 +0000)]
[NFC][Codegen] Add tests for hoisting and-by-const from "logical shift", when then eq-comparing with 0

This was initially reported as: https://reviews.llvm.org/D62818

https://rise4fun.com/Alive/oPH

llvm-svn: 362455

5 years agoFix DWARF DebugInfo unit test errors when cross-compiling
Jason Liu [Mon, 3 Jun 2019 22:22:03 +0000 (22:22 +0000)]
Fix DWARF DebugInfo unit test errors when cross-compiling

Summary:
When building with a Default Target set we can experience issues
in the DWARF DebugInfo unit tests because:

They assume we can generate object files for the host platform.
Some tests assume the endianess of the target we are generating
DWARF for and the host match.

This patch correct these issues by ensuring the tests which
generate objects in memory are run with respect to
LVM_DEFAULT_TARGET_TRIPLE and it's endianess.

We also make sure we don't use the hosts address size for line test
and split the triple util function in DwarfUtils into a version
that takes an address size and one that doesn't.

See also for discussion:
http://lists.llvm.org/pipermail/llvm-dev/2019-March/131212.html

Patch by: daltenty

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

llvm-svn: 362454

5 years agoRevert r362451 "foo" and r362452 "[X86] Add test cases for 32 and 64 bit versions...
Craig Topper [Mon, 3 Jun 2019 22:14:54 +0000 (22:14 +0000)]
Revert r362451 "foo" and r362452 "[X86] Add test cases for 32 and 64 bit versions of PR42118. NFC"

I failed to squash these properly

llvm-svn: 362453

5 years ago[X86] Add test cases for 32 and 64 bit versions of PR42118. NFC
Craig Topper [Mon, 3 Jun 2019 22:11:40 +0000 (22:11 +0000)]
[X86] Add test cases for 32 and 64 bit versions of PR42118. NFC

llvm-svn: 362452

5 years agofoo
Craig Topper [Mon, 3 Jun 2019 22:11:30 +0000 (22:11 +0000)]
foo

llvm-svn: 362451

5 years ago[ORC] Use uint8_t for bitfields in SymbolTableEntry.
Lang Hames [Mon, 3 Jun 2019 22:02:48 +0000 (22:02 +0000)]
[ORC] Use uint8_t for bitfields in SymbolTableEntry.

This allows for better struct packing on MSVC, and as a bonus will eliminate a
warning on GCC builds.

llvm-svn: 362450

5 years ago[SCCP] Add UnaryOperator visitor to SCCP for unary FNeg
Cameron McInally [Mon, 3 Jun 2019 21:53:56 +0000 (21:53 +0000)]
[SCCP] Add UnaryOperator visitor to SCCP for unary FNeg

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

llvm-svn: 362449

5 years agoPropagate fmf for setcc in SDAG for select folds
Michael Berg [Mon, 3 Jun 2019 21:53:26 +0000 (21:53 +0000)]
Propagate fmf for setcc in SDAG for select folds

llvm-svn: 362448

5 years agoAMDGPU: Disable stack realignment for kernels
Matt Arsenault [Mon, 3 Jun 2019 21:33:22 +0000 (21:33 +0000)]
AMDGPU: Disable stack realignment for kernels

This is something of a workaround, and the state of stack realignment
controls is kind of a mess. Ideally, we would be able to specify the
stack is infinitely aligned on entry to a kernel.

TargetFrameLowering provides multiple controls which apply at
different points. The StackRealignable field is used during
SelectionDAG, and for some reason distinct from this
hook. StackAlignment is a single field not dependent on the
function. It would probably be better to make that dependent on the
calling convention, and the maximum value for kernels.

Currently this doesn't really change anything, since the frame
lowering mostly does its own thing. This helps avoid regressions in a
future change which will rely more heavily on hasFP.

llvm-svn: 362447

5 years ago[AArch64][GlobalISel] Optimize G_FCMP + G_SELECT pairs when G_SELECT is fp
Jessica Paquette [Mon, 3 Jun 2019 20:47:20 +0000 (20:47 +0000)]
[AArch64][GlobalISel] Optimize G_FCMP + G_SELECT pairs when G_SELECT is fp

Instead of emitting all of the test stuff for a compare when it's only used by
a select, instead, just emit the compare + select. The select will use the
value of NZCV correctly, so we don't need to emit all of the test instructions
etc.

For now, only support fp selects which use G_FCMP. Also only support condition
codes which will only require one select to represent.

Also add a test.

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

llvm-svn: 362446

5 years agogn build: Merge r361896.
Peter Collingbourne [Mon, 3 Jun 2019 20:40:07 +0000 (20:40 +0000)]
gn build: Merge r361896.

llvm-svn: 362445

5 years agoELF: Introduce a separate bit for tracking whether an output section has ever had...
Peter Collingbourne [Mon, 3 Jun 2019 20:14:25 +0000 (20:14 +0000)]
ELF: Introduce a separate bit for tracking whether an output section has ever had an input section added to it. NFCI.

We currently (ab)use the Live bit on output sections to track whether
the section has ever had an input section added to it, and then later
use it during orphan placement. This will conflict with one of my upcoming
partition-related changes that will assign all output sections to a partition
(thus marking them as live) so that they can be added to the correct segment
by the code that creates program headers.

Instead of using the Live bit for this purpose, create a new flag and
start using it to track the property explicitly.

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

llvm-svn: 362444

5 years agoFix test failure from r362435
Erich Keane [Mon, 3 Jun 2019 19:57:52 +0000 (19:57 +0000)]
Fix test failure from r362435

Apparently I forgot to do an open brace in a namespace, so we get an
error about an extra closing brace.

llvm-svn: 362443

5 years agoCFLAA: reflow comments; NFC
George Burgess IV [Mon, 3 Jun 2019 19:56:22 +0000 (19:56 +0000)]
CFLAA: reflow comments; NFC

llvm-svn: 362442

5 years ago[CFLGraph] Add FAdd to visitConstantExpr.
Craig Topper [Mon, 3 Jun 2019 19:35:52 +0000 (19:35 +0000)]
[CFLGraph] Add FAdd to visitConstantExpr.

This looks like an oversight as all the other binary operators are present.

Accidentally noticed while auditing places that need FNeg handling.

No test because as noted in the review it would be contrived and amount to "don't crash"

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

llvm-svn: 362441

5 years ago[X86] Fix the pattern for merge masked vcvtps2pd.
Craig Topper [Mon, 3 Jun 2019 19:29:14 +0000 (19:29 +0000)]
[X86] Fix the pattern for merge masked vcvtps2pd.

r362199 fixed it for zero masking, but not zero masking. The load
folding in the peephole pass hid the bug. This patch turns off
the peephole pass on the relevant test to ensure coverage.

llvm-svn: 362440

5 years agoPropagate fmf for setcc/select folds
Michael Berg [Mon, 3 Jun 2019 19:12:15 +0000 (19:12 +0000)]
Propagate fmf for setcc/select folds

Summary: This change facilitates propagating fmf which was placed on setcc from fcmp through folds with selects so that back ends can model this path for arithmetic folds on selects in SDAG.

Reviewers: qcolombet, spatel

Reviewed By: qcolombet

Subscribers: nemanjai, jsji

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

llvm-svn: 362439

5 years ago[PowerPC] Look through copies for compare elimination
Nemanja Ivanovic [Mon, 3 Jun 2019 19:09:15 +0000 (19:09 +0000)]
[PowerPC] Look through copies for compare elimination

We currently miss the opportunities for optmizing comparisons in the peephole
optimizer if the input is the result of a COPY since we look for record-form
versions of the producing instruction.

This patch simply lets the optimization peek through copies.

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

llvm-svn: 362438

5 years agoSilence 'warning C4305: 'initializing': truncation from 'double' to 'float'' with...
Alexandre Ganea [Mon, 3 Jun 2019 18:46:30 +0000 (18:46 +0000)]
Silence 'warning C4305: 'initializing': truncation from 'double' to 'float'' with MSVC 19.16.27021.1 (VS2017 15.9.12)

llvm-svn: 362437

5 years agoTTI: Improve default costs for addrspacecast
Matt Arsenault [Mon, 3 Jun 2019 18:41:34 +0000 (18:41 +0000)]
TTI: Improve default costs for addrspacecast

For some reason multiple places need to do this, and the variant the
loop unroller and inliner use was not handling it.

Also, introduce a new wrapper to be slightly more precise, since on
AMDGPU some addrspacecasts are free, but not no-ops.

llvm-svn: 362436

5 years agoMake NoThrow FunctionLike, make FunctionLike include references, fix
Erich Keane [Mon, 3 Jun 2019 18:36:33 +0000 (18:36 +0000)]
Make NoThrow FunctionLike, make FunctionLike include references, fix
prettyprint

__declspec(nothrow) should work on function pointers as well as function
references, so this changes it to FunctionLike.  Additionally,
FunctionLike needed to be modified to permit function references.

Finally, the TypePrinter didn't properly print the NoThrow exception
specifier, so make sure we get that right as well.

llvm-svn: 362435

5 years agoPermit Exception Spec mismatch with NoThrow on inherited Virtual
Erich Keane [Mon, 3 Jun 2019 18:36:26 +0000 (18:36 +0000)]
Permit Exception Spec mismatch with NoThrow on inherited Virtual

As reported here: https://bugs.llvm.org/show_bug.cgi?id=42100

This fairly common pattern ends up being an error in MinGW, so relax it
in all cases to a warning.

llvm-svn: 362434

5 years agogn build: Merge r362371
Nico Weber [Mon, 3 Jun 2019 18:29:00 +0000 (18:29 +0000)]
gn build: Merge r362371

llvm-svn: 362433

5 years agoAdd ScalarEvolutionsTest::SCEVExpandInsertCanonicalIV tests
Artur Pilipenko [Mon, 3 Jun 2019 18:26:45 +0000 (18:26 +0000)]
Add ScalarEvolutionsTest::SCEVExpandInsertCanonicalIV tests

Test insertion of canonical IV in canonical expansion mode.

llvm-svn: 362432

5 years agoAdd cdb test for inline line tables
Reid Kleckner [Mon, 3 Jun 2019 18:24:55 +0000 (18:24 +0000)]
Add cdb test for inline line tables

This creates an integration test for inlined call line tables, and in
particular, ones that are discontiguous. We've had issues in the past
with discontiguous inline line tables, and until r362429 LLD didn't
write the inlinees section into the PDB.

The test was reduced from https://crbug.com/965670

Reviewers: thakis

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

llvm-svn: 362431

5 years ago[ConstantRange] Add sdiv() support
Nikita Popov [Mon, 3 Jun 2019 18:19:54 +0000 (18:19 +0000)]
[ConstantRange] Add sdiv() support

The implementation is conceptually simple: We separate the LHS and
RHS into positive and negative components and then also compute the
positive and negative components of the result, taking into account
that e.g. only pos/pos and neg/neg will give a positive result.

However, there's one significant complication: SignedMin / -1 is UB
for sdiv, and we can't just ignore it, because the APInt result of
SignedMin would break the sign segregation. Instead we drop SignedMin
or -1 from the corresponding ranges, taking into account some edge
cases with wrapped ranges.

Because of the sign segregation, the implementation ends up being
nearly fully precise even for wrapped ranges (the remaining
imprecision is due to ranges that are both signed and unsigned
wrapping and are divided by a trivial divisor like 1). This means
that the testing cannot just check the signed envelope as we
usually do. Instead we collect all possible results in a bitvector
and construct a better sign wrapped range (than the full envelope).

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

llvm-svn: 362430

5 years ago[PDB] Copy inlinee lines records into the PDB
Reid Kleckner [Mon, 3 Jun 2019 18:15:38 +0000 (18:15 +0000)]
[PDB] Copy inlinee lines records into the PDB

Summary:
- Fixes inline call frame line table display in windbg.
- Improve llvm-pdbutil to dump extra file ids.
- Warn on unknown subsections so we don't have this kind of bug in the
  future.

Reviewers: inglorion, akhuang, aganea

Subscribers: eraman, zturner, llvm-commits

Tags: #llvm

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

llvm-svn: 362429

5 years agogn build: Merge r362352
Nico Weber [Mon, 3 Jun 2019 18:13:29 +0000 (18:13 +0000)]
gn build: Merge r362352

llvm-svn: 362428

5 years agoFix a crash when the default of a switch is removed
Andrew Kaylor [Mon, 3 Jun 2019 17:54:15 +0000 (17:54 +0000)]
Fix a crash when the default of a switch is removed

This patch fixes a problem that occurs in LowerSwitch when a switch statement has a PHI node as its condition, and the PHI node only has two incoming blocks, and one of those incoming blocks is through an unreachable default in the switch statement. When this condition occurs, LowerSwitch holds a pointer to the condition value, but removes the switch block as a predecessor of the PHI block, causing the PHI node to be replaced. LowerSwitch then tries to use its stale pointer to the original condition value, causing a crash.

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

llvm-svn: 362427

5 years ago[Tests] Add LFTR tests for multiple exit loops (try 2)
Philip Reames [Mon, 3 Jun 2019 17:41:12 +0000 (17:41 +0000)]
[Tests] Add LFTR tests for multiple exit loops (try 2)

(Recommit after fixing a keymash in the run line.  Sorry for breakage.)

This is preparation for D62625 <https://reviews.llvm.org/D62625>

llvm-svn: 362426

5 years agotools: add `llvm-nm` and `llvm-objcopy` to tools
Saleem Abdulrasool [Mon, 3 Jun 2019 17:17:09 +0000 (17:17 +0000)]
tools: add `llvm-nm` and `llvm-objcopy` to tools

Add `nm` and `objcopy` to the default value for the tools that we install now
that they are sufficiently feature complete to replace bintuils' implementation.

Patch by Jiang Yi!

llvm-svn: 362425

5 years agobuiltins: correct function name for AEABI
Saleem Abdulrasool [Mon, 3 Jun 2019 17:08:13 +0000 (17:08 +0000)]
builtins: correct function name for AEABI

If `COMPILER_RT_ARMHF_TARGET` is set , the definition of the AEABI runtime
function `__aeabi_fcmpun` is misspelt: `__aeabi_fcmpum` instead of
`__aeabi_fcmpun`.

Patch by Konstantin Schwarz!

llvm-svn: 362424

5 years agoInclude what you use in Lanai.h
Dmitri Gribenko [Mon, 3 Jun 2019 17:02:15 +0000 (17:02 +0000)]
Include what you use in Lanai.h

Other files were not relying on these transitive includes, so I'm
submitting this change separately.

llvm-svn: 362423

5 years agoInclude what you use in LanaiAsmPrinter.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 17:02:07 +0000 (17:02 +0000)]
Include what you use in LanaiAsmPrinter.cpp

llvm-svn: 362422

5 years agoInclude what you use in LanaiMemAluCombiner.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 17:02:02 +0000 (17:02 +0000)]
Include what you use in LanaiMemAluCombiner.cpp

llvm-svn: 362421

5 years agoInclude what you use in LanaiISelDAGToDAG.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 17:01:57 +0000 (17:01 +0000)]
Include what you use in LanaiISelDAGToDAG.cpp

llvm-svn: 362420

5 years agoInclude what you use in LanaiFrameLowering.{cpp,h}
Dmitri Gribenko [Mon, 3 Jun 2019 17:01:52 +0000 (17:01 +0000)]
Include what you use in LanaiFrameLowering.{cpp,h}

llvm-svn: 362419

5 years agoRevert "[Tests] Add LFTR tests for multiple exit loops"
Dmitri Gribenko [Mon, 3 Jun 2019 16:58:11 +0000 (16:58 +0000)]
Revert "[Tests] Add LFTR tests for multiple exit loops"

This reverts commit r362417.  There's a syntax error in the RUN line.

llvm-svn: 362418

5 years ago[Tests] Add LFTR tests for multiple exit loops
Philip Reames [Mon, 3 Jun 2019 16:46:03 +0000 (16:46 +0000)]
[Tests] Add LFTR tests for multiple exit loops

This is preparation for D62625

llvm-svn: 362417

5 years agoInclude what you use in LanaiRegisterInfo.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 16:31:37 +0000 (16:31 +0000)]
Include what you use in LanaiRegisterInfo.cpp

llvm-svn: 362416

5 years ago[LoopPred] Convert a second member function to a static helper [NFC]
Philip Reames [Mon, 3 Jun 2019 16:23:20 +0000 (16:23 +0000)]
[LoopPred] Convert a second member function to a static helper [NFC]

(And remember to actually mark the first one static.)

llvm-svn: 362415

5 years ago[WebAssembly] Remove fptosi(undef) and fptoui(undef) from reduced test case.
Simon Pilgrim [Mon, 3 Jun 2019 16:21:58 +0000 (16:21 +0000)]
[WebAssembly] Remove fptosi(undef) and fptoui(undef) from reduced test case.

Pre-commit for D62811 - which adds DAG fpto[us]i(undef) --> undef constant fold

llvm-svn: 362414

5 years agoRevert "[llvm-ar] Fix relative thin archive path handling"
Dmitri Gribenko [Mon, 3 Jun 2019 16:21:37 +0000 (16:21 +0000)]
Revert "[llvm-ar] Fix relative thin archive path handling"

This reverts commit r362407.  It broke compilation of
llvm/lib/Object/ArchiveWriter.cpp:

error: type 'llvm::sys::path::const_iterator' does not provide a call
operator

llvm-svn: 362413

5 years ago[PowerPC] Set PROT_READ flag for MF_EXEC to prevent segfaults on PPC machines
Nemanja Ivanovic [Mon, 3 Jun 2019 16:20:59 +0000 (16:20 +0000)]
[PowerPC] Set PROT_READ flag for MF_EXEC to prevent segfaults on PPC machines

The big endian PPC buildbots are all failing now due to calls to cache
invalidation in unit tests on data that has only the PROT_EXEC flag set.
This has been an issue all along on FreeBSD but it can affect Linux machines
depending on configuration.

This patch mitigates the issue the same way it is mitigated on FreeBSD.

Since this is needed to bring the buildbots back to green, I plan to commit this
and allow for post-commit review, but I thought I would also post it here for
ease of access/readability.

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

llvm-svn: 362412

5 years ago[LoopPred] Convert member function to free helper function [NFC]
Philip Reames [Mon, 3 Jun 2019 16:17:14 +0000 (16:17 +0000)]
[LoopPred] Convert member function to free helper function [NFC]

llvm-svn: 362411

5 years agoRe-check in clang support gun asm goto after fixing tests.
Jennifer Yu [Mon, 3 Jun 2019 15:57:25 +0000 (15:57 +0000)]
Re-check in clang support gun asm goto after fixing tests.

llvm-svn: 362410

5 years ago[PR41567][Sema] Fixed cast kind in addr space conversions
Anastasia Stulova [Mon, 3 Jun 2019 15:42:36 +0000 (15:42 +0000)]
[PR41567][Sema] Fixed cast kind in addr space conversions

This change sets missing cast kind correctly in the address
space conversion case.

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

llvm-svn: 362409

5 years agoInclude what you use in LanaiInstrInfo.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 15:26:25 +0000 (15:26 +0000)]
Include what you use in LanaiInstrInfo.cpp

llvm-svn: 362408

5 years ago[llvm-ar] Fix relative thin archive path handling
Owen Reynolds [Mon, 3 Jun 2019 15:26:07 +0000 (15:26 +0000)]
[llvm-ar] Fix relative thin archive path handling

This fixes some thin archive relative path issues, paths are shortened where possible and paths are output correctly when using the display table command.

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

llvm-svn: 362407

5 years ago[lldb-server unittest] Add missing teardown logic
Antonio Afonso [Mon, 3 Jun 2019 15:18:15 +0000 (15:18 +0000)]
[lldb-server unittest] Add missing teardown logic

Summary:
This test base class is missing the teardown making the second set of tests extending it to fail in an assertion in the FileSystem::Initialize() (as it's being initialized twice).
Not sure why this isn't failing the build bots.. (unless they're running without asserts?).

With this fix `ninja LLDBServerTests && ./tools/lldb/unittests/tools/lldb-server/tests/LLDBServerTests` successfully runs and passes all tests.

Reviewers: clayborg, xiaobai, labath

Reviewed By: xiaobai, labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 362406

5 years agoInclude what you use in PPCInstrInfo.h
Dmitri Gribenko [Mon, 3 Jun 2019 15:04:05 +0000 (15:04 +0000)]
Include what you use in PPCInstrInfo.h

llvm-svn: 362405

5 years ago[llvm] [test] Remove non-portable EISDIR test from macho-disassemble-g-dsym.test
Michal Gorny [Mon, 3 Jun 2019 14:50:03 +0000 (14:50 +0000)]
[llvm] [test] Remove non-portable EISDIR test from macho-disassemble-g-dsym.test

Remove the test checking error message for 'is a directory'.  It does
not seem to serve any real purpose, and it relies on matching platform
error strings which are unpredictable and makes the test fragile.
Furthermore, it fails on NetBSD where read() works on directories,
and therefore does not return EISDIR at all.

Fixes r362141.

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

llvm-svn: 362404

5 years agoInclude what you use in NVPTX.h
Dmitri Gribenko [Mon, 3 Jun 2019 14:37:26 +0000 (14:37 +0000)]
Include what you use in NVPTX.h

Other files were not relying on these transitive includes, so I'm
submitting this change separately.

llvm-svn: 362403

5 years agoInclude what you use in NVPTX.h
Dmitri Gribenko [Mon, 3 Jun 2019 14:26:50 +0000 (14:26 +0000)]
Include what you use in NVPTX.h

I also fixed all other files that were including NVPTX.h and were
relying on transitive includes.

llvm-svn: 362402

5 years agoFixed build warning with -DLIBOMP_USE_HWLOC=1
Andrey Churbanov [Mon, 3 Jun 2019 14:21:59 +0000 (14:21 +0000)]
Fixed build warning with -DLIBOMP_USE_HWLOC=1

Made type of depth of hwloc object to correapond with
change from unsigned in hwloc 1,x to int in hwloc 2.x.
This eliminates the warning on signed-unsigned comparison.

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

llvm-svn: 362401

5 years ago[AMDGPU][MC] Added support of SCC, VCCZ and EXECZ operands
Dmitry Preobrazhensky [Mon, 3 Jun 2019 13:51:24 +0000 (13:51 +0000)]
[AMDGPU][MC] Added support of SCC, VCCZ and EXECZ operands

See bug 39292: https://bugs.llvm.org/show_bug.cgi?id=39292

Reviewers: rampitec, arsenm

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

llvm-svn: 362400

5 years agoUnbreak non-PIC builds after r362390 / D62720
David Zarzycki [Mon, 3 Jun 2019 13:39:49 +0000 (13:39 +0000)]
Unbreak non-PIC builds after r362390 / D62720

llvm-svn: 362399

5 years ago[OpenCL] Undefine cl_intel_planar_yuv extension
Andrew Savonichev [Mon, 3 Jun 2019 13:02:43 +0000 (13:02 +0000)]
[OpenCL] Undefine cl_intel_planar_yuv extension

Summary:

Remove unnecessary definition (otherwise the extension will be defined
where it's not supposed to be defined).

Consider the code:

  #pragma OPENCL EXTENSION cl_intel_planar_yuv : begin
  // some declarations
  #pragma OPENCL EXTENSION cl_intel_planar_yuv : end

is enough for extension to become known for clang.

Patch by: Dmitry Sidorov <dmitry.sidorov@intel.com>

Reviewers: Anastasia, yaxunl

Reviewed By: Anastasia

Tags: #clang

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

llvm-svn: 362398

5 years ago[SelectionDAG] Add [us]itofp(undef) --> 0 constant fold (PR39205)
Simon Pilgrim [Mon, 3 Jun 2019 13:02:07 +0000 (13:02 +0000)]
[SelectionDAG] Add [us]itofp(undef) --> 0 constant fold (PR39205)

We were missing this fold in the DAG, which I've copied directly from llvm::ConstantFoldCastInstruction

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

llvm-svn: 362397

5 years ago[SystemZ] Remove sitofp(undef) from reduced test case.
Simon Pilgrim [Mon, 3 Jun 2019 12:58:36 +0000 (12:58 +0000)]
[SystemZ] Remove sitofp(undef) from reduced test case.

Pre-commit for D62807 - which adds DAG [us]itofp(undef) --> 0 constant fold

llvm-svn: 362396

5 years agoInclude what you use in LanaiInstPrinter.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 12:53:05 +0000 (12:53 +0000)]
Include what you use in LanaiInstPrinter.cpp

llvm-svn: 362395

5 years agoInclude what you use in LanaiMCCodeEmitter.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 12:42:48 +0000 (12:42 +0000)]
Include what you use in LanaiMCCodeEmitter.cpp

LanaiMCCodeEmitter.cpp was not using any APIs from Lanai.h, and was only
including it for transitive dependencies.  Doing so is problematic from
include-what-you-use perspective, but it is also a layering issue (it
creates a dependency cycle between the primary Lanai target library and
the MCTargetDesc library).

llvm-svn: 362394

5 years agoRe-land [LLD][COFF] Early load PDB type server files
Alexandre Ganea [Mon, 3 Jun 2019 12:39:47 +0000 (12:39 +0000)]
Re-land [LLD][COFF] Early load PDB type server files

We need to have all input files ready before doing debuginfo type merging.
This patch is moving the late PDB type server discovery much earlier in the process, when the explicit inputs (OBJs, LIBs) are loaded.
The short term goal is to parallelize type merging.

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

llvm-svn: 362393

5 years agoInclude what you use in LanaiDisassembler.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 12:37:11 +0000 (12:37 +0000)]
Include what you use in LanaiDisassembler.cpp

llvm-svn: 362392

5 years ago[OpenCL] Use long instead of long long in x86 builtins
Andrew Savonichev [Mon, 3 Jun 2019 12:34:59 +0000 (12:34 +0000)]
[OpenCL] Use long instead of long long in x86 builtins

Summary: According to C99 standard long long is at least 64 bits in
size. However, OpenCL C defines long long as 128 bit signed
integer. This prevents one to use x86 builtins when compiling OpenCL C
code for x86 targets. The patch changes long long to long for OpenCL
only.

Patch by: Alexander Batashev <alexander.batashev@intel.com>

Reviewers: craig.topper, Ka-Ka, eandrews, erichkeane, Anastasia

Reviewed By: Ka-Ka, erichkeane, Anastasia

Subscribers: a.elovikov, yaxunl, Anastasia, cfe-commits, ivankara, etyurin, asavonic

Tags: #clang

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

llvm-svn: 362391

5 years agoAMDGPU/GFX10: V_CMPX_xxx instructions still have an omod operand
Nicolai Haehnle [Mon, 3 Jun 2019 12:07:41 +0000 (12:07 +0000)]
AMDGPU/GFX10: V_CMPX_xxx instructions still have an omod operand

Summary: Change-Id: If6ee98e4a723b643bc37254fc6ef8b3812db16da

Reviewers: rampitec

Subscribers: arsenm, kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

Change-Id: Id547ef152b2f92b24dc1c0efbf7e4467c4fb4b6e
llvm-svn: 362390

5 years agoInclude what you use in HexagonInstPrinter.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 11:41:22 +0000 (11:41 +0000)]
Include what you use in HexagonInstPrinter.cpp

HexagonInstPrinter.cpp was not using any APIs from HexagonAsmPrinter.h.
Doing so is problematic from include-what-you-use perspective, but it is
also a layering issue (it creates a dependency cycle between the primary
Hexagon target library and the MCTargetDesc library).

llvm-svn: 362389

5 years agoInclude what you use in HexagonAsmPrinter.h
Dmitri Gribenko [Mon, 3 Jun 2019 11:41:18 +0000 (11:41 +0000)]
Include what you use in HexagonAsmPrinter.h

llvm-svn: 362388

5 years agoInclude what you use in HexagonMCInstrInfo.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 11:25:37 +0000 (11:25 +0000)]
Include what you use in HexagonMCInstrInfo.cpp

HexagonMCInstrInfo.cpp was not using any APIs from Hexagon.h.  Doing so
is problematic from include-what-you-use perspective, but it is also a
layering issue (it creates a dependency cycle between the primary
Hexagon target library and the MCTargetDesc library).

llvm-svn: 362387

5 years agoInclude what you use in HexagonMCCodeEmitter.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 11:20:53 +0000 (11:20 +0000)]
Include what you use in HexagonMCCodeEmitter.cpp

HexagonMCCodeEmitter.cpp was not using any APIs from Hexagon.h.  Doing
so is problematic from include-what-you-use perspective, but it is also
a layering issue (it creates a dependency cycle between the primary
Hexagon target library and the MCTargetDesc library).

llvm-svn: 362386

5 years agoInclude what you use in HexagonMCCompound.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 11:20:48 +0000 (11:20 +0000)]
Include what you use in HexagonMCCompound.cpp

HexagonMCCompound.cpp was not using any APIs from Hexagon.h.  Doing so
is problematic from include-what-you-use perspective, but it is also a
layering issue (it creates a dependency cycle between the primary
Hexagon target library and the MCTargetDesc library).

llvm-svn: 362385

5 years agoInclude what you use in HexagonShuffler.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 11:14:20 +0000 (11:14 +0000)]
Include what you use in HexagonShuffler.cpp

HexagonShuffler.cpp was not using any APIs from Hexagon.h, and was only
including it for transitive dependencies.  Doing so is problematic from
include-what-you-use perspective, but it is also a layering issue (it
creates a dependency cycle between the primary Hexagon target library
and the MCTargetDesc library).

llvm-svn: 362384

5 years agoInclude what you use in HexagonMCChecker.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 11:14:15 +0000 (11:14 +0000)]
Include what you use in HexagonMCChecker.cpp

HexagonMCChecker.cpp was not using any APIs from Hexagon.h.  Doing so is
problematic from include-what-you-use perspective, but it is also a
layering issue (it creates a dependency cycle between the primary
Hexagon target library and the MCTargetDesc library).

llvm-svn: 362383

5 years agoInclude what you use in HexagonMCTargetDesc.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 11:14:10 +0000 (11:14 +0000)]
Include what you use in HexagonMCTargetDesc.cpp

HexagonMCTargetDesc.cpp was not using any APIs from Hexagon.h.  Doing so
is problematic from include-what-you-use perspective, but it is also a
layering issue (it creates a dependency cycle between the primary
Hexagon target library and the MCTargetDesc library).

llvm-svn: 362382

5 years agoInclude what you use in HexagonMCShuffler.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 11:14:05 +0000 (11:14 +0000)]
Include what you use in HexagonMCShuffler.cpp

HexagonMCShuffler.cpp was not using any APIs from Hexagon.h.  Doing so
is problematic from include-what-you-use perspective, but it is also a
layering issue (it creates a dependency cycle between the primary
Hexagon target library and the MCTargetDesc library).

llvm-svn: 362381

5 years ago[ARM] Fix recent breakage of -mfpu=none.
Simon Tatham [Mon, 3 Jun 2019 11:02:53 +0000 (11:02 +0000)]
[ARM] Fix recent breakage of -mfpu=none.

The recent change D60691 introduced a bug in clang when handling
option combinations such as `-mcpu=cortex-m4 -mfpu=none`. Those
options together should select Cortex-M4 but disable all use of
hardware FP, but in fact, now hardware FP instructions can still be
generated in that mode.

The reason is because the handling of FPUVersion::NONE disables all
the same feature names it used to, of which the base one is `vfp2`.
But now there are further features below that, like `vfp2d16fp` and
(following D60694) `fpregs`, which also need to be turned off to
disable hardware FP completely.

Added a tiny test which double-checks that compiling a simple FP
function doesn't access the FP registers.

Reviewers: SjoerdMeijer, dmgreen

Reviewed By: dmgreen

Subscribers: lebedev.ri, javed.absar, kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 362380

5 years agoFix compilation warning about unused variable [NFC]
Mikael Holmen [Mon, 3 Jun 2019 10:50:41 +0000 (10:50 +0000)]
Fix compilation warning about unused variable [NFC]

llvm-svn: 362379

5 years ago[AArch64][SVE2] Add CPU and arch directive tests
Cullen Rhodes [Mon, 3 Jun 2019 10:42:02 +0000 (10:42 +0000)]
[AArch64][SVE2] Add CPU and arch directive tests

Summary:
This patch adds tests for directives .arch, .arch_extension and .cpu for
all features defined in Arm SVE2 architecture extension.

Reviewed By: chill

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

llvm-svn: 362378

5 years ago[llvm-readobj] - Convert gnu-sections.test to use YAML.
George Rimar [Mon, 3 Jun 2019 09:58:41 +0000 (09:58 +0000)]
[llvm-readobj] - Convert gnu-sections.test to use YAML.

gnu-sections.test currently use relocs.obj.elf-x86_64 and
relocs.obj.elf-i386 precompiled objects as an inputs.

These inputs actually initially were introduced to test the
dump of relocations and have almost nothing common with dumping
sections.

Patch converts the test to use yaml2obj. That allows to remove
relocs.obj.elf-i386 binary.
(relocs.obj.elf-x86_64 is still used by another test and can't be removed atm).

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

llvm-svn: 362377

5 years agoInclude what you use in HexagonELFObjectWriter.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 09:56:40 +0000 (09:56 +0000)]
Include what you use in HexagonELFObjectWriter.cpp

HexagonELFObjectWriter.cpp was not using any APIs from Hexagon.h, and
was only including it for transitive dependencies.  Doing so is
problematic from include-what-you-use perspective, but it is also a
layering issue (it creates a dependency cycle between the primary
Hexagon target library and the MCTargetDesc library).

llvm-svn: 362376

5 years agoRevert rL362358 : PR42104: Support instantiations of lambdas that implicitly capture...
Simon Pilgrim [Mon, 3 Jun 2019 09:56:09 +0000 (09:56 +0000)]
Revert rL362358 : PR42104: Support instantiations of lambdas that implicitly capture packs.

Two changes:
 * Track odr-use via FunctionParmPackExprs to properly handle dependent
   odr-uses of packs in generic lambdas.
 * Do not instantiate implicit captures; instead, regenerate them by
   instantiating the body of the lambda. This is necessary to
   distinguish between cases where only one element of a pack is
   captured and cases where the entire pack is captured.
........
Fixes http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win buildbot failures

llvm-svn: 362375

5 years ago[llvm-readobj/llvm-readelf] - Remove gnu-relocations.test completely.
George Rimar [Mon, 3 Jun 2019 09:52:32 +0000 (09:52 +0000)]
[llvm-readobj/llvm-readelf] - Remove gnu-relocations.test completely.

rL362089 introduced a set of yaml based reloc-types-*.test test cases
(instead of huge reloc-types.test that used a lot of precompiled binaries)
These test cases checks LLVM-styled dumping of the relocations.

gnu-relocations.test was a test case to check GNU styled relocations dumping.
It did that only for elf-x86 and elf-x86_64 targets. It did not test all of the
relocations though.

Now, after rL362089, it does not make sence to keep it.
This patch updates reloc-types-elf-i386.test and reloc-types-elf-x64.test tests
with llvm-readelf calls to check GNU styled output in one place.
It removes gnu-relocations.test completely.

One of intentions of doing this is also to get rid of relocs.obj.elf-i386 and
relocs.obj.elf-x86_64 precompiled objects completely (they are used in other tests still).

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

llvm-svn: 362374

5 years ago[LiveDebugValues] Close range for previous variable's location when adding newly...
Nikola Prica [Mon, 3 Jun 2019 09:48:29 +0000 (09:48 +0000)]
[LiveDebugValues] Close range for previous variable's location when adding newly deduced location

When LiveDebugValues deduces new variable's location from spill, restore or
register copy instruction it should close old variable's location. Otherwise
we can have multiple block output locations for same variable. That could lead
to inserting two DBG_VALUEs for same variable to the beginning of the successor
block which results to ignoring of first DBG_VALUE.

Reviewers: aprantl, jmorse, wolfgangp, dstenb

Reviewed By: aprantl

Subscribers: probinson, asowda, ivanbaev, petarj, djtodoro

Tags: #debug-info

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

llvm-svn: 362373

5 years agoInclude what you use in HexagonAsmBackend.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 09:43:05 +0000 (09:43 +0000)]
Include what you use in HexagonAsmBackend.cpp

HexagonAsmBackend.cpp was not using any APIs from Hexagon.h.  Doing so
is problematic from include-what-you-use perspective, but it is also a
layering issue (it creates a dependency cycle between the primary
Hexagon target library and the MCTargetDesc library).

llvm-svn: 362372

5 years ago[OpenCL] Declare builtin functions using TableGen
Sven van Haastregt [Mon, 3 Jun 2019 09:39:11 +0000 (09:39 +0000)]
[OpenCL] Declare builtin functions using TableGen

This patch adds a `-fdeclare-opencl-builtins` command line option to
the clang frontend.  This enables clang to verify OpenCL C builtin
function declarations using a fast StringMatcher lookup, instead of
including the opencl-c.h file with the `-finclude-default-header`
option.  This avoids the large parse time penalty of the header file.

This commit only adds the basic infrastructure and some of the OpenCL
builtins.  It does not cover all builtins defined by the various OpenCL
specifications.  As such, it is not a replacement for
`-finclude-default-header` yet.

RFC: http://lists.llvm.org/pipermail/cfe-dev/2018-November/060041.html

Co-authored-by: Pierre Gondois
Co-authored-by: Joey Gouly
Co-authored-by: Sven van Haastregt
Differential Revision: https://reviews.llvm.org/D60763

llvm-svn: 362371

5 years agoInclude what you use in HexagonAsmParser.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 09:38:48 +0000 (09:38 +0000)]
Include what you use in HexagonAsmParser.cpp

HexagonAsmParser.cpp was not using any APIs from Hexagon.h.  Doing so is
problematic from include-what-you-use perspective, but it is also a
layering issue (it creates a dependency cycle between the primary
Hexagon target library and the AsmParser library).

llvm-svn: 362370

5 years agoInclude what you use in HexagonShuffler.h
Dmitri Gribenko [Mon, 3 Jun 2019 09:33:48 +0000 (09:33 +0000)]
Include what you use in HexagonShuffler.h

HexagonShuffler.h was not using any APIs from Hexagon.h, and was only
including it for transitive dependencies.  Doing so is problematic from
include-what-you-use perspective, but it is also a layering issue (it
creates a dependency cycle between the primary Hexagon target library
and the MCTargetDesc library).

llvm-svn: 362369

5 years agoInclude what you use in BPFMCTargetDesc.cpp
Dmitri Gribenko [Mon, 3 Jun 2019 09:29:51 +0000 (09:29 +0000)]
Include what you use in BPFMCTargetDesc.cpp

BPFMCTargetDesc.cpp was not using any APIs from BPF.h.  Doing so is
problematic from include-what-you-use perspective, but it is also a
layering issue (it creates a dependency cycle between the primary
BPF target library and the MCTargetDesc library).

llvm-svn: 362368

5 years ago[LLD][ELF] - Remove dead code. NFC.
George Rimar [Mon, 3 Jun 2019 09:23:01 +0000 (09:23 +0000)]
[LLD][ELF] - Remove dead code. NFC.

I believe this line was dead after r362356.

llvm-svn: 362367