]> granicus.if.org Git - llvm/log
llvm
6 years ago[LCSSA] Handle case with single new PHI faster.
Florian Hahn [Sat, 2 Feb 2019 15:26:05 +0000 (15:26 +0000)]
[LCSSA] Handle case with single new PHI faster.

If there is only a single available value, all uses must be dominated by
the single value and there is no need to search for a reaching
definition.

This drastically speeds up LCSSA in some cases. For the test case
from PR37202, it speeds up LCSSA construction by 4 times.

Time-passes without this patch for test case from PR37202:

    Total Execution Time: 29.9285 seconds (29.9276 wall clock)

    ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
    5.2786 ( 17.7%)   0.0021 (  1.2%)   5.2806 ( 17.6%)   5.2808 ( 17.6%)  Unswitch loops
    4.3739 ( 14.7%)   0.0303 ( 18.1%)   4.4042 ( 14.7%)   4.4042 ( 14.7%)  Loop-Closed SSA Form Pass
    4.2658 ( 14.3%)   0.0192 ( 11.5%)   4.2850 ( 14.3%)   4.2851 ( 14.3%)  Loop-Closed SSA Form Pass #2
    2.2307 (  7.5%)   0.0013 (  0.8%)   2.2320 (  7.5%)   2.2318 (  7.5%)  Loop Invariant Code Motion
    2.0888 (  7.0%)   0.0012 (  0.7%)   2.0900 (  7.0%)   2.0897 (  7.0%)  Unroll loops
    1.6761 (  5.6%)   0.0013 (  0.8%)   1.6774 (  5.6%)   1.6774 (  5.6%)  Value Propagation
    1.3686 (  4.6%)   0.0029 (  1.8%)   1.3716 (  4.6%)   1.3714 (  4.6%)  Induction Variable Simplification
    1.1457 (  3.8%)   0.0010 (  0.6%)   1.1468 (  3.8%)   1.1468 (  3.8%)  Loop-Closed SSA Form Pass #4
    1.1384 (  3.8%)   0.0005 (  0.3%)   1.1389 (  3.8%)   1.1389 (  3.8%)  Loop-Closed SSA Form Pass #6
    1.1360 (  3.8%)   0.0027 (  1.6%)   1.1387 (  3.8%)   1.1387 (  3.8%)  Loop-Closed SSA Form Pass #5
    1.1331 (  3.8%)   0.0010 (  0.6%)   1.1341 (  3.8%)   1.1340 (  3.8%)  Loop-Closed SSA Form Pass #3

Time passes with this patch

  Total Execution Time: 19.2802 seconds (19.2813 wall clock)

   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   4.4234 ( 23.2%)   0.0038 (  2.0%)   4.4272 ( 23.0%)   4.4273 ( 23.0%)  Unswitch loops
   2.3828 ( 12.5%)   0.0020 (  1.1%)   2.3848 ( 12.4%)   2.3847 ( 12.4%)  Unroll loops
   1.8714 (  9.8%)   0.0020 (  1.1%)   1.8734 (  9.7%)   1.8735 (  9.7%)  Loop Invariant Code Motion
   1.7973 (  9.4%)   0.0022 (  1.2%)   1.7995 (  9.3%)   1.8003 (  9.3%)  Value Propagation
   1.4010 (  7.3%)   0.0033 (  1.8%)   1.4043 (  7.3%)   1.4044 (  7.3%)  Induction Variable Simplification
   0.9978 (  5.2%)   0.0244 ( 13.1%)   1.0222 (  5.3%)   1.0224 (  5.3%)  Loop-Closed SSA Form Pass #2
   0.9611 (  5.0%)   0.0257 ( 13.8%)   0.9868 (  5.1%)   0.9868 (  5.1%)  Loop-Closed SSA Form Pass
   0.5856 (  3.1%)   0.0015 (  0.8%)   0.5871 (  3.0%)   0.5869 (  3.0%)  Unroll loops #2
   0.4132 (  2.2%)   0.0012 (  0.7%)   0.4145 (  2.1%)   0.4143 (  2.1%)  Loop Invariant Code Motion #3

Reviewers: efriedma, davide, mzolotukhin

Reviewed By: efriedma

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

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

6 years ago[LCSSA] Add expensive verification of LCSSA form for sub-loops.
Florian Hahn [Sat, 2 Feb 2019 14:42:27 +0000 (14:42 +0000)]
[LCSSA] Add expensive verification of LCSSA form for sub-loops.

This assertion makes sure all sub-loops are in LCSSA form before
bringing their parent in LCSSA form. This precondition was added to
formLCSSA in D56848.

Reviewers: davide, efriedma, mzolotukhin

Reviewed By: davide

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

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

6 years ago[X86][SSE]: Adding full coverage of MC encoding tests for the SSE isa sets.<NFC>
Craig Topper [Sat, 2 Feb 2019 06:21:54 +0000 (06:21 +0000)]
[X86][SSE]: Adding full coverage of MC encoding tests for the SSE isa sets.<NFC>

Summary:
NFC.
Adding MC regressions tests to cover all the SSE ISA sets as follows:
SSE, SSE2, SSE3, SSE4, SSE42, SSEMXCSR, SSE_PREFETCH, SSSE3

This patch is part of a larger task to cover MC encoding of all X86 ISA Sets.
See revision: https://reviews.llvm.org/D39952

Patch by Gadi Haber and Wang Tianqing

Reviewers: RKSimon, zvi, craig.topper, AndreiGrischenko, gadi.haber, LuoYuanke

Reviewed By: craig.topper

Subscribers: jfb, llvm-commits

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

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

6 years agoRevert "Bump minimum toolchain version"
JF Bastien [Sat, 2 Feb 2019 06:01:12 +0000 (06:01 +0000)]
Revert "Bump minimum toolchain version"

Reverting D57264 again, it looks like we're down to two bots that need fixing:

polly-amd64-linux
polly-arm-linux

They both have old versions of libstdc++ and recent clang.

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

6 years ago[BPF] [BTF] Process FileName with absolute path correctly
Yonghong Song [Sat, 2 Feb 2019 05:54:59 +0000 (05:54 +0000)]
[BPF] [BTF] Process FileName with absolute path correctly

In IR, sometimes the following attributes for DIFile may be
generated:
  filename: /home/yhs/test.c
  directory: /tmp
The /tmp may represent the working directory of the compilation
process.

In such cases, since filename is with absolute path,
the directory should be ignored by BTF. The filename alone is
enough to get the source.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352952 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoBump minimum toolchain version
JF Bastien [Sat, 2 Feb 2019 05:15:34 +0000 (05:15 +0000)]
Bump minimum toolchain version

Summary:
The RFC on moving past C++11 got good traction:
  http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html

