]> granicus.if.org Git - llvm/log
llvm
5 years ago[X86] Split SCALEF(S) ISD opcodes into a version without rounding mode.
Craig Topper [Mon, 11 Mar 2019 04:36:59 +0000 (04:36 +0000)]
[X86] Split SCALEF(S) ISD opcodes into a version without rounding mode.

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

5 years ago[X86] Split RCP28/RSQRT/GETEXP/EXP2 ISD opcodes into SAE and current direction nodes...
Craig Topper [Mon, 11 Mar 2019 04:36:57 +0000 (04:36 +0000)]
[X86] Split RCP28/RSQRT/GETEXP/EXP2 ISD opcodes into SAE and current direction nodes. Remove rounding mode operand.

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

5 years ago[X86] Rename _RND versions of RANGE/REDUCE/GETMANT/RDNSCALE ISD opcodes to _SAE....
Craig Topper [Mon, 11 Mar 2019 04:36:55 +0000 (04:36 +0000)]
[X86] Rename _RND versions of RANGE/REDUCE/GETMANT/RDNSCALE ISD opcodes to _SAE. Remove SAE operand.

No need to explicitly store it and match it during isel.

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

5 years ago[X86] Rename X86ISD::CVTPH2PS_RND to CVTPH2PS_SAE. Remove SAE operand.
Craig Topper [Mon, 11 Mar 2019 04:36:53 +0000 (04:36 +0000)]
[X86] Rename X86ISD::CVTPH2PS_RND to CVTPH2PS_SAE. Remove SAE operand.

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

5 years ago[X86] Rename the CVTT*_RND ISD nodes to _SAE and remove the SAE operand. Split VFPROU...
Craig Topper [Mon, 11 Mar 2019 04:36:51 +0000 (04:36 +0000)]
[X86] Rename the CVTT*_RND ISD nodes to _SAE and remove the SAE operand. Split VFPROUNDS_RND/VFPEXT(S)_RND into versions without rounding operand.

For VFPEXT(S) we only need current rounding mode and an SAE version. Neither need extra operand.

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

5 years ago[X86] Rename X86ISD::CMPM_RND and X86ISD::FSETCCM_RND to _SAE instead of _RND. Remove...
Craig Topper [Mon, 11 Mar 2019 04:36:49 +0000 (04:36 +0000)]
[X86] Rename X86ISD::CMPM_RND and X86ISD::FSETCCM_RND to _SAE instead of _RND. Remove rounding operand.

The operand could only be the SAE encoding so no need to include it.

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

5 years ago[X86] Split the VFIXUPIMM/VFIXUPIMMS nodes into a current rounding mode and SAE ISD...
Craig Topper [Mon, 11 Mar 2019 04:36:47 +0000 (04:36 +0000)]
[X86] Split the VFIXUPIMM/VFIXUPIMMS nodes into a current rounding mode and SAE ISD opcode.

Remove matching of FROUND_CURRENT and FROUND_NO_EXC for these nodes from isel table.

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

5 years ago[X86] Begin removing matching of FROUND_CURRENT and FROUND_NO_EXC from isel tables.
Craig Topper [Mon, 11 Mar 2019 04:36:44 +0000 (04:36 +0000)]
[X86] Begin removing matching of FROUND_CURRENT and FROUND_NO_EXC from isel tables.

Instead I plan to have dedicated nodes for FROUND_CURRENT and FROUND_NO_EXC.

This patch starts with FADDS/FSUBS/FMULS/FDIVS/FMAXS/FMINS/FSQRTS.

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

5 years ago[PowerPC] Remove the override of isMachineVerifierClean() to open machine verifier
Zi Xuan Wu [Mon, 11 Mar 2019 03:31:09 +0000 (03:31 +0000)]
[PowerPC] Remove the override of isMachineVerifierClean() to open machine verifier
After fix all asserts found by machine verifier in PowerPC target with following patches,
we can activate machine verifier as default.

rL293769, rL348566, rL349030, rL349029, rL350113, rL350111,
rL350799, rL350165, rL355378, rL352174, rL354762, rL350115

It's also found in PR#27456, https://bugs.llvm.org/show_bug.cgi?id=27456

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

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

5 years agoAdd test case for add to sub post legalization. NFC
Amaury Sechet [Mon, 11 Mar 2019 01:25:48 +0000 (01:25 +0000)]
Add test case for add to sub post legalization. NFC

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

5 years ago[X86] Remove unneeded isel patterns from VCVTSI2SDZ and VCVTUSI2SDZ. NFC
Craig Topper [Mon, 11 Mar 2019 01:20:38 +0000 (01:20 +0000)]
[X86] Remove unneeded isel patterns from VCVTSI2SDZ and VCVTUSI2SDZ. NFC

We had patterns using X86ISD::SCALAR_SINT_TO_FP_RND/SCALAR_UINT_TO_FP_RND for
these instructions. There's nothing to round. Instead, we use a regular
sint_to_fp/uint_to_fp and a movsd as the pattern for these.

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

5 years ago[X86] Remove VCVTSI2SDZrrb_Int as it shouldn't exist.
Craig Topper [Mon, 11 Mar 2019 01:20:37 +0000 (01:20 +0000)]
[X86] Remove VCVTSI2SDZrrb_Int as it shouldn't exist.

This would convert a signed 32-bit integer to double precision with rounding. But there's nothing to round.

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

5 years agoRemove redundant extractBooleanFlip argument. NFC
Amaury Sechet [Mon, 11 Mar 2019 00:37:01 +0000 (00:37 +0000)]
Remove redundant extractBooleanFlip argument. NFC

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

5 years ago[x86] add x86-specific opcodes to extractelement scalarization list
Sanjay Patel [Sun, 10 Mar 2019 18:56:21 +0000 (18:56 +0000)]
[x86] add x86-specific opcodes to extractelement scalarization list

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

5 years ago[CGP] fix comments; NFC
Sanjay Patel [Sun, 10 Mar 2019 18:42:30 +0000 (18:42 +0000)]
[CGP] fix comments; NFC

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

5 years ago[X86] Remove unused variable. NFC
Craig Topper [Sun, 10 Mar 2019 17:36:41 +0000 (17:36 +0000)]
[X86] Remove unused variable. NFC

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

5 years ago[X86] Make lowering of intrinsics with rounding mode stricter so that only valid...
Craig Topper [Sun, 10 Mar 2019 17:20:45 +0000 (17:20 +0000)]
[X86] Make lowering of intrinsics with rounding mode stricter so that only valid rounding modes are lowered. Update tests accordingly

Many of our tests were not using valid rounding mode immediates. Clang verifies this in the frontend when it creates the intrinsics from builtins, but the backend would still lower invalid immediates.

With this change we will now leave them as intrinsics if the immediate is invalid. This will cause an isel selection failure.

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

5 years ago[X86] Remove dead code from the handler for INTR_TYPE_SCALAR_MASK_RM.
Craig Topper [Sun, 10 Mar 2019 17:20:42 +0000 (17:20 +0000)]
[X86] Remove dead code from the handler for INTR_TYPE_SCALAR_MASK_RM.

The code in here handles nodes with 6 or 7 operands. But only the 6 operand case is ever used these days.

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

