]> granicus.if.org Git - llvm/log
llvm
5 years ago[FastISel] Fix the crash in gc.result lowering
Serguei Katkov [Thu, 4 Apr 2019 04:19:56 +0000 (04:19 +0000)]
[FastISel] Fix the crash in gc.result lowering

The Fast ISel has a fallback to SelectionDAGISel in case it cannot handle the instruction.
This works as follows:
Using reverse order, try to select instruction using Fast ISel, if it cannot handle instruction it fallbacks to SelectionDAGISel
for these instructions if it is a call and continue fast instruction selections.

However if unhandled instruction is not a call or statepoint related instruction it fallbacks to SelectionDAGISel for all remaining
instructions in basic block.

However gc.result instruction is missed and as a result it is possible that gc.result is processed earlier than statepoint
causing breakage invariant the gc.results should be handled after statepoint.

Test is updated because in the current form fast-isel cannot handle ret instruction (due to i1 ret type without explicit ext)
and as a result test does not check fast-isel at all.

Reviewers: reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D60182

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

5 years agoRevert r357452 - 'SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function...
David L. Jones [Thu, 4 Apr 2019 02:27:57 +0000 (02:27 +0000)]
Revert r357452 - 'SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used results (PR41259)'

This revision causes tests to fail under ASAN. Since the cause of the failures
is not clear (could be ASAN, could be a Clang bug, could be a bug in this
revision), the safest course of action seems to be to revert while investigating.

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

5 years agogn build: Merge r357663
Nico Weber [Thu, 4 Apr 2019 02:08:10 +0000 (02:08 +0000)]
gn build: Merge r357663

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

5 years ago[WebAssembly] EmscriptenEHSjLj: Don't abort if __THREW__ is defined
Sam Clegg [Thu, 4 Apr 2019 01:43:21 +0000 (01:43 +0000)]
[WebAssembly] EmscriptenEHSjLj: Don't abort if __THREW__ is defined

This allows __THREW__ to be defined in the current module, although
it is still required to be a GlobalVariable.

In emscripten we want to be able to compile the source code that
defines this symbols.

Previously we were avoid this by not running this pass when building
that compiler-rt library, but I have change out to build it using the
normal compiler path:
https://github.com/emscripten-core/emscripten/pull/8391

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

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

5 years ago[XCOFF] Add functionality for parsing AIX XCOFF object file headers
Hubert Tong [Thu, 4 Apr 2019 00:53:21 +0000 (00:53 +0000)]
[XCOFF] Add functionality for parsing AIX XCOFF object file headers

Summary:
1. Add functionality for parsing AIX XCOFF object files headers.
2. Only support 32-bit AIX XCOFF object files in this patch.
3. Print out the AIX XCOFF object file header in YAML format.

Reviewers: sfertile, hubert.reinterpretcast, jasonliu, mstorsjo, zturner, rnk

Reviewed By: sfertile, hubert.reinterpretcast

Subscribers: jsji, mgorny, hiraditya, jdoerfert, llvm-commits

Tags: #llvm

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

Patch by Digger Lin

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

5 years ago[Support] On AIX, Check ENOTSUP on posix_fallocate instead of EOPNOTSUPP
Hubert Tong [Thu, 4 Apr 2019 00:40:34 +0000 (00:40 +0000)]
[Support] On AIX, Check ENOTSUP on posix_fallocate instead of EOPNOTSUPP

Summary:
`posix_fallocate` can fail if the underlying filesystem does not support
it; and, on AIX, such a failure is reported by a return value of
`ENOTSUP`. The existing code checks only for `EOPNOTSUPP`, which may
share the same value as `ENOTSUP`, but is not required to.

Reviewers: xingxue, sfertile, jasonliu

Reviewed By: xingxue

Subscribers: kristina, jsji, llvm-commits

Tags: #llvm

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

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

5 years ago[AIX] SelectionDAGNodes.h: Pack bit-fields that are meant to be packed
Hubert Tong [Thu, 4 Apr 2019 00:33:57 +0000 (00:33 +0000)]
[AIX] SelectionDAGNodes.h: Pack bit-fields that are meant to be packed

Summary:
Certain classes in the subject file are expected to provide different
views of a two-byte field as a collection of various bit-fields. On AIX,
the canonical layout of bit-fields would cause these classes to span
four bytes. Applying the `pack` pragma for compilers that employ the AIX
canonical layout allows these classes to fit within the expected two
bytes. In the future, the pragma would also likely need to be applied
when building with Clang on AIX.

Reviewers: xingxue, sfertile, jasonliu

Reviewed By: xingxue

Subscribers: jsji, llvm-commits

Tags: #llvm

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

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

5 years ago[gn] Use "$link /lib" for archives instead of lib.exe
Reid Kleckner [Thu, 4 Apr 2019 00:31:19 +0000 (00:31 +0000)]
[gn] Use "$link /lib" for archives instead of lib.exe

Summary:
This avoids the need to talk about lib.exe or llvm-lib.exe and it does
the right thing with LLD.

Reviewers: thakis

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Remove CustomInserters for RDPKRU/WRPKRU. Use some custom lowering and new...
Craig Topper [Thu, 4 Apr 2019 00:28:49 +0000 (00:28 +0000)]
[X86] Remove CustomInserters for RDPKRU/WRPKRU. Use some custom lowering and new ISD opcodes instead.

These inserters inserted some instructions to zero some registers and copied from virtual registers to physical registers.

This change instead inserts the zeros directly into the DAG at lowering time using new ISD opcodes
that take the extra zeroes as inputs. The zeros will then go through isel on their own to select
the MOV32r0 pseudo. Then we just need to mention the physical registers directly
in the isel patterns and the isel table and InstrEmitter will take care of inserting the necessary
copies to/from physical registers.

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

5 years ago[codeview] Remove Type member from CVRecord
Reid Kleckner [Thu, 4 Apr 2019 00:28:48 +0000 (00:28 +0000)]
[codeview] Remove Type member from CVRecord

