Commit Graph

312523 Commits

Author SHA1 Message Date
Samuel Benzaquen 9b7aa02b53 Add relational benchmark against a string constant.
Summary:
Add relational benchmark against a string constant.
These can potentially trigger inlining of the operations. We want to
benchmark that.

Reviewers: EricWF

Subscribers: christof, jdoerfert, libcxx-commits

Tags: #libc

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

llvm-svn: 356680
2019-03-21 16:06:15 +00:00
Roman Lebedev 7028cedafe [AST] OMPStructuredBlockTest: two matchers were promoted into ASTMatchers.h
llvm-svn: 356679
2019-03-21 15:50:54 +00:00
Louis Dionne f3486db1f7 [libc++] Mark bad_any_cast tests as unsupported when the dylib doesn't support bad_any_cast
With the latest compiler fix to availability, some availability failures
that didn't trigger before now trigger.

llvm-svn: 356678
2019-03-21 15:37:11 +00:00
Roman Lebedev 408eb44f49 [ASTMatcher] Add clang-query disclaimer to two more matchers that take enum
As we have figured out in
https://reviews.llvm.org/D57112
and
https://bugs.llvm.org/show_bug.cgi?id=41176

this kind-of works, but needs special care.

llvm-svn: 356677
2019-03-21 15:33:43 +00:00
Roman Lebedev c816195759 [ASTMatchers][OpenMP] OpenMP Structured-block-related matchers
Summary: Exposes to the  for ASTMatchers the interface/modelling
of OpenMP structured-block.

Reviewers: gribozavr, aaron.ballman, JonasToth, george.karpenkov

Reviewed By: gribozavr, aaron.ballman

Subscribers: guansong, jdoerfert, cfe-commits

Tags: #clang, #openmp

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

llvm-svn: 356676
2019-03-21 15:33:35 +00:00
Roman Lebedev 33ef20ec2f [ASTTypeTraits][ASTMatchers][OpenMP] OMPClause handling
Summary:
`OMPClause` is the base class, it is not descendant from **any**
other class, therefore for it to work with e.g.
`VariadicDynCastAllOfMatcher<>`, it needs to be handled here.

Reviewers: sbenza, bkramer, pcc, klimek, hokein, gribozavr, aaron.ballman, george.karpenkov

Reviewed By: gribozavr, aaron.ballman

Subscribers: guansong, jdoerfert, alexfh, ABataev, cfe-commits

Tags: #openmp, #clang

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

llvm-svn: 356675
2019-03-21 15:33:24 +00:00
Roman Lebedev de0e4ae024 [ASTMatchers][OpenMP] Add base ompExecutableDirective() matcher.
Summary:
A simple matcher for `OMPExecutableDirective` Stmt type.
Split off from D57113.

Reviewers: gribozavr, aaron.ballman, JonasToth, george.karpenkov

Reviewed By: gribozavr, aaron.ballman

Subscribers: guansong, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 356674
2019-03-21 15:33:10 +00:00
Serge Guelton ce54fa1855 Workaround items/iteritems difference between Python2 and Python3
Differential Revision: https://reviews.llvm.org/D59588

llvm-svn: 356673
2019-03-21 14:47:40 +00:00
Serge Guelton 468219b387 Workaround Python's map difference between Python2/3
When the output of map is not used, using a list comprehension or an explicit
call to list looks awkward.

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

llvm-svn: 356672
2019-03-21 14:44:58 +00:00
Serge Guelton bfb779188f Portable int/long conversion across Python 2 / Python 3
Differential Revision: https://reviews.llvm.org/D59585

llvm-svn: 356671
2019-03-21 14:41:34 +00:00
Serge Guelton 3577da7667 Portable exception value access across Python 2 / Python 3
Differential Revision: https://reviews.llvm.org/D59583

llvm-svn: 356670
2019-03-21 14:39:55 +00:00
David Green f0f01051a1 Fixup opt-remarks.ll gold plugin test. NFC
Now that rL356594 has added a TailCallElim pass to LTO, the call gets marked as
tail.

llvm-svn: 356669
2019-03-21 14:35:06 +00:00
Florian Hahn 71033f2987 [DAGCombiner] Use getTokenFactor in a few more cases.
SDNodes can only have 64k operands and for some inputs (e.g. large
number of stores), we can reach this limit when creating TokenFactor
nodes. This patch is a follow up to D56740 and updates a few more places
that potentially can create TokenFactors with too many operands.

