Commit Graph

157292 Commits

Author SHA1 Message Date
Simon Pilgrim
f8539a68b2 [MC][X86] Add test case from PR19251
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318605 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 23:23:25 +00:00
Simon Pilgrim
3bfd36caff [MC][X86] Add teet case from PR32807
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318603 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 23:06:42 +00:00
Eric Fiselier
92849725c8 Fix use of config.h in public headers.
The CodeGenCoverage.h header is installed, but it references
the build-only header "llvm/Config/config.h". This breaks use
of the CodeGenCoverage.h header once it is installed, because config.h isn't
available.

This patch fixes the error by moving the config.h include from
the CodeGenCoverage.h header (where it's not needed), to the
CodeGenCoverage.cpp source file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318602 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 22:42:26 +00:00
Simon Pilgrim
907754a980 [X86][AVX512VL] Add AVX512VL tests to the vselect packss tests.
PR34553 has gone, adding tests to ensure it doesn't come back.

vselect_packss_v16i64 still has some awful codegen on AVX512 targets....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318599 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 19:47:59 +00:00
Craig Topper
5d6db15d33 [X86] Add another gather test with v8i8 sign extended indices.
This requires the indices to be legalized and sign extended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318597 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 19:25:35 +00:00
Craig Topper
bc2091e761 [X86] Simplify the gather/scatter isel predicates.
We don't need a dyn_cast, the predicate already specified the base node. We only need to check the type of the index, the base ptr is guaranteed to be scalar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318596 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 19:05:12 +00:00
Craig Topper
1c264a2595 [X86] Qualify a few places with ExperimentalVectorWideningLegalization.
I'm playing around with this flag and these places cause errors if not qualified.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318595 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 18:49:16 +00:00
Simon Pilgrim
ef51737cc1 [X86] Add todo comment for TRUNC(SUB(X,C)) -> SUB(TRUNC(X),C')
As discussed on PR35295, but it causes regressions in combineSubToSubus which need to be addressed first 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318594 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 18:33:07 +00:00
Florian Hahn
e4bdacd531 [CallSiteSplitting] Remove some indirection (NFC).
Summary:
With this patch I tried to reduce the complexity of the code sightly, by
removing some indirection. Please let me know what you think.

Reviewers: junbuml, mcrosier, davidxl

Reviewed By: junbuml

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318593 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 18:14:13 +00:00
Sanjay Patel
5f1ca19dfc [x86] add tests for unnecessary shuffling; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318592 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 16:25:38 +00:00
Martin Storsjo
dc3bf3460c [X86] Output cfi directives for saved XMM registers even if no GPRs are saved
This makes sure that functions that only clobber xmm registers
(on win64) also get the right cfi directives, if dwarf exceptions
are enabled.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318591 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 06:23:48 +00:00
Craig Topper
2cd93d8719 [X86] Fix typo in variable name. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318590 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 05:09:55 +00:00
Quentin Colombet
5f15b7e6c3 [AArch64] Map G_LOAD on FPR when the definition goes to a copy to FPR
We used to detect loads feeding fp instructions, but we were
failing to take into account cases where this happens through copies.
For instance, loads can fed copies coming from the ABI lowering
of floating point arguments/results.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318589 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 04:28:59 +00:00
Quentin Colombet
7bf447e9be [AArch64] Map G_STORE on FPR when the source comes from a FPR copy
We used to detect that stores were fed by fp instructions, but we were
failing to take into account cases where this happens through copies.
For instance, stores can be fed by copies coming from the ABI lowering
of floating point arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318588 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 04:28:58 +00:00
Quentin Colombet
b8765da3b6 [RegisterBankInfo] Relax the assert of having matching type sizes on default mappings
Instead of asserting that the type sizes are exactly equal, we check
that the new size is big enough to contain the original type.
We have to relax this constrain because, right now, we sometimes
specify that things that are smaller than a storage type are legal
instead of widening everything to the size of a storage type.
E.g., we say that G_AND s16 is legal and we map that on GPR32.

This is something we may revisit in the future (either by changing
the legalization process or keeping track separately of the storage
size and the size of the type), but let us reflect the reality of
the situation for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318587 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 04:28:58 +00:00
Quentin Colombet
8e0e176ebf [AArch64][RegisterBankInfo] Teach instruction mapping about gpr32 -> fpr16 cross copies
Turns out this copies can actually occur because of the way we lower the
ABI for half.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318586 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 04:28:56 +00:00
Rafael Espindola
a3c17b6b5b Reorder static functions. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318584 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 02:12:53 +00:00
Rafael Espindola
53742c5e59 Split realPathFromHandle in two.
By having an UTF-16 version we avoid some code duplication in calling
GetFinalPathNameByHandleW.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318583 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 02:05:59 +00:00
Walter Lee
43a4579060 [asan] Add a full redzone after every stack variable
We were not doing that for large shadow granularity.  Also add more
stack frame layout tests for large shadow granularity.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318581 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 01:13:18 +00:00
Evgeniy Stepanov
3cdd9f6def Revert "[asan] Use dynamic shadow on 32-bit Android" and 3 more.
Revert the following commits:
  r318369 [asan] Fallback to non-ifunc dynamic shadow on android<22.
  r318235 [asan] Prevent rematerialization of &__asan_shadow.
  r317948 [sanitizer] Remove unnecessary attribute hidden.
  r317943 [asan] Use dynamic shadow on 32-bit Android.

MemoryRangeIsAvailable() reads /proc/$PID/maps into an mmap-ed buffer
that may overlap with the address range that we plan to use for the
dynamic shadow mapping. This is causing random startup crashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 00:22:34 +00:00
Daniel Sanders
603ba13533 [globalisel][tablegen] Generalize pointer-type inference by introducing ptypeN. NFC
ptypeN is functionally the same as typeN except that it informs the
SelectionDAG importer that an operand should be treated as a pointer even
if it was written as iN. This is important for patterns that use iN instead
of iPTR to represent pointers. E.g.:
  (set GPR64:$dst, (load GPR64:$addr))

Previously, this was handled as a hardcoded special case for the appropriate
operands to G_LOAD and G_STORE.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318574 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-18 00:16:44 +00:00
Reid Kleckner
b287a8d8c2 [lit] Try to improve Ctrl-C behavior on Windows
This functionality was broken during a refactor a while back because
'pool' is no longer in scope.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318572 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 23:52:33 +00:00
Petr Hosek
8e87d92d1d [CMake][runtimes] Don't passthrough prefixes for non-default targets
The passthrough is useful for setting up the options for the default
build, but we already have a different mechanism to pass CMake flags
to builds for builtins and runtimes targets so this is not really
needed there. Furthermore, when the flags are set for the default
build, with the prefix passthrough set we have to explicitly override
all options in other targets which can be cumbersome.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318571 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 23:51:53 +00:00
Zachary Turner
cf9af88805 Fix an issue with llvm lit tool substitutions.
When using an installed clang with an in-tree llvm, we were not
searching in the right paths for the tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318564 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 22:51:43 +00:00
Zhen Cao
fc1a0ac68e [MC] Fix regression tests on Windows when git “core.autocrlf” is set to true.
Differential Revision: https://reviews.llvm.org/D39737

This is the second attempt to commit this. The test was broken on Linux in the first attempt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318560 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 21:59:43 +00:00
Matt Arsenault
9f8c0170e6 AMDGPU: Move hazard avoidance out of waitcnt pass.
This is mostly moving VMEM clause breaking into
the hazard recognizer. Also move another hazard
currently handled in the waitcnt pass.

Also stops breaking clauses unless xnack is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318557 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 21:35:32 +00:00
Vedant Kumar
ddb44a6e69 [llvm-profdata] Don't treat non-fatal merge errors as fatal
This fixes an issue seen on the coverage bot:
http://lab.llvm.org:8080/green/view/Experimental/job/clang-stage2-coverage-R/1930

Profile merging shouldn't fail if a single counter mismatch is detected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318555 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 21:18:32 +00:00
Jonas Hahnfeld
4f5d63bce0 llvm-demangle-fuzzer: Link in Support
The refactoring in r318407 transiently includes abi-breaking.h
which defines EnableABIBreakingChecks. This breaks my Debug
build because this fuzzer did not link in Support with the symbol.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318553 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 20:46:55 +00:00
Jun Bum Lim
974e5c8e9c [LICM] Fix PR35342
Summary: This change fix PR35342 by replacing only the current use with undef in unreachable blocks.

Reviewers: efriedma, mcrosier, igor-laevsky

Reviewed By: efriedma

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318551 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 20:38:25 +00:00
Rafael Espindola
ec6f9b0b97 Use TempFile in the implementation of LockFileManager.
This move some of the complexity over to the lower level TempFile.

It also makes it a bit more explicit where errors are ignored since we
now have a call to consumeError.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318550 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 20:06:41 +00:00
Chandler Carruth
f5f61851ee [PM/Unswitch] Teach SimpleLoopUnswitch to do non-trivial unswitching,
making it no longer even remotely simple.

The pass will now be more of a "full loop unswitching" pass rather than
anything substantively simpler than any other approach. I plan to rename
it accordingly once the dust settles.

The key ideas of the new loop unswitcher are carried over for
non-trivial unswitching:
1) Fully unswitch a branch or switch instruction from inside of a loop to
   outside of it.
2) Update the CFG and IR. This avoids needing to "remember" the
   unswitched branches as well as avoiding excessively cloning and
   reliance on complex parts of simplify-cfg to cleanup the cfg.