This patch therefore bumps the toolchain versions according to our policy:
  llvm.org/docs/DeveloperPolicy.html#toolchain

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane

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

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

6 years ago[llvm-objcopy] Temporarily limit one test to darwin
Alexander Shaposhnikov [Sat, 2 Feb 2019 05:01:00 +0000 (05:01 +0000)]
[llvm-objcopy] Temporarily limit one test to darwin

Some triples in llvm-mc appear to be unavailable on some buildbots.
To please those buildbots we temporarily limit the test to darwin
(where the required triple is guranteed to be available)
until we find the right solution.

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

6 years ago[ASan] Do not instrument other runtime functions with `__asan_handle_no_return`
Julian Lettner [Sat, 2 Feb 2019 02:05:16 +0000 (02:05 +0000)]
[ASan] Do not instrument other runtime functions with `__asan_handle_no_return`

Summary:
Currently, ASan inserts a call to `__asan_handle_no_return` before every
`noreturn` function call/invoke. This is unnecessary for calls to other
runtime funtions. This patch changes ASan to skip instrumentation for
functions calls marked with `!nosanitize` metadata.

Reviewers: TODO

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

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

6 years ago[llvm-objcopy] Fix triples in macho tests.
Alexander Shaposhnikov [Sat, 2 Feb 2019 02:04:09 +0000 (02:04 +0000)]
[llvm-objcopy] Fix triples in macho tests.

Update triples used by the macho tests to fix some buildbots.

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

6 years ago[AutoUpgrade] Fix AutoUpgrade for x86.seh.recoverfp
Mandeep Singh Grang [Sat, 2 Feb 2019 01:32:48 +0000 (01:32 +0000)]
[AutoUpgrade] Fix AutoUpgrade for x86.seh.recoverfp

Summary: This fixes the bug in https://reviews.llvm.org/D56747#inline-502711.

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: javed.absar, llvm-commits

Tags: #llvm

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

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

6 years ago[llvm-objcopy] Add ability to copy MachO object files
Alexander Shaposhnikov [Sat, 2 Feb 2019 00:38:07 +0000 (00:38 +0000)]
[llvm-objcopy] Add ability to copy MachO object files

This diff implements first bits for copying (without modification) MachO object files.

Test plan: make check-all

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

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

6 years agoRevert "[BPF] [BTF] Process FileName with absolute path correctly"
Yonghong Song [Fri, 1 Feb 2019 23:49:52 +0000 (23:49 +0000)]
Revert "[BPF] [BTF] Process FileName with absolute path correctly"

This reverts commit r352939.

Some tests failed. Revert to unblock others.

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

6 years ago[AArch64] Fix unused variable [NFC]
Mandeep Singh Grang [Fri, 1 Feb 2019 23:42:34 +0000 (23:42 +0000)]
[AArch64] Fix unused variable [NFC]

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

6 years ago[BPF] [BTF] Process FileName with absolute path correctly
Yonghong Song [Fri, 1 Feb 2019 23:23:17 +0000 (23:23 +0000)]
[BPF] [BTF] Process FileName with absolute path correctly

In IR, sometimes the following attributes for DIFile may be
generated:
  filename: /home/yhs/test.c
  directory: /tmp
The /tmp may represent the working directory of the compilation
process.

In such cases, since filename is with absolute path,
the directory should be ignored by BTF. The filename alone is
enough to get the source.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352939 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeGen] Be as conservative about atomic accesses as for volatile
Philip Reames [Fri, 1 Feb 2019 22:58:52 +0000 (22:58 +0000)]
[CodeGen] Be as conservative about atomic accesses as for volatile

Background: At the moment, we record the AtomicOrdering of an access in the MMO, but also mark any atomic access as volatile in SelectionDAG. I'm working towards separating that. See https://reviews.llvm.org/D57601 for context.

Update all usages of isVolatile in lib/CodeGen to preserve behaviour once atomic MMOs stop being also volatile. This is NFC in it's current form, but is essential for correctness once we make that final change.

It useful to keep in mind that AtomicSDNode is not a parent of LoadSDNode, StoreSDNode, or LSBaseSDNode. As a result, any call to isVolatile on one of those static types doesn't need a companion isAtomic check.  We should probably adjust that class hierarchy long term, but for now, that seperation is useful.

I'm deliberately being conservative about handling. I want the change to stop adding volatile to be NFC itself, and then will work through places where we can be less conservative for atomics one by one in separate changes w/tests.

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

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

6 years ago[InstCombine] Refactor test checks (NFC)
Evandro Menezes [Fri, 1 Feb 2019 22:52:05 +0000 (22:52 +0000)]
[InstCombine] Refactor test checks (NFC)

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

6 years ago[Test] Update file w/update_test_checks.py to make a follow on change obvious
Philip Reames [Fri, 1 Feb 2019 22:30:51 +0000 (22:30 +0000)]
[Test] Update file w/update_test_checks.py to make a follow on change obvious

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

6 years ago[WebAssembly] Add codegen support for the import_field attribute
Dan Gohman [Fri, 1 Feb 2019 22:27:34 +0000 (22:27 +0000)]
[WebAssembly] Add codegen support for the import_field attribute

This adds the LLVM side of https://reviews.llvm.org/D57602 -- the
import_field attribute. See that patch for details.

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

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

6 years ago[COFF, ARM64] Fix localaddress to handle stack realignment and variable size objects
Mandeep Singh Grang [Fri, 1 Feb 2019 21:41:33 +0000 (21:41 +0000)]
[COFF, ARM64] Fix localaddress to handle stack realignment and variable size objects

Summary: This fixes using the correct stack registers for SEH when stack realignment is needed or when variable size objects are present.

Reviewers: rnk, efriedma, ssijaric, TomTan

Reviewed By: rnk, efriedma

Subscribers: javed.absar, kristof.beyls, llvm-commits

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

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

6 years ago[X86][AVX] Add VMOVDDUP-VPBROADCASTQ execution domain mapping
Simon Pilgrim [Fri, 1 Feb 2019 21:41:30 +0000 (21:41 +0000)]
[X86][AVX] Add VMOVDDUP-VPBROADCASTQ execution domain mapping

Noticed in D57514.

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

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

6 years ago[AMDGPU] Mark test functions with hidden visibility
Scott Linder [Fri, 1 Feb 2019 21:23:28 +0000 (21:23 +0000)]
[AMDGPU] Mark test functions with hidden visibility

Prepare for future patch which affects codegen for calls to preemptible
functions.

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

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

6 years ago[DebugInfo] Fix mkdir use in test
Jordan Rupprecht [Fri, 1 Feb 2019 21:14:21 +0000 (21:14 +0000)]
[DebugInfo] Fix mkdir use in test

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

