]> granicus.if.org Git - llvm/log
llvm
5 years agoFix missing use of defined() in include guard
David Tenty [Fri, 12 Jul 2019 20:12:15 +0000 (20:12 +0000)]
Fix missing use of defined() in include guard

Subscribers: arsenm, jvesely, nhaehnle, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365952 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SystemZ] Fix addcarry of addcarry of const carry (PR42606)
Nikita Popov [Fri, 12 Jul 2019 20:03:34 +0000 (20:03 +0000)]
[SystemZ] Fix addcarry of addcarry of const carry (PR42606)

This fixes https://bugs.llvm.org/show_bug.cgi?id=42606 by extending
D64213. Instead of only checking if the carry comes from a matching
operation, we now check the full chain of carries. Otherwise we might
custom lower the outermost addcarry, but then generically legalize
an inner addcarry.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365949 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Use MachineInstr::findRegisterDefOperand to simplify some code in optimizeCompa...
Craig Topper [Fri, 12 Jul 2019 19:26:35 +0000 (19:26 +0000)]
[X86] Use MachineInstr::findRegisterDefOperand to simplify some code in optimizeCompareInstr. NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365946 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo] Add column info for inline sites
Jonas Devlieghere [Fri, 12 Jul 2019 19:25:45 +0000 (19:25 +0000)]
[DebugInfo] Add column info for inline sites

The column field is missing for all inline sites, currently it's always
zero. This changes populates DW_AT_call_column field for inline sites.
Test case modified to cover this change.

Patch by: Wenlei He

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365945 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoThe variable "Latch" is only used in an assert, which makes builds that use "-DNDEBUG...
Sterling Augustine [Fri, 12 Jul 2019 18:51:08 +0000 (18:51 +0000)]
The variable "Latch" is only used in an assert, which makes builds that use "-DNDEBUG" fail with unused variable messages.

Summary: Move the logic into the assert itself.

Subscribers: hiraditya, sanjoy, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365943 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SystemZ] Fix build bot failure after r365932
Ulrich Weigand [Fri, 12 Jul 2019 18:44:51 +0000 (18:44 +0000)]
[SystemZ] Fix build bot failure after r365932

Insert LLVM_FALLTHROUGH to avoid compiler warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365942 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[x86] add test for bogus cmov (PR40483); NFC
Sanjay Patel [Fri, 12 Jul 2019 18:38:29 +0000 (18:38 +0000)]
[x86] add test for bogus cmov (PR40483); NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365941 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Extend MIMG opcode to 8 bits
Stanislav Mekhanoshin [Fri, 12 Jul 2019 18:38:06 +0000 (18:38 +0000)]
[AMDGPU] Extend MIMG opcode to 8 bits

This is NFC, but required for future commit.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365940 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAddition to rL365925, removing remaining virtuals
Stefan Stipanovic [Fri, 12 Jul 2019 18:34:06 +0000 (18:34 +0000)]
Addition to rL365925, removing remaining virtuals

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365938 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSlightly simplify MappedBlockStream::createIndexedStream() calls
Nico Weber [Fri, 12 Jul 2019 18:24:38 +0000 (18:24 +0000)]
Slightly simplify MappedBlockStream::createIndexedStream() calls

All callers had a PDBFile object at hand, so call
Pdb.createIndexedStream() instead, which pre-populates all the arguments
(and returns nullptr for kInvalidStreamIndex).

Also change safelyCreateIndexedStream() to only take the string index,
and update callers. Make the method public and call it in two places
that manually did the bounds checking before.

No intended behavior change.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365936 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd explicit newline at end of `llvm-pdbutil dump`
Nico Weber [Fri, 12 Jul 2019 18:22:47 +0000 (18:22 +0000)]
Add explicit newline at end of `llvm-pdbutil dump`

All dump modes I checked didn't print a trailing newline, so add one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365934 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SystemZ] Add support for new cpu architecture - arch13
Ulrich Weigand [Fri, 12 Jul 2019 18:13:16 +0000 (18:13 +0000)]
[SystemZ] Add support for new cpu architecture - arch13

This patch series adds support for the next-generation arch13
CPU architecture to the SystemZ backend.

This includes:
- Basic support for the new processor and its features.
- Assembler/disassembler support for new instructions.
- CodeGen for new instructions, including new LLVM intrinsics.
- Scheduler description for the new processor.
- Detection of arch13 as host processor.

Note: No currently available Z system supports the arch13
architecture.  Once new systems become available, the
official system name will be added as supported -march name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365932 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove unused methods in Sancov.
Leonard Chan [Fri, 12 Jul 2019 18:09:09 +0000 (18:09 +0000)]
Remove unused methods in Sancov.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365931 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add NEG to isUseDefConvertible.
Craig Topper [Fri, 12 Jul 2019 17:52:17 +0000 (17:52 +0000)]
[X86] Add NEG to isUseDefConvertible.

We can use the C flag from NEG to detect that the input was zero.

