Commit Graph

302063 Commits

Author SHA1 Message Date
Eric Fiselier 43245b1f3b Fix incorrect use of aligned allocation in get_temporary_buffer.
llvm-svn: 345403
2018-10-26 17:12:32 +00:00
Shafik Yaghmour 693fbf5c93 [DataFormatters] Adding formatters for libc++ std::u16string and std::u32string
rdar://problem/41302849

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

llvm-svn: 345402
2018-10-26 17:00:48 +00:00
Eric Fiselier b914eaf45f XFAIL sized deallocation test with GCC
llvm-svn: 345400
2018-10-26 16:37:11 +00:00
Andrea Di Biagio 0bd8628d0d [tblgen] Improve comments in TargetInstrPredicate.td. NFC
llvm-svn: 345399
2018-10-26 16:22:26 +00:00
Bjorn Pettersson b25340236c [Fixed Point Arithmetic] Refactor fixed point casts
Summary:
- Added names for some emitted values (such as "tobool" for
  the result of a cast to boolean).
- Replaced explicit IRBuilder request for doing sext/zext/trunc
  by using CreateIntCast instead.
- Simplify code for emitting satuation into one if-statement
  for clamping to max, and one if-statement for clamping to min.

Reviewers: leonardchan, ebevhan

Reviewed By: leonardchan

Subscribers: cfe-commits

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

llvm-svn: 345398
2018-10-26 16:12:12 +00:00
Vlad Tsyrklevich 672ba25d8b Revert "UBSan blacklist workaround for bot timeouts"
This reverts commit r335525. This workaround is no longer necessary
because PR37929 has been fixed.

llvm-svn: 345397
2018-10-26 16:07:50 +00:00
Francis Visoiu Mistrih 9a9f16ba87 [MIR] Simplify and move MIR test
Also fixes a Machine Verifier issue.

llvm-svn: 345396
2018-10-26 16:00:29 +00:00
Simon Pilgrim 5d1be4f8d4 [X86][SSE] Move 2-input limit up from getFauxShuffleMask to resolveTargetShuffleInputs
Makes no difference to actual shuffle decoding yet, but merges all the existing limits in one place for when proper support is fixed.

llvm-svn: 345395
2018-10-26 15:19:02 +00:00
Evgeniy Stepanov f4a6f6424d [sanitizer] Fix mallopt test on Android.
There is not a single common mallopt option between gnu/linux and
android, so simply use a random number there.

llvm-svn: 345394
2018-10-26 15:13:20 +00:00
Rui Ueyama 4c06a6cc90 Rename warnUnorderableSymbol maybeWarnUnorderableSymbol because the function doesn't always emit a warning.
llvm-svn: 345393
2018-10-26 15:07:12 +00:00
Rui Ueyama 2b39ea477c Refactor readCallGraph() and readCallGraphFromObjectFiles(). NFC.
llvm-svn: 345392
2018-10-26 15:07:02 +00:00
Sanjay Patel 6b40768f5a [x86] commute blendvb with constant condition op to allow load folding
This is a narrow fix for 1 of the problems mentioned in PR27780:
https://bugs.llvm.org/show_bug.cgi?id=27780

I looked at more general solutions, but it's a mess. We canonicalize shuffle masks
based on the number of elements accessed from each operand, and that's not optional.
If you remove that, we'll crash because we fail to match isel patterns. So I'm
waiting until we're sure that we have blendvb with constant condition and then
commuting based on the load potential. Other cases like blend-with-immediate are
already handled elsewhere, so this is probably not a common problem anyway.

I didn't use "MayFoldLoad" because that checks for one-use and in these cases, we've
screwed that up by creating a temporary PSHUFB using these operands that we're counting
on to be killed later. Undoing that didn't look like a simple task because it's
intertwined with determining if we actually use both operands of the shuffle or not.a

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