Summary:
Now CVType and CVSymbol are effectively type-safe wrappers around
ArrayRef<uint8_t>. Make the kind() accessor load it from the
RecordPrefix, which is the same for types and symbols.

Reviewers: zturner, aganea

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoFix minor innaccuracy in previous comment on ManagedStaticBase
Reid Kleckner [Thu, 4 Apr 2019 00:13:16 +0000 (00:13 +0000)]
Fix minor innaccuracy in previous comment on ManagedStaticBase

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

5 years agoMake ManagedStatic constexpr constructible
Reid Kleckner [Thu, 4 Apr 2019 00:11:21 +0000 (00:11 +0000)]
Make ManagedStatic constexpr constructible

Apparently it needs member initializers so that it can be constructed in
a constexpr context. I explained my investigation of this in PR41367.

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

5 years agollvm-undname: Name a pair. No behavior change.
Nico Weber [Wed, 3 Apr 2019 23:29:05 +0000 (23:29 +0000)]
llvm-undname: Name a pair. No behavior change.

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

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

5 years ago[X86] Remove CustomInserter pseudos for MONITOR/MONITORX/CLZERO. Use custom instructi...
Craig Topper [Wed, 3 Apr 2019 23:28:30 +0000 (23:28 +0000)]
[X86] Remove CustomInserter pseudos for MONITOR/MONITORX/CLZERO. Use custom instruction selection instead.

This custom inserter existed so we could do a weird thing where we pretended that the instructions support
a full address mode instead of taking a pointer in EAX/RAX. I think was largely so we could be pointer
size agnostic in the isel pattern.

To make this work we would then put the address into an LEA into EAX/RAX in front of the instruction after
isel. But the LEA is overkill when we just have a base pointer. So we end up using the LEA as a slower MOV
instruction.

With this change we now just do custom selection during isel instead and just assign the incoming address
of the intrinsic into EAX/RAX based on its size. After the intrinsic is selected, we can let isel take
care of selecting an LEA or other operation to do any address computation needed in this basic block.

I've also split the instruction into a 32-bit mode version and a 64-bit mode version so the implicit
use is properly sized based on the pointer. Without this we get comments in the assembly output about
killing eax and defing rax or vice versa depending on whether we define the instruction to use EAX/RAX.

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

5 years ago[X86] Remove dead CHECK lines for a test. NFC
Craig Topper [Wed, 3 Apr 2019 23:28:18 +0000 (23:28 +0000)]
[X86] Remove dead CHECK lines for a test. NFC

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

5 years ago[X86] Autogenerate checks. NFC
Craig Topper [Wed, 3 Apr 2019 23:28:11 +0000 (23:28 +0000)]
[X86] Autogenerate checks. NFC

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

5 years agollvm-undname: Fix a crash-on-invalid
Nico Weber [Wed, 3 Apr 2019 23:27:18 +0000 (23:27 +0000)]
llvm-undname: Fix a crash-on-invalid

Found by oss-fuzz, fixes issue 13260 on oss-fuzz.

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

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

5 years agollvm-undame: Fix an assert-on-invalid
Nico Weber [Wed, 3 Apr 2019 23:23:32 +0000 (23:23 +0000)]
llvm-undame: Fix an assert-on-invalid

Found by oss-fuzz, fixes issue 12432 on os-fuzz.

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

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

5 years agollvm-undname: Fix an assert-on-invalid
Nico Weber [Wed, 3 Apr 2019 23:19:39 +0000 (23:19 +0000)]
llvm-undname: Fix an assert-on-invalid

Found by oss-fuzz, fixes issues 12428 and 12429 on oss-fuzz.

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

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

5 years agollvm-undname: Fix a crash-on-invalid
Nico Weber [Wed, 3 Apr 2019 23:15:56 +0000 (23:15 +0000)]
llvm-undname: Fix a crash-on-invalid

Found by oss-fuzz, fixes issues 12435 and 12438 on oss-fuzz.

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

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

5 years agollvm-cxxfilt: Demangle gcc "old-style unified" ctors and dtors
Nico Weber [Wed, 3 Apr 2019 23:14:33 +0000 (23:14 +0000)]
llvm-cxxfilt: Demangle gcc "old-style unified" ctors and dtors

These are variant 4, cf
https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/mangle.c#L1851
https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/mangle.c#L1880
and gcc seems to sometimes emit them still.

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

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

5 years ago[x86] fold shuffles of h-ops that have an undef operand
Sanjay Patel [Wed, 3 Apr 2019 22:40:35 +0000 (22:40 +0000)]
[x86] fold shuffles of h-ops that have an undef operand

If an operand is undef, we can assume it's the same as the
other operand.

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

5 years ago[x86] eliminate movddup of horizontal op
Sanjay Patel [Wed, 3 Apr 2019 22:15:29 +0000 (22:15 +0000)]
[x86] eliminate movddup of horizontal op

This pattern would show up as a regression if we more
aggressively convert vector FP ops to scalar ops.

There's still a missed optimization for the v4f64 legal
case (AVX) because we create that h-op with an undef operand.
We should probably just duplicate the operands for that
pattern to avoid trouble.

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

5 years ago[IR] Create new method in `Function` class (NFC)
Evandro Menezes [Wed, 3 Apr 2019 21:27:03 +0000 (21:27 +0000)]
[IR] Create new method in `Function` class (NFC)

Create method `optForNone()` testing for the function level equivalent of
`-O0` and refactor appropriately.

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

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

5 years ago[x86] add another test for disguised h-op; NFC
Sanjay Patel [Wed, 3 Apr 2019 21:10:55 +0000 (21:10 +0000)]
[x86] add another test for disguised h-op; NFC

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

5 years agoAMDGPU: Split block for si_end_cf
Matt Arsenault [Wed, 3 Apr 2019 20:53:20 +0000 (20:53 +0000)]
AMDGPU: Split block for si_end_cf