Really we could probably use the Z flag too. But C matches what
we'd do for usubo 0, X.

Haven't found a test case for this due to the usubo formation
in CGP. But I verified if I comment out the CGP code this
transformation catches some of the same cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365929 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][AVX] Add PR34359 shuffle test case.
Simon Pilgrim [Fri, 12 Jul 2019 17:42:32 +0000 (17:42 +0000)]
[X86][AVX] Add PR34359 shuffle test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365926 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Removing unnecessary `virtual` keywords.
Stefan Stipanovic [Fri, 12 Jul 2019 17:42:14 +0000 (17:42 +0000)]
[Attributor] Removing unnecessary `virtual` keywords.

Some function in the Attributor framework are unnecessarily
marked virtual. This patch removes virtual keyword

Reviewers: jdoerfert

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365925 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Deduce "nofree" function attribute
Hideto Ueno [Fri, 12 Jul 2019 17:38:51 +0000 (17:38 +0000)]
[Attributor] Deduce "nofree" function attribute

Summary: Deduce "nofree" function attribute. A more concise description of "nofree" is on D49165.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: homerdin, hfinkel, lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365924 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IndVars] Use exit count reasoning to discharge obviously untaken exits
Philip Reames [Fri, 12 Jul 2019 17:05:35 +0000 (17:05 +0000)]
[IndVars] Use exit count reasoning to discharge obviously untaken exits

Continue in the spirit of D63618, and use exit count reasoning to prove away loop exits which can not be taken since the backedge taken count of the loop as a whole is provably less than the minimal BE count required to take this particular loop exit.

As demonstrated in the newly added tests, this triggers in a number of cases where IndVars was previously unable to discharge obviously redundant exit tests. And some not so obvious ones.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365920 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix some minor coding-style issues in git-llvm.
James Y Knight [Fri, 12 Jul 2019 16:41:28 +0000 (16:41 +0000)]
Fix some minor coding-style issues in git-llvm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365918 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAllow the 'git-llvm' tool to push to svn from the split repositories
James Y Knight [Fri, 12 Jul 2019 16:40:46 +0000 (16:40 +0000)]
Allow the 'git-llvm' tool to push to svn from the split repositories
for 'test-suite', 'lnt', 'zorg', and 'www'.

This is done by looking at the pathname of the git remote named
'origin', which is not 100% reliable, but should work in most cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365917 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[FunctionAttrs] Add a test for "nofree" function attribute
Hideto Ueno [Fri, 12 Jul 2019 16:29:14 +0000 (16:29 +0000)]
[FunctionAttrs] Add a test for "nofree" function attribute

This patch adds a test for nofree function attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365916 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support] Move the static initializer install_out_memory_new_handler to InitLLVM
Fangrui Song [Fri, 12 Jul 2019 16:23:25 +0000 (16:23 +0000)]
[Support] Move the static initializer install_out_memory_new_handler to InitLLVM

An application linking against LLVMSupport should not get the gratuitous
set::std_new_handler call.

Reviewed By: jfb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365915 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd missing <atomic> include to appease MSVC builds.
Simon Pilgrim [Fri, 12 Jul 2019 16:16:23 +0000 (16:16 +0000)]
Add missing <atomic> include to appease MSVC builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365914 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMinor cleanup.
Artem Belevich [Fri, 12 Jul 2019 16:13:29 +0000 (16:13 +0000)]
Minor cleanup.

Simplify things a bit by removing unnecessary full type qualification.
This also happens to avoid a build break with now-unsupported
Visual Studio 2015.

Differential Review: https://reviews.llvm.org/D64588

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365913 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTest commit
Hideto Ueno [Fri, 12 Jul 2019 16:08:32 +0000 (16:08 +0000)]
Test commit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365912 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSupport for dumping current PrettyStackTrace on SIGINFO (Ctrl-T)
Jordan Rose [Fri, 12 Jul 2019 16:05:09 +0000 (16:05 +0000)]
Support for dumping current PrettyStackTrace on SIGINFO (Ctrl-T)

Support SIGINFO (and SIGUSR1 for POSIX purposes) to tell what
long-running jobs are doing, as inspired by BSD tools (including on
macOS), by dumping the current PrettyStackTrace.

This adds a new kind of signal handler for non-fatal "info" signals,
similar to the "interrupt" handler that already exists for SIGINT
(Ctrl-C). It then uses that handler to update a "generation count"
managed by the PrettyStackTrace infrastructure, which is then checked
whenever a PrettyStackTraceEntry is pushed or popped on each
thread. If the generation has changed---i.e. if the user has pressed
Ctrl-T---the stack trace is dumped, though unfortunately it can't
include the deepest entry because that one is currently being
constructed/destructed.

https://reviews.llvm.org/D63750

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365911 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Fix DPP combiner check for exec modification
Jay Foad [Fri, 12 Jul 2019 15:59:40 +0000 (15:59 +0000)]
[AMDGPU] Fix DPP combiner check for exec modification