6 years ago[InstCombine] Expand Windows test (NFC)
Evandro Menezes [Fri, 1 Feb 2019 21:14:10 +0000 (21:14 +0000)]
[InstCombine] Expand Windows test (NFC)

Run checks for Win32 as well.

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

6 years ago[DebugInfo] Don't use realpath when looking up debug binary locations.
Jordan Rupprecht [Fri, 1 Feb 2019 21:04:16 +0000 (21:04 +0000)]
[DebugInfo] Don't use realpath when looking up debug binary locations.

Summary:
Using realpath makes assumptions about build systems that do not always hold true. The debug binary referred to from the .gnu_debuglink should exist in the same directory (or in a .debug directory, etc.), but the files may only exist as symlinks to a differently named files elsewhere, and using realpath causes that lookup to fail.

This was added in r189250, and this is basically a revert + regression test case.

Reviewers: dblaikie, samsonov, jhenderson

Reviewed By: dblaikie

Subscribers: llvm-commits, hiraditya

Tags: #llvm

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

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

6 years ago[opaque pointer types] Pass function type for CallBase::setCalledFunction.
James Y Knight [Fri, 1 Feb 2019 20:44:54 +0000 (20:44 +0000)]
[opaque pointer types] Pass function type for CallBase::setCalledFunction.

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

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

6 years ago[opaque pointer types] Pass value type to GetElementPtr creation.
James Y Knight [Fri, 1 Feb 2019 20:44:47 +0000 (20:44 +0000)]
[opaque pointer types] Pass value type to GetElementPtr creation.

This cleans up all GetElementPtr creation in LLVM to explicitly pass a
value type rather than deriving it from the pointer's element-type.

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

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

6 years ago[opaque pointer types] Pass value type to LoadInst creation.
James Y Knight [Fri, 1 Feb 2019 20:44:24 +0000 (20:44 +0000)]
[opaque pointer types] Pass value type to LoadInst creation.

This cleans up all LoadInst creation in LLVM to explicitly pass the
value type rather than deriving it from the pointer's element-type.

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

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

6 years ago[opaque pointer types] Pass function types to InvokeInst creation.
James Y Knight [Fri, 1 Feb 2019 20:43:34 +0000 (20:43 +0000)]
[opaque pointer types] Pass function types to InvokeInst creation.

This cleans up all InvokeInst creation in LLVM to explicitly pass a
function type rather than deriving it from the pointer's element-type.

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

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

6 years ago[opaque pointer types] Pass function types to CallInst creation.
James Y Knight [Fri, 1 Feb 2019 20:43:25 +0000 (20:43 +0000)]
[opaque pointer types] Pass function types to CallInst creation.

This cleans up all CallInst creation in LLVM to explicitly pass a
function type rather than deriving it from the pointer's element-type.

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

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

6 years ago[InstCombine] Expand Windows test (NFC)
Evandro Menezes [Fri, 1 Feb 2019 20:42:03 +0000 (20:42 +0000)]
[InstCombine] Expand Windows test (NFC)

Run checks for Win64 as well.

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

6 years agogn build: Create regular archives for the sanitizer runtimes.
Peter Collingbourne [Fri, 1 Feb 2019 20:34:43 +0000 (20:34 +0000)]
gn build: Create regular archives for the sanitizer runtimes.

We'll need to do this eventually if we create an installable package.
For now, this lets me use the archives to build Android, whose build
system wants to copy the archives to another location.

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

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

6 years ago[InstCombine] Extra null-checking on TFE/LWE support
Michael Liao [Fri, 1 Feb 2019 19:53:44 +0000 (19:53 +0000)]
[InstCombine] Extra null-checking on TFE/LWE support

- If that operand is not ConstantInt, skip enabling TFE/LWE.

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

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

6 years agoHopefully fix a couple more sphinx doc errors.
James Y Knight [Fri, 1 Feb 2019 19:40:07 +0000 (19:40 +0000)]
Hopefully fix a couple more sphinx doc errors.

These seem to only appear on the buildbot runner, and it looks like we
tried to suppress them, but it's not working. Not sure why.

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

6 years ago[llvm-objdump] - llvm-objdump can skip bytes at the end of a section.
Sid Manning [Fri, 1 Feb 2019 19:11:47 +0000 (19:11 +0000)]
[llvm-objdump] - llvm-objdump can skip bytes at the end of a section.

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

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

6 years agoFix a bug in the definition of isUnordered on MachineMemOperand
Philip Reames [Fri, 1 Feb 2019 19:08:59 +0000 (19:08 +0000)]
Fix a bug in the definition of isUnordered on MachineMemOperand

Background: At the moment, we record the AtomicOrdering of an access in the MMO, but also mark any atomic access as volatile in SelectionDAG. GlobalISEL keeps the two separate, but currently doesn't know how to lower an atomic G_LOAD at all. See https://reviews.llvm.org/D57601 for context.

The definition used for unordered was only checking volatility, not atomicity. As noted above, all atomic MMOs are currently also volatile, so this is a latent bug only. Copy the definition used in IR, after auditing the two (2) uses of the function to be sure the desired semantics are the same.

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

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

6 years agotest commit (add blank line) NFC
Roland Froese [Fri, 1 Feb 2019 18:55:43 +0000 (18:55 +0000)]
test commit (add blank line) NFC

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

6 years ago[llvm-readobj] Add a flag to dump just the section-to-segment mapping.
Matt Davis [Fri, 1 Feb 2019 18:51:10 +0000 (18:51 +0000)]
[llvm-readobj] Add a flag to dump just the section-to-segment mapping.

Summary:
The following patch introduces a new function `printSectionMapping` which is responsible for dumping just the section-to-segment mapping.
This patch also introduces a n option `-section-mapping` that outputs that mapping without the program headers.

Previously, this functionality was controlled by `printProgramHeaders`, and the output from `-program-headers` has not been changed.  I am happy to change the option name, I copied  the name that was displayed when outputting the mapping table.

Reviewers: khemant, jhenderson, grimar, rupprecht

Reviewed By: jhenderson, grimar, rupprecht

Subscribers: rupprecht, jhenderson, llvm-commits

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

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

6 years ago[InstCombine] Refactor test checks (NFC)
Evandro Menezes [Fri, 1 Feb 2019 18:34:20 +0000 (18:34 +0000)]
[InstCombine] Refactor test checks (NFC)

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

6 years agogn build: Add a missing dependency from llvm/test to llvm-lit
Nico Weber [Fri, 1 Feb 2019 18:17:19 +0000 (18:17 +0000)]
gn build: Add a missing dependency from llvm/test to llvm-lit

check-llvm already listed llvm-lit as script which counts as a dep, so running
check-llvm worked fine, but `ninja -C out/gn llvm/test` didn't build llvm-lit
before if it wasn't already there.

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