Relying on no spill or other code being inserted before this was
precarious. It relied on code diligently checking isBasicBlockPrologue
which is likely to be forgotten.

Ideally this could be done earlier, but this doesn't work because of
phis. Any other instruction can't be placed before them, so we have to
accept the position being incorrect during SSA.

This avoids regressions in the fast register allocator rewrite from
inverting the direction.

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

5 years ago[x86] add test for disguised horizontal op; NFC
Sanjay Patel [Wed, 3 Apr 2019 20:34:22 +0000 (20:34 +0000)]
[x86] add test for disguised horizontal op; NFC

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

5 years ago[dwarfdump] Remove bogus verifier error
Jonas Devlieghere [Wed, 3 Apr 2019 19:57:13 +0000 (19:57 +0000)]
[dwarfdump] Remove bogus verifier error

The standard doesn't require a DW_TAG_variable, DW_TAG_formal_parameter
or DW_TAG_constant to A DW_AT_type attribute describing the type of the
variable. It only specifies that it *can* have one.

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

5 years ago[ProfileSummary] Count callsite samples when computing total samples.
Taewook Oh [Wed, 3 Apr 2019 19:54:43 +0000 (19:54 +0000)]
[ProfileSummary] Count callsite samples when computing total samples.

Summary: Currently ProfileSummaryBuilder doesn't count into callsite samples when computing total samples. Considering that ProfileSummaryInfo is used to checked the hotness of not only body samples but also callsite samples (from SampleProfileLoader), I think the callsite sample counts should be considered when computing total samples.

Reviewers: eraman, danielcdh, wmi

Subscribers: hiraditya, jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years agogn build: Add build file for dexp
Nico Weber [Wed, 3 Apr 2019 19:09:15 +0000 (19:09 +0000)]
gn build: Add build file for dexp

None of check-clang-tools's tests run this, but the CMake
check-clang-tools depends on the binary, so add it for consistency.

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

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

5 years agoAMDGPU/NFC: Add offset field to arg metadata (required for code object v3)
Konstantin Zhuravlyov [Wed, 3 Apr 2019 19:07:29 +0000 (19:07 +0000)]
AMDGPU/NFC: Add offset field to arg metadata (required for code object v3)

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

5 years ago[X86] Extend boolean arguments to inline-asm according to getBooleanType
Krzysztof Parzyszek [Wed, 3 Apr 2019 17:43:14 +0000 (17:43 +0000)]
[X86] Extend boolean arguments to inline-asm according to getBooleanType

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

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

5 years ago[X86][AVX] combineHorizontalPredicateResult - split any/allof v16i16/v32i8 reduction...
Simon Pilgrim [Wed, 3 Apr 2019 17:28:34 +0000 (17:28 +0000)]
[X86][AVX] combineHorizontalPredicateResult - split any/allof v16i16/v32i8 reduction on AVX1

Perform the 2 x 128-bit lo/hi OR/AND on the vectors before calling PMOVMSKB on the 128-bit result.

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

5 years ago[X86][AVX] combineHorizontalPredicateResult - support v16i16/v32i8 reduction on AVX1
Simon Pilgrim [Wed, 3 Apr 2019 17:17:13 +0000 (17:17 +0000)]
[X86][AVX] combineHorizontalPredicateResult - support v16i16/v32i8 reduction on AVX1

Use getPMOVMSKB helper which splits v32i8 MOVMSK calls on pre-AVX2 targets.

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

5 years ago[DWARF] check whether the DIE is valid before querying for information
Paul Semel [Wed, 3 Apr 2019 17:13:45 +0000 (17:13 +0000)]
[DWARF] check whether the DIE is valid before querying for information

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

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

5 years ago[AArch64][GlobalISel] Legalize G_FEXP2
Jessica Paquette [Wed, 3 Apr 2019 16:58:32 +0000 (16:58 +0000)]
[AArch64][GlobalISel] Legalize G_FEXP2

Same as G_EXP. Add a test, and update legalizer-info-validation.mir and
f16-instructions.ll.

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

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

5 years ago[x86] make stack folding tests immune to unrelated transforms; NFC
Sanjay Patel [Wed, 3 Apr 2019 16:33:24 +0000 (16:33 +0000)]
[x86] make stack folding tests immune to unrelated transforms; NFC

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

5 years ago[DAGCombiner] Rename variables Demanded -> DemandedBits/DemandedElts. NFCI.
Simon Pilgrim [Wed, 3 Apr 2019 16:00:59 +0000 (16:00 +0000)]
[DAGCombiner] Rename variables Demanded -> DemandedBits/DemandedElts. NFCI.

Use consistent variable names down the SimplifyDemanded* call stack so debugging isn't such a annoyance.

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

5 years agoTest commit: Remove double variable assignment
Lewis Revill [Wed, 3 Apr 2019 15:54:30 +0000 (15:54 +0000)]
Test commit: Remove double variable assignment

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

5 years ago[llvm-readobj] - Fix 2 test cases.
George Rimar [Wed, 3 Apr 2019 15:11:19 +0000 (15:11 +0000)]
[llvm-readobj] - Fix 2 test cases.

https://reviews.llvm.org/D60122 (r357595) changed the
symbols description format.

This change fix two more new test cases to fix BB:
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/16205/steps/test-stage1-compiler/logs/stdio

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

5 years ago[SystemZ] Improve codegen for certain SADDO-immediate cases
Ulrich Weigand [Wed, 3 Apr 2019 15:09:19 +0000 (15:09 +0000)]
[SystemZ] Improve codegen for certain SADDO-immediate cases

When performing an add-with-overflow with an immediate in the
range -2G ... -4G, code currently loads the immediate into a
register, which generally takes two instructions.

In this particular case, it is preferable to load the negated
immediate into a register instead, which always only requires
one instruction, and then perform a subtract.

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