Summary:
r363675 changed the exec modification helper function, now called
execMayBeModifiedBeforeUse, so that if no UseMI is specified it checks
all instructions in the basic block, even beyond the last use. That
meant that the DPP combiner no longer worked in any basic block that
ended with a control flow instruction, and in particular it didn't work
on code sequences generated by the atomic optimizer.

Fix it by reinstating the old behaviour but in a new helper function
execMayBeModifiedBeforeAnyUse, and limiting the number of instructions
scanned.

Reviewers: arsenm, vpykhtin

Subscribers: kzhuravl, nemanjai, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kbarton, MaskRay, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365910 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LegacyPassManager] Small ModuleCount cleanup
Fangrui Song [Fri, 12 Jul 2019 15:18:29 +0000 (15:18 +0000)]
[LegacyPassManager] Small ModuleCount cleanup

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365907 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Restrict v_cndmask_b32 abs/neg modifiers to f32
Jay Foad [Fri, 12 Jul 2019 15:02:59 +0000 (15:02 +0000)]
[AMDGPU] Restrict v_cndmask_b32 abs/neg modifiers to f32

Summary:
D64497 allowed abs/neg source modifiers on v_cndmask_b32 but it doesn't
make any sense to apply them to f16 operands; they would interpret the
bits of the value as an f32, giving nonsensical results. This patch
restricts them to f32 operands.

Reviewers: arsenm, hakzsam

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365904 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDelete dead stores
Fangrui Song [Fri, 12 Jul 2019 14:58:15 +0000 (14:58 +0000)]
Delete dead stores

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365903 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agocmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macros
Tom Stellard [Fri, 12 Jul 2019 14:40:18 +0000 (14:40 +0000)]
cmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macros

Summary:
This will simplify the macros by allowing us to remove the hard-coded
list of libraries that should be installed when
LLVM_INSTALL_TOOLCHAIN_ONLY is enabled.

Reviewers: beanz, smeenai

Reviewed By: beanz

Subscribers: aheejin, mehdi_amini, mgorny, steven_wu, dexonsmith, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365902 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[gn] Tag unneeded variable.
Bryant Wong [Fri, 12 Jul 2019 13:09:39 +0000 (13:09 +0000)]
[gn] Tag unneeded variable.

When only building targets without assembly parsers (e.g. `llvm_targets_to_build
= ["NVPTX"]`), `all_targets` is empty and causes GN to warn about an
assigned-but-unused variable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365897 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombine] narrowExtractedVectorBinOp - wrap subvector extraction in helper. NFCI.
Simon Pilgrim [Fri, 12 Jul 2019 13:00:35 +0000 (13:00 +0000)]
[DAGCombine] narrowExtractedVectorBinOp - wrap subvector extraction in helper. NFCI.

First step towards supporting 'free' subvector extractions other than concat_vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365896 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LIT] Emit timeout error message only if timeout was reached
Alexey Bader [Fri, 12 Jul 2019 12:48:43 +0000 (12:48 +0000)]
[LIT] Emit timeout error message only if timeout was reached

Summary:
This improves readability of LIT output: previously
error messages gets emitted that say that there was no error:

error: command reached timeout: False

Patch by Alexey Sachkov.

Reviewers: ddunbar, mgorny, modocache

Reviewed By: mgorny

Subscribers: delcypher, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365895 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Fold select (icmp sgt x, -1), lshr (X, Y), ashr (X, Y) to ashr (X, Y))
David Bolvansky [Fri, 12 Jul 2019 11:31:16 +0000 (11:31 +0000)]
[InstCombine] Fold select (icmp sgt x, -1), lshr (X, Y), ashr (X, Y) to ashr (X, Y))

Summary:
(select (icmp sgt x, -1), lshr (X, Y), ashr (X, Y)) -> ashr (X, Y))
(select (icmp slt x, 1), ashr (X, Y), lshr (X, Y)) -> ashr (X, Y))

Fixes PR41173

Alive proof by @lebedev.ri (thanks)
Name: PR41173
  %cmp = icmp slt i32 %x, 1
  %shr = lshr i32 %x, %y
  %shr1 = ashr i32 %x, %y
  %retval.0 = select i1 %cmp, i32 %shr1, i32 %shr
  =>
  %retval.0 = ashr i32 %x, %y

Optimization: PR41173
Done: 1
Optimization is correct!

Reviewers: lebedev.ri, spatel

Reviewed By: lebedev.ri

Subscribers: nikic, craig.topper, llvm-commits, lebedev.ri

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365893 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix test case of llvm-nm using implicit a.out
Alex Brachet [Fri, 12 Jul 2019 10:44:06 +0000 (10:44 +0000)]
Fix test case of llvm-nm using implicit a.out

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365892 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[test/Object, obj2yaml] - Move test cases from test/Object and cleanup.
George Rimar [Fri, 12 Jul 2019 10:29:29 +0000 (10:29 +0000)]
[test/Object, obj2yaml] - Move test cases from test/Object and cleanup.