6 years ago[InstCombine] Expand Windows test (NFC)
Evandro Menezes [Fri, 1 Feb 2019 17:39:48 +0000 (17:39 +0000)]
[InstCombine] Expand Windows test (NFC)

Add checks for Win64 to existing cases.

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

6 years ago[llvm-nm] Report '.comment' ELF sections as 'n' instead of '?'
Matt Davis [Fri, 1 Feb 2019 17:38:08 +0000 (17:38 +0000)]
[llvm-nm] Report '.comment' ELF sections as 'n' instead of '?'

Summary:
The previous implementation reported `.comment` sections as '?'
GNU uses 'n' which means  "The symbol is a debugging symbol."  `.note`  sections are represented as 'n' too.

The test related to this change was updated to CHECK-NEXT to ensure
order and that we did not miss any symbols in the dump.

Reviewers: jhenderson

Reviewed By: jhenderson

Subscribers: rupprecht, llvm-commits

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

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

6 years ago[DWARF v5] Fix DWARF emitter and consumer to produce/expect a uleb for a location...
Wolfgang Pieb [Fri, 1 Feb 2019 17:11:58 +0000 (17:11 +0000)]
[DWARF v5] Fix DWARF emitter and consumer to produce/expect a uleb for a location description's length.

Reviewer: davide, JDevliegere

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

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

6 years ago[llvm-objcopy][NFC] More error propagation (executeObjcopyOnArchive)
Jordan Rupprecht [Fri, 1 Feb 2019 17:08:07 +0000 (17:08 +0000)]
[llvm-objcopy][NFC] More error propagation (executeObjcopyOnArchive)

Summary:
Replace some reportError() calls with error propagation that was missed from rL352625.

Note this also adds an error check during Archive iteration that was being hidden by a different error check before:

```
  for (const Archive::Child &Child : Ar.children(Err)) {
    Expected<std::unique_ptr<Binary>> ChildOrErr = Child.getAsBinary();
    if (!ChildOrErr)
      // This aborts, so Err is never checked
      reportError(Ar.getFileName(), ChildOrErr.takeError());
```

Err is being checked after the loop, so during happy runs, everything is fine. But when reportError is changed to return the error instead of aborting, the fact that Err is never checked is now noticed in tests that trigger an error during the loop.

Reviewers: jhenderson, dblaikie, alexshap

Reviewed By: dblaikie

Subscribers: llvm-commits, lhames, jakehehrlich

Tags: #llvm

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

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

6 years agoFix some sphinx doc errors.
James Y Knight [Fri, 1 Feb 2019 17:06:41 +0000 (17:06 +0000)]
Fix some sphinx doc errors.

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

6 years ago[InstCombine] Refactor test checks (NFC)
Evandro Menezes [Fri, 1 Feb 2019 16:57:53 +0000 (16:57 +0000)]
[InstCombine] Refactor test checks (NFC)

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

6 years ago[AMDGPU] Fix for vector element insertion
Tim Corringham [Fri, 1 Feb 2019 16:51:09 +0000 (16:51 +0000)]
[AMDGPU] Fix for vector element insertion

Summary:
Incorrect code was generated when lowering insertelement operations
for vectors with 8 or 16 bit elements.  The value being inserted was
not adjusted for the position of the element within the 32 bit word
and so only the low element within each 32 bit word could receive
the intended value.

Fixed by simply replicating the value to each element of a
congruent vector before the mask and or operation used to
update the intended element.

A number of affected LIT tests have been updated appropriately.

before the mask & or into the intended

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

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

Tags: #llvm

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

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

6 years ago[SDAG] improve variable names; NFC
Sanjay Patel [Fri, 1 Feb 2019 16:06:53 +0000 (16:06 +0000)]
[SDAG] improve variable names; NFC

The version of FoldConstantArithmetic() that takes arbitrary nodes
was confusingly naming those nodes as constants when they might
not be; also "Cst" reads like "Cast".

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

6 years ago[X86][SSE] Use PSLLDQ/PSRLDQ to mask out zeroable ends of a shuffle
Simon Pilgrim [Fri, 1 Feb 2019 16:02:12 +0000 (16:02 +0000)]
[X86][SSE] Use PSLLDQ/PSRLDQ to mask out zeroable ends of a shuffle

As suggested on PR40318, this patch uses PSLLDQ/PSRLDQ to lower shuffles to zero out the ends of a vector, leaving a sequential inner section.

For pre-SSSE3 we do this for shuffles with zeros at either end (requiring up to 3 shifts), but once PSHUFB is available I've limited this to shuffles with a single zeroable end (2 shifts).

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

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

6 years ago[TargetLowering] try harder to determine undef elements of vector binops
Sanjay Patel [Fri, 1 Feb 2019 15:35:12 +0000 (15:35 +0000)]
[TargetLowering] try harder to determine undef elements of vector binops

This might be the start of tracking all vector element constants generally if we take it to its
logical conclusion, but let's stop here and make sure this is correct/beneficial so far.

The affected tests require a convoluted path before they get simplified currently because we
don't call SimplifyDemandedVectorElts() from binops directly and don't modify the binop operands
directly in SimplifyDemandedVectorElts().

That's why the tests all have a trailing shuffle to induce a chain reaction of transforms. So
something like this is happening:

1. Improve the knowledge of undefs in the binop via a SimplifyDemandedVectorElts() call that
   originates from a shuffle.
2. Transfer that undef knowledge back to the shuffle mask user as more undef lanes.
3. Combine the modified shuffle by calling SimplifyDemandedVectorElts() again.
4. Translate the improved shuffle mask as undemanded lanes of build vector constants causing
   those to become full undef constants.
5. Simplify the binop now that it has a full undef operand.