3) Update the analyses (where we can) rather than just blowing them away
   or relying on something else updating them.

Sadly, #3 is somewhat compromised here as the dominator tree updates
were too complex for me to want to reason about. I will need to make
another attempt to do this now that we have a nice dynamic update API
for dominators. However, we do adhere to #3 w.r.t. LoopInfo.

This approach also adds an important principls specific to non-trivial
unswitching: not *all* of the loop will be duplicated when unswitching.
This fact allows us to compute the cost in terms of how much *duplicate*
code is inserted rather than just on raw size. Unswitching conditions
which essentialy partition loops will work regardless of the total loop
size.

Some remaining issues that I will be addressing in subsequent commits:
- Handling unstructured control flow.
- Unswitching 'switch' cases instead of just branches.
- Moving to the dynamic update API for dominators.

Some high-level, interesting limitationsV that folks might want to push
on as follow-ups but that I don't have any immediate plans around:
- We could be much more clever about not cloning things that will be
  deleted. In fact, we should be able to delete *nothing* and do
  a minimal number of clones.
- There are many more interesting selection criteria for which branch to
  unswitch that we might want to look at. One that I'm interested in
  particularly are a set of conditions which all exit the loop and which
  can be merged into a single unswitched test of them.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318549 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 19:58:36 +00:00
