OSDN Git Service

android-x86/external-llvm.git
5 years ago[X86] Require second operand of X86vshiftuniform to be an integer. NFC
Craig Topper [Sat, 5 Jan 2019 01:40:29 +0000 (01:40 +0000)]
[X86] Require second operand of X86vshiftuniform to be an integer. NFC

We don't need to require the first operand to be an integer because we already said it was the same type as the result which we also constrained to an integer.

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

5 years ago[gn build] Add build files for unittests that load shared libraries
Nico Weber [Sat, 5 Jan 2019 01:39:18 +0000 (01:39 +0000)]
[gn build] Add build files for unittests that load shared libraries

This is slightly ugly for three reasons:

- The shlib needs to go next to the binary to be found on all platforms, so the
  build files refer to target_out_dir
- The explicit -fPIC flag needed on the shared lib side, and the -rdynamic flag
  needed on the host side, on Linux
- Plugins that refer to LLVM code and assume that the host will resolve them
  don't work on Windows -- PluginsTests won't test anything on Windows (but
  DynamicLibraryTests will, since the dll here doesn't call LLVM code)

If we get lots more of these plugin / plugin host targets it might make sense
to add a template for them. But for now, these are the last ones we need.

(We're at 6 plugin hosts, 2 of them tests, and at 6 shared libraries, 2 of them
tests as well. clang is a plugin host by default in the CMake build but not
(yet?) in the GN build.)

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

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

5 years agoRevert "Revert "[hwasan] Android: Switch from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER...
Evgeniy Stepanov [Sat, 5 Jan 2019 00:44:58 +0000 (00:44 +0000)]
Revert "Revert "[hwasan] Android: Switch from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER(6)""

This reapplies commit r348983.

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

5 years ago[gn build] Add build file for DebugInfoPDBTests
Nico Weber [Sat, 5 Jan 2019 00:14:37 +0000 (00:14 +0000)]
[gn build] Add build file for DebugInfoPDBTests

I'm pretty unhappy this patch: DebugInfoPDBTests uses an API that requires some
magic txt file to be next to the unit test executable that stores the absolute
path to the LLVM source root.

The choices here are:

1. Don't use the unittest() template for DebugInfoPDBTests and set output_dir
   for unit tests in two places (the gni file for every test but this one, and the
   BUILD.gn file for this specific test).

2. Add another unittest_foo() template variation for this one test.

I went with the former, and added a comment to the template to look out for
this.

(The CMake build has the same issue.)

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

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

5 years ago[PGO] Use SourceFileName rather module name in PGOFuncName
Rong Xu [Fri, 4 Jan 2019 22:54:03 +0000 (22:54 +0000)]
[PGO] Use SourceFileName rather module name in PGOFuncName

In LTO or Thin-lto mode (though linker plugin), the module
names are of temp file names which are different for
different compilations. Using SourceFileName avoids the issue.
This should not change any functionality for current PGO as
all the current callers of getPGOFuncName() is before LTO.

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

5 years ago[X86] Fix warning; NFC
Nikita Popov [Fri, 4 Jan 2019 21:41:35 +0000 (21:41 +0000)]
[X86] Fix warning; NFC

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

5 years agoUpdate the pr_datasz of .note.gnu.property section.
Vyacheslav Zakharin [Fri, 4 Jan 2019 21:25:01 +0000 (21:25 +0000)]
Update the pr_datasz of .note.gnu.property section.
Patch by Xiang Zhang.

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

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

5 years ago[BDCE] Remove dead uses of arguments
Nikita Popov [Fri, 4 Jan 2019 21:21:43 +0000 (21:21 +0000)]
[BDCE] Remove dead uses of arguments

In addition to finding dead uses of instructions, also find dead uses
of function arguments, and replace them with zero as well.

I'm changing the way the known bits are computed here to remove the
coupling between the transfer function and the algorithm. It previously
relied on the first op being visited first and computing known bits --
unless the first op is not an instruction, in which case they're computed
on the second op. I could have adjusted this to check for "instruction
or argument", but I think it's better to avoid the repeated calculation
with an explicit flag.

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

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

5 years ago[AArch64] Adjust the cost model for Exynos M3
Evandro Menezes [Fri, 4 Jan 2019 21:02:25 +0000 (21:02 +0000)]
[AArch64] Adjust the cost model for Exynos M3

Improve the modeling of ASIMD loads and stores.

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

5 years ago[X86] Add INSERT_SUBVECTOR to ComputeNumSignBits
Craig Topper [Fri, 4 Jan 2019 20:50:59 +0000 (20:50 +0000)]
[X86] Add INSERT_SUBVECTOR to ComputeNumSignBits

This adds support for calculating sign bits of insert_subvector. I based it on the computeKnownBits.

My motivating case is propagating sign bits information across basic blocks on AVX targets where concatenating using insert_subvector is common.

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

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

5 years ago[x86] add tests for potential horizontal vector ops; NFC
Sanjay Patel [Fri, 4 Jan 2019 20:14:53 +0000 (20:14 +0000)]
[x86] add tests for potential horizontal vector ops; NFC

These are modified versions of the FP tests from rL349923.

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

5 years agohwasan: Implement lazy thread initialization for the interceptor ABI.
Peter Collingbourne [Fri, 4 Jan 2019 19:27:04 +0000 (19:27 +0000)]
hwasan: Implement lazy thread initialization for the interceptor ABI.

The problem is similar to D55986 but for threads: a process with the
interceptor hwasan library loaded might have some threads started by
instrumented libraries and some by uninstrumented libraries, and we
need to be able to run instrumented code on the latter.

The solution is to perform per-thread initialization lazily. If a
function needs to access shadow memory or add itself to the per-thread
ring buffer its prologue checks to see whether the value in the
sanitizer TLS slot is null, and if so it calls __hwasan_thread_enter
and reloads from the TLS slot. The runtime does the same thing if it
needs to access this data structure.

This change means that the code generator needs to know whether we
are targeting the interceptor runtime, since we don't want to pay
the cost of lazy initialization when targeting a platform with native
hwasan support. A flag -fsanitize-hwaddress-abi={interceptor,platform}
has been introduced for selecting the runtime ABI to target. The
default ABI is set to interceptor since it's assumed that it will
be more common that users will be compiling application code than
platform code.

Because we can no longer assume that the TLS slot is initialized,
the pthread_create interceptor is no longer necessary, so it has
been removed.

Ideally, lazy initialization should only cost one instruction in the
hot path, but at present the call may cause us to spill arguments
to the stack, which means more instructions in the hot path (or
theoretically in the cold path if the spills are moved with shrink
wrapping). With an appropriately chosen calling convention for
the per-thread initialization function (TODO) the hot path should
always need just one instruction and the cold path should need two
instructions with no spilling required.

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

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

5 years ago[ThinLTO] Handle chains of aliases
Teresa Johnson [Fri, 4 Jan 2019 19:04:54 +0000 (19:04 +0000)]
[ThinLTO] Handle chains of aliases

At -O0, globalopt is not run during the compile step, and we can have a
chain of an alias having an immediate aliasee of another alias. The
summaries are constructed assuming aliases in a canonical form
(flattened chains), and as a result only the base object but no
intermediate aliases were preserved.

Fix by adding a pass that canonicalize aliases, which ensures each
alias is a direct alias of the base object.

Reviewers: pcc, davidxl

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, arphaman, llvm-commits

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

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

5 years ago[x86] lower extracted fadd/fsub to horizontal vector math; 2nd try
Sanjay Patel [Fri, 4 Jan 2019 17:48:13 +0000 (17:48 +0000)]
[x86] lower extracted fadd/fsub to horizontal vector math; 2nd try

The 1st try for this was at rL350369, but it caused IR-level diffs because
our cost models differentiate custom vs. legal/promote lowering. So that was
reverted at rL350373. The cost models were fixed independently at rL350403,
so this is effectively the same patch as last time.

Original commit message:
This would show up if we fix horizontal reductions to narrow as they go along,
but it's an improvement for size and/or Jaguar (fast-hops) independent of that.

We need to do this late to not interfere with other pattern matching of larger
horizontal sequences.

We can extend this to integer ops in a follow-up patch.

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

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

5 years ago[CodeExtractor] Do not extract unsafe lifetime markers
Vedant Kumar [Fri, 4 Jan 2019 17:43:22 +0000 (17:43 +0000)]
[CodeExtractor] Do not extract unsafe lifetime markers

Lifetime markers which reference inputs to the extraction region are not
safe to extract. Example ('rhs' will be extracted):

```
               entry:
              +------------+
              | x = alloca |
              | y = alloca |
              +------------+
             /              \
   lhs:                      rhs:
  +-------------------+     +-------------------+
  | lifetime_start(x) |     | lifetime_start(x) |
  | use(x)            |     | lifetime_start(y) |
  | lifetime_end(x)   |     | use(x, y)         |
  | lifetime_start(y) |     | lifetime_end(y)   |
  | use(y)            |     | lifetime_end(x)   |
  | lifetime_end(y)   |     +-------------------+
  +-------------------+
```

Prior to extraction, the stack coloring pass sees that the slots for 'x'
and 'y' are in-use at the same time. After extraction, the coloring pass
infers that 'x' and 'y' are *not* in-use concurrently, because markers
from 'rhs' are no longer available to help decide otherwise.

This leads to a miscompile, because the stack slots actually are in-use
concurrently in the extracted function.

Fix this by moving lifetime start/end markers for memory regions defined
in the calling function around the call to the extracted function.

Fixes llvm.org/PR39671 (rdar://45939472).

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

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

5 years ago[InstCombine] reduce raw IR narrowing rotate patterns to funnel shift
Sanjay Patel [Fri, 4 Jan 2019 17:38:12 +0000 (17:38 +0000)]
[InstCombine] reduce raw IR narrowing rotate patterns to funnel shift

Similar to rL350199 - there are no known analysis/codegen holes for
funnel shift intrinsics now, so we can canonicalize the 6+ regular
instructions to funnel shift to improve vectorization, inlining,
unrolling, etc.

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

5 years ago[gn build] Merge r350351
Nico Weber [Fri, 4 Jan 2019 17:32:28 +0000 (17:32 +0000)]
[gn build] Merge r350351

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

5 years ago[gn build] Commit change that should have been in r350410.
Nico Weber [Fri, 4 Jan 2019 17:26:05 +0000 (17:26 +0000)]
[gn build] Commit change that should have been in r350410.

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

5 years ago[gn build] Add even more build files for LLVM unittests
Nico Weber [Fri, 4 Jan 2019 17:16:21 +0000 (17:16 +0000)]
[gn build] Add even more build files for LLVM unittests

Another random assortment of easy build files.

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

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

5 years ago[gn build] Add more build files for LLVM unittests
Nico Weber [Fri, 4 Jan 2019 17:15:38 +0000 (17:15 +0000)]
[gn build] Add more build files for LLVM unittests

A fairly random assortment of build files that are easy.

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

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

5 years ago[gn build] Start adding build files for LLVM unittests
Nico Weber [Fri, 4 Jan 2019 17:14:55 +0000 (17:14 +0000)]
[gn build] Start adding build files for LLVM unittests

Adds build files for //llvm/unittest/[A-D].

Also teach sync_source_lists_from_cmake.py to not complain about missing
BUILD.gn files for CMakeLists.txt files that just call add_subdirectory()
without calling add_.+_unittest, like e.g.
llvm/unittests/Target/CMakeLists.txt.

(Omits CodeGen/GlobalISel and DebugInfo/PDB because their build files are somewhat interesting, and this patch is already on the larger side.)

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

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

5 years ago[gn build] Add check-llvm target and make it work
Nico Weber [Fri, 4 Jan 2019 17:13:33 +0000 (17:13 +0000)]
[gn build] Add check-llvm target and make it work

With this, check-llvm runs and passes all of clang's lit tests. It doesn't run
any of its unit tests yet.

This is the only change in the GN build patch series that needs a change to a
file outside of llvm/utils/gn: llvm/test/tools/llvm-config/booleans.test checks
the result of llvm-config --build-system for some reason, so I'm updating the
test to accept "gn" as valid output in addition to "cmake". (The alternative
would be to let the gn build self-identify as cmake, which seems worse.)

Like with check-clang and check-lld, running just ninja -C out/gn will build
all prerequisites needed to run tests, but it won't run the tests (so that the
build becomes clean after one build). Running ninja -C out/gn check-llvm will
build prerequisites if needed and run the tests. The check-llvm target never
becomes clean and runs tests every time.

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

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

5 years ago[gn build] Add build file for libLTO.dylib
Nico Weber [Fri, 4 Jan 2019 17:12:25 +0000 (17:12 +0000)]
[gn build] Add build file for libLTO.dylib

Not used by anything yet, but will be needed to make check-llvm run ld64's libLTO plugin tests.

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

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

5 years ago[LICM] Adjust how moving the re-hoist point works
John Brawn [Fri, 4 Jan 2019 17:12:09 +0000 (17:12 +0000)]
[LICM] Adjust how moving the re-hoist point works

In some cases the order that we hoist instructions in means that when rehoisting
(which uses the same order as hoisting) we can rehoist to a block A, then a
block B, then block A again. This currently causes an assertion failure as it
expects that when changing the hoist point it only ever moves to a block that
dominates the hoist point being moved from.

Fix this by moving the re-hoist point when it doesn't dominate the dominator of
hoisted instruction, or in other words when it wouldn't dominate the uses of
the instruction being rehoisted.

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

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

5 years ago[gn build] Add build files for llvm/lib/{LineEditor,Testing/Support,TextAPI}
Nico Weber [Fri, 4 Jan 2019 17:11:46 +0000 (17:11 +0000)]
[gn build] Add build files for llvm/lib/{LineEditor,Testing/Support,TextAPI}

Nothing pulls them in yet, but they will be needed for check-llvm.

LineEditor depends on libedit, so create a gn/build/lib for it, following the
usual pattern.

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

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

5 years agoUndo r350355 "[X86] Remove terrible DX Register parsing hack in parse operand. NFCI."
Nirav Dave [Fri, 4 Jan 2019 17:11:15 +0000 (17:11 +0000)]
Undo r350355 "[X86] Remove terrible DX Register parsing hack in parse operand. NFCI."

Add missing test case and update comments.

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

5 years ago[CostModel][X86] Fix SSE1 FADD/FSUB costs
Simon Pilgrim [Fri, 4 Jan 2019 16:55:57 +0000 (16:55 +0000)]
[CostModel][X86] Fix SSE1 FADD/FSUB costs

Noticed in D56011 - handle the case that scalar fp ops are quicker on P3 than P4

Add the other costs so that we're not relying on the default "is legal/custom" cost logic.

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

5 years agoRevert patches 348835 and 348571 because they're
Ranjeet Singh [Fri, 4 Jan 2019 16:39:10 +0000 (16:39 +0000)]
Revert patches 348835 and 348571 because they're
causing code size performance regressions.

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

5 years ago[CostModel][X86] Add SSE1 fp cost tests
Simon Pilgrim [Fri, 4 Jan 2019 16:37:01 +0000 (16:37 +0000)]
[CostModel][X86] Add SSE1 fp cost tests

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

5 years agoFix typo: "with he MODULE" -> "with the MODULE"
Mark Searles [Fri, 4 Jan 2019 16:35:01 +0000 (16:35 +0000)]
Fix typo: "with he MODULE" -> "with the MODULE"

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

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

5 years ago[X86] Add VPSLLI/VPSRLI ((X >>u C1) << C2) SimplifyDemandedBits combine
Simon Pilgrim [Fri, 4 Jan 2019 15:43:43 +0000 (15:43 +0000)]
[X86] Add VPSLLI/VPSRLI ((X >>u C1) << C2) SimplifyDemandedBits combine

Repeat of the generic SimplifyDemandedBits shift combine

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

5 years ago[MCA] Improved handling of in-order issue/dispatch resources.
Andrea Di Biagio [Fri, 4 Jan 2019 15:08:38 +0000 (15:08 +0000)]
[MCA] Improved handling of in-order issue/dispatch resources.

Added field 'MustIssueImmediately' to the instruction descriptor of instructions
that only consume in-order issue/dispatch processor resources.
This speeds up queries from the hardware Scheduler, and gives an average ~5%
speedup on a release build.

No functional change intended.

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

5 years ago[X86] Split immediate shifts tests. NFCI.
Simon Pilgrim [Fri, 4 Jan 2019 14:56:10 +0000 (14:56 +0000)]
[X86] Split immediate shifts tests. NFCI.

A future patch will combine logical shifts more aggressively.

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

5 years ago[ValueTracking] Fix a misuse of APInt in GetPointerBaseWithConstantOffset
Florian Hahn [Fri, 4 Jan 2019 14:53:22 +0000 (14:53 +0000)]
[ValueTracking] Fix a misuse of APInt in GetPointerBaseWithConstantOffset

GetPointerBaseWithConstantOffset include this code, where ByteOffset
and GEPOffset are both of type llvm::APInt :

  ByteOffset += GEPOffset.getSExtValue();

The problem with this line is that getSExtValue() returns an int64_t, but
the += matches an overload for uint64_t. The problem is that the resulting
APInt is no longer considered to be signed. That in turn causes assertion
failures later on if the relevant pointer type is > 64 bits in width and
the GEPOffset was negative.

Changing it to

  ByteOffset += GEPOffset.sextOrTrunc(ByteOffset.getBitWidth());

resolves the issue and explicitly performs the sign-extending
or truncation. Additionally, instead of asserting later if the result
is > 64 bits, it breaks out of the loop in that case.

See also
 https://reviews.llvm.org/D24729
 https://reviews.llvm.org/D24772

This commit must be merged after D38662 in order for the test to pass.

Patch by Michael Ferguson <mpfergu@gmail.com>.

Reviewers: reames, sanjoy, hfinkel

Reviewed By: hfinkel

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

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

5 years ago[gn build] Make write_cmake_config.py check that each key passed is unique
Nico Weber [Fri, 4 Jan 2019 13:48:58 +0000 (13:48 +0000)]
[gn build] Make write_cmake_config.py check that each key passed is unique

I got that wrong once while locally while working on check-llvm.

Reviewed as part of https://reviews.llvm.org/D56195

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

5 years ago[MCA] Store extra information about processor resources in the ResourceManager.
Andrea Di Biagio [Fri, 4 Jan 2019 12:31:14 +0000 (12:31 +0000)]
[MCA] Store extra information about processor resources in the ResourceManager.

Method ResourceManager::use() is responsible for updating the internal state of
used processor resources, as well as notifying resource groups that contain used
resources.

Before this patch, method 'use()' didn't know how to quickly obtain the set of
groups that contain a particular resource unit. It had to discover groups by
perform a potentially slow search (done by iterating over the set of processor
resource descriptors).

With this patch, the relationship between resource units and groups is stored in
the ResourceManager. That means, method 'use()' no longer has to search for
groups. This gives an average speedup of ~4-5% on a release build.

This patch also adds extra code comments in ResourceManager.h to better describe
the resource mask layout, and how resouce indices are computed from resource
masks.

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

5 years ago[AArch64] Add command-line option predres
Diogo N. Sampaio [Fri, 4 Jan 2019 11:04:18 +0000 (11:04 +0000)]
[AArch64] Add command-line option predres

Prediction control instructions are only
mandatory from v8.5a onwards but is optional
from Armv8.0-A. This patch adds a command
line option to enable it by it's own.

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

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

5 years ago[CMake] Use XCODE_ATTRIBUTE properties for code signing and entitlements in Xcode
Stefan Granitz [Fri, 4 Jan 2019 09:22:32 +0000 (09:22 +0000)]
[CMake] Use XCODE_ATTRIBUTE properties for code signing and entitlements in Xcode

Summary: A post-commit comment to D55116 amended that this was the correct way for code signing in Xcode.

Reviewers: beanz

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

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

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

5 years ago[WebAssembly] Split the checking from the sorting logic.
Richard Trieu [Fri, 4 Jan 2019 06:49:24 +0000 (06:49 +0000)]
[WebAssembly] Split the checking from the sorting logic.

Move the check for -1 and identical values outside the vector sorting code.
Compare functions need to be able to compare identical elements to be
conforming.

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

5 years ago[memcpyopt] Remove a few unnecessary isVolatile() checks. NFC
Xin Tong [Fri, 4 Jan 2019 02:13:22 +0000 (02:13 +0000)]
[memcpyopt] Remove a few unnecessary isVolatile() checks. NFC

We already checked for isSimple() on the store.

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

5 years ago[X86] Add post-isel peephole to fold KAND+KORTEST into KTEST if only the zero flag...
Craig Topper [Fri, 4 Jan 2019 00:10:58 +0000 (00:10 +0000)]
[X86] Add post-isel peephole to fold KAND+KORTEST into KTEST if only the zero flag is used.

Doing this late so we will prefer to fold the AND into a masked comparison first. That can be better for the live range of the mask register.

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

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

5 years agorevert r350369: [x86] lower extracted fadd/fsub to horizontal vector math
Sanjay Patel [Fri, 4 Jan 2019 00:02:02 +0000 (00:02 +0000)]
revert r350369: [x86] lower extracted fadd/fsub to horizontal vector math

There are non-codegen tests that need to be updated with this code change.

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

5 years ago[x86] lower extracted fadd/fsub to horizontal vector math
Sanjay Patel [Thu, 3 Jan 2019 23:16:19 +0000 (23:16 +0000)]
[x86] lower extracted fadd/fsub to horizontal vector math

This would show up if we fix horizontal reductions to narrow as they go along,
but it's an improvement for size and/or Jaguar (fast-hops) independent of that.

We need to do this late to not interfere with other pattern matching of larger
horizontal sequences.

We can extend this to integer ops in a follow-up patch.

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

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

5 years ago[WebAssembly] Optimize Irreducible Control Flow
Heejin Ahn [Thu, 3 Jan 2019 23:10:11 +0000 (23:10 +0000)]
[WebAssembly] Optimize Irreducible Control Flow

Summary:
Irreducible control flow is not that rare, e.g. it happens in malloc and
3 other places in the libc portions linked in to a hello world program.
This patch improves how we handle that code: it emits a br_table to
dispatch to only the minimal necessary number of blocks. This reduces
the size of malloc by 33%, and makes it comparable in size to asm2wasm's
malloc output.

Added some tests, and verified this passes the emscripten-wasm tests run
on the waterfall (binaryen2, wasmobj2, other).

Reviewers: aheejin, sunfish

Subscribers: mgrang, jgravelle-google, sbc100, dschuff, llvm-commits

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

Patch by Alon Zakai (kripken)

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

5 years ago[WebAssembly] Fixed disassembler not knowing about new brlist operand
Wouter van Oortmerssen [Thu, 3 Jan 2019 23:01:30 +0000 (23:01 +0000)]
[WebAssembly] Fixed disassembler not knowing about new brlist operand

Summary:
The previously introduced new operand type for br_table didn't have
a disassembler implementation, causing an assert.

Reviewers: dschuff, aheejin

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

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

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

5 years ago[WebAssembly] Made InstPrinter more robust
Wouter van Oortmerssen [Thu, 3 Jan 2019 22:59:59 +0000 (22:59 +0000)]
[WebAssembly] Made InstPrinter more robust

Summary:
Instead of asserting on certain kinds of malformed instructions, it
now still print, but instead adds an annotation indicating the
problem, and/or indicates invalid_type etc.

We're using the InstPrinter from many contexts that can't always
guarantee values are within range (e.g. the disassembler), where having
output is more valueable than asserting.

Reviewers: dschuff, aheejin

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

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

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

5 years ago[x86] add 512-bit vector tests for horizontal ops; NFC
Sanjay Patel [Thu, 3 Jan 2019 22:55:18 +0000 (22:55 +0000)]
[x86] add 512-bit vector tests for horizontal ops; NFC

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

5 years ago[x86] add AVX512 runs for horizontal ops; NFC
Sanjay Patel [Thu, 3 Jan 2019 22:42:32 +0000 (22:42 +0000)]
[x86] add AVX512 runs for horizontal ops; NFC

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

5 years ago[X86] Add test case for D56283.
Craig Topper [Thu, 3 Jan 2019 22:31:07 +0000 (22:31 +0000)]
[X86] Add test case for D56283.

This tests a case where we need to be able to compute sign bits for two insert_subvectors that is a liveout of a basic block. The result is then used as a boolean vector in another basic block.

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

5 years ago[x86] remove dead CHECK lines from test file; NFC
Sanjay Patel [Thu, 3 Jan 2019 22:30:36 +0000 (22:30 +0000)]
[x86] remove dead CHECK lines from test file; NFC

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

5 years ago[x86] split tests for FP and integer horizontal math
Sanjay Patel [Thu, 3 Jan 2019 22:26:51 +0000 (22:26 +0000)]
[x86] split tests for FP and integer horizontal math

These are similar patterns, but when you throw AVX512 onto the pile,
the number of variations explodes. For FP, we really don't care about
AVX1 vs. AVX2 for FP ops. There may be some superficial shuffle diffs,
but that's not what we're testing for here, so I removed those RUNs.

Separating by type also lets us specify 'sse3' for the FP file vs. 'ssse3'
for the integer file...because x86.

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

5 years ago[x86] add common FileCheck prefix to reduce assert duplication; NFC
Sanjay Patel [Thu, 3 Jan 2019 22:11:14 +0000 (22:11 +0000)]
[x86] add common FileCheck prefix to reduce assert duplication; NFC

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

5 years ago[X86] Remove terrible DX Register parsing hack in parse operand. NFCI.
Nirav Dave [Thu, 3 Jan 2019 21:46:30 +0000 (21:46 +0000)]
[X86] Remove terrible DX Register parsing hack in parse operand. NFCI.

Fold hack special casing of (%dx) operand parsing into the related
hack for out*/in* instruction parsing.

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

5 years ago[DAGCombiner][x86] scalarize binop followed by extractelement
Sanjay Patel [Thu, 3 Jan 2019 21:31:16 +0000 (21:31 +0000)]
[DAGCombiner][x86] scalarize binop followed by extractelement

As noted in PR39973 and D55558:
https://bugs.llvm.org/show_bug.cgi?id=39973
...this is a partial implementation of a fold that we do as an IR canonicalization in instcombine:

// extelt (binop X, Y), Index --> binop (extelt X, Index), (extelt Y, Index)

We want to have this in the DAG too because as we can see in some of the test diffs (reductions),
the pattern may not be visible in IR.

Given that this is already an IR canonicalization, any backend that would prefer a vector op over
a scalar op is expected to already have the reverse transform in DAG lowering (not sure if that's
a realistic expectation though). The transform is limited with a TLI hook because there's an
existing transform in CodeGenPrepare that tries to do the opposite transform.

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

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

5 years ago[AVR] Update integration/blink.ll as we now generate sbi/cbi instructions.
Nirav Dave [Thu, 3 Jan 2019 21:25:39 +0000 (21:25 +0000)]
[AVR] Update integration/blink.ll as we now generate sbi/cbi instructions.

Silence long standing test failure.

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

5 years ago[CaptureTracking] Add a unit test for MaxUsesToExplore
Artur Pilipenko [Thu, 3 Jan 2019 20:16:33 +0000 (20:16 +0000)]
[CaptureTracking] Add a unit test for MaxUsesToExplore

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

5 years ago[AMDGPU] Fix scalar operand folding bug that causes SHOC performance regression.
Alexander Timofeev [Thu, 3 Jan 2019 19:55:32 +0000 (19:55 +0000)]
[AMDGPU] Fix scalar operand folding bug that causes SHOC performance regression.

Detailed description: SIFoldOperands::foldInstOperand iterates over the
operand uses calling the function that changes def-use iteratorson the
way. As a result loop exits immediately when def-use iterator is
changed. Hence, the operand is folded to the very first use instruction
only. This makes VGPR live along the whole basic block and increases
register pressure significantly. The performance drop observed in SHOC
DeviceMemory test is caused by this bug.

Proposed fix: collect uses to separate container for further processing
in another loop.

Testing: make check-llvm
SHOC performance test.

Reviewers: rampitec, ronlieb

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

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

5 years ago[UnrollRuntime] Move the DomTree verification under expensive checks
Anna Thomas [Thu, 3 Jan 2019 19:43:33 +0000 (19:43 +0000)]
[UnrollRuntime] Move the DomTree verification under expensive checks

Suggested by Hal as done in r349871.

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

5 years agoRemove unused %host_cc lit pattern
Nico Weber [Thu, 3 Jan 2019 19:31:53 +0000 (19:31 +0000)]
Remove unused %host_cc lit pattern

It was added in r257236 but then the one use was removed in r309517. Since no
test should call %host_cc, remove the pattern.

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

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

5 years agoReflow module.modulemap for readability
Adrian Prantl [Thu, 3 Jan 2019 19:30:18 +0000 (19:30 +0000)]
Reflow module.modulemap for readability

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

5 years agoUnbreak the modules build by splitting Target out into its own top-level module
Adrian Prantl [Thu, 3 Jan 2019 19:24:37 +0000 (19:24 +0000)]
Unbreak the modules build by splitting Target out into its own top-level module

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

5 years agoRevert "Resubmit rL345008 "Split MachinePipeliner code into header and cpp files""
Stefan Granitz [Thu, 3 Jan 2019 19:09:24 +0000 (19:09 +0000)]
Revert "Resubmit rL345008 "Split MachinePipeliner code into header and cpp files""

This reverts commit r350290.

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

5 years agoRevert "[MachinePipeliner] Add missing header file to MachinePipeliner.h"
Stefan Granitz [Thu, 3 Jan 2019 19:09:18 +0000 (19:09 +0000)]
Revert "[MachinePipeliner] Add missing header file to MachinePipeliner.h"

This reverts commit r350296.

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

5 years ago[llvm-objcopy] Fix buildbots on older compilers
Jordan Rupprecht [Thu, 3 Jan 2019 19:09:00 +0000 (19:09 +0000)]
[llvm-objcopy] Fix buildbots on older compilers

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

5 years ago[MCStreamer] Use report_fatal_error in EmitRawTextImpl
Kristina Brooks [Thu, 3 Jan 2019 18:42:31 +0000 (18:42 +0000)]
[MCStreamer] Use report_fatal_error in EmitRawTextImpl

Use report_fatal_error in MCStreamer::EmitRawTextImpl instead of
using errs() and explain the rationale behind it not being
llvm_unreachable() to save confusion for any future maintainers.

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

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

5 years ago[elfabi] Introduce tool for ELF TextAPI
Armando Montanez [Thu, 3 Jan 2019 18:32:36 +0000 (18:32 +0000)]
[elfabi] Introduce tool for ELF TextAPI

Follow up for D53051

This patch introduces the tool associated with the ELF implementation of
TextAPI (previously llvm-tapi, renamed for better distinction). This
tool will house a number of features related to enalysis and
manipulation of shared object's exposed interfaces. The first major
feature for this tool is support for producing binary stubs that are
useful for compile-time linking of shared objects. This patch introduces
beginnings of support for reading binary ELF objects to work towards
that goal.

Added:

 - elfabi tool.
 - support for reading architecture from a binary ELF file into an
 ELFStub.
 - Support for writing .tbe files.

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

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

5 years agoRename TapiTests to TextAPITests
Nico Weber [Thu, 3 Jan 2019 18:24:58 +0000 (18:24 +0000)]
Rename TapiTests to TextAPITests

This makes the target name consistent with how all the other unit tests are
named.

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

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

5 years ago[x86] add tests for buildvector with extracted element; NFC
Sanjay Patel [Thu, 3 Jan 2019 17:55:32 +0000 (17:55 +0000)]
[x86] add tests for buildvector with extracted element; NFC

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

5 years agoFix typos in comments
Jordan Rupprecht [Thu, 3 Jan 2019 17:51:32 +0000 (17:51 +0000)]
Fix typos in comments

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

5 years ago[llvm-objcopy][ELF] Implement a mutable section visitor that updates size-related...
Jordan Rupprecht [Thu, 3 Jan 2019 17:45:30 +0000 (17:45 +0000)]
[llvm-objcopy][ELF] Implement a mutable section visitor that updates size-related fields (Size, EntrySize, Align) before layout.

Summary:
Fix EntrySize, Size, and Align before doing layout calculation.

As a side cleanup, this removes a dependence on sizeof(Elf_Sym) within BinaryReader, so we can untemplatize that.

This unblocks a cleaner implementation of handling the -O<format> flag. See D53667 for a previous attempt. Actual implementation of the -O<format> flag will come in an upcoming commit, this is largely a NFC (although not _totally_ one, because alignment on binary input was actually wrong before).

Reviewers: jakehehrlich, jhenderson, alexshap, espindola

Reviewed By: jhenderson

Subscribers: emaste, arichardson, llvm-commits

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

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

5 years ago[UnrollRuntime] Add DomTree verification under debug mode
Anna Thomas [Thu, 3 Jan 2019 17:44:44 +0000 (17:44 +0000)]
[UnrollRuntime] Add DomTree verification under debug mode

NFC: This adds the dom tree verification under debug mode at a point
just before we start unrolling the loop. This allows us to verify dom
tree at a state where it is much smaller and before the unrolling
actually happens.
This also implies we do not need to run -verify-dom-info everytime to
see if the DT is in a valid state when we transform the loop for runtime
unrolling.

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

5 years ago[AArch64] Add new scheduling predicates
Evandro Menezes [Thu, 3 Jan 2019 17:28:09 +0000 (17:28 +0000)]
[AArch64] Add new scheduling predicates

Add new scheduling predicates to identify the ASIMD loads and stores using the post indexed addressing mode.

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

5 years agoPython compat - no explicit reference to Python version
Serge Guelton [Thu, 3 Jan 2019 15:44:24 +0000 (15:44 +0000)]
Python compat - no explicit reference to Python version

Update documentation and shebang.

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

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

5 years agoPython compat - iterator protocol
Serge Guelton [Thu, 3 Jan 2019 15:43:14 +0000 (15:43 +0000)]
Python compat - iterator protocol

In Python2 next() is used wile it's __next__ in Python3.

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

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

5 years ago[CostModel][X86] Add truncate cost tests to cover all legal destination types
Simon Pilgrim [Thu, 3 Jan 2019 14:49:39 +0000 (14:49 +0000)]
[CostModel][X86] Add truncate cost tests to cover all legal destination types

We were only testing costs for legal source vector element counts

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

5 years ago[MCA] Improve code comment and reuse an helper function in ResourceManager. NFCI
Andrea Di Biagio [Thu, 3 Jan 2019 14:47:46 +0000 (14:47 +0000)]
[MCA] Improve code comment and reuse an helper function in ResourceManager. NFCI

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

5 years ago[RISCV][MC] Accept %lo and %pcrel_lo on operands to li
Alex Bradbury [Thu, 3 Jan 2019 14:41:41 +0000 (14:41 +0000)]
[RISCV][MC] Accept %lo and %pcrel_lo on operands to li

This matches GNU assembler behaviour.

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

5 years agoPython compat - decode/encode string
Serge Guelton [Thu, 3 Jan 2019 14:40:34 +0000 (14:40 +0000)]
Python compat - decode/encode string

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

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

5 years agoPython compat - test if type is integral
Serge Guelton [Thu, 3 Jan 2019 14:12:50 +0000 (14:12 +0000)]
Python compat - test if type is integral

Rely on numbers.Integral instead of int/long

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

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

5 years agoPython compat - urllib
Serge Guelton [Thu, 3 Jan 2019 14:12:44 +0000 (14:12 +0000)]
Python compat - urllib

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

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

5 years agoPython compat - has_key vs. in operator
Serge Guelton [Thu, 3 Jan 2019 14:12:37 +0000 (14:12 +0000)]
Python compat - has_key vs. in operator

Use portable `in` operator instead of `has_key(...)` method.

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

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

5 years agoPython compat - map/filter
Serge Guelton [Thu, 3 Jan 2019 14:12:30 +0000 (14:12 +0000)]
Python compat - map/filter

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

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

5 years agoPython compat - iteritems() vs. items()
Serge Guelton [Thu, 3 Jan 2019 14:12:23 +0000 (14:12 +0000)]
Python compat - iteritems() vs. items()

Always use `items()` and introduce extra `list(...)` call when needed.

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

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

5 years agoPython compat - portable way of raising exceptions
Serge Guelton [Thu, 3 Jan 2019 14:12:13 +0000 (14:12 +0000)]
Python compat - portable way of raising exceptions

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

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

5 years ago[NFC] Remove unused Python import
Serge Guelton [Thu, 3 Jan 2019 14:12:07 +0000 (14:12 +0000)]
[NFC] Remove unused Python import

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

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

5 years agoPythran compat - range vs. xrange
Serge Guelton [Thu, 3 Jan 2019 14:11:58 +0000 (14:11 +0000)]
Pythran compat - range vs. xrange

Use range instead of xrange whenever possible. The extra list creation in Python2
is generally not a performance bottleneck.

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

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

5 years agoPython compat - assertRaisesRegex
Serge Guelton [Thu, 3 Jan 2019 14:11:41 +0000 (14:11 +0000)]
Python compat - assertRaisesRegex

Python3 uses assertRaisesRegex instad of assertRaisesRegexp.

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

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

5 years agoPython compat - print statement
Serge Guelton [Thu, 3 Jan 2019 14:11:33 +0000 (14:11 +0000)]
Python compat - print statement

Make sure all print statements are compatible with Python 2 and Python3 using
the `from __future__ import print_function` statement.

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

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

5 years ago[NewPM] Port Msan
Philip Pfaffe [Thu, 3 Jan 2019 13:42:44 +0000 (13:42 +0000)]
[NewPM] Port Msan

Summary:
Keeping msan a function pass requires replacing the module level initialization:
That means, don't define a ctor function which calls __msan_init, instead just
declare the init function at the first access, and add that to the global ctors
list.

Changes:
- Pull the actual sanitizer and the wrapper pass apart.
- Add a newpm msan pass. The function pass inserts calls to runtime
  library functions, for which it inserts declarations as necessary.
- Update tests.

Caveats:
- There is one test that I dropped, because it specifically tested the
  definition of the ctor.

Reviewers: chandlerc, fedor.sergeev, leonardchan, vitalybuka

Subscribers: sdardis, nemanjai, javed.absar, hiraditya, kbarton, bollu, atanasyan, jsji

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

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

5 years ago[NFC] Fix missing testfile change of rL350299
Diogo N. Sampaio [Thu, 3 Jan 2019 12:48:06 +0000 (12:48 +0000)]
[NFC] Fix missing testfile change of rL350299

This file was missing on the patch

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

5 years ago[X86] Cleanup saturated add/sub tests
Simon Pilgrim [Thu, 3 Jan 2019 12:31:13 +0000 (12:31 +0000)]
[X86] Cleanup saturated add/sub tests
Use X86/X64 check prefixes
Use nounwind to reduce cfi noise

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

5 years ago[SLPVectorizer] Flag ADD/SUB SSAT/USAT intrinsics trivially vectorizable (PR40123)
Simon Pilgrim [Thu, 3 Jan 2019 12:18:23 +0000 (12:18 +0000)]
[SLPVectorizer] Flag ADD/SUB SSAT/USAT intrinsics trivially vectorizable (PR40123)

Enables SLP vectorization for the SSE2 PADDS/PADDUS/PSUBS/PSUBUS style intrinsics

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

5 years ago[ARM] Add command-line option for SB
Diogo N. Sampaio [Thu, 3 Jan 2019 12:09:12 +0000 (12:09 +0000)]
[ARM] Add command-line option for SB

SB (Speculative Barrier) is only mandatory from 8.5
onwards but is optional from Armv8.0-A. This patch adds a command
line option to enable SB, as it was previously only possible to
enable by selecting -march=armv8.5-a.

This patch also renames FeatureSpecRestrict to FeatureSB.

Reviewed By: olista01, LukeCheeseman

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

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

5 years ago[SLPVectorizer][X86] Add ADD/SUB SSAT/USAT tests (PR40123)
Simon Pilgrim [Thu, 3 Jan 2019 12:02:14 +0000 (12:02 +0000)]
[SLPVectorizer][X86] Add ADD/SUB SSAT/USAT tests (PR40123)

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

5 years ago[MachinePipeliner] Add missing header file to MachinePipeliner.h
Lama Saba [Thu, 3 Jan 2019 11:56:27 +0000 (11:56 +0000)]
[MachinePipeliner] Add missing header file to MachinePipeliner.h

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

5 years ago[X86] Add ADD/SUB SSAT/USAT vector costs (PR40123)
Simon Pilgrim [Thu, 3 Jan 2019 11:38:42 +0000 (11:38 +0000)]
[X86] Add ADD/SUB SSAT/USAT vector costs (PR40123)

Costs for real SSE2 instructions

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

5 years ago[X86] Add ADD/SUB SSAT/USAT cost tests (PR40123)
Simon Pilgrim [Thu, 3 Jan 2019 11:29:24 +0000 (11:29 +0000)]
[X86] Add ADD/SUB SSAT/USAT cost tests (PR40123)

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

5 years ago[AMDGPU] Change section name with metadata access
Piotr Sobczak [Thu, 3 Jan 2019 11:22:58 +0000 (11:22 +0000)]
[AMDGPU] Change section name with metadata access

Summary:
The commit rL348922 introduced a means to set Metadata
section kind for a global variable, if its explicit section
name was prefixed with ".AMDGPU.metadata.".

This patch changes that prefix to ".AMDGPU.comment.",
as "metadata" in the section name might lead to
ambiguity with metadata used by AMD PAL runtime.

Change-Id: Idd4748800d6fe801441d91595fc21e5a4171e668

Reviewers: kzhuravl

Reviewed By: kzhuravl

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

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

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

5 years agoResubmit rL345008 "Split MachinePipeliner code into header and cpp files"
Lama Saba [Thu, 3 Jan 2019 10:03:54 +0000 (10:03 +0000)]
Resubmit rL345008 "Split MachinePipeliner code into header and cpp files"

The commit caused unclear failures in http://green.lab.llvm.org/green//job/lldb-cmake/
will revert if the error reappears

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

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

5 years ago[CodeGen] Skip over dbg-instr in twoaddr pass
Markus Lavin [Thu, 3 Jan 2019 08:36:06 +0000 (08:36 +0000)]
[CodeGen] Skip over dbg-instr in twoaddr pass

A DBG_VALUE between a two-address instruction and a following COPY
would prevent rescheduleMIBelowKill optimization inside
TwoAddressInstructionPass.

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

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