Reviewers: efriedma, craig.topper, aemerson, RKSimon

Reviewed By: RKSimon

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

llvm-svn: 356668
2019-03-21 14:32:09 +00:00
Simon Pilgrim da4992bf8d [DAGCombine] SimplifySelectCC - call FoldSetCC with the setcc result type
We were calling FoldSetCC with the compare operand type instead of the result type.

Found by OSS-Fuzz #13838 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13838)

llvm-svn: 356667
2019-03-21 14:07:18 +00:00
Peter Smith d3511a214e [ELF][ARM] Redesign of .ARM.exidx handling to use a SyntheticSection
Instead of creating extra Synthetic .ARM.exidx sections to account for
gaps in the table, create a single .ARM.exidx SyntheticSection that can
derive the contents of the gaps from a sorted list of the executable
InputSections. This has the benefit of moving the ARM specific code for
SyntheticSections in SHF_LINK_ORDER processing and the table merging code
into the ARM specific SyntheticSection. This also makes it easier to create
EXIDX_CANTUNWIND table entries for executable InputSections that don't
have an associated .ARM.exidx section.

Fixes pr40277

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

llvm-svn: 356666
2019-03-21 14:06:40 +00:00
Sanjay Patel d47eac59ef [CodeGenPrepare] limit formation of overflow intrinsics (PR41129)
This is probably a bigger limitation than necessary, but since we don't have any evidence yet
that this transform led to real-world perf improvements rather than regressions, I'm making a
quick, blunt fix.

In the motivating x86 example from:
https://bugs.llvm.org/show_bug.cgi?id=41129
...and shown in the regression test, we want to avoid an extra instruction in the dominating
block because that could be costly.

The x86 LSR test diff is reversing the changes from D57789. There's no evidence that 1 version
is any better than the other yet.

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

llvm-svn: 356665
2019-03-21 13:57:07 +00:00
Xing GUO 3e9e55491e [llvm-readobj] Format codes. NFC.
llvm-svn: 356664
2019-03-21 13:42:06 +00:00
Erich Keane 505427cb2f Permit redeclarations of a builtin to specify calling convention.
After https://reviews.llvm.org/rL355317 we noticed that quite a decent
amount of code redeclares builtins (memcpy in particular, I believe
reduced from an MSVC header) with a calling convention specified.
This gets particularly troublesome when the user specifies a new
'default' calling convention on the command line.

When looking to add a diagnostic for this case, it was noticed that we
had 3 other diagnostics that differed only slightly.  This patch ALSO
unifies those under a 'select'.  Unfortunately, the order of words in
ONE of these diagnostics was reversed ("'thiscall' calling convention"
vs "calling convention 'thiscall'"), so this patch also standardizes on
the former.

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

Change-Id: I79f99fe7c2301640755ffdd774b46eb44526bb22
llvm-svn: 356663
2019-03-21 13:30:56 +00:00
Paul Hoad cbb726d0c5 [clang-format] Add basic support for formatting C# files
Summary:

This revision adds basic support for formatting C# files with clang-format, I know the barrier to entry is high here  so I'm sending this revision in to test the water as to whether this might be something we'd consider landing.

Tracking in Bugzilla as:
https://bugs.llvm.org/show_bug.cgi?id=40850

Justification:
C# code just looks ugly in comparison to the C++ code in our source tree which is clang-formatted.

I've struggled with Visual Studio reformatting to get a clean and consistent style, I want to format our C# code on saving like I do now for C++ and i want it to have the same style as defined in our .clang-format file, so it consistent as it can be with C++.  (Braces/Breaking/Spaces/Indent etc..)

Using clang format without this patch leaves the code in a bad state, sometimes when the BreakStringLiterals is set, it  fails to compile.

Mostly the C# is similar to Java, except instead of JavaAnnotations I try to reuse the TT_AttributeSquare.

Almost the most valuable portion is to have a new Language in order to partition the configuration for C# within a common .clang-format file, with the auto detection on the .cs extension. But there are other C# specific styles that could be added later if this is accepted. in particular how  `{ set;get }` is formatted.