test/Object is not correct place to have tests that check obj2yaml
functionality, because we have test/tools/obj2yaml folder for that.

In this patch I merged a few test cases with their YAMLs from Inputs
folder, converted one of binary inputs and moved them to
tools/obj2yaml folder.

There are still another tests that might need the same, so it is initial step.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365891 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[tools] [llvm-nm] Default to reading from stdin not a.out
Alex Brachet [Fri, 12 Jul 2019 10:20:01 +0000 (10:20 +0000)]
[tools] [llvm-nm] Default to reading from stdin not a.out

Summary: This moves away from defaulting to a.out and uses stdin only if stdin has a file redirected to it. This has been discussed on the llvm-dev mailing list [[ https://lists.llvm.org/pipermail/llvm-dev/2019-July/133642.html | here ]].

Reviewers: jhenderson, rupprecht, MaskRay, chrisjackson

Reviewed By: jhenderson, MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365889 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[DwarfDebug] Dump call site debug info"
Djordje Todorovic [Fri, 12 Jul 2019 09:45:12 +0000 (09:45 +0000)]
Revert "[DwarfDebug] Dump call site debug info"

A build failure was found on the SystemZ platform.

This reverts commit 9e7e73578e54cd22b3c7af4b54274d743b6607cc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365886 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Object/ELF] - Improve error reporting for notes.
George Rimar [Fri, 12 Jul 2019 09:29:12 +0000 (09:29 +0000)]
[Object/ELF] - Improve error reporting for notes.

This patch improves the error messages reported for
note sections and phdrs and also makes a cleanup for
existent test case.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365884 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][PowerPC] Added test for MachinePRE.
Kai Luo [Fri, 12 Jul 2019 09:10:35 +0000 (09:10 +0000)]
[NFC][PowerPC] Added test for MachinePRE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365883 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Allow parsing dot '.' in assembly
Sam Elliott [Fri, 12 Jul 2019 08:36:07 +0000 (08:36 +0000)]
[RISCV] Allow parsing dot '.' in assembly

Summary:
Useful for jumps, such as `j .`.

I am not sure who should review this. Do not hesitate to change the reviewers if needed.

Reviewers: asb, jrtc27, lenary

Reviewed By: lenary

Subscribers: MaskRay, lenary, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, llvm-commits

Tags: #llvm

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

Patch by John LLVM (JohnLLVM)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365881 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTest commit. NFC.
Bryant Wong [Fri, 12 Jul 2019 08:25:59 +0000 (08:25 +0000)]
Test commit. NFC.

Formatting fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365878 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[YAMLIO] Wrap explicit specialization in llvm::yaml to appease build bots
Fangrui Song [Fri, 12 Jul 2019 06:23:24 +0000 (06:23 +0000)]
[YAMLIO] Wrap explicit specialization in llvm::yaml to appease build bots

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365876 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Fixed comment. NFC.
Stanislav Mekhanoshin [Fri, 12 Jul 2019 05:13:10 +0000 (05:13 +0000)]
[AMDGPU] Fixed comment. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365871 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Fix JmpLink to texternalsym and tglobaladdr on mcroMIPS R6
Simon Atanasyan [Fri, 12 Jul 2019 04:58:45 +0000 (04:58 +0000)]
[mips] Fix JmpLink to texternalsym and tglobaladdr on mcroMIPS R6

There is not match for the `MipsJmpLink texternalsym` and `MipsJmpLink
tglobaladdr` patterns for microMIPS R6. As a result LLVM incorrectly
selects the `JALRC16` compact 2-byte instruction which takes a target
instruction address from a register only and assign `R_MIPS_32` relocation
for this instruction. This relocation completely overwrites `JALRC16`
and nearby instructions.

This patch adds missed matching patterns, selects `BALC` instruction and
assign a correct `R_MICROMIPS_PC26_S1` relocation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365870 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[YAMLIO] Remove trailing spaces when outputting maps
Fangrui Song [Fri, 12 Jul 2019 04:51:31 +0000 (04:51 +0000)]
[YAMLIO] Remove trailing spaces when outputting maps

llvm::yaml::Output::paddedKey unconditionally outputs spaces, which
are superfluous if the value to be dumped is a sequence or map.
Change `bool NeedsNewLine` to `StringRef Padding` so that it can be
overridden to `\n` if the value is a sequence or map.

An empty map/sequence is special. It is printed as `{}` or `[]` without
a newline, while a non-empty map/sequence follows a newline. To handle
this distinction, add another variable `PaddingBeforeContainer` and does
the special handling in endMapping/endSequence.

Reviewed By: grimar, jhenderson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365869 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agodocs/GithubMove.rst: Add link to GitHub migration status page
Tom Stellard [Fri, 12 Jul 2019 02:31:50 +0000 (02:31 +0000)]
docs/GithubMove.rst: Add link to GitHub migration status page

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365865 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReturn Undef from isBytewiseValue for empty arrays or structs
Vitaly Buka [Fri, 12 Jul 2019 02:23:07 +0000 (02:23 +0000)]
Return Undef from isBytewiseValue for empty arrays or structs