5 years ago[yaml2obj][obj2yaml] - Change how symbol's binding is descibed when parsing/dumping.
George Rimar [Wed, 3 Apr 2019 14:53:42 +0000 (14:53 +0000)]
[yaml2obj][obj2yaml] - Change how symbol's binding is descibed when parsing/dumping.

Currently, YAML has the following syntax for describing the symbols:

Symbols:
  Local:
    LocalSymbol1:
    ...
    LocalSymbol2:
    ...
  ...
  Global:
    GlobalSymbol1:
  ...
  Weak:
  ...
  GNUUnique:

I.e. symbols are grouped by their bindings. That is not very convenient,
because:

It does not allow to set a custom binding, what can be useful for producing
broken/special outputs for test cases. Adding a new binding would require to
change a syntax (what we observed when added GNUUnique recently).

It does not allow to change the order of the symbols in .symtab/.dynsym,
i.e. currently all Local symbols are placed first, then Global, Weak and GNUUnique
are following, but we are not able to change the order.

It is not consistent. Binding is just one of the properties of the symbol,
we do not group them by other properties.

It makes the code more complex that it can be. This patch shows it can be simplified
with the change performed.

The patch changes the syntax to just:

Symbols:
  Symbol1:
  ...
  Symbol2:
  ...
...

With that, we are able to work with the binding field just like with any other symbol property.

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

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

5 years ago[NFC] Address missed review comment for test
James Henderson [Wed, 3 Apr 2019 14:50:50 +0000 (14:50 +0000)]
[NFC] Address missed review comment for test

Reviewed by: grimar

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

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

5 years ago[x86] remove duplicate tests
Sanjay Patel [Wed, 3 Apr 2019 14:45:45 +0000 (14:45 +0000)]
[x86] remove duplicate tests

Accidentally double-committed these.

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

5 years ago[x86] add negative tests for FP scalarization; NFC
Sanjay Patel [Wed, 3 Apr 2019 14:41:28 +0000 (14:41 +0000)]
[x86] add negative tests for FP scalarization; NFC

These go with the proposal in D60150.

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

5 years ago[x86] add tests with constants for FP scalarization; NFC
Sanjay Patel [Wed, 3 Apr 2019 14:41:24 +0000 (14:41 +0000)]
[x86] add tests with constants for FP scalarization; NFC

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

5 years ago[llvm-objcopy] Make section rename/set flags case-insensitive
James Henderson [Wed, 3 Apr 2019 14:40:27 +0000 (14:40 +0000)]
[llvm-objcopy] Make section rename/set flags case-insensitive

This fixes https://bugs.llvm.org/show_bug.cgi?id=41305. GNU objcopy
--set-section-flags/--rename-section flags are case-insensitive, so this
patch updates llvm-objcopy to match.

Reviewed by: grimar

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

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

5 years ago[x86] add tests with constants for FP scalarization; NFC
Sanjay Patel [Wed, 3 Apr 2019 14:36:47 +0000 (14:36 +0000)]
[x86] add tests with constants for FP scalarization; NFC

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

5 years ago[MIPS GlobalISel] Select floating point arithmetic operations
Petar Avramovic [Wed, 3 Apr 2019 14:12:59 +0000 (14:12 +0000)]
[MIPS GlobalISel] Select floating point arithmetic operations

Select 32 and 64 bit floating point add, sub, mul and div for MIPS32.

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

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

5 years ago[AArch64] Update v8.5a MTE LDG/STG instructions
Javed Absar [Wed, 3 Apr 2019 14:12:13 +0000 (14:12 +0000)]
[AArch64] Update v8.5a MTE LDG/STG instructions