llvm-svn: 345390
2018-10-26 14:58:13 +00:00
Simon Pilgrim 7575c6d01b [X86] Use existing pulled out VT variables. NFCI.
llvm-svn: 345388
2018-10-26 14:39:28 +00:00
Max Kazantsev 619a83463f [SimpleLoopUnswitch] Unswitch by experimental.guard intrinsics
This patch adds support of `llvm.experimental.guard` intrinsics to non-trivial
simple loop unswitching. These intrinsics represent implicit control flow which
has pretty much the same semantics as usual conditional branches. The
algorithm of dealing with them is following:

- Consider guards as unswitching candidates;
- If a guard is considered the best candidate, turn it into a branch;
- Apply normal unswitching algorithm on this branch.

The patch has no compile time effect on code that does not contain any guards.

Differential Revision: https://reviews.llvm.org/D53744
Reviewed By: chandlerc

llvm-svn: 345387
2018-10-26 14:20:11 +00:00
Sjoerd Meijer 56f336e2c9 [ARM] Fix ARMCodeGenPrepare test cases
While working on FileCheck producing better diagnostics in D53710, I noticed
that our test case is broken in a few different ways. The test was running, but
results were not checked as prefix CHECK-COMMON wasn't defined (which is what
FileCheck should warn about). Also, the output was different in 2 cases because
of recent changes in ARMCodeGenPrepare.

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

llvm-svn: 345386
2018-10-26 14:19:57 +00:00
Aleksandr Urakov d99b15e484 [Windows] Define generic arguments registers for Windows x64
Summary:
When evaluating expressions the generic arguments registers are required by ABI.
This patch defines them.

Reviewers: zturner, stella.stamenova, labath

Subscribers: aleksandr.urakov, lldb-commits

Tags: #lldb

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

llvm-svn: 345385
2018-10-26 14:15:34 +00:00
Francis Visoiu Mistrih 08d321c9f9 [CodeGen] Remove out operands from PATCHABLE_OP
The current model requires 1 out operand, but it is not used nor created.

This fixed an x86 machine verifier issue.

Part of PR27481.

llvm-svn: 345384
2018-10-26 13:37:25 +00:00
Owen Reynolds c443e7ef55 [llvm-ar] Access ADDLIB in llvm-ar via command line
ADDLIB is called to add the contents of an archive to another archive. 
Previously this was only accessible through the use of an MRI script.

With the use of a new "L" modifier, archive files can treated in the 
manner above when using quick append.

llvm-svn: 345383
2018-10-26 13:34:38 +00:00
Scott Linder 11ef7984b0 [AMDGPU] Add a pass to promote bitcast calls
AMDGPU currently only supports direct calls, but at lower optimisation levels it
fails to lower statically direct calls which appear indirect due to a bitcast.

Add a pass to visit all CallSites and use CallPromotionUtils to "devirtualize"
calls.

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

llvm-svn: 345382
2018-10-26 13:18:36 +00:00
Roman Lebedev 08701ec753 [clang-tidy] Re-commit: Add new 'readability-uppercase-literal-suffix' check (CERT DCL16-C, MISRA C:2012, 7.3, MISRA C++:2008, 2-13-4)
Summary:
Detects when the integral literal or floating point (decimal or hexadecimal)
literal has non-uppercase suffix, and suggests to make the suffix uppercase,
with fix-it.

All valid combinations of suffixes are supported.

```
  auto x = 1;  // OK, no suffix.

  auto x = 1u; // warning: integer literal suffix 'u' is not upper-case

  auto x = 1U; // OK, suffix is uppercase.

  ...
```

This is a re-commit, the original was reverted by me in
rL345305 due to discovered bugs. (implicit code, template instantiation)
Tests were added, and the bugs were fixed.
I'm unable to find any further bugs, hopefully there aren't any..

References:
* [[ https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152241 | CERT DCL16-C ]]
* MISRA C:2012, 7.3 - The lowercase character "l" shall not be used in a literal suffix
* MISRA C++:2008, 2-13-4 - Literal suffixes shall be upper case

Reviewers: JonasToth, aaron.ballman, alexfh, hokein, xazax.hun

Reviewed By: aaron.ballman