5 years ago[AArch64] Add tests for saddsat/ssubsat; NFC
Nikita Popov [Sun, 10 Mar 2019 12:21:36 +0000 (12:21 +0000)]
[AArch64] Add tests for saddsat/ssubsat; NFC

Signed versions of the existing unsigned tests.

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

5 years ago[TableGen] Make CheckImmAllOnesVMatcher and CheckImmAllZerosVMatcher contradictory...
Craig Topper [Sun, 10 Mar 2019 06:44:09 +0000 (06:44 +0000)]
[TableGen] Make CheckImmAllOnesVMatcher and CheckImmAllZerosVMatcher contradictory matchers.

This improves X86 factoring a little bit.

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

5 years agoRecommit r355224 "[TableGen][SelectionDAG][X86] Add specific isel matchers for immAll...
Craig Topper [Sun, 10 Mar 2019 05:21:52 +0000 (05:21 +0000)]
Recommit r355224 "[TableGen][SelectionDAG][X86] Add specific isel matchers for immAllZerosV/immAllOnesV. Remove bitcasts from X86 patterns that are no longer necessary."

Includes a fix to emit a CheckOpcode for build_vector when immAllZerosV/immAllOnesV is used as a pattern root. This means it can't be used to look through bitcasts when used as a root, but that's probably ok. This extra CheckOpcode will ensure that the first match in the isel table will be a SwitchOpcode which is needed by the caching optimization in the ISel Matcher.

Original commit message:

Previously we had build_vector PatFrags that called ISD::isBuildVectorAllZeros/Ones. Internally the ISD::isBuildVectorAllZeros/Ones look through bitcasts, but we aren't able to take advantage of that in isel. Instead of we have to canonicalize the types of the all zeros/ones build_vectors and insert bitcasts. Then we have to pattern match those exact bitcasts.

By emitting specific matchers for these 2 nodes, we can make isel look through any bitcasts without needing to explicitly match them. We should also be able to remove the canonicalization to vXi32 from lowering, but I've left that for a follow up.

This removes something like 40,000 bytes from the X86 isel table.

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

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

5 years ago[runtime] Use --strip-all rather than --strip-sections
Petr Hosek [Sun, 10 Mar 2019 04:26:54 +0000 (04:26 +0000)]
[runtime] Use --strip-all rather than --strip-sections

We need to preserve section headers for shared libraries.

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

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

5 years ago[git-llvm] Only use --force-interactive when supported
Shoaib Meenai [Sun, 10 Mar 2019 01:34:42 +0000 (01:34 +0000)]
[git-llvm] Only use --force-interactive when supported

The --force-interactive option was introduced in SVN 1.8, and trying to
pass it to older SVN clients causes an error; CentOS 7 includes SVN 1.7,
for example, so this makes `git llvm` not usable out of the box. Older
clients would be interactive by default anyway [1], so just don't pass
the option if it's not supported.

An alternative would be to check the version instead of checking the
help text, but I think directly detecting the presence of the option is
more direct.

[1] http://svn.apache.org/viewvc?view=revision&revision=1424037

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

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

5 years ago[ValueTracking] Move constant range computation into ValueTracking; NFC
Nikita Popov [Sat, 9 Mar 2019 21:17:42 +0000 (21:17 +0000)]
[ValueTracking] Move constant range computation into ValueTracking; NFC

InstructionSimplify currently has some code to determine the constant
range of integer instructions for some simple cases. It is used to
simplify icmps.

This change moves the relevant code into ValueTracking as
llvm::computeConstantRange(), so it can also be reused for other
purposes.

In particular this is with the optimization of overflow checks in
mind (ref D59071), where constant ranges cover some cases that
known bits don't.

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

5 years ago[ARM] Use non-constant operand in umulo-32.ll; NFC
Nikita Popov [Sat, 9 Mar 2019 13:43:21 +0000 (13:43 +0000)]
[ARM] Use non-constant operand in umulo-32.ll; NFC

Currently the store+load is folded and both operands of the umulo
end up being constants. To avoid this getting folded away entirely,
make sure at least one operand is non-constant.

Also remove some allocas which don't seem relevant to the test.

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

5 years ago[ARM] Generate test checks for umulo-32.ll; NFC
Nikita Popov [Sat, 9 Mar 2019 13:21:15 +0000 (13:21 +0000)]
[ARM] Generate test checks for umulo-32.ll; NFC

The second test case is going to be changed by D59041, so generate
full baseline checks.

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

5 years ago[RISCV][NFC] Minor refactoring of CC_RISCV
Alex Bradbury [Sat, 9 Mar 2019 11:16:27 +0000 (11:16 +0000)]
[RISCV][NFC] Minor refactoring of CC_RISCV

Immediately check if we need to early-exit as we have a return value that
can't be returned directly. Also tweak following if/else.

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

5 years ago[RISCV][NFC] Split out emitSelectPseudo from EmitInstrWithCustomInserter
Alex Bradbury [Sat, 9 Mar 2019 09:30:14 +0000 (09:30 +0000)]
[RISCV][NFC] Split out emitSelectPseudo from EmitInstrWithCustomInserter

It's cleaner and more consistent to have a separate helper function here.

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

5 years ago[RISCV] Support -target-abi at the MC layer and for codegen
Alex Bradbury [Sat, 9 Mar 2019 09:28:06 +0000 (09:28 +0000)]
[RISCV] Support -target-abi at the MC layer and for codegen