The latest MTE specification adds register Xt to the STG instruction family:
  STG [Xn, #offset] -> STG Xt, [Xn, #offset]
The tag written to memory is taken from Xt rather than Xn.
Also, the LDG instruction also was changed to read return address from Xt:
  LDG Xt, [Xn, #offset].
This patch includes those changes and tests.
Specification is at: https://developer.arm.com/docs/ddi0596/c
Differential Revision: https://reviews.llvm.org/D60188

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

5 years agoAMDGPU: Fix copy/paste error in intrnsic comment
Matt Arsenault [Wed, 3 Apr 2019 13:56:36 +0000 (13:56 +0000)]
AMDGPU: Fix copy/paste error in intrnsic comment

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

5 years ago[DAGCombiner] loosen restrictions for moving shuffles after vector binop
Sanjay Patel [Wed, 3 Apr 2019 13:42:06 +0000 (13:42 +0000)]
[DAGCombiner] loosen restrictions for moving shuffles after vector binop

There are 3 changes to make this correspond to the same transform in instcombine:
1. Remove the legality check - we can't create anything less legal than we started with.
2. Ease the use restriction, so we only bail out if both operands have >1 use.
3. Ease the use restriction for binops with a repeated operand (eg, mul x, x).

As discussed in D60150, there's a scalarization opportunity that will be made
easier by allowing this transform more generally.

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

5 years ago[llvm-readobj] Add GNU style dumper for .gnu.version section
Xing GUO [Wed, 3 Apr 2019 13:32:49 +0000 (13:32 +0000)]
[llvm-readobj] Add GNU style dumper for .gnu.version section

Summary: Currently, `llvm-readobj` do not support GNU style dumper for symbol versioning sections. In this patch, I would like to implement dumper for `.gnu.version` section

Reviewers: jhenderson, rupprecht, grimar

Reviewed By: jhenderson, rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-nm]Add support for --no-demangle
James Henderson [Wed, 3 Apr 2019 12:57:46 +0000 (12:57 +0000)]
[llvm-nm]Add support for --no-demangle

GNU nm has --no-demangle, so llvm-nm should too. It disables the
--demangle switch. The patch also allows --demangle to be specified
multiple times (the last of all --no-demangle/--demangle switches
takes precedence).

Reviewed by: grimar, rupprecht, mattd

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

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

5 years agogn build: Add build files for clangd xpc framework code
Nico Weber [Wed, 3 Apr 2019 12:33:19 +0000 (12:33 +0000)]
gn build: Add build files for clangd xpc framework code

This is a bit of a larger change since this is the first (and as far as
I can tell only) place where the LLVM build produces macOS framework
bundles.

GN has some built-in support for this, so use that.
`gn help create_bundle` has a terse description (but it's a bit
outdated: `deps` must be `public_deps` and the conditionals in the
example in the help aren't quite right on non-iOS).

We need a new 'copy_bundle_data' tool, and since we copy the clangd.xpc
bundle as bundle_data into ClangdXPC.framework it needs to be able to
handle directories in addition to files.

GN also insists we have a compile_xcassets tool even though it's not
used. I just made that run `false`.

Despite GN's support for bundles, we still need to manually create the
expected symlink structure in the .framework bundle. Since this code
never runs on Windows, it's safe to create the symlinks before the
symlink targets exist, so we can just make the bundle depend on the
steps that create the symlinks. For this to work, change the symlink
script to create the symlink's containing directory if it doesn't yet
exist.

I locally verified that CMake and GN build create the same bundle
structure. (I noticed that both builds set LC_ID_DYLIB to the pre-copy
libClangdXPCLib.dylib name, but that seems to not cause any issues and
it happens in the CMake build too.)

(Also add an error message to clangd-xpc-test-client for when loading
the dylib fails – this was useful while locally debugging this.)

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

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

5 years ago[X86] Regenerate LEA codegen tests
Simon Pilgrim [Wed, 3 Apr 2019 12:33:16 +0000 (12:33 +0000)]
[X86] Regenerate LEA codegen tests

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

5 years ago[DAGCombine] Don't use getZExtValue() until we know the constant is in range.
Simon Pilgrim [Wed, 3 Apr 2019 11:00:55 +0000 (11:00 +0000)]
[DAGCombine] Don't use getZExtValue() until we know the constant is in range.

Noticed during prep for a patch for PR40758.

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

5 years ago[mips] Remove unused FGRH32 register class. NFC
Simon Atanasyan [Wed, 3 Apr 2019 10:08:27 +0000 (10:08 +0000)]
[mips] Remove unused FGRH32 register class. NFC

If we need this class in the future we will easily restore it.

Differential Revision: http://reviews.llvm.org/D60132

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

5 years ago[X86] Make the post machine scheduler macrofusion-aware.
Clement Courbet [Wed, 3 Apr 2019 09:37:30 +0000 (09:37 +0000)]
[X86] Make the post machine scheduler macrofusion-aware.

Summary:
Given that X86 does not use this currently, this is an NFC. I'll
experiment with enabling and will report numbers.

Reviewers: andreadb, lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[X86][NFC] Add tests for misched macro-fusion.
Clement Courbet [Wed, 3 Apr 2019 08:21:54 +0000 (08:21 +0000)]
[X86][NFC] Add tests for misched macro-fusion.

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

5 years ago[InstCombine] Simplify ctpop with bitreverse/bswap
David Bolvansky [Wed, 3 Apr 2019 08:08:44 +0000 (08:08 +0000)]
[InstCombine] Simplify ctpop with bitreverse/bswap

Summary: Fixes PR41337

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoRevert r357256 "[DAGCombine] Improve Lifetime node chains."
Hans Wennborg [Wed, 3 Apr 2019 07:41:58 +0000 (07:41 +0000)]
Revert r357256 "[DAGCombine] Improve Lifetime node chains."

As it caused a pathological compile-time regressionin V8, see PR41352.

> Improve both start and end lifetime nodes chain dependencies.
>
> Reviewers: courbet
>
> Reviewed By: courbet
>
> Subscribers: hiraditya, llvm-commits
>
> Tags: #llvm
>
> Differential Revision: https://reviews.llvm.org/D59795

This also reverts the follow-up r357309:

> [DAGCombiner] Rewrite ImproveLifetimeNodeChain to avoid DAG loop.
>
> Avoid EXPENSIVE_CHECK failure. NFCI.

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

5 years ago[PowerPC]add testcase for ppcctrloops pass shortloop check
Chen Zheng [Wed, 3 Apr 2019 03:11:34 +0000 (03:11 +0000)]
[PowerPC]add testcase for ppcctrloops pass shortloop check

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

5 years agoFix TargetLibraryInfoTest.ValidProto after rL357552
Sam Clegg [Wed, 3 Apr 2019 02:30:35 +0000 (02:30 +0000)]
Fix TargetLibraryInfoTest.ValidProto after rL357552

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

5 years agoAMDGPU: Assume ECC is enabled by default if supported
Matt Arsenault [Wed, 3 Apr 2019 01:58:57 +0000 (01:58 +0000)]
AMDGPU: Assume ECC is enabled by default if supported

The test should really be checking for the property directly in the
code object headers, but there are problems with this. I don't see
this directly represented in the text form, and for the binary
emission this is depending on a function level subtarget feature to
emit a global flag.

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

5 years ago[WebAssembly] Add Emscripten OS definition + small_printf
Alon Zakai [Wed, 3 Apr 2019 01:08:35 +0000 (01:08 +0000)]
[WebAssembly] Add Emscripten OS definition + small_printf

The Emscripten OS provides a definition of __EMSCRIPTEN__, and also that it
supports iprintf optimizations.

Also define small_printf optimizations, which is a printf with float support
but not long double (which in wasm can be useful since long doubles are 128
bit and force linking of float128 emulation code). This part is based on
sunfish's https://reviews.llvm.org/D57620 (which can't land yet since
the WASI integration isn't ready yet).

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

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

5 years agoInstSimplify: Fold round intrinsics from sitofp/uitofp
Matt Arsenault [Wed, 3 Apr 2019 00:25:06 +0000 (00:25 +0000)]
InstSimplify: Fold round intrinsics from sitofp/uitofp

https://godbolt.org/z/gEMRZb

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

5 years ago[WebAssembly] Remove unneeded target operand flags
Sam Clegg [Wed, 3 Apr 2019 00:17:29 +0000 (00:17 +0000)]
[WebAssembly] Remove unneeded target operand flags

This change is in preparation for the addition of new target
operand flags for new relocation types.  Have a symbol type as part
of the flag set makes it harder to use and AFAICT these are serving
no purpose.

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

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

5 years ago[X86] Update the test case for v4i1 bitselect in combine-bitselect.ll to not have...
Craig Topper [Wed, 3 Apr 2019 00:05:03 +0000 (00:05 +0000)]
[X86] Update the test case for v4i1 bitselect in combine-bitselect.ll to not have an infinite loop in IR.

In fact we don't even need a loop at all. I backed out the bug fix this was testing for and verified that this new case hit the same issue.

This should stop D59626 from deleting some of this code by realizing it was dead due to the loop.

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

5 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Wed, 3 Apr 2019 00:04:57 +0000 (00:04 +0000)]
[X86] Autogenerate complete checks. NFC

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

5 years agoAMDGPU: Remove unnecessary subtarget get
Matt Arsenault [Wed, 3 Apr 2019 00:01:05 +0000 (00:01 +0000)]
AMDGPU: Remove unnecessary subtarget get

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

5 years agoAMDGPU: Fix names for generation features
Matt Arsenault [Wed, 3 Apr 2019 00:01:03 +0000 (00:01 +0000)]
AMDGPU: Fix names for generation features

We should overall stop using these, but the uppercase name didn't
work. Any feature string is converted to lowercase, so these
could never be found in the table.

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

5 years agoAMDGPU: Don't use the default cpu in a few tests
Matt Arsenault [Wed, 3 Apr 2019 00:00:58 +0000 (00:00 +0000)]
AMDGPU: Don't use the default cpu in a few tests

Avoids unnecessary test changes in a future commit.

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

5 years ago[GlobalISel] Add IRTranslator support for llvm.stacksave and llvm.stackrestore
Jessica Paquette [Tue, 2 Apr 2019 22:46:31 +0000 (22:46 +0000)]
[GlobalISel] Add IRTranslator support for llvm.stacksave and llvm.stackrestore

Also update arm64-irtranslator.ll.

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

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

5 years agoX86: regenerate speculative-load-hardening-indirect.ll tests. NFC.
Stanislav Mekhanoshin [Tue, 2 Apr 2019 22:44:46 +0000 (22:44 +0000)]
X86: regenerate speculative-load-hardening-indirect.ll tests. NFC.

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

5 years ago[COFF] Reduce the size of Chunk and SectionChunk, NFC
Reid Kleckner [Tue, 2 Apr 2019 22:11:58 +0000 (22:11 +0000)]
[COFF] Reduce the size of Chunk and SectionChunk, NFC

Summary:
Reorder the fields in both to use padding more efficiently, and add more
comments on the purpose of the fields.

Replace `std::vector<SectionChunk*> AssociativeChildren` with a
singly-linked list. This avoids the separate vector allocation to list
associative children, and shrinks the 3 pointers used for the typically
empty vector down to 1.

In the end, this reduces the sum of heap allocations used to link
browser_tests.exe with NO PDB by 13.10%, going from 2,248,728 KB to
1,954,071 KB of heap. These numbers exclude memory mapped files, which
are of course a significant factor in LLD's memory usage.

Reviewers: ruiu, mstorsjo, aganea

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Mark the default case of the X86InstrInfo::convertToThreeAddress switch as...
Craig Topper [Tue, 2 Apr 2019 20:52:16 +0000 (20:52 +0000)]
[X86] Mark the default case of the X86InstrInfo::convertToThreeAddress switch as unreachable.

This function should only be called with instructions that are really convertible. And all
convertible instructions need to be handled by the switch. So nothing should use the default.

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

5 years ago[X86] Check MI.isConvertibleTo3Addr() before calling convertToThreeAddress in X86Fixu...
Craig Topper [Tue, 2 Apr 2019 20:52:10 +0000 (20:52 +0000)]
[X86] Check MI.isConvertibleTo3Addr() before calling convertToThreeAddress in X86FixupLEAs.

X86FixupLEAs just assumes convertToThreeAddress will return nullptr for any instruction that isn't convertible.

But the code in convertToThreeAddress for X86 assumes that any instruction coming in has at least 2 operands and that the second one is a register. But those properties aren't guaranteed of all instructions. We should check the instruction property first.

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

5 years ago[TableGen] Properly calculate the minimum size needed or ConvertFn in GenAsmmatcher...
Craig Topper [Tue, 2 Apr 2019 20:52:04 +0000 (20:52 +0000)]
[TableGen] Properly calculate the minimum size needed or ConvertFn in GenAsmmatcher.inc files

We were using the number of Matchables rather than the number of rows in the converter table.

This only matters for a few of the targets where the number of matchables is more than 255, but the number of converters is less than 255. Many of the targets have more than 256 converters. So already required a uint16_t.

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

5 years ago[x86] add more tests for FP scalarization; NFC
Sanjay Patel [Tue, 2 Apr 2019 20:24:06 +0000 (20:24 +0000)]
[x86] add more tests for FP scalarization; NFC

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

5 years ago[InstCombine] Added tests for PR41337
David Bolvansky [Tue, 2 Apr 2019 20:21:26 +0000 (20:21 +0000)]
[InstCombine] Added tests for PR41337

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

5 years ago[InstCombine] Simplify ctlz/cttz with bitreverse
David Bolvansky [Tue, 2 Apr 2019 20:13:28 +0000 (20:13 +0000)]
[InstCombine] Simplify ctlz/cttz with bitreverse

Summary: Fixes PR41273

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[AArch64][GlobalISel] Select llvm.aarch64.stlxr(i64, i64*)
Jessica Paquette [Tue, 2 Apr 2019 19:57:26 +0000 (19:57 +0000)]
[AArch64][GlobalISel] Select llvm.aarch64.stlxr(i64, i64*)

This adds partial instruction selection support for llvm.aarch64.stlxr. It also
factors out selection for G_INTRINSIC_W_SIDE_EFFECTS into its own function. The
new function removes the restriction that the intrinsic ID on the
G_INTRINSIC_W_SIDE_EFFECTS be on operand 0.

Also add a test, and add a GISel line to arm64-ldxr-stxr.ll.

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

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

5 years ago[FileCheck] Fix FileCheck.cpp compilation on Solaris
Rainer Orth [Tue, 2 Apr 2019 18:38:23 +0000 (18:38 +0000)]
[FileCheck] Fix FileCheck.cpp compilation on Solaris

Both LLVM 8.0.0 and current trunk fail to compile on Solaris with GCC 8.1.0:

  /vol/llvm/src/llvm/dist/utils/FileCheck/FileCheck.cpp: In function ‘void DumpAnnotatedInput(llvm::raw_ostream&, const llvm::FileCheckRequest&, llvm::StringRef, std::vector<InputAnnotation>&, unsigned int)’:
  /vol/llvm/src/llvm/dist/utils/FileCheck/FileCheck.cpp:408:41: error: call of overloaded ‘log10(unsigned int&)’ is ambiguous
     unsigned LineNoWidth = log10(LineCount) + 1;
                                           ^
  In file included from /vol/gcc-8/lib/gcc/i386-pc-solaris2.11/8.1.0/include-fixed/math.h:24,
                   from /vol/gcc-8/include/c++/8.1.0/cmath:45,
                   from /vol/llvm/src/llvm/dist/include/llvm-c/DataTypes.h:28,
                   from /vol/llvm/src/llvm/dist/include/llvm/Support/DataTypes.h:16,
                   from /vol/llvm/src/llvm/dist/include/llvm/ADT/Hashing.h:47,
                   from /vol/llvm/src/llvm/dist/include/llvm/ADT/ArrayRef.h:12,
                   from /vol/llvm/src/llvm/dist/include/llvm/Support/CommandLine.h:22,
                   from /vol/llvm/src/llvm/dist/utils/FileCheck/FileCheck.cpp:18:
  /vol/gcc-8/lib/gcc/i386-pc-solaris2.11/8.1.0/include-fixed/iso/math_iso.h:209:21: note: candidate: ‘long double std::log10(long double)’
    inline long double log10(long double __X) { return __log10l(__X); }
                       ^~~~~
  /vol/gcc-8/lib/gcc/i386-pc-solaris2.11/8.1.0/include-fixed/iso/math_iso.h:170:15: note: candidate: ‘float std::log10(float)’
    inline float log10(float __X) { return __log10f(__X); }
                 ^~~~~
  /vol/gcc-8/lib/gcc/i386-pc-solaris2.11/8.1.0/include-fixed/iso/math_iso.h:70:15: note: candidate: ‘double std::log10(double)’
   extern double log10 __P((double));
                 ^~~~~

Fixed by using std::log10 instead, which allowed the compilation on i386-pc-solaris2.11
and sparc-sun-solaris2.11 to continue.

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

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

5 years ago[InstCombine] Added tests for PR41273
David Bolvansky [Tue, 2 Apr 2019 18:33:54 +0000 (18:33 +0000)]
[InstCombine] Added tests for PR41273

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

5 years ago[Remarks][NFCI] Remove useless include
Francis Visoiu Mistrih [Tue, 2 Apr 2019 17:48:55 +0000 (17:48 +0000)]
[Remarks][NFCI] Remove useless include

Remarks.h only uses LLVMBool, which comes from llvm-c/Types.h. Nothing
from llvm-c/Core.h is used.

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

5 years ago[ArgPromotion] Set debug location at updated callsites
Vedant Kumar [Tue, 2 Apr 2019 17:42:17 +0000 (17:42 +0000)]
[ArgPromotion] Set debug location at updated callsites

Set the correct debug location on instructions which load arguments in
preparation for a call to an arg-promoted function.

This prevents location cascade from misattributing the line/scope of one
of these loads to the location of the instruction preceding the call.

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

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

5 years ago[DebugInfo] Fix pr41180 : Loop Vectorization Debugify Failure
Vedant Kumar [Tue, 2 Apr 2019 17:28:34 +0000 (17:28 +0000)]
[DebugInfo] Fix pr41180 : Loop Vectorization Debugify Failure

Bug: https://bugs.llvm.org/show_bug.cgi?id=41180

In the bug test case the debug location was missing for the cmp instruction in
the "middle block" BB. This patch fixes the bug by copying the debug location
from the cmp of the scalar loop's terminator branch, if it exists.

The patch also fixes the debug location on the subsequent branch instruction.
It was previously using the location of the of the original loop's pre-header
block terminator. Both of these instructions will now map to the source line of
the conditional branch in the original loop.

A regression test has been added that covers these issues.

Patch by Orlando Cazalet-Hyams!

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

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

5 years ago[DAGCombiner] reduce code duplication; NFC
Sanjay Patel [Tue, 2 Apr 2019 17:20:54 +0000 (17:20 +0000)]
[DAGCombiner] reduce code duplication; NFC

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

5 years ago[X86] Allow FixupLEAs to form INC/DEC under OptSize not just MinSize
Craig Topper [Tue, 2 Apr 2019 17:13:03 +0000 (17:13 +0000)]
[X86] Allow FixupLEAs to form INC/DEC under OptSize not just MinSize

This matches our usual INC/DEC heuristic used during isel.

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

5 years ago[PowerPC] Fix reversed bit issue in DCMX mask for "xvtstdcdp" and "xvtstdcsp" P9...
Stefan Pintilie [Tue, 2 Apr 2019 16:56:01 +0000 (16:56 +0000)]
[PowerPC] Fix reversed bit issue in DCMX mask for "xvtstdcdp" and "xvtstdcsp" P9 implementation

Did experiments on power 9 machine, checked the outputs for NaN & Infinity+
cases with corresponding DCMX bit set. Confirmed the DCMX mask bit for NaN and
infinity+ are reversed.

This patch fixes the issue.

Patch by Victor Huang.

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

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

5 years ago[WideableCond] Fix a nasty bug in detection of "explicit guards"
Philip Reames [Tue, 2 Apr 2019 16:51:43 +0000 (16:51 +0000)]
[WideableCond] Fix a nasty bug in detection of "explicit guards"

The code was failing to actually check for the presence of the call to widenable_condition.  The whole point of specifying the widenable_condition intrinsic was allowing widening transforms.  A normal branch is not widenable.  A normal branch leading to a deopt is not widenable (in general).

I added a test case via LoopPredication, but GuardWidening has an analogous bug.  Those are the only two passes actually using this utility just yet. Noticed while working on LoopPredication for non-widenable branches; POC in D60111.

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

5 years ago[llvm-objcopy] Change SHT_NOBITS to SHT_PROBITS for some --set-section-flags
Jordan Rupprecht [Tue, 2 Apr 2019 16:49:56 +0000 (16:49 +0000)]
[llvm-objcopy] Change SHT_NOBITS to SHT_PROBITS for some --set-section-flags

Summary:
Some flags accepted by --set-section-flags and --rename-section can change a SHT_NOBITS section to a SHT_PROGBITS section. Note that none of them can change a SHT_PROGBITS to SHT_NOBITS.

The full list (found via experimentation of individually setting each flag) that does this is: contents, load, noload, code, data, rom, and debug.

This was found by testing llvm-objcopy with the gnu binutils test suite, specifically this test case: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=binutils/testsuite/binutils-all/copy-1.d;h=f2b0d9e90df738c2891b4d5c7b62f62894b556ca;hb=HEAD

Reviewers: jhenderson, grimar, jakehehrlich, alexshap, espindola

Reviewed By: jhenderson

Subscribers: emaste, arichardson, MaskRay, llvm-commits

Tags: #llvm

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

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

5 years ago[SLP] reorderInputsAccordingToOpcode is const method. NFCI.
Simon Pilgrim [Tue, 2 Apr 2019 16:27:11 +0000 (16:27 +0000)]
[SLP] reorderInputsAccordingToOpcode is const method. NFCI.

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

5 years ago[BPF] Replace fstream and sstream with line_iterator
Fangrui Song [Tue, 2 Apr 2019 16:15:46 +0000 (16:15 +0000)]
[BPF] Replace fstream and sstream with line_iterator

Summary: This makes libLLVMBPFCodeGen.so 1128 bytes smaller for my build.

Reviewers: yonghong-song

Reviewed By: yonghong-song

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-shlib] Fix cross-compilation for LLVM-C
Shoaib Meenai [Tue, 2 Apr 2019 15:58:05 +0000 (15:58 +0000)]
[llvm-shlib] Fix cross-compilation for LLVM-C