Reviewers: djasper, klimek, krasimir, benhamilton, JonasToth

Reviewed By: klimek

Subscribers: llvm-commits, mgorny, jdoerfert, cfe-commits

Tags: #clang, #clang-tools-extra

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

llvm-svn: 356662
2019-03-21 13:09:22 +00:00
Simon Pilgrim 87d261bfd3 [Thumb] Fix infinite loop in ABS expansion (PR41160)
Don't expand ISD::ABS node if its legal.

llvm-svn: 356661
2019-03-21 12:41:18 +00:00
Tim Renouf 361b5b2193 [AMDGPU] Support for v3i32/v3f32
Added support for dwordx3 for most load/store types, but not DS, and not
intrinsics yet.

SI (gfx6) does not have dwordx3 instructions, so they are not enabled
there.

Some of this patch is from Matt Arsenault, also of AMD.

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

Change-Id: I913ef54f1433a7149da8d72f4af54dbb13436bd9
llvm-svn: 356659
2019-03-21 12:01:21 +00:00
Simon Pilgrim 92cbcfc325 Fix -Wmisleading-indentation gcc7 warning. NFCI.
llvm-svn: 356658
2019-03-21 11:58:22 +00:00
Oliver Stannard defdb1070f [AArch64] Allow -mattr=tpidr-el[1|2|3]
Added subtarget features for AArch64 to use TPIDR_EL[1|2|3] as the TLS base
register, rather than the default TPIDR_EL0.

Patch by Philip Derrin!

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

llvm-svn: 356657
2019-03-21 11:30:17 +00:00
Simon Pilgrim 54ed653870 [SelectionDAG] Add scalarization of ABS node (PR41149)
Patch by: @ikulagin (Ivan Kulagin)

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

llvm-svn: 356656
2019-03-21 11:18:54 +00:00
Pavel Labath 045b8544fd Fix two more issues with r356652
The first problem was a use-after-free in the tests (detected by asan
bots). The temporary array created for the "create" call is guaranteed
to live only until the end of the statement. The fix there is to store
the test data in a local variable to ensure it has the right lifetime

The second issue is broken BUILD_SHARED_LIBS build, which I fix by
adding the appropriate BinaryFormat dependency to the Object unit tests.

llvm-svn: 356655
2019-03-21 10:21:55 +00:00
Alex Bradbury 0a9541e9ed [RISCV][NFC] Remove old CHECK lines from linker-relaxation.s test
The RELOC: check lines are no longer used.

llvm-svn: 356654
2019-03-21 09:53:19 +00:00
Pavel Labath 7da2de698f Attempt to fix modules build for r356652
The commit added a new .def file. This adds it to the list of textual
headers.

llvm-svn: 356653
2019-03-21 09:44:07 +00:00
Pavel Labath 581d79a440 [Object] Add basic minidump support
Summary:
This patch adds basic support for reading minidump files. It contains
the definitions of various important minidump data structures (header,
stream directory), and of one minidump stream (SystemInfo). The ability
to read other streams will be added in follow-up patches. However, all
streams can be read even now as raw data, which means lldb's minidump
support (where this code is taken from) can be immediately rebased on
top of this patch as soon as it lands.

As we don't have any support for generating minidump files (yet), this
tests the code via unit tests with some small handcrafted binaries in
the form of c char arrays.

Reviewers: Bigcheese, jhenderson, zturner

Subscribers: srhines, dschuff, mgorny, fedor.sergeev, lemo, clayborg, JDevlieghere, aprantl, lldb-commits, llvm-commits

Tags: #llvm

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

llvm-svn: 356652
2019-03-21 09:18:59 +00:00
Fangrui Song ebfb7852be [BasicAA] Use DenseMap::try_emplace after D59151. NFC
llvm-svn: 356651
2019-03-21 08:47:40 +00:00
Zinovy Nis 72bb9a65d6 Reland r356547 after fixing the YAML module missing issue.
[clang-tidy] Parallelize clang-tidy-diff.py

This patch has 2 rationales:

- large patches lead to long command lines and often cause max command line length restrictions imposed by OS;
- clang-tidy runs on modified files are independent and can be done in parallel, the same as done for run-clang-tidy.

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