This patch adds proper handling of -target-abi, as accepted by llvm-mc and
llc. Lowering (codegen) for the hard-float ABIs will follow in a subsequent
patch. However, this patch does add MC layer support for the hard float and
RVE ABIs (emission of the appropriate ELF flags
https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#-file-header).

ABI parsing must be shared between codegen and the MC layer, so we add
computeTargetABI to RISCVUtils. A warning will be printed if an invalid or
unrecognized ABI is given.

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

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

5 years ago[WebAssembly] Use named operands to identify loads and stores
Thomas Lively [Sat, 9 Mar 2019 04:31:37 +0000 (04:31 +0000)]
[WebAssembly] Use named operands to identify loads and stores

Summary:
Uses the named operands tablegen feature to look up the indices of
offset, address, and p2align operands for all load and store
instructions. This replaces brittle, incorrect logic for identifying
loads and store when eliminating frame indices, which previously
crashed on bulk-memory ops. It also cleans up the SetP2Alignment pass.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, jfb, llvm-commits

Tags: #llvm

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

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

5 years agoRefactor isBooleanFlip into extractBooleanFlip so that users do not depend on the...
Amaury Sechet [Sat, 9 Mar 2019 02:51:52 +0000 (02:51 +0000)]
Refactor isBooleanFlip into extractBooleanFlip so that users do not depend on the patern matched. NFC

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

5 years ago[x86] add tests for extract of FP select; NFC
Sanjay Patel [Sat, 9 Mar 2019 02:11:05 +0000 (02:11 +0000)]
[x86] add tests for extract of FP select; NFC

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

5 years ago[ScalarizeMaskedMemIntrin] Use IRBuilder functions that take uint32_t/uint64_t for...
Craig Topper [Sat, 9 Mar 2019 02:08:41 +0000 (02:08 +0000)]
[ScalarizeMaskedMemIntrin] Use IRBuilder functions that take uint32_t/uint64_t for getelementptr, extractelement, and insertelement.

This saves needing to call getInt32 ourselves. Making the code a little shorter.

The test changes are because insert/extract use getInt64 internally. Shouldn't be a functional issue.

This cleanup because I plan to write similar code for expandload/compressstore.

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

5 years ago[CMake] Support stripping and linking output to .build-id directory
Petr Hosek [Sat, 9 Mar 2019 01:26:55 +0000 (01:26 +0000)]
[CMake] Support stripping and linking output to .build-id directory

When installing runtimes with install-runtimes-stripped, we don't want
to just strip them, we also want to preserve the debugging information
for potential debugging. To make it possible to later find the stripped
debugging information, we want to use the .build-id layout:

https://fedoraproject.org/wiki/RolandMcGrath/BuildID#Find_files_by_build_ID

That is, for libfoo.so with build ID abcdef1234, the debugging information
will be installed into lib/debug/.build-id/ab/cdef1234. llvm-objcopy
already has support for stripping files and linking the debugging
stripped output into the right location. However, CMake doesn't support
customizing strip invocation for the *-stripped targets. So instead, we
replace CMAKE_STRIP with a custom script that invokes llvm-objcopy with
the right command line flags.

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

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

5 years agoRename a local variable counter to Counter.
Wei Mi [Fri, 8 Mar 2019 23:32:07 +0000 (23:32 +0000)]
Rename a local variable counter to Counter.

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

5 years ago[RegisterCoalescer][NFC] bind a DenseMap access to a reference to avoid
Wei Mi [Fri, 8 Mar 2019 23:29:46 +0000 (23:29 +0000)]
[RegisterCoalescer][NFC] bind a DenseMap access to a reference to avoid
repeated lookup operations

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

5 years ago[ScalarizeMaskedMemIntrin] Only set the ModifiedDT flag if new basic blocks were...
Craig Topper [Fri, 8 Mar 2019 23:03:43 +0000 (23:03 +0000)]
[ScalarizeMaskedMemIntrin] Only set the ModifiedDT flag if new basic blocks were added.

There are special cases in the scalarization for constant masks. If we hit one of the special cases we don't need to reset the iteration.

Noticed while starting work on adding expandload/compressstore to this pass.

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

5 years ago[RISCV] Allow access to FP CSRs without F extension
Ana Pazos [Fri, 8 Mar 2019 23:01:08 +0000 (23:01 +0000)]
[RISCV] Allow access to FP CSRs without F extension

Summary:
Floating-point CSRs should be accessible even when F extension is not enabled.
But pseudo instructions that access floating point CSRs still require the F extension.
GNU tools already implement this behavior. RISC-V spec is pending update to reflect
this behavior and to extend it to pseudo instructions that access floating point CSRs.

Reviewers: asb

Reviewed By: asb

Subscribers: asb, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, llvm-commits

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

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

5 years ago[CodeGenPrepare] Fix ModifiedDT flag in optimizeSelectInst
Rong Xu [Fri, 8 Mar 2019 22:46:18 +0000 (22:46 +0000)]
[CodeGenPrepare] Fix ModifiedDT flag in optimizeSelectInst

r44412 fixed a huge compile time regression but it needed ModifiedDT flag to be
maintained correctly in optimizations in optimizeBlock() and optimizeInst().
Function optimizeSelectInst() does not update the flag.
This patch propagates the flag in optimizeSelectInst() back to
optimizeBlock().

This patch also removes ModifiedDT in CodeGenPrepare class (which is not used).
The property of ModifiedDT is now recorded in a ref parameter.

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

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

5 years ago[Go / ASAN] Disable Go bindings for ASAN tests.
Mitch Phillips [Fri, 8 Mar 2019 22:34:33 +0000 (22:34 +0000)]
[Go / ASAN] Disable Go bindings for ASAN tests.

Go binding tests fail under ASAN with the error at the bottom of this
commit message. The reason the buildbots are not currently always
failing on this test is that they selectively disable the bindings due
to a Go binary not being present on their system.

This change should allow users to build an asan-bootstrapped compiler
and run asan-ified unit tests locally, similar to the way that
sanitizer-* buildbots do.

The error is:
```
FAIL: LLVM :: Bindings/Go/go.test (7050 of 30112)
******************** TEST 'LLVM :: Bindings/Go/go.test' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/mitchp/llvm-build/asan/sanitized-clang/bin/llvm-go go=/usr/lib/google-golang/bin/go test llvm.org/llvm/bindings/go/llvm
--
Exit Code: 1

Command Output (stdout):
--
FAIL llvm.org/llvm/bindings/go/llvm [build failed]

--
Command Output (stderr):
--
ld.lld: error: undefined symbol: std::allocator<char>::allocator()
>>> referenced by InstrumentationBindings.cpp
>>>               $WORK/b048/_x018.o:(LLVMAddDataFlowSanitizerPass)

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)
>>> referenced by InstrumentationBindings.cpp
>>>               $WORK/b048/_x018.o:(LLVMAddDataFlowSanitizerPass)

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
>>> referenced by InstrumentationBindings.cpp
>>>               $WORK/b048/_x018.o:(LLVMAddDataFlowSanitizerPass)

ld.lld: error: undefined symbol: std::allocator<char>::~allocator()
>>> referenced by InstrumentationBindings.cpp
>>>               $WORK/b048/_x018.o:(LLVMAddDataFlowSanitizerPass)

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
>>> referenced by InstrumentationBindings.cpp
>>>               $WORK/b048/_x018.o:(LLVMAddDataFlowSanitizerPass)

ld.lld: error: undefined symbol: std::allocator<char>::~allocator()
>>> referenced by InstrumentationBindings.cpp
>>>               $WORK/b048/_x018.o:(LLVMAddDataFlowSanitizerPass)

ld.lld: error: undefined symbol: llvm::createDataFlowSanitizerPass(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, void* (*)(), void* (*)())
>>> referenced by InstrumentationBindings.cpp
>>>               $WORK/b048/_x018.o:(LLVMAddDataFlowSanitizerPass)

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
>>> referenced by InstrumentationBindings.cpp
>>>               $WORK/b048/_x018.o:(void std::_Destroy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*))

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
>>> referenced by InstrumentationBindings.cpp
>>>               $WORK/b048/_x018.o:(void __gnu_cxx::new_allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::construct<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&))

ld.lld: error: undefined symbol: std::__throw_length_error(char const*)
>>> referenced by InstrumentationBindings.cpp
>>>               $WORK/b048/_x018.o:(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_check_len(unsigned long, char const*) const)

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
>>> referenced by InstrumentationBindings.cpp
>>>               $WORK/b048/_x018.o:(void std::_Construct<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&))

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
>>> referenced by InstrumentationBindings.cpp
>>>               $WORK/b048/_x018.o:(void __gnu_cxx::new_allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::destroy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*))

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()
>>> referenced by SupportBindings.cpp
>>>               $WORK/b048/_x019.o:(LLVMLoadLibraryPermanently2)

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const
>>> referenced by SupportBindings.cpp
>>>               $WORK/b048/_x019.o:(LLVMLoadLibraryPermanently2)

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const
>>> referenced by SupportBindings.cpp
>>>               $WORK/b048/_x019.o:(LLVMLoadLibraryPermanently2)

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const
>>> referenced by SupportBindings.cpp
>>>               $WORK/b048/_x019.o:(LLVMLoadLibraryPermanently2)

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
>>> referenced by SupportBindings.cpp
>>>               $WORK/b048/_x019.o:(LLVMLoadLibraryPermanently2)

ld.lld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
>>> referenced by SupportBindings.cpp
>>>               $WORK/b048/_x019.o:(LLVMLoadLibraryPermanently2)

ld.lld: error: undefined symbol: llvm::sys::DynamicLibrary::getPermanentLibrary(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)
>>> referenced by SupportBindings.cpp
>>>               $WORK/b048/_x019.o:(llvm::sys::DynamicLibrary::LoadLibraryPermanently(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*))

ld.lld: error: undefined symbol: __asan_option_detect_stack_use_after_return
>>> referenced by MCJIT.cpp:45 (/usr/local/google/home/mitchp/llvm/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp:45)
>>>               MCJIT.cpp.o:(llvm::MCJIT::createJIT(std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, std::__1::shared_ptr<llvm::MCJITMemoryManager>, std::__1::shared_ptr<llvm::LegacyJITSymbolResolver>, std::__1::unique_ptr<llvm::TargetMachine, std::__1::default_delete<llvm::TargetMachine> >)) in archive /usr/local/google/home/mitchp/llvm-build/asan/sanitized-clang/lib/libLLVMMCJIT.a

ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

--
```

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

5 years ago[AArch64][GlobalISel] Fix i1 arguments not being zero-extended as required by ABI.
Amara Emerson [Fri, 8 Mar 2019 22:17:00 +0000 (22:17 +0000)]
[AArch64][GlobalISel] Fix i1 arguments not being zero-extended as required by ABI.

Fixes PR41001.

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

5 years agoImprove "llvm-nm -f sysv" output for Elf files
Sunil Srivastava [Fri, 8 Mar 2019 22:00:50 +0000 (22:00 +0000)]
Improve "llvm-nm -f sysv" output for Elf files

Specifically, compute and Print Type and Section columns.

This is a re-commit of rL354833, after fixing the Asan problem found a a buildbot.

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

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

5 years ago[x86] scalarize extract element 0 of FP cmp
Sanjay Patel [Fri, 8 Mar 2019 21:54:41 +0000 (21:54 +0000)]
[x86] scalarize extract element 0 of FP cmp

An extension of D58282 noted in PR39665:
https://bugs.llvm.org/show_bug.cgi?id=39665

This doesn't answer the request to use movmsk, but that's an
independent problem. We need this and probably still need
scalarization of FP selects because we can't do that as a
target-independent transform (although it seems likely that
targets besides x86 should have this transform).

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

5 years ago[NVPTX][DEBUGINFO]Temp workaround for crash of ptxas: disable packed bytes in debug...
Alexey Bataev [Fri, 8 Mar 2019 21:29:17 +0000 (21:29 +0000)]
[NVPTX][DEBUGINFO]Temp workaround for crash of ptxas: disable packed bytes in debug sections.

Summary:
This patch works around the bug in the ptxas tool with the processing of bytes
separated by the comma symbol. The emission of the packed string is
temporarily disabled.

Reviewers: tra

Subscribers: jholewinski, jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years ago[HWASan] Save + print registers when tag mismatch occurs in AArch64.
Mitch Phillips [Fri, 8 Mar 2019 21:22:35 +0000 (21:22 +0000)]
[HWASan] Save + print registers when tag mismatch occurs in AArch64.

Summary:
This change change the instrumentation to allow users to view the registers at the point at which tag mismatch occured. Most of the heavy lifting is done in the runtime library, where we save the registers to the stack and emit unwind information. This allows us to reduce the overhead, as very little additional work needs to be done in each __hwasan_check instance.

In this implementation, the fast path of __hwasan_check is unmodified. There are an additional 4 instructions (16B) emitted in the slow path in every __hwasan_check instance. This may increase binary size somewhat, but as most of the work is done in the runtime library, it's manageable.

The failure trace now contains a list of registers at the point of which the failure occured, in a format similar to that of Android's tombstones. It currently has the following format:

Registers where the failure occurred (pc 0x0055555561b4):
    x0  0000000000000014  x1  0000007ffffff6c0  x2  1100007ffffff6d0  x3  12000056ffffe025
    x4  0000007fff800000  x5  0000000000000014  x6  0000007fff800000  x7  0000000000000001
    x8  12000056ffffe020  x9  0200007700000000  x10 0200007700000000  x11 0000000000000000
    x12 0000007fffffdde0  x13 0000000000000000  x14 02b65b01f7a97490  x15 0000000000000000
    x16 0000007fb77376b8  x17 0000000000000012  x18 0000007fb7ed6000  x19 0000005555556078
    x20 0000007ffffff768  x21 0000007ffffff778  x22 0000000000000001  x23 0000000000000000
    x24 0000000000000000  x25 0000000000000000  x26 0000000000000000  x27 0000000000000000
    x28 0000000000000000  x29 0000007ffffff6f0  x30 00000055555561b4

... and prints after the dump of memory tags around the buggy address.

Every register is saved exactly as it was at the point where the tag mismatch occurs, with the exception of x16/x17. These registers are used in the tag mismatch calculation as scratch registers during __hwasan_check, and cannot be saved without affecting the fast path. As these registers are designated as scratch registers for linking, there should be no important information in them that could aid in debugging.

Reviewers: pcc, eugenis

Reviewed By: pcc, eugenis

Subscribers: srhines, kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, hiraditya, jdoerfert, llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

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

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

5 years ago[cmake] Remove llvm from LLVM_ALL_PROJECTS
Shoaib Meenai [Fri, 8 Mar 2019 21:10:22 +0000 (21:10 +0000)]
[cmake] Remove llvm from LLVM_ALL_PROJECTS

LLVM is always built; including it in LLVM_ENABLE_PROJECTS has no
effect, but since it's in LLVM_ALL_PROJECTS, we produce a confusing
message about it being disabled. Drop it from LLVM_ALL_PROJECTS to avoid
this. Pointed out by David Greene on the mailing list [1].

[1] http://lists.llvm.org/pipermail/llvm-dev/2019-March/130854.html

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

5 years ago[GN] Merge 355720.
Mitch Phillips [Fri, 8 Mar 2019 21:05:27 +0000 (21:05 +0000)]
[GN] Merge 355720.

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

5 years ago[RegionPass] Fix forgotten "!".
Michael Kruse [Fri, 8 Mar 2019 21:03:06 +0000 (21:03 +0000)]
[RegionPass] Fix forgotten "!".

Commit r355068 "Fix IR/Analysis layering issue with OptBisect" uses the
template

   return Gate.isEnabled() && !Gate.shouldRunPass(this, getDescription(...));

for all pass kinds. For the RegionPass, it left out the not operator,
causing region passes to be skipped as soon as a pass gate is used.

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

5 years agoAMDGPU: Move d16 load matching to preprocess step
Matt Arsenault [Fri, 8 Mar 2019 20:58:11 +0000 (20:58 +0000)]
AMDGPU: Move d16 load matching to preprocess step

When matching half of the build_vector to a load, there could still be
a hidden dependency on the other half of the build_vector the pattern
wouldn't detect. If there was an additional chain dependency on the
other value, a cycle could be introduced.

I don't think a tablegen pattern is capable of matching the necessary
conditions, so move this into PreprocessISelDAG. Check isPredecessorOf
for the other value to avoid a cycle. This has a warning that it's
expensive, so this should probably be moved into an MI pass eventually
that will have more freedom to reorder instructions to help match
this. That is currently complicated by the lack of a computeKnownBits
type mechanism for the selected function.

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

5 years agoDAG: Don't try to cluster loads with tied inputs
Matt Arsenault [Fri, 8 Mar 2019 20:46:15 +0000 (20:46 +0000)]
DAG: Don't try to cluster loads with tied inputs

This avoids breaking possible value dependencies when sorting loads by
offset.

AMDGPU has some load instructions that write into the high or low bits
of the destination register, and have a tied input for the other input
bits. These can easily have the same base pointer, but be a swizzle so
the high address load needs to come first. This was inserting glue
forcing the opposite ordering, producing a cycle the InstrEmitter
would assert on. It may be potentially expensive to look for the
dependency between the other loads, so just skip any where this could
happen.

Fixes bug 40936 by reverting r351379, which added a hacky attempt to
fix this by adding chains in this case, which I think was just working
around broken glue before the InstrEmitter. The core of the patch is
re-implementing the fix for that problem.

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

5 years ago[x86] add tests for extracted vector FP cmp; NFC
Sanjay Patel [Fri, 8 Mar 2019 20:45:27 +0000 (20:45 +0000)]
[x86] add tests for extracted vector FP cmp; NFC

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

5 years agoRevert "[runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/"
Matthew Voss [Fri, 8 Mar 2019 20:33:55 +0000 (20:33 +0000)]
Revert "[runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/"

This broke the windows bots.

This reverts commit 28302c66d2586074f77497d5dc4eac7182b679e0.

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

5 years agoAMDGPU: Add more tests for d16 loads
Matt Arsenault [Fri, 8 Mar 2019 20:30:51 +0000 (20:30 +0000)]
AMDGPU: Add more tests for d16 loads

Also fix a few cases that weren't testing what they were supposed to.

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

5 years agoAMDGPU: Don't bother checking the chain in areLoadsFromSameBasePtr
Matt Arsenault [Fri, 8 Mar 2019 20:30:51 +0000 (20:30 +0000)]
AMDGPU: Don't bother checking the chain in areLoadsFromSameBasePtr

This is only called in contexts that are verifying the chain itself,
and the query itself is only asking about the address.

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

5 years agoAMDGPU: Correct DS implementation of areLoadsFromSameBasePtr
Matt Arsenault [Fri, 8 Mar 2019 20:30:50 +0000 (20:30 +0000)]
AMDGPU: Correct DS implementation of areLoadsFromSameBasePtr

This was checking the wrong operands for the base register and the
offsets. The indexes are shifted by the number of output registers
from the machine instruction definition, and the chain is moved to the
end.

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

5 years ago[DEBUG_INFO][NVPTX]Emit empty .debug_loc section in presence of the debug option.
Alexey Bataev [Fri, 8 Mar 2019 20:08:04 +0000 (20:08 +0000)]
[DEBUG_INFO][NVPTX]Emit empty .debug_loc section in presence of the debug option.

Summary:
If the LLVM module shows that it has debug info, but the file is
actually empty and the real debug info is not emitted, the ptxas tool
emits error 'Debug information not found in presence of .target debug'.
We need at leas one empty debug section to silence this message. Section
`.debug_loc` is not emitted for PTX and we can emit empty `.debug_loc`
section if `debug` option was emitted.

Reviewers: tra

Subscribers: jholewinski, aprantl, llvm-commits

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

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

5 years ago[DAGCombiner] fold (add (add (xor a, -1), b), 1) -> (sub b, a)
Amaury Sechet [Fri, 8 Mar 2019 19:39:32 +0000 (19:39 +0000)]
[DAGCombiner] fold (add (add (xor a, -1), b), 1) -> (sub b, a)

Summary: This pattern is sometime created after legalization.

Reviewers: efriedma, spatel, RKSimon, zvi, bkramer

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[CFLAnders] Fix typo in comment; NFC
George Burgess IV [Fri, 8 Mar 2019 19:28:55 +0000 (19:28 +0000)]
[CFLAnders] Fix typo in comment; NFC

Patch by Enna1!

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

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

5 years ago[RegisterCoalescer] Limit the number of joins for large live interval with
Wei Mi [Fri, 8 Mar 2019 19:25:32 +0000 (19:25 +0000)]
[RegisterCoalescer] Limit the number of joins for large live interval with
many valnos.

Recently we found compile time out problem in several cases when
SpeculativeLoadHardening was enabled. The significant compile time was spent
in register coalescing pass, where register coalescer tried to join many other
live intervals with some very large live intervals with many valnos.

Specifically, every time JoinVals::mapValues is called, computeAssignment will
be called by getNumValNums() times of the target live interval. If the large
live interval has N valnos and has N copies associated with it, trying to
coalescing those copies will at least cost N^2 complexity.

The patch adds some limit to the effort trying to join those very large live
intervals with others. By default, for live interval with > 100 valnos, and
when it has been coalesced with other live interval by more than 100 times,
we will stop coalescing for the live interval anymore. That put a compile
time cap for the N^2 algorithm and effectively solves the compile time
problem we saw.

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

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

5 years ago[x86] prevent infinite looping from inverse shuffle transforms
Sanjay Patel [Fri, 8 Mar 2019 19:20:28 +0000 (19:20 +0000)]
[x86] prevent infinite looping from inverse shuffle transforms

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

5 years ago[X86] Add test case for PR22473
Simon Pilgrim [Fri, 8 Mar 2019 19:16:26 +0000 (19:16 +0000)]
[X86] Add test case for PR22473

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

5 years ago[ARM][FIX] Fix vfmal.f16 and vfmsl.f16 operand
Diogo N. Sampaio [Fri, 8 Mar 2019 17:11:20 +0000 (17:11 +0000)]
[ARM][FIX] Fix vfmal.f16 and vfmsl.f16 operand

The indexed variant of vfmal.f16 and vfmsl.f16
instructions use the uppser bits of the indexed
operand to store the index (1 bit for the double
variant, 2 bits for the quad).

This limits the usable registers to d0 - d7 or
s0 - s15. This patch enforces this limitation.

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

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

5 years agoFix typo in constant vector
Simon Pilgrim [Fri, 8 Mar 2019 15:17:26 +0000 (15:17 +0000)]
Fix typo in constant vector

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

5 years ago[llvm-readelf]Don't lose negative-ness of negative addends for no symbol relocations
James Henderson [Fri, 8 Mar 2019 13:22:05 +0000 (13:22 +0000)]
[llvm-readelf]Don't lose negative-ness of negative addends for no symbol relocations

llvm-readelf prints relocation addends as:

  <symbol value>[+-]<absolute addend>

where [+-] is determined from whether addend is less than zero or not.
However, it does not print the +/- if there is no symbol, which meant
that negative addends became their positive value with no indication
that this had happened. This patch stops the absolute conversion when
addends are negative and there is no associated symbol.

Reviewed by: Higuoxing, mattd, MaskRay

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

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

5 years agogn build: Merge r355685
Nico Weber [Fri, 8 Mar 2019 13:07:22 +0000 (13:07 +0000)]
gn build: Merge r355685

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

5 years agogn build: Unbreak finding a working `gn` on $PATH on Unix after r355645
Nico Weber [Fri, 8 Mar 2019 13:01:58 +0000 (13:01 +0000)]
gn build: Unbreak finding a working `gn` on $PATH on Unix after r355645

From the Python subprocess docs:

   If shell is True, it is recommended to pass args as a string rather than as
   a sequence.

   [...]

   If args is a sequence, the first item specifies the command string, and any
   additional items will be treated as additional arguments to the shell itself.

Prior to this change, the `--version` would be passed to the shell, not to
a potential gn binary on $PATH, and running `gn` without any arguments makes
it exit with an exit code != 0, so the script would think that there wasn't
a working gn binary on $PATH.

Fix this by following the documentation's recommendation of using a string
now that we pass shell=True. I tested this on macOS and Windows, each with
the three cases of

- no gn on PATH (should run gn downloaded by get.py if present,
  else suggest running get.py)
- broken gn wrapper on PATH (should behave like the previous item)
- working gn on PATH (should use gn on PATH)

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

5 years agogn build: Unbreak get.py and gn.py on Windows
Nico Weber [Fri, 8 Mar 2019 12:45:50 +0000 (12:45 +0000)]
gn build: Unbreak get.py and gn.py on Windows

`os.uname()` doesn't exist on Windows, so use `platform.machine()` which
returns `os.uname()[4]` on non-Win and (on 64-bit systems) "AMD64" on Windows.
Also use `sys.platform` instead of `platform` to check for Windows-ness for the
file extension in gn.py (get.py got this right).

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

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

5 years ago[DAGCombine] Merge visitSMULO+visitUMULO into visitMULO. NFCI.
Simon Pilgrim [Fri, 8 Mar 2019 11:41:18 +0000 (11:41 +0000)]
[DAGCombine] Merge visitSMULO+visitUMULO into visitMULO. NFCI.

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

5 years ago[DAGCombine] Merge visitSADDO+visitUADDO into visitADDO. NFCI.
Simon Pilgrim [Fri, 8 Mar 2019 11:30:33 +0000 (11:30 +0000)]
[DAGCombine] Merge visitSADDO+visitUADDO into visitADDO. NFCI.

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

5 years ago[DAGCombine] Merge visitSSUBO+visitUSUBO into visitSUBO. NFCI.
Simon Pilgrim [Fri, 8 Mar 2019 11:16:55 +0000 (11:16 +0000)]
[DAGCombine] Merge visitSSUBO+visitUSUBO into visitSUBO. NFCI.

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

5 years ago[IR][ARM] Add function pointer alignment to datalayout
Michael Platings [Fri, 8 Mar 2019 10:44:06 +0000 (10:44 +0000)]
[IR][ARM] Add function pointer alignment to datalayout

Use this feature to fix a bug on ARM where 4 byte alignment is
incorrectly assumed.

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

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

5 years ago[SelectionDAG] Allow the user to specify a memeq function.
Clement Courbet [Fri, 8 Mar 2019 09:07:45 +0000 (09:07 +0000)]
[SelectionDAG] Allow the user to specify a memeq function.

Summary:
Right now, when we encounter a string equality check,
e.g. `if (memcmp(a, b, s) == 0)`, we try to expand to a comparison if `s` is a
small compile-time constant, and fall back on calling `memcmp()` else.

This is sub-optimal because memcmp has to compute much more than
equality.

This patch replaces `memcmp(a, b, s) == 0` by `bcmp(a, b, s) == 0` on platforms
that support `bcmp`.

`bcmp` can be made much more efficient than `memcmp` because equality
compare is trivially parallel while lexicographic ordering has a chain
dependency.

Subscribers: fedor.sergeev, jyknight, ckennelly, gchatelet, llvm-commits

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

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

5 years ago[AMDGPU] V_CVT_F32_UBYTE{0,1,2,3} are full rate instructions
Carl Ritson [Fri, 8 Mar 2019 09:03:11 +0000 (09:03 +0000)]
[AMDGPU] V_CVT_F32_UBYTE{0,1,2,3} are full rate instructions

Summary: Fix a bug in the scheduling model where V_CVT_F32_UBYTE{0,1,2,3} are incorrectly marked as quarter rate instructions.

Reviewers: arsenm, rampitec

Reviewed By: rampitec

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

Tags: #llvm

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

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

5 years ago[X86] Improve the type checking in isLegalMaskedLoad and isLegalMaskedGather.
Craig Topper [Fri, 8 Mar 2019 07:33:43 +0000 (07:33 +0000)]
[X86] Improve the type checking in isLegalMaskedLoad and isLegalMaskedGather.

We were just checking pointer size and type primitive size. But this caused unintended things like vectors of half being accepted by masked load/store.

For FP we now explicitly check for only double and float.

For pointers we now let any pointer through. Trusting that only 32 and 64 would be used to generate assembly.

We only check bitwidth after checking that the type is an integer.

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

5 years ago[runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/
Petr Hosek [Fri, 8 Mar 2019 05:35:22 +0000 (05:35 +0000)]
[runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/

This change is a consequence of the discussion in "RFC: Place libs in
Clang-dedicated directories", specifically the suggestion that
libunwind, libc++abi and libc++ shouldn't be using Clang resource
directory.  Tools like clangd make this assumption, but this is
currently not true for the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR build.
This change addresses that by moving the output of these libraries to
lib/<target> and include/ directories, leaving resource directory only
for compiler-rt runtimes and Clang builtin headers.

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

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

5 years ago[Bitcode] Fix bitcode compatibility issue with clang.arc.use intrinsic
Steven Wu [Fri, 8 Mar 2019 05:27:53 +0000 (05:27 +0000)]
[Bitcode] Fix bitcode compatibility issue with clang.arc.use intrinsic

Summary:
In r349534, objc arc implementation is switched to use intrinsics and at
the same time, clang.arc.use is renamed to llvm.objc.clang.arc.use to
make the naming more consistent. The side-effect of that is llvm no
longer recognize it as intrinsics and codegen external references to
it instead.

Rather than upgrade the old intrinsics name to the new one and wait for
the arc-contract pass to remove it, simply remove it in the bitcode
upgrader.

rdar://problem/48607063

Reviewers: pete, ahatanak, erik.pilkington, dexonsmith

Reviewed By: pete, dexonsmith

Subscribers: jkorous, jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years ago[x86] add extract FP tests for target-specific nodes; NFC
Sanjay Patel [Thu, 7 Mar 2019 23:55:54 +0000 (23:55 +0000)]
[x86] add extract FP tests for target-specific nodes; NFC

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

5 years agoTemporarily diasble debug output in GenericDomTreeConstruction.h
Adrian Prantl [Thu, 7 Mar 2019 23:30:19 +0000 (23:30 +0000)]
Temporarily diasble debug output in GenericDomTreeConstruction.h
to get the modules bots running again.

The LLVM_DEBUG macro only plays well with a modular build of LLVM when
the header is marked as textual, but doing so causes redefinition
errors.

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

5 years agoMake GenericDomTreeConstruction textual instead.
Adrian Prantl [Thu, 7 Mar 2019 23:17:11 +0000 (23:17 +0000)]
Make GenericDomTreeConstruction textual instead.

I think the problem is that it uses the LLVM_DEBUG macro in funciton bodies.

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

5 years agoWork around a module build error on the LLDB incremental green dragon bot.
Adrian Prantl [Thu, 7 Mar 2019 22:25:26 +0000 (22:25 +0000)]
Work around a module build error on the LLDB incremental green dragon bot.

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

5 years ago[GN] Locate prebuilt binaries correctly.
Mitch Phillips [Thu, 7 Mar 2019 22:20:36 +0000 (22:20 +0000)]
[GN] Locate prebuilt binaries correctly.

Use the system shell to see if we can find a 'gn' binary on $PATH. This solves the error wherein subprocess.call fails ungracefully if the binary doesn't exist.

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

5 years agoAdd secondary libstdc++ 4.8 and 5.1 detection mechanisms
Hubert Tong [Thu, 7 Mar 2019 21:28:33 +0000 (21:28 +0000)]
Add secondary libstdc++ 4.8 and 5.1 detection mechanisms

Summary:
The date-based approach to detecting unsupported versions of libstdc++
does not handle bug fix releases of older versions. As an example, the
`__GLIBCXX__` value associated with version 5.1, `20150422`, is less
than the values associated with versions 4.8.5 and 4.9.3.

This patch adds secondary checks based on certain properties in
sufficiently new versions of libstdc++.

Reviewers: jfb, tstellar, rnk, sfertile, nemanjai

Reviewed By: jfb

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Correct scheduler information for rotate by constant for Haswell, Broadwell...
Craig Topper [Thu, 7 Mar 2019 21:22:56 +0000 (21:22 +0000)]
[X86] Correct scheduler information for rotate by constant for Haswell, Broadwell, and Skylake.

Rotate with explicit immediate is a single uop from Haswell on. An immediate of 1 has a dependency on the previous writer of flags, but the other immediate values do not.

The implicit rotate by 1 instruction is 2 uops. But the flags are merged after the rotate uop so the data result does not see the flag dependency. But I don't think we have any way of modeling that.

RORX is 1 uop without the load. 2 uops with the load. We currently model these with WriteShift/WriteShiftLd.

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

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

5 years ago[X86] Model ADC/SBB with immediate 0 more accurately in the Haswell scheduler model
Craig Topper [Thu, 7 Mar 2019 21:22:51 +0000 (21:22 +0000)]
[X86] Model ADC/SBB with immediate 0 more accurately in the Haswell scheduler model

Haswell and possibly Sandybridge have an optimization for ADC/SBB with immediate 0 to use a single uop flow. This only applies GR16/GR32/GR64 with an 8-bit immediate. It does not apply to GR8. It also does not apply to the implicit AX/EAX/RAX forms.

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

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

5 years ago[CodeGen] Reuse BlockUtils for -unreachableblockelim pass (NFC)
Brian Gesiak [Thu, 7 Mar 2019 20:40:55 +0000 (20:40 +0000)]
[CodeGen] Reuse BlockUtils for -unreachableblockelim pass (NFC)

Summary:
The logic in the -unreachableblockelim pass does the following:

1. It traverses the function it's given in depth-first order and
   creates a set of basic blocks that are unreachable from the
   function's entry node.
2. It iterates over each of those unreachable blocks and (1) removes any
   successors' references to the dead block, and (2) replaces any uses of
   instructions from the dead block with null.

The logic in (2) above is identical to what the `llvm::DeleteDeadBlocks`
function from `BasicBlockUtils.h` does. The only difference is that
`llvm::DeleteDeadBlocks` replaces uses of instructions from dead blocks
not with null, but with undef.

Replace the duplicate logic in the -unreachableblockelim pass with a
call to `llvm::DeleteDeadBlocks`. This results in less code but no
functional change (NFC).

Reviewers: mkazantsev, wmi, davidxl, silvas, davide

Reviewed By: davide

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoAMDHSA: Code object v3 updates
Konstantin Zhuravlyov [Thu, 7 Mar 2019 19:58:29 +0000 (19:58 +0000)]
AMDHSA: Code object v3 updates

  - Copy kernel symbol attributes into kernel descriptor attributes
  - Make sure kernel symbol's visibility is not "higher" than protected

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

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

5 years ago[llvm-mca] Emit a message when no bottlenecks are identified.
Matt Davis [Thu, 7 Mar 2019 19:34:44 +0000 (19:34 +0000)]
[llvm-mca] Emit a message when no bottlenecks are identified.

Summary:
Since bottleneck hints are enabled via user request, it can be
confusing if no bottleneck information is presented.  Such is the
case when no bottlenecks are identified.  This patch emits a message
in that case.

Reviewers: andreadb

Reviewed By: andreadb

Subscribers: tschuett, gbedwell, llvm-commits

Tags: #llvm

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

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

5 years ago[GN] Remove DataLayoutTest.cpp from IR Unittests.
Mitch Phillips [Thu, 7 Mar 2019 18:58:45 +0000 (18:58 +0000)]
[GN] Remove DataLayoutTest.cpp from IR Unittests.

Merge of GN files to fit with rL355616.

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

5 years agoDelete x86_64 ShadowCallStack support
Vlad Tsyrklevich [Thu, 7 Mar 2019 18:56:36 +0000 (18:56 +0000)]
Delete x86_64 ShadowCallStack support

Summary:
ShadowCallStack on x86_64 suffered from the same racy security issues as
Return Flow Guard and had performance overhead as high as 13% depending
on the benchmark. x86_64 ShadowCallStack was always an experimental
feature and never shipped a runtime required to support it, as such
there are no expected downstream users.

Reviewers: pcc

Reviewed By: pcc

Subscribers: mgorny, javed.absar, hiraditya, jdoerfert, cfe-commits, #sanitizers, llvm-commits

Tags: #clang, #sanitizers, #llvm

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

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

5 years ago[PowerPC] Run clang format to avoid compiling warning.
Jinsong Ji [Thu, 7 Mar 2019 18:55:21 +0000 (18:55 +0000)]
[PowerPC] Run clang format to avoid compiling warning.

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

5 years ago[Sanitizer] Add 'dispatch' feature to be used in compiler-rt tests
Julian Lettner [Thu, 7 Mar 2019 18:15:23 +0000 (18:15 +0000)]
[Sanitizer] Add 'dispatch' feature to be used in compiler-rt tests

Reviewed By: dvyukov

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

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

5 years agoRollback of rL355585.
Mitch Phillips [Thu, 7 Mar 2019 18:13:39 +0000 (18:13 +0000)]
Rollback of rL355585.

Introduces memory leak in FunctionTest.GetPointerAlignment that breaks sanitizer buildbots:

```
=================================================================
==2453==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 128 byte(s) in 1 object(s) allocated from:
    #0 0x610428 in operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:105
    #1 0x16936bc in llvm::User::operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/User.cpp:151:19
    #2 0x7c3fe9 in Create /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/Function.h:144:12
    #3 0x7c3fe9 in (anonymous namespace)::FunctionTest_GetPointerAlignment_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/IR/FunctionTest.cpp:136
    #4 0x1a836a0 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
    #5 0x1a836a0 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2474
    #6 0x1a85c55 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
    #7 0x1a870d0 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
    #8 0x1aa5b84 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
    #9 0x1aa4d30 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
    #10 0x1aa4d30 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4257
    #11 0x1a6b656 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
    #12 0x1a6b656 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50
    #13 0x7f5af37a22e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x610428 in operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:105
    #1 0x151be6b in make_unique<llvm::ValueSymbolTable> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/ADT/STLExtras.h:1349:29
    #2 0x151be6b in llvm::Function::Function(llvm::FunctionType*, llvm::GlobalValue::LinkageTypes, unsigned int, llvm::Twine const&, llvm::Module*) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/Function.cpp:241
    #3 0x7c4006 in Create /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/Function.h:144:16
    #4 0x7c4006 in (anonymous namespace)::FunctionTest_GetPointerAlignment_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/IR/FunctionTest.cpp:136
    #5 0x1a836a0 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
    #6 0x1a836a0 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2474
    #7 0x1a85c55 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
    #8 0x1a870d0 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
    #9 0x1aa5b84 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
    #10 0x1aa4d30 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
    #11 0x1aa4d30 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4257
    #12 0x1a6b656 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
    #13 0x1a6b656 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50
    #14 0x7f5af37a22e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)

SUMMARY: AddressSanitizer: 168 byte(s) leaked in 2 allocation(s).
```

See http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/11358/steps/check-llvm%20asan/logs/stdio for more information.

Also introduces use-of-uninitialized-value in ConstantsTest.FoldGlobalVariablePtr:
```
==7070==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x14e703c in User /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/User.h:79:5
    #1 0x14e703c in Constant /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/Constant.h:44
    #2 0x14e703c in llvm::GlobalValue::GlobalValue(llvm::Type*, llvm::Value::ValueTy, llvm::Use*, unsigned int, llvm::GlobalValue::LinkageTypes, llvm::Twine const&, unsigned int) /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/GlobalValue.h:78
    #3 0x14e5467 in GlobalObject /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/GlobalObject.h:34:9
    #4 0x14e5467 in llvm::GlobalVariable::GlobalVariable(llvm::Type*, bool, llvm::GlobalValue::LinkageTypes, llvm::Constant*, llvm::Twine const&, llvm::GlobalValue::ThreadLocalMode, unsigned int, bool) /b/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/Globals.cpp:314
    #5 0x6938f1 in llvm::(anonymous namespace)::ConstantsTest_FoldGlobalVariablePtr_Test::TestBody() /b/sanitizer-x86_64-linux-fast/build/llvm/unittests/IR/ConstantsTest.cpp:565:18
    #6 0x1a240a1 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc
    #7 0x1a240a1 in testing::Test::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2474
    #8 0x1a26d26 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
    #9 0x1a2815f in testing::TestCase::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
    #10 0x1a43de8 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
    #11 0x1a42c47 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc
    #12 0x1a42c47 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:4257
    #13 0x1a0dfba in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
    #14 0x1a0dfba in main /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50
    #15 0x7f2081c412e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #16 0x4dff49 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/unittests/IR/IRTests+0x4dff49)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/User.h:79:5 in User
```

See http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/30222/steps/check-llvm%20msan/logs/stdio for more information.

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

5 years ago[InterleavedAccessAnalysis] Fix integer overflow in insertMember.
Florian Hahn [Thu, 7 Mar 2019 17:50:16 +0000 (17:50 +0000)]
[InterleavedAccessAnalysis] Fix integer overflow in insertMember.

Without checking for integer overflow, invalid members can be added
 e.g. if the calculated key overflows, becomes positive and the largest key.

This fixes
      https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7560
      https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13128
      https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13229

Reviewers: Ayal, anna, hsaito, efriedma

Reviewed By: efriedma

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

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

5 years ago[DebugInfo] Fix the type of the formated variable
Petar Jovanovic [Thu, 7 Mar 2019 16:31:08 +0000 (16:31 +0000)]
[DebugInfo] Fix the type of the formated variable

Change the format type of *Personality and *LSDAAddress to PRIx64 since
they are of type uint64_t.
The problem was detected on mips builds, where it was printing junk values
and causing test failure.

Patch by Milos Stojanovic.

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

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

5 years agogn build: Port r342002
Nico Weber [Thu, 7 Mar 2019 15:44:59 +0000 (15:44 +0000)]
gn build: Port r342002

I had hoped we could remove the dependency on shell32.lib from lib/Support
(there isn't much depending on it), but looks like this will take a while. So
for now, port this over.

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

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

5 years agogn build: Merge r355522
Nico Weber [Thu, 7 Mar 2019 15:43:14 +0000 (15:43 +0000)]
gn build: Merge r355522

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

5 years ago[llvm-readobj] Dump DT_USED value as string like GNU readelf does
Xing GUO [Thu, 7 Mar 2019 14:53:10 +0000 (14:53 +0000)]
[llvm-readobj] Dump DT_USED value as string like GNU readelf does

Reviewers: jhenderson

Reviewed By: jhenderson

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

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

5 years ago[LSR] Attempt to increase the accuracy of LSR's setup cost
David Green [Thu, 7 Mar 2019 13:44:40 +0000 (13:44 +0000)]
[LSR] Attempt to increase the accuracy of LSR's setup cost

In some loops, we end up generating loop induction variables that look like:
  {(-1 * (zext i16 (%i0 * %i1) to i32))<nsw>,+,1}
As opposed to the simpler:
  {(zext i16 (%i0 * %i1) to i32),+,-1}
i.e we count up from -limit to 0, not the simpler counting down from limit to
0. This is because the scores, as LSR calculates them, are the same and the
second is filtered in place of the first. We end up with a redundant SUB from 0
in the code.

This patch tries to make the calculation of the setup cost a little more
thoroughly, recursing into the scev members to better approximate the setup
required. The cost function for comparing LSR costs is:

return std::tie(C1.NumRegs, C1.AddRecCost, C1.NumIVMuls, C1.NumBaseAdds,
                C1.ScaleCost, C1.ImmCost, C1.SetupCost) <
       std::tie(C2.NumRegs, C2.AddRecCost, C2.NumIVMuls, C2.NumBaseAdds,
                C2.ScaleCost, C2.ImmCost, C2.SetupCost);
So this will only alter results if none of the other variables turn out to be
different.

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

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

5 years ago[MIPS GlobalISel] Fix mul operands
Petar Avramovic [Thu, 7 Mar 2019 13:28:29 +0000 (13:28 +0000)]
[MIPS GlobalISel] Fix mul operands

Unsigned mul high for MIPS32 is selected into two PseudoInstructions:
PseudoMULTu and PseudoMFHI that use accumulator register class ACC64 for
some of its operands. Registers in this class have appropriate hi and lo
register as subregisters: $lo0 and $hi0 are subregisters of $ac0 etc.
mul instruction implicit-defs $lo0 and $hi0 according to MipsInstrInfo.td.
In functions where mul and PseudoMULTu are present fastRegisterAllocator
will "run out of registers during register allocation" because
'calcSpillCost' for $ac0 will return spillImpossible because subregisters
$lo0 and $hi0 of $ac0 are reserved by mul instruction above. A solution is
to mark implicit-defs of $lo0 and $hi0 as dead in mul instruction.

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

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

5 years ago[yaml2obj] - Allow producing ELFDATANONE ELFs
George Rimar [Thu, 7 Mar 2019 12:09:19 +0000 (12:09 +0000)]
[yaml2obj] - Allow producing ELFDATANONE ELFs

I need this to remove a binary from LLD test suite.
The patch also simplifies the code a bit.

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

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