When we're cross-compiling, build and use a native llvm-nm instead of
attempting to use the one from the target's build tree.

A nice follow-up would be to add a cache variable to allow specifying a
path to an external native llvm-nm instead of building one ourselves,
similar to LLVM_TABLEGEN and LLVM_CONFIG_PATH.

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

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

5 years ago[cmake] Add function for building native tool
Shoaib Meenai [Tue, 2 Apr 2019 15:58:03 +0000 (15:58 +0000)]
[cmake] Add function for building native tool

Instead of duplicating functionality for building native versions of
tblgen and llvm-config, add a function to set up a native tool build.
This will also be used for llvm-nm in a follow-up.

This should be NFC for tblgen, besides the slightly different COMMENT
for the custom command (it'll display the tablegen target name instead
of always saying TableGen).  For the native llvm-config, it's a behavior
change in that we'll use llvm_ExternalProject_BuildCmd instead of
constructing the build command manually, always build in Release, and
reference the correct binary path for multi-config generators. I believe
all of these changes to be bug fixes.

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

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

5 years ago[SimplifyCFG] Don't split musttail call from ret
Joseph Tremoulet [Tue, 2 Apr 2019 15:48:58 +0000 (15:48 +0000)]
[SimplifyCFG] Don't split musttail call from ret