llvm-svn: 356649
2019-03-21 08:32:07 +00:00
Mikael Holmen 5b1754f93d Silence warning about unused variable in builds without asserts [NFC]
llvm-svn: 356648
2019-03-21 07:54:44 +00:00
Serge Guelton 32cffcf1ab Use list comprehension instead of map/filter to prepare Python2/3 compat
Differential Revision: https://reviews.llvm.org/D59579

llvm-svn: 356647
2019-03-21 07:19:09 +00:00
Craig Topper 8de7bc0bff [ScalarizeMaskedMemIntrinsics] Reverse some if conditions to reduce indentations to remove curly braces.
Pre-commit for D59180

llvm-svn: 356646
2019-03-21 05:54:37 +00:00
Craig Topper 72d888ba9f [InstCombine] Add test case for PR41164. NFC
llvm-svn: 356645
2019-03-21 05:33:10 +00:00
Alina Sbirlea 4fdbd822fc [BasicAA] Reduce no of map seaches [NFCI].
Summary:
This is a refactoring patch.
- Reduce the number of map searches by reusing the iterator.
- Add asserts to check that the entry is in the cache, as this is something BasicAA relies on to avoid infinite recursion.

Reviewers: chandlerc, aschwaighofer

Subscribers: sanjoy, jlebar, llvm-commits

Tags: #llvm

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

llvm-svn: 356644
2019-03-21 05:02:05 +00:00
Jonas Devlieghere a262531dd2 [Reproducers] Properly handle QEnvironment packets
On Linux, a QEnvironment packet is sent for every environment variable.
This breaks replay when the number of environment variables is different
then during capture. The solution is to always reply with OK.

llvm-svn: 356643
2019-03-21 04:08:31 +00:00
Philip Reames 60212be619 [instcombine] Add some todos, and arrange code for readibility
llvm-svn: 356642
2019-03-21 03:23:40 +00:00
George Burgess IV ae84e9ab49 [MSSA] Delete move ctor; remove dynamic never-moved verification
Code archaeology in D59315 revealed that MSSA should never be moved.
Rather than trying to check dynamically that this hasn't happened in the
verify() functions of Walkers, it's likely best to just delete its move
constructor.

Since all these verify() functions did is check that MSSA hasn't moved,
this allows us to remove these verify functions.

I can readd the verification checks if someone's super concerned about
us trying to `memcpy` MemorySSA or something somewhere, but I imagine we
have other problems if we're trying anything like that...

llvm-svn: 356641
2019-03-21 03:11:34 +00:00
Eric Fiselier c9f4cbf7a6 Add dylib-has-no-filesystem when filesystem is disabled
llvm-svn: 356640
2019-03-21 02:13:30 +00:00
Eric Fiselier e7e268d942 Mark debug death tests as unsupported on Windows
llvm-svn: 356639
2019-03-21 02:07:55 +00:00
Jonas Devlieghere e3ea27b640 [Reproducers] Log inconsistencies during replay (NFC)
Make debugging of the GDB remote packet aspect of reproducers easier by
logging both requests and replies. This enables some sanity checking
during replay.

llvm-svn: 356638
2019-03-21 01:57:33 +00:00
Eric Fiselier 0e04ab7e94 Remove type visibility specifiers from new chrono types.
_LIBCPP_TYPE_VIS is only really needed on types with a vtable.
And on Windows it doesn't work with types that have only inline methods.

This patch removes the unneeded attributes.

llvm-svn: 356637
2019-03-21 01:48:15 +00:00
George Burgess IV eda3d11d14 creduce-clang-crash.py: preprocess file + reduce commandline
This CL causes our creduce-clang-crash.py util to:

- try to preprocess the file before reducing
- try to remove some command line arguments
- now require a llvm bin directory, since the generated crash script
  doesn't have an absolute path for clang

It also marks it as executable, since I forgot to do that in the last
commit. :)

Patch by Amy Huang!

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