Reviewers: pcc, eugenis

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365864 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoNFC: Unforget a colon in a few CHECK: directives.
Artem Dergachev [Fri, 12 Jul 2019 02:16:56 +0000 (02:16 +0000)]
NFC: Unforget a colon in a few CHECK: directives.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365863 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MachinePipeliner] Fix order for nodes with Anti dependence in same cycle
Jinsong Ji [Fri, 12 Jul 2019 01:59:42 +0000 (01:59 +0000)]
[MachinePipeliner] Fix order for nodes with Anti dependence in same cycle

Summary:
Problem exposed in PowerPC functional testing.

We did not consider Anti dependence for nodes in same cycle,
so we may end up generating bad machine code.
eg: the reduced test won't verify.

*** Bad machine code: Using an undefined physical register ***
- function:    lame_encode_buffer_interleaved
- basic block: %bb.4  (0x4bde4e12928)
- instruction: %29:gprc = ADDZE %27:gprc, implicit-def dead $carry, implicit $carry
- operand 3:   implicit $carry

Reviewers: bcahoon, kparzysz, hfinkel

Subscribers: MaskRay, wuzish, nemanjai, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365859 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoHandle IntToPtr in isBytewiseValue
Vitaly Buka [Fri, 12 Jul 2019 01:42:03 +0000 (01:42 +0000)]
Handle IntToPtr in isBytewiseValue

Summary:
This helps with more efficient use of memset for pattern initialization

From @pcc prototype for -ftrivial-auto-var-init=pattern optimizations

Binary size change on CTMark, (with -fuse-ld=lld -Wl,--icf=all, similar results with default linker options)
```
                   master           patch      diff
Os           8.238864e+05    8.238864e+05       0.0
O3           1.054797e+06    1.054797e+06       0.0
Os zero      8.292384e+05    8.292384e+05       0.0
O3 zero      1.062626e+06    1.062626e+06       0.0
Os pattern   8.579712e+05    8.338048e+05 -0.030299
O3 pattern   1.090502e+06    1.067574e+06 -0.020481
```

Zero vs Pattern on master
```
               zero       pattern      diff
Os     8.292384e+05  8.579712e+05  0.036578
O3     1.062626e+06  1.090502e+06  0.025124
```

Zero vs Pattern with the patch
```
               zero       pattern      diff
Os     8.292384e+05  8.338048e+05  0.003333
O3     1.062626e+06  1.067574e+06  0.003193
```

Reviewers: pcc, eugenis

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365858 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoNFC: lit: python3 compatibility for functions
Alex Lorenz [Fri, 12 Jul 2019 00:48:53 +0000 (00:48 +0000)]
NFC: lit: python3 compatibility for functions
usePlatformSdkOnDarwin/findPlatformSdkVersionOnMacOS

These functions should decode subprocess output

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365852 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Reorder pow() transformations (NFC)
Evandro Menezes [Fri, 12 Jul 2019 00:33:49 +0000 (00:33 +0000)]
[InstCombine] Reorder pow() transformations (NFC)

Move the transformation from `powf(x, itofp(y))` to `powi(x, y)` to the
group of transformations related to the exponent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365851 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Skip calculating callee saved registers for entry function.
Michael Liao [Thu, 11 Jul 2019 23:53:30 +0000 (23:53 +0000)]
[AMDGPU] Skip calculating callee saved registers for entry function.

Reviewers: arsenm

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365846 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: s_waitcnt field should be treated as unsigned
Matt Arsenault [Thu, 11 Jul 2019 23:42:57 +0000 (23:42 +0000)]
AMDGPU: s_waitcnt field should be treated as unsigned

Also make it an ImmLeaf, so it should work with global isel as well,
which was part of the point of moving it in the first place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365842 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[sancov] Ignore PC samples with value 0
Petr Hosek [Thu, 11 Jul 2019 22:59:23 +0000 (22:59 +0000)]
[sancov] Ignore PC samples with value 0

The sancov runtime for the (Fuchsia) Zircon kernel delivers results
in the standard format, but as the full array of possible samples
with 0 in uncovered slots. That runtime delivers "live" data and
has no final "export" pass to compactify out the uncovered slots,
and it seems silly to require another offline tool just for that.

Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D63695

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365839 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NewPM] Port Sancov
Leonard Chan [Thu, 11 Jul 2019 22:35:40 +0000 (22:35 +0000)]
[NewPM] Port Sancov

This patch contains a port of SanitizerCoverage to the new pass manager. This one's a bit hefty.

Changes:

- Split SanitizerCoverageModule into 2 SanitizerCoverage for passing over
  functions and ModuleSanitizerCoverage for passing over modules.
- ModuleSanitizerCoverage exists for adding 2 module level calls to initialization
  functions but only if there's a function that was instrumented by sancov.