Justin Bogner
9bde5fb8f8 MIRParser: Avoid reading uninitialized memory on generic vregs
If a vreg's bank is specified in the registers block and one of its
defs or uses also specifies the bank, we end up checking that the
RegBank is equal to diagnose conflicting banks. The problem comes up
for generic vregs, where we weren't fully initializing the VRegInfo
when parsing the registers block, so we'd end up comparing a null
pointer to uninitialized memory.

This fixes a non-deterministic failure when round tripping through MIR
with generic vregs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318543 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 18:51:20 +00:00
Simon Pilgrim
f54bfed5d2 [X86] Merge scheduling tests for SHLD/SHRD
Reduces spsce used and makes it easier to compare the 2 values for the equivalent instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318541 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 18:35:49 +00:00
Volodymyr Sapsai
3c60df7cce [ThinLTO] Remove too aggressive assertion in building function call graph.
The assertion was introduced in r317853 but there are cases when a call
isn't handled either as direct or indirect. In this case we add a
reference graph edge but not a call graph edge.

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: mehdi_amini, inglorion, eraman, hiraditya, efriedma, llvm-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318540 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 18:28:05 +00:00
Rafael Espindola
39107fc224 Try to fix the windows build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318535 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 17:46:39 +00:00
Rafael Espindola
ebc0ffe8fd Use TempFile in dsymutil.
I don't think there is any functionality change, but the code is
easier to understand IMHO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 17:33:09 +00:00
Rafael Espindola
1e4e74feed Revert "[MC] Fix regression tests on Windows when git “core.autocrlf” is set to true."
This reverts commit r318528.