Summary:
When inserting an `unreachable` after a noreturn call, we must ensure
that it's not a musttail call to avoid breaking the IR invariants for
musttail calls.

Reviewers: fedor.sergeev, majnemer

Reviewed By: majnemer

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[SampleProfile] Repeat indirect call promotion only when the target is actually hot.
Taewook Oh [Tue, 2 Apr 2019 15:48:21 +0000 (15:48 +0000)]
[SampleProfile] Repeat indirect call promotion only when the target is actually hot.

Summary: It is possible that multiple indirect call targets have been promoted for a single callsite from the profiled binary. Current implementation repeats promotion for all these targets as far as the callsite itself is hot (the callsite is assumed to be hot if any one of these targets was "hot" during the profiling). However, even when one of the ICPed target is hot other targets may not, and we should not repeat promotion for "cold" targets.

Reviewers: danielcdh, wmi

Subscribers: hiraditya, jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years ago[PruneEH] Don't split musttail call from ret
Joseph Tremoulet [Tue, 2 Apr 2019 15:47:11 +0000 (15:47 +0000)]
[PruneEH] Don't split musttail call from ret

Summary:
When inserting an `unreachable` after a noreturn call, we must ensure
that it's not a musttail call to avoid breaking the IR invariants for
musttail calls.

Reviewers: fedor.sergeev, majnemer

Reviewed By: majnemer

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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