- Added legacy and new PM wrapper classes that own instances of the 2 new classes.
- Update llvm tests and add clang tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365838 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Fixed asan error with agpr spilling
Stanislav Mekhanoshin [Thu, 11 Jul 2019 22:30:11 +0000 (22:30 +0000)]
[AMDGPU] Fixed asan error with agpr spilling

Instruction was used after it was erased.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365837 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix build errors LLVM tests are disabled.
Diego Novillo [Thu, 11 Jul 2019 22:08:35 +0000 (22:08 +0000)]
Fix build errors LLVM tests are disabled.

Original patch from alanbaker@google.com

Fixes the error:
CMake Error in <...>/llvm/cmake/modules/CMakeLists.txt:

export called with target "LLVMTestingSupport" which requires target
"gtest" that is not in the export set.

This occurs when LLVM is embedded in a larger project, but is configured not to
include tests. If testing is disabled gtest isn't available and LLVM fails to
configure.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365836 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] gfx908 agpr spilling
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:54:13 +0000 (21:54 +0000)]
[AMDGPU] gfx908 agpr spilling

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365833 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Deduce "nosync" function attribute.
Stefan Stipanovic [Thu, 11 Jul 2019 21:37:40 +0000 (21:37 +0000)]
[Attributor] Deduce "nosync" function attribute.

Introduce and deduce "nosync" function attribute to indicate that a function
does not synchronize with another thread in a way that other thread might free memory.

Reviewers: jdoerfert, jfb, nhaehnle, arsenm

Subscribers: wdng, hfinkel, nhaenhle, mehdi_amini, steven_wu,
dexonsmith, arsenm, uenoku, hiraditya, jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365830 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] gfx908 hazard recognizer
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:30:34 +0000 (21:30 +0000)]
[AMDGPU] gfx908 hazard recognizer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365829 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine][NFCI] Add more test coverage to onehot_merge.ll
Huihui Zhang [Thu, 11 Jul 2019 21:28:25 +0000 (21:28 +0000)]
[InstCombine][NFCI] Add more test coverage to onehot_merge.ll

Prep work for upcoming patch D64275.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365828 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] gfx908 scheduling
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:25:00 +0000 (21:25 +0000)]
[AMDGPU] gfx908 scheduling

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365826 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] gfx908 mfma support
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:19:33 +0000 (21:19 +0000)]
[AMDGPU] gfx908 mfma support

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365824 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoOpen native file handles to avoid converting from FDs, NFC
Reid Kleckner [Thu, 11 Jul 2019 20:29:32 +0000 (20:29 +0000)]
Open native file handles to avoid converting from FDs, NFC

Follow up to r365588.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365820 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[UpdateTestChecks] Emit warning when invalid test paths
David Bolvansky [Thu, 11 Jul 2019 20:14:22 +0000 (20:14 +0000)]
[UpdateTestChecks] Emit warning when invalid test paths

Summary:
Recently I ran into the following issue:

./update_test_checks.py /path/not-existing-file.ll

The script was silent and I was suprised why the real test file hadn't been updated.

Solution:
Emit warning if we detect this problem.

Reviewers: lebedev.ri, spatel, jdoerfert, nikic

Reviewed By: lebedev.ri, spatel, jdoerfert, nikic

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365818 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Revisited tests for D64285
David Bolvansky [Thu, 11 Jul 2019 19:39:20 +0000 (19:39 +0000)]
[NFC] Revisited tests for D64285

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365815 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NVPTX] Remove now unused atomic.load.add.f32 intrinsics
Benjamin Kramer [Thu, 11 Jul 2019 19:21:59 +0000 (19:21 +0000)]
[NVPTX] Remove now unused atomic.load.add.f32 intrinsics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365811 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC][NFC] Update testcase to avoid dead code
Jinsong Ji [Thu, 11 Jul 2019 19:16:33 +0000 (19:16 +0000)]
[PowerPC][NFC] Update testcase to avoid dead code

The original testcase might be optimized out due to dead code,
update the testcase to avoid it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365810 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Pre commit test cases for D64574. Along with a test case for PR42571. NFC
Craig Topper [Thu, 11 Jul 2019 18:19:27 +0000 (18:19 +0000)]
[X86] Pre commit test cases for D64574. Along with a test case for PR42571. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365803 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Assembler: support negative float constants.
Wouter van Oortmerssen [Thu, 11 Jul 2019 18:18:07 +0000 (18:18 +0000)]
[WebAssembly] Assembler: support negative float constants.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, aheejin, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365802 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NVPTX] Use atomicrmw fadd instead of intrinsics
Benjamin Kramer [Thu, 11 Jul 2019 17:11:25 +0000 (17:11 +0000)]
[NVPTX] Use atomicrmw fadd instead of intrinsics