As we can see from the unchanged 'and' and 'or' tests, tracking undefs alone isn't a full solution.
We would need to track zero and all-ones constants to improve those opcodes. We'd probably need to
track NaN for FP ops too (assuming we don't have fast-math-flags set).

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

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

6 years ago[X86][AVX] Combine INSERT_SUBVECTOR(SRC0, BITCAST(SHUFFLE(EXTRACT_SUBVECTOR(SRC1)))
Simon Pilgrim [Fri, 1 Feb 2019 15:31:01 +0000 (15:31 +0000)]
[X86][AVX] Combine INSERT_SUBVECTOR(SRC0, BITCAST(SHUFFLE(EXTRACT_SUBVECTOR(SRC1)))

Enable peeking through one use bitcasts to the subvector shuffle.

This still depends on the subvector being the same scalar-size but D57514 has already helped with the more tricky patterns

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

6 years ago[llvm-strip] Implement --keep-file-symbols
Eugene Leviant [Fri, 1 Feb 2019 15:25:15 +0000 (15:25 +0000)]
[llvm-strip] Implement --keep-file-symbols

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

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

6 years ago[llvm-objcopy][NFC] Propagate errors in removeSymbols/removeSectionReferences
Jordan Rupprecht [Fri, 1 Feb 2019 15:20:36 +0000 (15:20 +0000)]
[llvm-objcopy][NFC] Propagate errors in removeSymbols/removeSectionReferences

Reviewers: jhenderson, alexshap, jakehehrlich, espindola

Reviewed By: jhenderson

Subscribers: emaste, arichardson, llvm-commits

Tags: #llvm

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

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

6 years ago[InstCombine] reduce duplicate code; NFC
Sanjay Patel [Fri, 1 Feb 2019 14:37:49 +0000 (14:37 +0000)]
[InstCombine] reduce duplicate code; NFC

An unused variable problem was introduced with rL352870
and stubbed out with rL352871, but we can make a better
fix by actually using the local variable in code rather
than just the assert.

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

6 years ago[InstCombine] Fix -Wunused-variable when -DLLVM_ENABLE_ASSERTIONS=off
Fangrui Song [Fri, 1 Feb 2019 14:22:02 +0000 (14:22 +0000)]
[InstCombine] Fix -Wunused-variable when -DLLVM_ENABLE_ASSERTIONS=off

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

6 years ago[InstCombine] try to reduce x86 addcarry to generic uaddo intrinsic
Sanjay Patel [Fri, 1 Feb 2019 14:14:47 +0000 (14:14 +0000)]
[InstCombine] try to reduce x86 addcarry to generic uaddo intrinsic

If we can reduce the x86-specific intrinsic to the generic op, it allows existing
simplifications and value tracking folds. AFAICT, this always results in identical
x86 codegen in the non-reduced case...which should be true because we semi-generically
(too aggressively IMO) convert to llvm.uadd.with.overflow in CGP, so the DAG/isel must
already combine/lower this intrinsic as expected.

This isn't quite what was requested in:
https://bugs.llvm.org/show_bug.cgi?id=40486
...but we want to have these kinds of folds early for efficiency and to enable greater
simplifications. For the case in the bug report where we have:
_addcarry_u64(0, ahi, 0, &ahi)
...this gets completely simplified away in IR.

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

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

6 years ago[CMake] Add install targets for utilities to LLVM exports if LLVM_INSTALL_UTILS=ON
Stefan Granitz [Fri, 1 Feb 2019 13:08:09 +0000 (13:08 +0000)]
[CMake] Add install targets for utilities to LLVM exports if LLVM_INSTALL_UTILS=ON

Summary: D56606 was only appending target names to the `LLVM_EXPORTS`/`LLVM_EXPORTS_BUILDTREE_ONLY` properties. Targets showed up correctly in the build-tree `LLVMExports.cmake`, but they were missing in the installed one (as we found in https://bugs.llvm.org/show_bug.cgi?id=40443), because install did not register them explicitly.

Reviewers: mgorny, smeenai, beanz, gottesmm, dschuff, tstellar, serge-sans-paille

Reviewed By: smeenai

Subscribers: llvm-commits

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

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

6 years ago[AArch64] Optimize floating point materialization
Adhemerval Zanella [Fri, 1 Feb 2019 12:26:06 +0000 (12:26 +0000)]
[AArch64] Optimize floating point materialization

This patch changes isFPImmLegal to return if the value can be enconded
as the immediate operand of a logical instruction besides checking if
for immediate field for fmov.

This optimizes some floating point materization, inclusive values
used on isinf lowering.

Reviewed By: rengolin, efriedma, evandro

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

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

6 years agoDisable tidy checks with too many hits
Ilya Biryukov [Fri, 1 Feb 2019 11:20:13 +0000 (11:20 +0000)]
Disable tidy checks with too many hits

Summary:
Some tidy checks have too many hits in the codebase, making it hard to spot
other results from clang-tidy, therefore rendering the tool less useful.

Two checks were disabled:
  - misc-non-private-member-variable-in-classes in the whole LLVM monorepo,
    it is very common to have those in LLVM and the style guide does not forbid
    them.
  - readability-identifier-naming in the clang subtree. There are thousands of
    violations in 'Sema.h' alone.

Before the change, 'Sema.h' had >1000 tidy warnings, after the change the number
dropped to 3 warnings (unterminated namespace comments).

Reviewers: alexfh, hokein

Reviewed By: hokein

Subscribers: llvm-commits, cfe-commits

Tags: #clang, #llvm

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

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

6 years ago[X86][BdVer2] Transfer delays from the integer to the floating point unit.
Roman Lebedev [Fri, 1 Feb 2019 11:15:13 +0000 (11:15 +0000)]
[X86][BdVer2] Transfer delays from the integer to the floating point unit.

Summary:
I'm unable to find this number in the "AMD SOG for family 15h".
llvm-exegesis measures the latencies of these instructions as `2`,
which matches the latencies specified in "AMD SOG for family 15h".

However if we look at Agner, Microarchitecture, "AMD Bulldozer, Piledriver,
Steamroller and Excavator pipeline", "Data delay between different execution
domains", the int->ivec transfer is listed as `8`..`10`cy of additional latency.

Also, Agner's "Instruction tables", for Piledriver, lists their latencies as `12`,
which is consistent with `2cy` from exegesis / AMD SOG + `10cy` transfer delay.

Additional data point comes from the fact that Agner's "Instruction tables",
for Jaguar, lists their latencies as `8`; and "AMD SOG for family 16h" does
state the `+6cy` int->ivec delay, which is consistent with instr latency of `1` or `2`.

Reviewers: andreadb, RKSimon, craig.topper

Reviewed By: andreadb

Subscribers: gbedwell, courbet, llvm-commits

Tags: #llvm

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

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

6 years agoProvide reason messages for unviable inlining
Yevgeny Rouban [Fri, 1 Feb 2019 10:44:43 +0000 (10:44 +0000)]
Provide reason messages for unviable inlining

InlineCost's isInlineViable() is changed to return InlineResult
instead of bool. This provides messages for failure reasons and
allows to get more specific messages for cases where callsites
are not viable for inlining.

Reviewed By: xbolva00, anemet

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

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

6 years agoRevert r352750.
James Henderson [Fri, 1 Feb 2019 10:38:40 +0000 (10:38 +0000)]
Revert r352750.

This was causing a build bot failure:
http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/15346/

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

6 years ago[llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer
James Henderson [Fri, 1 Feb 2019 10:24:55 +0000 (10:24 +0000)]
[llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer

Prior to this change, there are a few tests called llvm-symbolizer* in
the DebugInfo test area. These really were testing either the DebugInfo
or Symbolizer library, rather than the llvm-symbolizer tool itself, so
this patch renames them to be clearer that they aren't explicitly tests
for llvm-symbolizer (such tests belong in test/tools/llvm-symbolizer).

This patch also reinstates the copying of a DWO file, removed previously
in r352752. The test needs this so that it could possibly fail.

Finally, some of the tests have been simplified slightly by removing
unnecessary switches and/or unused check-prefixes.

Reviewed by: dblaikie

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

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

6 years ago[doc]Update String Error documentation in Programmer Manual
James Henderson [Fri, 1 Feb 2019 10:02:42 +0000 (10:02 +0000)]
[doc]Update String Error documentation in Programmer Manual

A while back, createStringError was added to provide easier construction
of StringError instances, especially with formatting options. Prior to
this patch, that the documentation only mentions the standard method of
using it. Since createStringError is slightly shorter to type, and also
provides the formatting options, this patch updates the Programmer's
Manual to use the new function in its examples, and to mention the
printf formatting options. It also fixes a small typo in one of the
examples and removes the unnecessary make_error_code call.

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

6 years ago[CodeGen] Don't scavenge non-saved regs in exception throwing functions
Oliver Stannard [Fri, 1 Feb 2019 09:23:51 +0000 (09:23 +0000)]
[CodeGen] Don't scavenge non-saved regs in exception throwing functions

Previously, LiveRegUnits was assuming that if a block has no successors
and does not return, then no registers are live at the end of it
(because the end of the block is unreachable). This was causing the
register scavenger to use callee-saved registers to materialise stack
frame addresses without saving them in the prologue. This would normally
be fine, because the end of the block is unreachable, but this is not
legal if the block ends by throwing a C++ exception. If this happens,
the scratch register will be modified, but its previous value won't be
preserved, so it doesn't get restored by the exception unwinder.

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

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

6 years ago[obj2yaml] - Merge dumpRelSection and dumpRelaSection. NFC.
George Rimar [Fri, 1 Feb 2019 07:50:08 +0000 (07:50 +0000)]
[obj2yaml] - Merge dumpRelSection and dumpRelaSection. NFC.

These methods are very similar, patch merge them into one.

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

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

6 years ago[SLPVectorizer] Get rid of IndexQueue array from vectorizeStores. NFCI.
Yevgeny Rouban [Fri, 1 Feb 2019 06:44:08 +0000 (06:44 +0000)]
[SLPVectorizer] Get rid of IndexQueue array from vectorizeStores. NFCI.

Indices are checked as they are generated. No need to fill the whole array of indices.

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

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

6 years agoRevert "Bump minimum toolchain version"
JF Bastien [Fri, 1 Feb 2019 04:44:39 +0000 (04:44 +0000)]
Revert "Bump minimum toolchain version"

Looks like we still have a few bots that are sad. Let try to get them fixed!

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

6 years agoBump minimum toolchain version
JF Bastien [Fri, 1 Feb 2019 04:33:21 +0000 (04:33 +0000)]
Bump minimum toolchain version

Summary:
The RFC on moving past C++11 got good traction:
  http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html

This patch therefore bumps the toolchain versions according to our policy:
  llvm.org/docs/DeveloperPolicy.html#toolchain

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane

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

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

6 years ago[RISCV] Implement RV64D codegen
Alex Bradbury [Fri, 1 Feb 2019 03:53:30 +0000 (03:53 +0000)]
[RISCV] Implement RV64D codegen

This patch:
* Adds necessary RV64D codegen patterns
* Modifies CC_RISCV so it will properly handle f64 types (with soft float ABI)

Note that in general there is no reason to try to select fcvt.w[u].d rather than fcvt.l[u].d for i32 conversions because fptosi/fptoui produce poison if the input won't fit into the target type.

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

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

6 years ago[SelectionDAG] Support promotion of the FPOWI integer operand
Alex Bradbury [Fri, 1 Feb 2019 03:46:28 +0000 (03:46 +0000)]
[SelectionDAG] Support promotion of the FPOWI integer operand

For targets where i32 is not a legal type (e.g. 64-bit RISC-V),
LegalizeIntegerTypes must promote the integer operand of ISD::FPOWI. As this
is a signed value, this should be sign-extended.

This patch enables all tests in test/CodeGen/RISCVfloat-intrinsics.ll for
RV64, as prior to this patch that file couldn't be compiled for RV64 due to an
assertion when performing codegen for fpowi.

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

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

6 years agoFix compilation of examples after 13680223b9d8 / r352827
James Y Knight [Fri, 1 Feb 2019 03:23:42 +0000 (03:23 +0000)]
Fix compilation of examples after 13680223b9d8 / r352827

Who knew...they're not built by default or as part of the tests.

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

6 years ago[opaque pointer types] Add a FunctionCallee wrapper type, and use it.
James Y Knight [Fri, 1 Feb 2019 02:28:03 +0000 (02:28 +0000)]
[opaque pointer types] Add a FunctionCallee wrapper type, and use it.

Recommit r352791 after tweaking DerivedTypes.h slightly, so that gcc
doesn't choke on it, hopefully.

Original Message:
The FunctionCallee type is effectively a {FunctionType*,Value*} pair,
and is a useful convenience to enable code to continue passing the
result of getOrInsertFunction() through to EmitCall, even once pointer
types lose their pointee-type.

Then:
- update the CallInst/InvokeInst instruction creation functions to
  take a Callee,
- modify getOrInsertFunction to return FunctionCallee, and
- update all callers appropriately.

One area of particular note is the change to the sanitizer
code. Previously, they had been casting the result of
`getOrInsertFunction` to a `Function*` via
`checkSanitizerInterfaceFunction`, and storing that. That would report
an error if someone had already inserted a function declaraction with
a mismatching signature.

However, in general, LLVM allows for such mismatches, as
`getOrInsertFunction` will automatically insert a bitcast if
needed. As part of this cleanup, cause the sanitizer code to do the
same. (It will call its functions using the expected signature,
however they may have been declared.)

Finally, in a small number of locations, callers of
`getOrInsertFunction` actually were expecting/requiring that a brand
new function was being created. In such cases, I've switched them to
Function::Create instead.

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

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

6 years ago[x86] adjust test to show both add/inc options; NFC
Sanjay Patel [Fri, 1 Feb 2019 00:07:20 +0000 (00:07 +0000)]
[x86] adjust test to show both add/inc options; NFC

If we're optimizing for size, that overrides the subtarget
feature, so we would always produce 'inc' if we matched
this pattern.

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

6 years ago[x86] add test for missed opportunity to use 'inc'; NFC
Sanjay Patel [Thu, 31 Jan 2019 23:46:58 +0000 (23:46 +0000)]
[x86] add test for missed opportunity to use 'inc'; NFC

Another pattern exposed in D57516.

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

6 years ago[sanitizer-coverage] prune trace-cmp instrumentation for CMP isntructions that feed...
Kostya Serebryany [Thu, 31 Jan 2019 23:43:00 +0000 (23:43 +0000)]
[sanitizer-coverage] prune trace-cmp instrumentation for CMP isntructions that feed into the backedge branch. Instrumenting these CMP instructions is almost always useless (and harmful) for fuzzing

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

6 years agoGlobalISel: Fix MMO creation with non-power-of-2 mem size
Matt Arsenault [Thu, 31 Jan 2019 23:41:23 +0000 (23:41 +0000)]
GlobalISel: Fix MMO creation with non-power-of-2 mem size

It should probably just be mandatory for getTgtMemIntrinsic to return
the alignment.

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

6 years agoRevert "Bump minimum toolchain version"
JF Bastien [Thu, 31 Jan 2019 23:29:39 +0000 (23:29 +0000)]
Revert "Bump minimum toolchain version"

A handful of bots are still breaking, either because I missed them in my audit,
they were offline, or something else. I'm contacting their authors, but I'll
revert for now and re-commit later.

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

6 years ago[WebAssembly] Fix a regression selecting negative build_vector lanes
Thomas Lively [Thu, 31 Jan 2019 23:22:39 +0000 (23:22 +0000)]
[WebAssembly] Fix a regression selecting negative build_vector lanes

Summary:
The custom lowering introduced in rL352592 creates build_vector nodes
with negative i32 operands, but these operands did not meet the value
range constraints necessary to match build_vector nodes. This CL fixes
the issue by removing the unnecessary constraints.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish

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

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

6 years agoDeveloperPolicy: update toolchain with sample RFC / patch
JF Bastien [Thu, 31 Jan 2019 23:18:11 +0000 (23:18 +0000)]
DeveloperPolicy: update toolchain with sample RFC / patch

As was suggested when the policy originally went in.

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

6 years agoBump minimum toolchain version
JF Bastien [Thu, 31 Jan 2019 23:13:10 +0000 (23:13 +0000)]
Bump minimum toolchain version

Summary:
The RFC on moving past C++11 got good traction:
  http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html

This patch therefore bumps the toolchain versions according to our policy:
  llvm.org/docs/DeveloperPolicy.html#toolchain

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane

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

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

6 years agoFixed hasLinkerPrivateGlobalPrefix treating StringRef as C String.
Wouter van Oortmerssen [Thu, 31 Jan 2019 23:03:48 +0000 (23:03 +0000)]
Fixed hasLinkerPrivateGlobalPrefix treating StringRef as C String.

Reviewers: jgravelle-google, sbc100

Subscribers: aheejin, llvm-commits

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

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

6 years ago[RISCV] Add RV64F codegen support
Alex Bradbury [Thu, 31 Jan 2019 22:48:38 +0000 (22:48 +0000)]
[RISCV] Add RV64F codegen support

This requires a little extra work due tothe fact i32 is not a legal type. When
call lowering happens post-legalisation (e.g. when an intrinsic was inserted
during legalisation). A bitcast from f32 to i32 can't be introduced. This is
similar to the challenges with RV32D. To handle this, we introduce
target-specific DAG nodes that perform bitcast+anyext for f32->i64 and
trunc+bitcast for i64->f32.

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

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

6 years ago[WebAssembly] MC: Fix for outputing wasm object to /dev/null
Sam Clegg [Thu, 31 Jan 2019 22:38:22 +0000 (22:38 +0000)]
[WebAssembly] MC: Fix for outputing wasm object to /dev/null

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

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

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

6 years ago[x86] add test for missed opportunity to use 'inc'; NFC
Sanjay Patel [Thu, 31 Jan 2019 22:33:11 +0000 (22:33 +0000)]
[x86] add test for missed opportunity to use 'inc'; NFC

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

6 years ago[Hexagon] Rename textually included file from .h to .inc
Richard Trieu [Thu, 31 Jan 2019 21:58:42 +0000 (21:58 +0000)]
[Hexagon] Rename textually included file from .h to .inc

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

6 years agoRevert "[opaque pointer types] Add a FunctionCallee wrapper type, and use it."
James Y Knight [Thu, 31 Jan 2019 21:51:58 +0000 (21:51 +0000)]
Revert "[opaque pointer types] Add a FunctionCallee wrapper type, and use it."

This reverts commit f47d6b38c7a61d50db4566b02719de05492dcef1 (r352791).

Seems to run into compilation failures with GCC (but not clang, where
I tested it). Reverting while I investigate.

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

6 years agoFix compilation error with GCC after r352791.
James Y Knight [Thu, 31 Jan 2019 21:21:57 +0000 (21:21 +0000)]
Fix compilation error with GCC after r352791.

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

6 years ago[EarlyCSE & MSSA] Cleanup special handling for removing MemoryAccesses.
Alina Sbirlea [Thu, 31 Jan 2019 21:12:41 +0000 (21:12 +0000)]
[EarlyCSE & MSSA] Cleanup special handling for removing MemoryAccesses.

Summary: Moving special handling to MemorySSAUpdater in D57199.

Reviewers: gberry, george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

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

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

6 years ago[WebAssembly] Add bulk memory target feature
Thomas Lively [Thu, 31 Jan 2019 21:02:19 +0000 (21:02 +0000)]
[WebAssembly] Add bulk memory target feature

Summary: Also clean up some preexisting target feature code.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, jfb

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

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

6 years ago[DAGCombine] Avoid CombineZExtLogicopShiftLoad if there is free ZEXT
Guozhi Wei [Thu, 31 Jan 2019 20:46:42 +0000 (20:46 +0000)]
[DAGCombine] Avoid CombineZExtLogicopShiftLoad if there is free ZEXT

This patch fixes pr39098.

For the attached test case, CombineZExtLogicopShiftLoad can optimize it to

t25: i64 = Constant<1099511627775>
t35: i64 = Constant<0>
  t0: ch = EntryToken
t57: i64,ch = load<(load 4 from `i40* undef`, align 8), zext from i32> t0, undef:i64, undef:i64
    t58: i64 = srl t57, Constant:i8<1>
  t60: i64 = and t58, Constant:i64<524287>
t29: ch = store<(store 5 into `i40* undef`, align 8), trunc to i40> t57:1, t60, undef:i64, undef:i64

But later visitANDLike transforms it to

t25: i64 = Constant<1099511627775>
t35: i64 = Constant<0>
  t0: ch = EntryToken
t57: i64,ch = load<(load 4 from `i40* undef`, align 8), zext from i32> t0, undef:i64, undef:i64
      t61: i32 = truncate t57
    t63: i32 = srl t61, Constant:i8<1>
  t64: i32 = and t63, Constant:i32<524287>
t65: i64 = zero_extend t64
    t58: i64 = srl t57, Constant:i8<1>
  t60: i64 = and t58, Constant:i64<524287>
t29: ch = store<(store 5 into `i40* undef`, align 8), trunc to i40> t57:1, t60, undef:i64, undef:i64

And it triggers CombineZExtLogicopShiftLoad again, causes a dead loop.

Both forms should generate same instructions, CombineZExtLogicopShiftLoad generated IR looks cleaner. But it looks more difficult to prevent visitANDLike to do the transform, so I prevent CombineZExtLogicopShiftLoad to do the transform if the ZExt is free.

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

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

6 years ago[opaque pointer types] Add a FunctionCallee wrapper type, and use it.
James Y Knight [Thu, 31 Jan 2019 20:35:56 +0000 (20:35 +0000)]
[opaque pointer types] Add a FunctionCallee wrapper type, and use it.

The FunctionCallee type is effectively a {FunctionType*,Value*} pair,
and is a useful convenience to enable code to continue passing the
result of getOrInsertFunction() through to EmitCall, even once pointer
types lose their pointee-type.

Then:
- update the CallInst/InvokeInst instruction creation functions to
  take a Callee,
- modify getOrInsertFunction to return FunctionCallee, and
- update all callers appropriately.

One area of particular note is the change to the sanitizer
code. Previously, they had been casting the result of
`getOrInsertFunction` to a `Function*` via
`checkSanitizerInterfaceFunction`, and storing that. That would report
an error if someone had already inserted a function declaraction with
a mismatching signature.

However, in general, LLVM allows for such mismatches, as
`getOrInsertFunction` will automatically insert a bitcast if
needed. As part of this cleanup, cause the sanitizer code to do the
same. (It will call its functions using the expected signature,
however they may have been declared.)

Finally, in a small number of locations, callers of
`getOrInsertFunction` actually were expecting/requiring that a brand
new function was being created. In such cases, I've switched them to
Function::Create instead.

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

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

6 years ago[cmake] Note future cleanup in comment. NFC
Shoaib Meenai [Thu, 31 Jan 2019 20:32:45 +0000 (20:32 +0000)]
[cmake] Note future cleanup in comment. NFC

CMake 3.6 introduced CMAKE_TRY_COMPILE_PLATFORM_VARIABLES, which solves
precisely the problem that necessitated init_user_prop, so we can switch
over whenever we bump our minimum CMake requirement.

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

6 years ago[MemorySSA] Extend removeMemoryAccess API to optimize MemoryPhis.
Alina Sbirlea [Thu, 31 Jan 2019 20:13:47 +0000 (20:13 +0000)]
[MemorySSA] Extend removeMemoryAccess API to optimize MemoryPhis.

Summary:
EarlyCSE needs to optimize MemoryPhis after an access is removed and has
special handling for it. This should be handled by MemorySSA instead.
The default remains that MemoryPhis are *not* optimized after an access
is removed.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, llvm-commits, Prazek

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

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

6 years ago[DAG][SystemZ] Define unwrapAddress for PCREL_WRAPPER.
Nirav Dave [Thu, 31 Jan 2019 19:58:34 +0000 (19:58 +0000)]
[DAG][SystemZ] Define unwrapAddress for PCREL_WRAPPER.

Summary:
Like with X86, this allows better DAG-level alias analysis and
alignment inference for wrapped addresses.

Reviewers: jonpa, uweigand

Reviewed By: uweigand

Subscribers: hiraditya, llvm-commits

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

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

6 years ago[ELF] Return the section name when calling getSymbolName on a section symbol.
Matt Davis [Thu, 31 Jan 2019 19:42:21 +0000 (19:42 +0000)]
[ELF] Return the section name when calling getSymbolName on a section symbol.

Summary:
Previously, llvm-nm would report symbols for .debug and .note sections as: '?' with an empty  section name:

```
00000000 ?
00000000 ?
...
```

With this patch the output more closely resembles GNU nm:
```
00000000 N .debug_abbrev
00000000 n .note.GNU-stack
...
```

This patch calls `getSectionName` for sections that belong to symbols of type `ELF::STT_SECTION`, which returns the name of the section from the section string table.

Reviewers: Bigcheese, davide, jhenderson

Reviewed By: davide, jhenderson

Subscribers: rupprecht, jhenderson, llvm-commits

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

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

6 years ago[DAG] Aggressively cleanup dangling node in CombineZExtLogicopShiftLoad.
Nirav Dave [Thu, 31 Jan 2019 19:35:14 +0000 (19:35 +0000)]
[DAG] Aggressively cleanup dangling node in CombineZExtLogicopShiftLoad.

While dangling nodes will eventually be pruned when they are
considered, leaving them disables combines requiring single-use.

Reviewers: Carrot, spatel, craig.topper, RKSimon, efriedma

Subscribers: hiraditya, llvm-commits

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

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

6 years ago[Intrinsic] Expand SMULFIX to MUL, MULH[US], or [US]MUL_LOHI on vector arguments
Leonard Chan [Thu, 31 Jan 2019 19:15:37 +0000 (19:15 +0000)]
[Intrinsic] Expand SMULFIX to MUL, MULH[US], or [US]MUL_LOHI on vector arguments

r zero scale SMULFIX, expand into MUL which produces better code for X86.

For vector arguments, expand into MUL if SMULFIX is provided with a zero scale.
Otherwise, expand into MULH[US] or [US]MUL_LOHI.

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

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

6 years agoRevert "[X86] Mark EMMS and FEMMS as clobbering MM0-7 and ST0-7."
Craig Topper [Thu, 31 Jan 2019 19:05:22 +0000 (19:05 +0000)]
Revert "[X86] Mark EMMS and FEMMS as clobbering MM0-7 and ST0-7."

This is causing a failure in chromium

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

6 years agoLower widenable_conditions in CGP
Philip Reames [Thu, 31 Jan 2019 18:45:46 +0000 (18:45 +0000)]
Lower widenable_conditions in CGP

This ensures that if we make it to the backend w/o lowering widenable_conditions first, that we generate correct code. Doing it in CGP - instead of isel - let's us fold control flow before hitting block local instruction selection.

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

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

6 years agoGlobalISel: Fix handling of vectors of pointers in clamp{Min,Max}NumElements
Matt Arsenault [Thu, 31 Jan 2019 18:01:49 +0000 (18:01 +0000)]
GlobalISel: Fix handling of vectors of pointers in clamp{Min,Max}NumElements

This avoids hitting the assert added in r352636 in a future commit.

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