MC/AsmParser/preserve-comments-crlf.s fails on linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318533 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 17:31:20 +00:00
Michal Gorny
0b373e161f [CMake] Allow for Solaris ld -V output on stdout
In recent versions of Solaris 11.4 (previously 12), ld -V output went to
stdout instead of stderr. Since AddLLVM.cmake only expects it on stderr,
Solaris ld wasn't properly detected and options not understood by it are
passed during the build.

The following patch fixes this, allowing for both variants.

Tested on i386-pc-solaris2.11.4 (on top of D35755 which is needed for
proper Solaris support).

Patch by Rainer Orth.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318532 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 17:12:14 +00:00
Evandro Menezes
b57e8217cf [AArch64] Adjust the cost model for Exynos M1 and M2
Improve the accuracy of the model by specifying the proper number of uops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318531 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 16:42:15 +00:00
Zhen Cao
e66112a7be [MC] Fix regression tests on Windows when git “core.autocrlf” is set to true.
Differential Revision: https://reviews.llvm.org/D39737

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318528 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 16:17:56 +00:00
Dmitry Preobrazhensky
fa8708611d [AMDGPU][MC][GFX9][disassembler] Corrected decoding of op_sel_hi for v_mad_mix*
See bug 35148: https://bugs.llvm.org//show_bug.cgi?id=35148

Reviewers: tamazov, SamWot, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318526 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 15:15:40 +00:00
Ben Dunbobbin
8c82162a48 [Support][CachePruning] Fix regression in pruning interval
Fixed broken comparison.
borked by: rL284966 (see: https://reviews.llvm.org/D25730).

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

This is a second attempt to commit this.
The first attempt broke lld and gold tests that had been written against
the incorrect behaivour.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318524 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 14:42:18 +00:00
Andrew Ng
1cb3c5390b [gold] Fix broken thin LTO cache test NFC
Fix test as it is assuming that the cache pruning is always being
performed by default. Explicitly set prune interval to 0s to ensure
pruning is always performed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318520 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 12:00:57 +00:00
Martin Storsjo
305f0fb156 [ARM] Use dwarf exception handling on MinGW
Enabling and using dwarf exceptions seems like an easier path
to take, than to make the COFF/ARM backend output EHABI directives.
Previously, no EH model was enabled at all on this target.

There's no point in setting UseIntegratedAssembler to false since
GNU binutils doesn't support Windows on ARM, and since we don't
need to support external assembler, we don't need to use register
numbers in cfi directives.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318510 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 08:04:40 +00:00
Craig Topper
0d1dc56a25 [SelectionDAG] Allow custom vector widening through ReplaceNodeResults to handle nodes with chain outputs.
Previously we were assuming all results were vectors and calling SetWidenedVector, but if its a chain result we should just replace uses instead.

This fixes an error found by expensive checks after r318368.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318509 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 07:03:57 +00:00
Max Kazantsev
9157aac43e [IRCE] Remove folding of two range checks into RANGE_CHECK_BOTH
The logic of replacing of a couple `RANGE_CHECK_LOWER + RANGE_CHECK_UPPER`
into `RANGE_CHECK_BOTH` in fact duplicates the logic of range intersection which
happens when we calculate safe iteration space. Effectively, the result of intersection of
these ranges doesn't differ from the range of merged range check.

We chose to remove duplicating logic in favor of code simplicity.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318508 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 06:49:26 +00:00
Matt Arsenault
6b6cd3cd66 AMDGPU: Replace list of SMEM buffer opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318506 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 04:18:26 +00:00
Matt Arsenault
5c9a14c058 AMDGPU: Fix breaking SMEM clauses
This was completely ignoring subregisters,
so was not very useful. Also only break them
if xnack is actually enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318505 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 04:18:24 +00:00
Vedant Kumar
0ff70a666f [llvm-profdata] Fix a dangling reference to an error string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318502 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 02:58:23 +00:00
Aditya Nandakumar
3d7c6e8ab7 [GISel]: DCE copy instructions during legalization
We might have instructions such as ext(copy(trunc)), and while cleaning
up legalization artifacts, we can also dce the copies that are in
between legalization artifacts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318501 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 02:44:55 +00:00