AutoUpgrade the old intrinsics to atomicrmw fadd.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365796 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r365792
Nico Weber [Thu, 11 Jul 2019 17:09:35 +0000 (17:09 +0000)]
gn build: Merge r365792

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365795 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Merge negated ISD::SUB nodes into X86ISD::SUB equivalent (PR40483)
Sanjay Patel [Thu, 11 Jul 2019 15:56:33 +0000 (15:56 +0000)]
[X86] Merge negated ISD::SUB nodes into X86ISD::SUB equivalent (PR40483)

Follow up to D58597, where it was noted that the commuted ISD::SUB variant
was having problems with lack of combines.

See also D63958 where we untangled setcc/sub pairs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365791 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix a few 'no newline at end of file' warnings that Xcode emits
Nico Weber [Thu, 11 Jul 2019 15:26:45 +0000 (15:26 +0000)]
Fix a few 'no newline at end of file' warnings that Xcode emits

(Xcode even has a snazzy "Fix" button, but clicking that inserts two
newlines. So close!)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365789 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r365773
Nico Weber [Thu, 11 Jul 2019 15:01:50 +0000 (15:01 +0000)]
gn build: Merge r365773

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365787 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombine] narrowInsertExtractVectorBinOp - add CONCAT_VECTORS support
Simon Pilgrim [Thu, 11 Jul 2019 14:45:03 +0000 (14:45 +0000)]
[DAGCombine] narrowInsertExtractVectorBinOp - add CONCAT_VECTORS support

We already split extract_subvector(binop(insert_subvector(v,x),insert_subvector(w,y))) -> binop(x,y).

This patch adds support for extract_subvector(binop(concat_vectors(),concat_vectors())) cases as well.

In particular this means we don't have to wait for X86 lowering to convert concat_vectors to insert_subvector chains, which helps avoid some cases where demandedelts/combine calls occur too late to split large vector ops.

The fast-isel-store.ll load folding regression is annoying but I don't think is that critical.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365785 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRegUsageInfoCollector: Skip calling conventions I missed before
Matt Arsenault [Thu, 11 Jul 2019 14:41:40 +0000 (14:41 +0000)]
RegUsageInfoCollector: Skip calling conventions I missed before

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365784 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Move kernel argument handling to separate function
Matt Arsenault [Thu, 11 Jul 2019 14:18:25 +0000 (14:18 +0000)]
AMDGPU/GlobalISel: Move kernel argument handling to separate function

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365782 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix missing C++ mode comment
Matt Arsenault [Thu, 11 Jul 2019 14:18:22 +0000 (14:18 +0000)]
Fix missing C++ mode comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365781 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGlobalISel: Use Register
Matt Arsenault [Thu, 11 Jul 2019 14:18:19 +0000 (14:18 +0000)]
GlobalISel: Use Register

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365780 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r365775 - "[Object/ELF] - Improve error reporting for notes."
George Rimar [Thu, 11 Jul 2019 14:03:27 +0000 (14:03 +0000)]
Revert r365775 - "[Object/ELF] - Improve error reporting for notes."

It broke BB: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/15419

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365779 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Object/ELF] - Improve error reporting for notes.
George Rimar [Thu, 11 Jul 2019 13:47:44 +0000 (13:47 +0000)]
[Object/ELF] - Improve error reporting for notes.

This patch improves the error messages reported for
note sections and phdrs and also makes a cleanup for
existent test case.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365775 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] don't move FP negation out of a constant expression
Sanjay Patel [Thu, 11 Jul 2019 13:44:29 +0000 (13:44 +0000)]
[InstCombine] don't move FP negation out of a constant expression

-(X * ConstExpr) becomes X * (-ConstExpr), so don't reverse that
and infinite loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365774 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[yaml2obj/elf-override-shsize.yaml] - An attemp to fix ppc64 bot.
George Rimar [Thu, 11 Jul 2019 13:26:36 +0000 (13:26 +0000)]
[yaml2obj/elf-override-shsize.yaml] - An attemp to fix ppc64 bot.

Failture:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/35670/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Aelf-override-shsize.yaml

Solution:
Change `od` tool invocation to print single bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365772 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoOpaquePtr: switch to GlobalValue::getValueType in a few places. NFC.
Tim Northover [Thu, 11 Jul 2019 13:13:02 +0000 (13:13 +0000)]
OpaquePtr: switch to GlobalValue::getValueType in a few places. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365770 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoOpaquePtr: use byval accessor instead of inspecting pointer type. NFC.
Tim Northover [Thu, 11 Jul 2019 13:12:38 +0000 (13:12 +0000)]
OpaquePtr: use byval accessor instead of inspecting pointer type. NFC.

The accessor can deal with both "byval(ty)" and "ty* byval" forms
seamlessly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365769 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoOpaquePtr: use load instruction directly for type. NFC.
Tim Northover [Thu, 11 Jul 2019 13:12:08 +0000 (13:12 +0000)]
OpaquePtr: use load instruction directly for type. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365768 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoInstructionSimplify: Simplify InstructionSimplify. NFC.
Tim Northover [Thu, 11 Jul 2019 13:11:44 +0000 (13:11 +0000)]
InstructionSimplify: Simplify InstructionSimplify. NFC.