Subscribers: Eugene.Zelenko, mgorny, rnkovacs, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 345381
2018-10-26 13:09:27 +00:00
Hans Wennborg 40ccbd315d Revert r345330 "Add MS ABI mangling for operator<=>."
The generated MS manglings differ between 32- and 64-bit, and the test only
expects the latter. See also the commit email thread.

> Thanks to Cameron DaCamara at Microsoft for letting us know what their
> chosen mangling is here!

llvm-svn: 345380
2018-10-26 13:05:45 +00:00
Simon Pilgrim 11c01f402f Regenerate test
llvm-svn: 345379
2018-10-26 12:33:56 +00:00
Sam McCall 0739ffc161 [llvm-mca] Fix -wreorder and -Wunused-private-field after r345376. NFC
llvm-svn: 345378
2018-10-26 12:19:48 +00:00
George Rimar 088d96b43d [Codegen] - Implement basic .debug_loclists section emission (DWARF5).
.debug_loclists is the DWARF 5 version of the .debug_loc.
With that patch, it will be emitted when DWARF 5 is used.

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

llvm-svn: 345377
2018-10-26 11:25:12 +00:00
Andrea Di Biagio 84d0051310 [llvm-mca] Removed dependency on mca::SourcMgr in some Views. NFC
llvm-svn: 345376
2018-10-26 10:48:04 +00:00
Max Kazantsev bde31000b1 [SimpleLoopUnswitch] Make all checks before actual non-trivial unswitch
We should be able to make all relevant checks before we actually start the non-trivial
unswitching, so that we could guarantee that once we have started the transform,
it will always succeed.

Reviewed By: chandlerc
Differential Revision: https://reviews.llvm.org/D53747

llvm-svn: 345375
2018-10-26 09:52:58 +00:00
Aleksandr Urakov da169c4001 [PDB] Fix `SymbolFilePDBTests` after r345313
Differential Revision: https://reviews.llvm.org/D53749

llvm-svn: 345374
2018-10-26 09:36:26 +00:00
Zachary Turner 9f727950a5 [NativePDB] Add the ability to dump dump global variables.
LLDB has the ability to display global variables, even without a running
process, via the target variable command. This is because global
variables are linker initialized, so their values are embedded directly
into the executables. This gives us great power for testing native PDB
functionality in a cross-platform manner, because we don't actually need
a running process. We can just create a target using an EXE file, and
display global variables. And global variables can have arbitrarily
complex types, so in theory we can fully exercise the type system,
record layout, and data formatters for native PDB files and PE/COFF
executables on any host platform, as long as our type does not require a
dynamic initializer.

This patch adds basic support for finding variables by name, and adds an
exhaustive test for fundamental data types and pointers / references to
fundamental data types.

Subsequent patches will extend this to typedefs, classes, pointers to
functions, and other cases.

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

llvm-svn: 345373
2018-10-26 09:06:38 +00:00
Martin Storsjo b547ef2a29 Revert "Reapply: [Driver] Use forward slashes in most linker arguments"
This reverts commit r345370, as it uncovered even more issues in
tests with partial/inconsistent path normalization:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/13562
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/886
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20994

In particular, these tests seem to have failed:
    Clang :: CodeGen/thinlto-diagnostic-handler-remarks-with-hotness.ll
    Clang :: CodeGen/thinlto-multi-module.ll
    Clang :: Driver/cuda-external-tools.cu
    Clang :: Driver/cuda-options.cu
    Clang :: Driver/hip-toolchain-no-rdc.hip
    Clang :: Driver/hip-toolchain-rdc.hip
    Clang :: Driver/openmp-offload-gpu.c

At least the Driver tests could potentially be fixed by extending
the path normalization to even more places, but the issues with the
CodeGen tests are still unknown.

In addition, a number of other tests seem to have been broken in
other clang dependent tools such as clang-tidy and clangd.

llvm-svn: 345372
2018-10-26 08:33:29 +00:00
Sylvestre Ledru a060aa8a98 Update the example of BS_Stroustrup to match what is done by clang-format
Summary:
reported here https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911561