llvm-svn: 356636
2019-03-21 01:01:53 +00:00
Billy Robert O'Neal III 277cf30d6c [libcxx] [test] Revert r356632 add (void) casts to operator new calls, to suppress warnings generated by [[nodiscard]]."
llvm-svn: 356635
2019-03-21 00:24:43 +00:00
Artem Dergachev aa40315c69 [CFG] [analyzer] pr41142: C++17: Skip transparent InitListExprs in constructors.
When searching for construction contexts, i.e. figuring out which statements
define the object that is constructed by each construct-expression, ignore
transparent init-list expressions because they don't add anything to the
context. This allows the Static Analyzer to model construction, destruction,
materialization, lifetime extension correctly in more cases. Also fixes
a crash caused by incorrectly evaluating initial values of variables
initialized with such expressions.

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

llvm-svn: 356634
2019-03-21 00:15:07 +00:00
Eric Fiselier f1d87f8b4c Allow disabling of filesystem library.
Summary: Filesystem doesn't work on Windows, so we need a mechanism to turn it off for the time being.

Reviewers: ldionne, serge-sans-paille, EricWF

Reviewed By: EricWF

Subscribers: mstorsjo, mgorny, christof, jdoerfert, libcxx-commits

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

llvm-svn: 356633
2019-03-21 00:04:31 +00:00
Billy Robert O'Neal III 49fc265581 [libcxx] [test] Add (void) casts to operator new calls, to suppress warnings generated by [[nodiscard]].
This allows these tests to pass when compiled by MSVC++.

llvm-svn: 356632
2019-03-20 23:58:46 +00:00
Craig Topper 8d46403b8e [X86] Add CMPXCHG8B feature flag. Set it for all CPUs except i386/i486 including 'generic'. Disable use of CMPXCHG8B when this flag isn't set.
CMPXCHG8B was introduced on i586/pentium generation.

If its not enabled, limit the atomic width to 32 bits so the AtomicExpandPass will expand to lib calls. Unclear if we should be using a different limit for other configs. The default is 1024 and experimentation shows that using an i256 atomic will cause a crash in SelectionDAG.

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

llvm-svn: 356631
2019-03-20 23:35:49 +00:00
Douglas Yung 6452ba4786 Revert "Reland r356547 after fixing the tests for Linux."
This reverts commit 538fb72226 (r356565).

This is still breaking a build bot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/45557

llvm-svn: 356630
2019-03-20 23:21:43 +00:00
Michael Trent 02a2ce9a4b Fix Mach-O bind and rebase validation errors in libObject
Summary:
llvm-objdump (via libObject) validates DYLD_INFO rebase and bind
entries against the basic structure found in the Mach-O file before
evaluating the contents of those entries. Certain malformed Mach-Os can
defeat the validation check and force llvm-objdump (libObject) to crash.

The previous logic verified a rebase or bind started in a valid Mach-O
section, but did not verify that the section wholely contained the
fixup. It also generally allows rebases or binds to start immediately
after a valid section even if that range is not itself part of a valid
section. Finally, bind and rebase opcodes that indicate more than one
fixup (apply N times...) are not completely validated: only the first
and final fixups are checked.

The previous logic also rejected certain binaries as false positives.
Some bind and rebase opcodes can modify the state machine such that the
next bind or rebase will fail. libObject will reject these opcodes as
invalid in order to be helpful and print an error message associated
with the instruction that caused the problem, even though the binary is
not actually illegal until it consumes the invalid state in the state
machine. In other words, libObject may reject a Mach-O binary that
Apple's dynamic linker may consider legal. The original version of
macho-rebase-add-addr-uleb-too-big is an example of such a binary.

I have replaced the existing checkSegAndOffset and checkCountAndSkip
functions with a single function, checkSegAndOffsets, which validates
all of the fixups realized by a DYLD_INFO opcode. checkSegAndOffsets
verifies that a Mach-O section fully contains each fixup. Every fixup
realized by an opcode is validated, and some (but not all!)
inconsistencies in the state machine are allowed until a fixup is
realized. This means that libObject may fail on an opcode that realizes
a fixup, not on the opcode that introduced the arithmetic error.

Existing test cases have been modified to reflect the changes in error
messages returned by libObject. What's more, the test case for 
macho-rebase-add-addr-uleb-too-big has been modified so that it actually
triggers the error condition; the new code in libObject considers the
original test binary "legal".

rdar://47797757

Reviewers: lhames, pete, ab

Reviewed By: pete

Subscribers: rupprecht, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 356629
2019-03-20 23:21:16 +00:00