The interface predates CallBase, so both it and implementation were
significantly more complicated than they needed to be. There was even
some redundancy that could be eliminated.

Should also help with OpaquePointers by not trying to derive a
function's type from it's PointerType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365767 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[yaml2obj] - Allow overriding the sh_size field.
George Rimar [Thu, 11 Jul 2019 12:59:29 +0000 (12:59 +0000)]
[yaml2obj] - Allow overriding the sh_size field.

There is no way to set broken sh_size field currently
for sections. It can be usefull for writing the
test cases.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365766 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Updated tests for D64285
David Bolvansky [Thu, 11 Jul 2019 12:51:33 +0000 (12:51 +0000)]
[NFC] Updated tests for D64285

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365765 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj/llvm-readelf] - Report a warning instead of a error when dumping a...
George Rimar [Thu, 11 Jul 2019 12:26:48 +0000 (12:26 +0000)]
[llvm-readobj/llvm-readelf] - Report a warning instead of a error when dumping a broken dynamic section.

It does not make sence to stop dumping the object if the broken
dynamic section was found. In this patch I changed the behavior from
"report an error" to "report a warning". This matches GNU.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365762 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Reorder recently added/improved pow transformations
David Bolvansky [Thu, 11 Jul 2019 10:55:04 +0000 (10:55 +0000)]
[InstCombine] Reorder recently added/improved pow transformations

Changed cases are now faster with exp2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365758 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert [BitcodeReader] Validate OpNum, before accessing Record array.
Florian Hahn [Thu, 11 Jul 2019 10:53:40 +0000 (10:53 +0000)]
Revert [BitcodeReader] Validate OpNum, before accessing Record array.

This reverts r365750 (git commit 8b222ecf2769ee133691f208f6166ce118c4a164)

llvm-dis runs out of memory while opening invalid-fcmp-opnum.bc on
llvm-hexagon-elf, probably because the bitcode file contains other
suspicious values.

http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/21949

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365757 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Regenerate intrinsics tests. NFCI.
Simon Pilgrim [Thu, 11 Jul 2019 10:40:23 +0000 (10:40 +0000)]
[X86] Regenerate intrinsics tests. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365755 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Regenerate idot tests. NFCI.
Simon Pilgrim [Thu, 11 Jul 2019 10:37:58 +0000 (10:37 +0000)]
[AMDGPU] Regenerate idot tests. NFCI.

Reduces diff in D63281.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365754 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Don't change permissions of non-regular output files
Fangrui Song [Thu, 11 Jul 2019 10:17:59 +0000 (10:17 +0000)]
[llvm-objcopy] Don't change permissions of non-regular output files

There is currently an EPERM error when a regular user executes `llvm-objcopy a.o /dev/null`.
Worse, root can even change the mode bits of /dev/null.

Fix it by checking if the output file is special.

A new overload of llvm::sys::fs::setPermissions with FD as the parameter
is added. Users should provide `perm & ~umask` as the parameter if they
intend to respect umask.

The existing overload of llvm::sys::fs::setPermissions may be deleted if
we can find an implementation of fchmod() on Windows. fchmod() is
usually better than chmod() because it saves syscalls and can avoid race
condition.

Reviewed By: jakehehrlich, jhenderson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365753 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] -fno-plt: use GOT __tls_get_addr only if GOTPCRELX is enabled
Fangrui Song [Thu, 11 Jul 2019 10:10:09 +0000 (10:10 +0000)]
[X86] -fno-plt: use GOT __tls_get_addr only if GOTPCRELX is enabled

Summary:
As of binutils 2.32, ld has a bogus TLS relaxation error when the GD/LD
code sequence using R_X86_64_GOTPCREL (instead of R_X86_64_GOTPCRELX) is
attempted to be relaxed to IE/LE (binutils PR24784). gold and lld are good.

In gcc/config/i386/i386.md, there is a configure-time check of as/ld
support and the GOT relaxation will not be used if as/ld doesn't support
it:

    if (flag_plt || !HAVE_AS_IX86_TLS_GET_ADDR_GOT)
      return "call\t%P2";
    return "call\t{*%p2@GOT(%1)|[DWORD PTR %p2@GOT[%1]]}";

In clang, -DENABLE_X86_RELAX_RELOCATIONS=OFF is the default. The ld.bfd
bogus error can be reproduced with:

    thread_local int a;
    int main() { return a; }

clang -fno-plt -fpic a.cc -fuse-ld=bfd

GOTPCRELX gained relative good support in 2016, which is considered
relatively new.  It is even difficult to conditionally default to
-DENABLE_X86_RELAX_RELOCATIONS=ON due to cross compilation reasons. So
work around the ld.bfd bug by only using GOT when GOTPCRELX is enabled.

Reviewers: dalias, hjl.tools, nikic, rnk

Reviewed By: nikic

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365752 91177308-0d34-0410-b5e6-96231b3b80d8