clang-format-7 -style="{BreakBeforeBraces: Stroustrup}" wasn't doing
the same as the doc

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: cfe-commits

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

llvm-svn: 345371
2018-10-26 07:25:37 +00:00
Martin Storsjo cbd73574e4 Reapply: [Driver] Use forward slashes in most linker arguments
libtool inspects the output of $CC -v to detect what object files and
libraries are linked in by default. When clang is built as a native
windows executable, all paths are formatted with backslashes, and
the backslashes cause each argument to be enclosed in quotes. The
backslashes and quotes break further processing within libtool (which
is implemented in shell script, running in e.g. msys) pretty badly.

Between unix style pathes (that only work in tools that are linked
to the msys runtime, essentially the same as cygwin) and proper windows
style paths (with backslashes, that can easily break shell scripts
and msys environments), the best compromise is to use windows style
paths (starting with e.g. c:) but with forward slashes, which both
msys based tools, shell scripts and native windows executables can
cope with. This incidentally turns out to be the form of paths that
GCC prints out when run with -v on windows as well.

This change potentially makes the output from clang -v a bit more
inconsistent, but it is isn't necessarily very consistent to begin with.

Compared to the previous attempt in SVN r345004, this now does
the same transformation on more paths, hopefully on the right set
of paths so that all tests pass (previously some tests failed, where
path fragments that were required to be identical turned out to
use different path separators in different places). This now also
is done only for non-windows, or cygwin/mingw targets, to preserve
all backslashes for MSVC cases (where the paths can end up e.g. embedded
into PDB files. (The transformation function itself,
llvm::sys::path::convert_to_slash only has an effect when run on windows.)

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

llvm-svn: 345370
2018-10-26 07:01:59 +00:00
Fangrui Song 065c3610ad [SystemZ] Fix -Wcovered-switch-default as coding standard regulates
llvm-svn: 345369
2018-10-26 06:59:08 +00:00
Kristina Brooks 820aeb214a [NFC] Add periods to CREDITS.txt (testing git-llvm)
NFC commit to test git-llvm bridge for current GitHub monorepo.

llvm-svn: 345368
2018-10-26 06:57:02 +00:00
Fangrui Song 50aaaffedd [llvm-nm] Simplify. NFC
Change a \t to spaces
Change some zero-filling memcpy to aggregate initialization
Delete redundant ArchiveName.clear() after declaration

llvm-svn: 345367
2018-10-26 06:56:51 +00:00
Li Jia He f6fb752fe8 [PowerPC] Fix some missed optimization opportunities in combineSetCC
For both operands are bool, short, int, long, long long, add the following optimization.
1. 0-x == y --> x+y ==0
2. 0-x != y --> x+y != 0

Review: nemanjai
Differential Revision: https://reviews.llvm.org/D53360

llvm-svn: 345366
2018-10-26 06:48:53 +00:00
Li Jia He 9521467318 [PowerPC][NFC] Add tests for some missed optimization opportunities in combineSetCC
For both operands are bool, short, int, long, long long, add the following optimization test case.
1. 0-x == y --> x+y ==0
2. 0-x != y --> x+y != 0

Review: nemanjai
Differential Revision: https://reviews.llvm.org/D53358

llvm-svn: 345365
2018-10-26 05:02:10 +00:00
Li Jia He 15e6b10fa9 This reverts commit r345357, It is wrong to create a new directory and put the test file into it. I am sorry for this.
llvm-svn: 345364
2018-10-26 04:54:56 +00:00
Nemanja Ivanovic fce57f586d [NFC] Fix the regular expression for BE PPC in update_llc_test_checks.py
Currently, the regular expression that matches the lines of assembly for PPC LE
(ELFv2) does not work for the assembly for BE (ELFv1). This patch fixes it.

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

llvm-svn: 345363
2018-10-26 03:30:28 +00:00
Richard Smith 7c7e531f97 PR31978: Don't crash if CodeGen sees a top-level BindingDecl.
llvm-svn: 345362
2018-10-26 03:21:20 +00:00
Nemanja Ivanovic 6a74bfba20 [PowerPC] Keep vector int to fp conversions in vector domain
At present a v2i16 -> v2f64 convert is implemented by extracts to scalar,
scalar converts, and merge back into a vector. Use vector converts instead,
with the int data permuted into the proper position and extended if necessary.

Patch by RolandF.

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

llvm-svn: 345361
2018-10-26 03:19:13 +00:00
Saleem Abdulrasool 98ac9984b0 CodeGen: correct the case for swift 4.2, 5.0
This corrects the leader for the swift names.  The encoding for 4.2 and
5.0 differ by a single bit on the second character and were swapped.

llvm-svn: 345360
2018-10-26 03:16:16 +00:00
Fangrui Song 5300c2e0ea [Pipeliner] Mark swp-art-deps-rec.ll as REQUIRES: asserts after rL345319
llvm-svn: 345359
2018-10-26 03:15:56 +00:00
Fangrui Song 61ea8dae2e Add dependency from SystemZAsmParser to SystemZAsmPrinter after rL345349
This fixes -DBUILD_SHARED_LIBS=on build. The dependency is similar to that of X86's.

llvm-svn: 345358
2018-10-26 03:04:54 +00:00
Li Jia He 1ad356dfb3 [PowerPC][NFC] Add tests for some missed optimization opportunities in combineSetCC
For both operands are bool, short, int, long, long long, add the following optimization test case.
1. 0-x == y --> x+y ==0
2. 0-x != y --> x+y != 0

Review: nemanjai
Differential Revision: https://reviews.llvm.org/D53358

llvm-svn: 345357
2018-10-26 02:34:57 +00:00
Vlad Tsyrklevich 21beeb29ea Revert "[AArch64] Create proper memoperand for multi-vector stores"
This reverts commit r345315, it was causing test failures on
sanitizer-x86_64-linux-fast.

llvm-svn: 345356
2018-10-26 02:00:14 +00:00
Li Jia He 63aca02f08 add myself to the CREDITS.TXT
llvm-svn: 345355
2018-10-26 01:58:23 +00:00
Eli Friedman 540be6d0bb [AArch64] Support Windows stack probe command-line arguments.
Adds support for -mno-stack-arg-probe and -mstack-probe-size.

(Not really happy copy-pasting code, but that's what we do for all the
other Windows targets.)

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

llvm-svn: 345354
2018-10-26 01:31:57 +00:00
Chijun Sima 32fd196cbf Teach the DominatorTree fallback to recalculation when applying updates to speedup JT (PR37929)
Summary:
This patch makes the dominatortree recalculate when applying updates with the size of the update vector larger than a threshold. Directly applying updates is usually slower than recalculating the whole domtree in this case. This patch fixes an issue which causes JT running slowly on some inputs.

In bug 37929, the dominator tree is trying to apply 19,000+ updates several times, which takes several minutes.

After this patch, the time used by DT.applyUpdates:

| Input | Before (s) | After (s) | Speedup |
| the 2nd Reproducer in 37929 | 297 | 0.15 | 1980x |
| clang-5.0.0.0.bc | 9.7 | 4.3 | 2.26x |
| clang-5.0.0.4.bc | 11.6 | 2.6 | 4.46x |

Reviewers: kuhar, brzycki, trentxintong, davide, dmgreen, grosser

Reviewed By: kuhar, brzycki

Subscribers: kristina, llvm-commits

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

llvm-svn: 345353
2018-10-26 01:28:36 +00:00
Marshall Clow 27e9fdb2ff Run the min/max tests agaist the header <charconv>. Fix that header so it passes. NFC.
llvm-svn: 345352
2018-10-26 01:00:56 +00:00
Jonas Devlieghere a2a2f2efba Update test that checks auto-completion for settings set.
This reverts r345350 and updates the test rather than removing it. Now
we check that `--g` auto-completes to `--global`.

llvm-svn: 345351
2018-10-26 00:50:54 +00:00