Dylan McKay [Wed, 5 Oct 2016 13:27:30 +0000 (13:27 +0000)]
[AVR] Add AVRRegisterInfo::splitReg function
No tests are included just yet - this is used from the pseudo
instruction expander pass, which hasn't been pulled in-tree yet.
llvm-svn: 283316
Krzysztof Parzyszek [Wed, 5 Oct 2016 13:15:06 +0000 (13:15 +0000)]
Fix machine operand traversal in ScheduleDAGInstrs::fixupKills
llvm-svn: 283315
Michael Zuckerman [Wed, 5 Oct 2016 12:56:06 +0000 (12:56 +0000)]
[Clang][AVX512][BuiltIn]Adding missing intrinsics move_{sd|ss} to clang
Differential Revision: http://reviews.llvm.org/D21021
llvm-svn: 283314
Luke Drummond [Wed, 5 Oct 2016 12:40:49 +0000 (12:40 +0000)]
Delete unused global in ClangExpressionVariable.cpp
Differential Revision: https://reviews.llvm.org/D24793
llvm-svn: 283313
Dylan McKay [Wed, 5 Oct 2016 12:32:24 +0000 (12:32 +0000)]
[AVR] Update return type of dynamic alloca pass
It was recently changed from 'const char*' to StringRef
llvm-svn: 283312
Dylan McKay [Wed, 5 Oct 2016 11:48:56 +0000 (11:48 +0000)]
[AVR] Add the AVR frame lowering code
Summary: This allows AVR to lower frames into assembly code.
Reviewers: arsenm, kparzysz
Subscribers: japaric, wdng, beanz, mgorny
Differential Revision: https://reviews.llvm.org/D25032
llvm-svn: 283311
Dylan McKay [Wed, 5 Oct 2016 10:28:45 +0000 (10:28 +0000)]
[AVR] Split all of the AVR device definitions into a separate file
We have ~500 lines of subtarget feature definitions, they don't belong
in our main TableGen file.
llvm-svn: 283310
Dylan McKay [Wed, 5 Oct 2016 10:23:38 +0000 (10:23 +0000)]
[AVR] Enable the instruction printer in the target definition
llvm-svn: 283309
Dylan McKay [Wed, 5 Oct 2016 10:20:33 +0000 (10:20 +0000)]
[AVR] Add definitions for the ATTiny102 and ATtiny104 chips
llvm-svn: 283308
Eugene Leviant [Wed, 5 Oct 2016 10:10:45 +0000 (10:10 +0000)]
Do not join sections for relocatable object files
Differential revision: https://reviews.llvm.org/D25232
llvm-svn: 283307
Haojian Wu [Wed, 5 Oct 2016 10:04:13 +0000 (10:04 +0000)]
Overhaul clang-include-fixer.el
General overhaul to fix many coding bugs, simplify the code, and improve readability.
* Clarify documentation strings of user options.
* Say that clang-include-fixer-executable is a file to have auto completion.
* Allow user to select available options for clang-include-fixer-input-format. Turn it into a symbol as it's not a free-form string.
* Remove clang-include-fixer-query-mode. This option was apparently used to select between two different operation modes, which is not a typical use case for user options. Provide two separate commands instead.
* Add a face for the overlay highlighting so that users can customize it.
Move user commands to the front so that readers of the code aren't buried in internal functions.
* Make process calls asynchronous. This is possible here because clang-include-fixer doesn't change files in place. This means input is no longer blocked while clang-include-fixer is running.
* Factor out logic in helper functions to keep functions short.
* Add comments where appropriate.
* Provide an alternative buffer replacement strategy for the case that a single line was inserted (the normal case in the case of clang-include-fixer). This keeps point, markers, and other buffer information intact.
* Use let-alist and association lists instead of property lists to shorten the code.
* Instead of highlighting only the first occurrence of a symbol, highlight all occurrences and move point to the closest one.
* Detect qualified names at point.
* Use filepos-to-bufferpos if available.
* Formatting.
Patch by Philipp Stephani!
llvm-svn: 283306
Eugene Leviant [Wed, 5 Oct 2016 09:36:59 +0000 (09:36 +0000)]
[ELF] make KEEP command recognize file patterns
Differential revision: https://reviews.llvm.org/D25242
llvm-svn: 283305
Alex Lorenz [Wed, 5 Oct 2016 09:27:48 +0000 (09:27 +0000)]
[Sema] Packed member warning: Use the typedef name for anonymous structures
This commit improves the packed member warning by showing the name of the
anonymous structure/union when it was defined within a typedef declaration.
rdar://
28498901
Differential Revision: https://reviews.llvm.org/D25106
llvm-svn: 283304
Artem Dergachev [Wed, 5 Oct 2016 08:47:31 +0000 (08:47 +0000)]
[analyzer] Squash a compile error in r283301.
The constexpr string literal trick isn't supported in MSVC2013.
llvm-svn: 283303
Artem Dergachev [Wed, 5 Oct 2016 08:28:25 +0000 (08:28 +0000)]
[analyzer] Improve "Assuming..." diagnostic pieces for logical operators.
Logical short-circuit operators now act like other branch conditions.
If the symbolic value of the left-hand side is not known to be true or false
(based on the previous execution path), the "Assuming" event piece is added
in order to explain that the analyzer is adding a new assumption.
Additionally, when the assumption is made against the right-hand side of
the logical operator (i.e. when the operator itself acts as a condition
in another CFG terminator), the "Assuming..." piece is written out for the
right-hand side of the operator rather than for the whole operator.
This allows expression-specific diagnostic message text to be constructed.
Differential Revision: https://reviews.llvm.org/D25092
llvm-svn: 283302
Artem Dergachev [Wed, 5 Oct 2016 08:19:49 +0000 (08:19 +0000)]
[analyzer] Add "Assuming..." diagnostic pieces for unsupported conditions.
In the analyzer's path-sensitive reports, when a report goes through a branch
and the branch condition cannot be decided to be definitely true or false
(based on the previous execution path), an event piece is added that tells the
user that a new assumption is added upon the symbolic value of the branch
condition. For example, "Assuming 'a' is equal to 3".
The text of the assumption is hand-crafted in various manners depending on
the AST expression. If the AST expression is too complex and the text of
the assumption fails to be constructed, the event piece is omitted.
This causes loss of information and misunderstanding of the report.
Do not omit the event piece even if the expression is too complex;
add a piece with a generic text instead.
Differential Revision: https://reviews.llvm.org/D23300
llvm-svn: 283301
Simon Atanasyan [Wed, 5 Oct 2016 07:49:18 +0000 (07:49 +0000)]
[ELF] Do not merge sections in case of relocatable object generation
Do not merge sections if generating a relocatable object. It makes
the code simpler because we do not need to update relocations addends
to reflect changes introduced by merging. Instead of that we write
such "merge" sections into separate OutputSections and keep SHF_MERGE
/ SHF_STRINGS flags and sh_entsize value to be able to perform merging
later during a final linking.
Differential Revision: http://reviews.llvm.org/D25066
llvm-svn: 283300
Diana Picus [Wed, 5 Oct 2016 07:13:42 +0000 (07:13 +0000)]
[sanitizers] Update sanitizers test to better match glibc internals
Reapply 282061.
One of the tests relying on sem_t's layout gets the wrong value for versions of
glibc newer than 2.21 on platforms that don't have 64-bit atomics (e.g. ARM).
This commit fixes the test to work with:
* versions of glibc >= 2.21 on platforms with 64-bit atomics: unchanged
* versions of glibc >= 2.21 on platforms without 64-bit atomics: the semaphore
value is shifted by SEM_VALUE_SHIFT (which is set to 1 in glibc's internal
headers)
* versions of glibc < 2.21: unchanged
The logic is complicated a bit by the fact that the sanitizers always pick the
oldest version of the symbol available in glibc, which creates discrepancies
between old platforms which contain several versions od the sem_init symbol, and
newer platforms which contain only one.
See the glibc 2.23 sources:
* sysdeps/nptl/internaltypes.h (struct new_sem for glibc >= 2.21 and
struct old_sem for glibc < 2.21)
* nptl/sem_getvalue.c
This was uncovered on one of the new buildbots that we are trying to move to
production.
Differential Revision: https://reviews.llvm.org/D24766
llvm-svn: 283299
Mehdi Amini [Wed, 5 Oct 2016 05:59:29 +0000 (05:59 +0000)]
Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283285 and re-commit r283275 with
a fix for format("%s", Str); where Str is a StringRef.
llvm-svn: 283298
Dylan McKay [Wed, 5 Oct 2016 05:30:19 +0000 (05:30 +0000)]
[AVR] Add the machine code backend
Summary:
This adds the AVR machine code backend (`AVRAsmBackend.cpp`). This will
allow us to generate machine code from assembled AVR instructions.
Reviewers: arsenm, kparzysz
Subscribers: modocache, japaric, wdng, beanz, mgorny
Differential Revision: https://reviews.llvm.org/D25029
llvm-svn: 283297
Dean Michael Berris [Wed, 5 Oct 2016 05:20:08 +0000 (05:20 +0000)]
[Support][CommandLine] Add cl::getRegisteredSubcommands()
This should allow users of the library to get a range to iterate through
all the subcommands that are registered to the global parser. This
allows users to define subcommands in libraries that self-register to
have dispatch done at a different stage (like main). It allows for
writing code like the following:
for (auto *S : cl::getRegisteredSubcommands()) {
if (*S) {
// Dispatch on S->getName().
}
}
This change also contains tests that show this usage pattern.
Reviewers: zturner, dblaikie, echristo
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D24489
llvm-svn: 283296
Jason Molenda [Wed, 5 Oct 2016 02:29:13 +0000 (02:29 +0000)]
Change Platform::GetRemoteSharedModule so if it's given a ModuleSpec
which specifies a file path and UUID but not an architecture, open
the file at that path and try every one of the architectures in the
file to see if there is a UUID match. Currently we'll pick the
first slice of a multi-architecture file and return that as the
match, and when the UUID doesn't match because it's the wrong
architecture, we'll end up ignoring the file.
<rdar://problem/
28487804>
llvm-svn: 283295
Mehdi Amini [Wed, 5 Oct 2016 01:41:11 +0000 (01:41 +0000)]
Blind attempt to fix windows build after r283290 - Use StringRef in StringSaver API (NFC)
llvm-svn: 283294
Mehdi Amini [Wed, 5 Oct 2016 01:41:06 +0000 (01:41 +0000)]
Use StringRef in ARMConstantPool APIs (NFC)
llvm-svn: 283293
Kyle Butt [Wed, 5 Oct 2016 01:39:29 +0000 (01:39 +0000)]
Revert "Codegen: Tail-duplicate during placement."
This reverts commit
062ace9764953e9769142c1099281a345f9b6bdc.
Issue with loop info and block removal revealed by polly.
I have a fix for this issue already in another patch, I'll re-roll this
together with that fix, and a test case.
llvm-svn: 283292
Mehdi Amini [Wed, 5 Oct 2016 01:37:29 +0000 (01:37 +0000)]
Use StringRef in FastISel API (NFC)
llvm-svn: 283291
Mehdi Amini [Wed, 5 Oct 2016 01:32:41 +0000 (01:32 +0000)]
Use StringRef in StringSaver API (NFC)
llvm-svn: 283290
Jim Ingham [Wed, 5 Oct 2016 01:19:15 +0000 (01:19 +0000)]
The collision of class C and libsystem_c.dylib:C is a failure
worth preserving, but not essential to the purpose of this test
so I broke it into a separate test.
llvm-svn: 283289
Mehdi Amini [Wed, 5 Oct 2016 01:15:04 +0000 (01:15 +0000)]
Use StringRef in ARCRuntimeEntryPoints APIs (NFC)
llvm-svn: 283288
Jim Ingham [Wed, 5 Oct 2016 01:09:43 +0000 (01:09 +0000)]
This test is failing because there's a global symbol "C" in libsystem_c.dylib,
and that is defeating the lookup of the "struct C" here. Adding the bug for that.
llvm-svn: 283287
Kostya Serebryany [Wed, 5 Oct 2016 01:09:40 +0000 (01:09 +0000)]
[libFuzzer] add ShrinkValueProfileTest, move code around, NFC
llvm-svn: 283286
Mehdi Amini [Wed, 5 Oct 2016 01:04:02 +0000 (01:04 +0000)]
Revert "Re-commit "Use StringRef in Support/Darf APIs (NFC)""
One test seems randomly broken: DebugInfo/X86/gnu-public-names.ll
llvm-svn: 283285
Mehdi Amini [Wed, 5 Oct 2016 01:02:34 +0000 (01:02 +0000)]
Use StringRef in MCSectionMachO (NFC)
llvm-svn: 283284
Mehdi Amini [Wed, 5 Oct 2016 01:02:22 +0000 (01:02 +0000)]
Use StringRef in DarwinAsmParser (NFC)
llvm-svn: 283283
Michael Zolotukhin [Wed, 5 Oct 2016 00:44:52 +0000 (00:44 +0000)]
[LoopDistribute] Fix a typo in the pass name.
llvm-svn: 283282
Mehdi Amini [Wed, 5 Oct 2016 00:37:18 +0000 (00:37 +0000)]
Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283278 and re-commit r283275 with
the update to fix the build on the LLDB side.
llvm-svn: 283281
Justin Lebar [Wed, 5 Oct 2016 00:27:38 +0000 (00:27 +0000)]
[CUDA] Add missing ':' to noexcept.cu test.
llvm-svn: 283280
Kostya Serebryany [Wed, 5 Oct 2016 00:25:17 +0000 (00:25 +0000)]
[libFuzzer] clear the corpus elements if they are evicted (i.e. smaller elements with proper coverage are found). Make sure we never try to mutate empty element. Print the corpus size in bytes in the status lines
llvm-svn: 283279
Mehdi Amini [Wed, 5 Oct 2016 00:21:14 +0000 (00:21 +0000)]
Revert "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283275, it broke LLDB Android debug server.
llvm-svn: 283278
Mehdi Amini [Wed, 5 Oct 2016 00:15:18 +0000 (00:15 +0000)]
Use StringRef instead of raw pointers in ARMBuildAttrs (NFC)
llvm-svn: 283277
Jim Ingham [Wed, 5 Oct 2016 00:07:01 +0000 (00:07 +0000)]
Add the new minidump files to the Xcode project.
llvm-svn: 283276
Mehdi Amini [Tue, 4 Oct 2016 23:55:40 +0000 (23:55 +0000)]
Use StringRef in Support/Darf APIs (NFC)
llvm-svn: 283275
Kyle Butt [Tue, 4 Oct 2016 23:54:18 +0000 (23:54 +0000)]
Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.
In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.
This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.
Issue from previous rollback fixed, and a new test was added for that
case as well.
Differential revision: https://reviews.llvm.org/D18226
llvm-svn: 283274
Mehdi Amini [Tue, 4 Oct 2016 23:47:33 +0000 (23:47 +0000)]
Use StringRef in TableGen (NFC)
llvm-svn: 283273
Justin Lebar [Tue, 4 Oct 2016 23:41:49 +0000 (23:41 +0000)]
[CUDA] Mark device functions as nounwind.
Summary:
This prevents clang from emitting 'invoke's and catch statements.
Things previously mostly worked thanks to TryToMarkNoThrow() in
CodeGenFunction. But this is not a proper IPO, and it doesn't properly
handle cases like mutual recursion.
Fixes bug 30593.
Reviewers: tra
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25166
llvm-svn: 283272
Justin Lebar [Tue, 4 Oct 2016 23:41:45 +0000 (23:41 +0000)]
[CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator.
Summary:
This will let us (in a separate patch) allocate deferred diagnostics in
the ASTContext's PartialDiagnostic arena.
Reviewers: rnk
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25260
llvm-svn: 283271
Kostya Serebryany [Tue, 4 Oct 2016 23:39:58 +0000 (23:39 +0000)]
[asan] When protect_shadow_gap=0, set up the shadow for the shadow gap. This is needed to support NVIDIA CUDA drivers. Unfortunately, I don't know how to test it properly with CUDA on a public build bot, so adding a test that emulates the CUDA behavior.
llvm-svn: 283270
Manuel Jacob [Tue, 4 Oct 2016 23:32:42 +0000 (23:32 +0000)]
[C API] Add LLVMConstExactUDiv and LLVMBuildExactUDiv functions.
Summary:
These are analog to the existing LLVMConstExactSDiv and LLVMBuildExactSDiv
functions.
Reviewers: deadalnix, majnemer
Subscribers: majnemer, llvm-commits
Differential Revision: https://reviews.llvm.org/D25259
llvm-svn: 283269
Mehdi Amini [Tue, 4 Oct 2016 23:31:39 +0000 (23:31 +0000)]
Use StringRef in TableGen emitted API for attribute (NFC)
llvm-svn: 283268
Rafael Espindola [Tue, 4 Oct 2016 22:43:38 +0000 (22:43 +0000)]
Update for llvm change.
llvm-svn: 283267
Rafael Espindola [Tue, 4 Oct 2016 22:43:25 +0000 (22:43 +0000)]
Misc improvements to StringTableBuilder.
This patch adds write methods to StringTableBuilder so that it is
easier to change the underlying implementation.
Using the write methods, avoid creating a temporary buffer when using
mmaped output.
It also uses a more compact key in the DenseMap. Overall this produces
a slightly faster lld:
firefox
master 6.
853419709
patch 6.
841968912 1.00167361138x faster
chromium
master 4.
297280174
patch 4.
298712163 1.00033323147x slower
chromium fast
master 1.
802335952
patch 1.
806872459 1.00251701521x slower
the gold plugin
master 0.3247149
patch 0.
321971644 1.00852017888x faster
clang
master 0.
551279945
patch 0.
543733194 1.01387951128x faster
llvm-as
master 0.
032743458
patch 0.
032143478 1.01866568391x faster
the gold plugin fsds
master 0.
350814247
patch 0.
348571741 1.00643341309x faster
clang fsds
master 0.6281672
patch 0.
621130222 1.01132931187x faster
llvm-as fsds
master 0.
030168899
patch 0.
029797155 1.01247582194x faster
scylla
master 3.
104222518
patch 3.
059590248 1.01458766252x faster
llvm-svn: 283266
Alina Sbirlea [Tue, 4 Oct 2016 22:39:53 +0000 (22:39 +0000)]
[cpu-detection] Copy simplified version of get_cpuid_max to remove dependency to clang's implementation
Summary:
Attempting to fix PR30384.
Take the same approach as in compiler_rt and add a simplified version of __get_cpuid_max.
Including cpuid.h is no longer needed.
Reviewers: echristo, joerg
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D24597
llvm-svn: 283265
Albert Gutowski [Tue, 4 Oct 2016 22:29:49 +0000 (22:29 +0000)]
Separate builtins for x84-64 and i386; implement __mulh and __umulh
Summary: We need x86-64-specific builtins if we want to implement some of the MS intrinsics - winnt.h contains definitions of some functions for i386, but not for x86-64 (for example _InterlockedOr64), which means that we cannot treat them as builtins for both i386 and x86-64, because then we have definitions of builtin functions in winnt.h on i386.
Reviewers: thakis, majnemer, hans, rnk
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24598
llvm-svn: 283264
Dimitar Vlahovski [Tue, 4 Oct 2016 21:55:47 +0000 (21:55 +0000)]
xfailing tests for Minidump plugin
the tests are failing on the buildbot because there is an extra frame
(maybe) on the call stack.
Will investigate tomorrow.
llvm-svn: 283263
Tamas Berghammer [Tue, 4 Oct 2016 21:32:46 +0000 (21:32 +0000)]
Fix the decorator of TestBreakpointCaseSensitivity
llvm-svn: 283262
Zachary Turner [Tue, 4 Oct 2016 21:27:09 +0000 (21:27 +0000)]
Make building the clang-tidy VS extension less spammy.
The package that strong name signs the 3rd party references
spams a ton of output to the log, making the build really ugly.
Make this quiet.
llvm-svn: 283261
Eric Fiselier [Tue, 4 Oct 2016 21:25:51 +0000 (21:25 +0000)]
[libcxx] [test] Guard __has_include usage with a macro
Summary: There's a macro scheme already being used for __has_feature etc. Use it for __has_include too, which makes MSVC happy (it doesn't support __has_include yet, and unguarded use explodes horribly).
Reviewers: mclow.lists, EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25251
llvm-svn: 283260
Dimitar Vlahovski [Tue, 4 Oct 2016 21:02:13 +0000 (21:02 +0000)]
Adding a new Minidump post-mortem debugging plugin
Summary:
This plugin resembles the already existing Windows-only Minidump plugin.
The WinMinidumpPlugin uses the Windows API for parsing Minidumps
while this plugin is cross-platform because it includes a Minidump
parser (which is already commited)
It is able to produce a backtrace, to read the general puprose regiters,
inspect local variables, show image list, do memory reads, etc.
For now the only arch that this supports is x86 64 bit
This is because I have only written a register context for that arch.
Others will come in next CLs.
I copied the WinMinidump tests and adapted them a little bit for them to
work with the new plugin (and they pass)
I will add more tests, aiming for better code coverage.
There is still functionality to be added, see TODOs in code.
Reviewers: labath, zturner
Subscribers: beanz, mgorny, amccarth, lldb-commits, modocache
Differential Revision: https://reviews.llvm.org/D25196
llvm-svn: 283259
Hans Wennborg [Tue, 4 Oct 2016 21:01:04 +0000 (21:01 +0000)]
clang-cl: Make /Fo apply also when using -flto
llvm-svn: 283258
Hans Wennborg [Tue, 4 Oct 2016 21:01:02 +0000 (21:01 +0000)]
clang-cl: Use the .obj file extension also in LTO mode
llvm-svn: 283257
Hans Wennborg [Tue, 4 Oct 2016 21:01:00 +0000 (21:01 +0000)]
clang-cl: expose the -fuse-ld option
llvm-svn: 283256
Hans Wennborg [Tue, 4 Oct 2016 21:00:57 +0000 (21:00 +0000)]
clang-cl: Expose the -flto option
We could hook up /GL as an alias for -flto, but that might be
confusing, as clang-cl in that mode would not be drop-in compatible
with cl.exe /GL, as it requires the linker to be lld.
Exposing -flto seems like a less confusing way to expose this
functionality.
llvm-svn: 283255
David L Kreitzer [Tue, 4 Oct 2016 20:57:19 +0000 (20:57 +0000)]
Revert r283248. It caused failures in the hexagon buildbots.
llvm-svn: 283254
Anna Zaks [Tue, 4 Oct 2016 20:49:31 +0000 (20:49 +0000)]
[analyzer] Add PostStmt callback for ArraySubscriptExpr
A patch by Jan Smets!
Differential Revision: https://reviews.llvm.org/D25009
llvm-svn: 283253
Sanjay Patel [Tue, 4 Oct 2016 20:46:43 +0000 (20:46 +0000)]
[Target] move reciprocal estimate settings from TargetOptions to TargetLowering
The motivation for the change is that we can't have pseudo-global settings for
codegen living in TargetOptions because that doesn't work with LTO.
Ideally, these reciprocal attributes will be moved to the instruction-level via
FMF, metadata, or something else. But making them function attributes is at least
an improvement over the current state.
The ingredients of this patch are:
Remove the reciprocal estimate command-line debug option.
Add TargetRecip to TargetLowering.
Remove TargetRecip from TargetOptions.
Clean up the TargetRecip implementation to work with this new scheme.
Set the default reciprocal settings in TargetLoweringBase (everything is off).
Update the PowerPC defaults, users, and tests.
Update the x86 defaults, users, and tests.
Note that if this patch needs to be reverted, the related clang patch checked in
at r283251 should be reverted too.
Differential Revision: https://reviews.llvm.org/D24816
llvm-svn: 283252
Sanjay Patel [Tue, 4 Oct 2016 20:44:05 +0000 (20:44 +0000)]
[clang] make reciprocal estimate codegen a function attribute
The motivation for the change is that we can't have pseudo-global settings
for codegen living in TargetOptions because that doesn't work with LTO.
Ideally, these reciprocal attributes will be moved to the instruction-level
via FMF, metadata, or something else. But making them function attributes is
at least an improvement over the current state.
I'm committing this patch ahead of the related LLVM patch to avoid bot failures,
but if that patch needs to be reverted, then this should be reverted too.
Differential Revision: https://reviews.llvm.org/D24815
llvm-svn: 283251
Kevin Enderby [Tue, 4 Oct 2016 20:37:43 +0000 (20:37 +0000)]
Next set of additional error checks for invalid Mach-O files for the
load commands that uses the MachO::encryption_info_command and
MachO::encryption_info_command types but not used in llvm libObject
code but used in llvm tool code.
This includes just LC_ENCRYPTION_INFO and
LC_ENCRYPTION_INFO_64 load commands.
llvm-svn: 283250
Vedant Kumar [Tue, 4 Oct 2016 20:36:04 +0000 (20:36 +0000)]
[ubsan] Disable bounds-check for flexible array ivars
This eliminates a class of false positives for -fsanitize=array-bounds
on instrumented ObjC projects.
Differential Revision: https://reviews.llvm.org/D22227
llvm-svn: 283249
David L Kreitzer [Tue, 4 Oct 2016 20:31:32 +0000 (20:31 +0000)]
[safestack] Requires a valid TargetMachine to be passed to the SafeStack pass.
Patch by Michael LeMay
Differential revision: http://reviews.llvm.org/D24896
llvm-svn: 283248
Michal Gorny [Tue, 4 Oct 2016 20:25:37 +0000 (20:25 +0000)]
[cmake] Make LIT_COMMAND configurable and improve fallback support
Make LIT_COMMAND configurable, use source tree only when actually
available and extend the default search to other common executable names
'lit.py' and 'lit', in order to increase uniformity between all LLVM
projects and support using installed lit.
Changing the conditional used to determine whether in-tree or external
lit is being used covers the case when LLVM_MAIN_SRC_DIR is defined but
does not exist (anymore). In this case, the functions falls back to
looking for installed lit rather than attempting to use a non-existing
path. The same conditional is used in clang already.
Making LIT_COMMAND a cache variable in case the source tree variant is
used serves two purposes. Firstly, it increases uniformity between
the two branches since find_program() implicitly makes LIT_COMMAND
a cache variable. Secondly, it allows overriding the lit executable used
to run the tests when the LLVM source tree is provided. Gentoo is
planning to use this to use installed (and byte-compiled) lit instead of
re-compiling it in every LLVM project.
Extending default search is meant to increase uniformity between
different LLVM projects. The 'lit.py' name is already used by a few of
them, and 'lit' is the name used by utils/lit/setup.py when installing.
Differential Revision: https://reviews.llvm.org/D25076
llvm-svn: 283247
Daniel Jasper [Tue, 4 Oct 2016 20:18:25 +0000 (20:18 +0000)]
clang-format: Fix bad multi-variable for-loop formatting.
Before:
for (int*p, *q; p != q; p = p->next) {
After:
for (int *p, *q; p != q; p = p->next) {
llvm-svn: 283246
Tobias Grosser [Tue, 4 Oct 2016 19:48:40 +0000 (19:48 +0000)]
Build and run isl_test as part of check-polly
Running isl tests is important to gain confidence that the isl build we created
works as expected. Besides the actual isl tests, there are also isl AST
generation tests shipped with isl. This change only adds support for the isl
unit tests. AST generation test support is left for a later commit.
There is a choice to run tests directly through the build system or in the
context of lit. We choose to run tests as part of lit to as this allows us to
easily set environment variables, print output only on error and generally run
the tests directly from the lit command.
Reviewers: brad.king, Meinersbur
Subscribers: modocache, brad.king, pollydev, beanz, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D25155
llvm-svn: 283245
Zachary Turner [Tue, 4 Oct 2016 19:33:13 +0000 (19:33 +0000)]
[Support] Add case-insensitive versions of StringSwitch members.
This adds support for CaseLower, CasesLower, StartsWithLower, and
EndsWithLower.
Differential revision: https://reviews.llvm.org/D24686
llvm-svn: 283244
Matthias Braun [Tue, 4 Oct 2016 19:28:21 +0000 (19:28 +0000)]
AArch64: Macrofusion: Split features, add missing combinations.
AArch64InstrInfo::shouldScheduleAdjacent() determines whether two
instruction can benefit from macroop fusion on apple CPUs. The list
turned out to be incomplete:
- the "rr" variants of the instructions were missing
- even the "rs" variants can have shift value == 0 and behave like the
"rr" variants
This also splits the MacropFusion target feature into
ArithmeticBccFusion and ArithmeticCbzFusion.
Differential Revision: https://reviews.llvm.org/D25142
llvm-svn: 283243
Mike Aizatsky [Tue, 4 Oct 2016 19:19:16 +0000 (19:19 +0000)]
[sancov] documentation update after r283241
llvm-svn: 283242
Mike Aizatsky [Tue, 4 Oct 2016 19:18:23 +0000 (19:18 +0000)]
[sancov] renamed symcov-report-server to coverage-report-server
llvm-svn: 283241
Anna Zaks [Tue, 4 Oct 2016 19:02:53 +0000 (19:02 +0000)]
[asan] Switch to using dynamic shadow offset on iOS
The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset.
Differential Revision: https://reviews.llvm.org/D25218
llvm-svn: 283240
Anna Zaks [Tue, 4 Oct 2016 19:02:29 +0000 (19:02 +0000)]
[asan] LLVM: Switch to using dynamic shadow offset on iOS
The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset.
This is the LLVM counterpart of https://reviews.llvm.org/D25218
Differential Revision: https://reviews.llvm.org/D25219
llvm-svn: 283239
Francis Ricci [Tue, 4 Oct 2016 18:48:00 +0000 (18:48 +0000)]
Improvements to testing blacklist
Summary:
This patch is necessary because individual test cases are not required
to have unique names. Therefore, test cases must now
be specified explicitly in the form <TestCase>.<TestMethod>.
Because it works by regex matching, passing just <TestCase> will
still disable an entire file.
This also allows for multiple exclusion files to be specified.
Reviewers: zturner, labath, jingham, tfiala
Subscribers: lldb-commits, sas
Differential Revision: https://reviews.llvm.org/D24988
llvm-svn: 283238
Tamas Berghammer [Tue, 4 Oct 2016 18:35:39 +0000 (18:35 +0000)]
Fix FixupEnvironment on Android after the Args refactor
llvm-svn: 283237
Hal Finkel [Tue, 4 Oct 2016 18:13:45 +0000 (18:13 +0000)]
Don't filter diagnostics written as YAML to the output file
The purpose of the YAML diagnostic output file is to collect information on
optimizations performed, or not performed, for later processing by tools that
help users (and compiler developers) understand how code was optimized. As
such, the diagnostics that appear in the file should not be coupled to what a
user might want to see summarized for them as the compiler runs, and in fact,
because the user likely does not know what optimization diagnostics their tools
might want to use, the user cannot provide a useful filter regardless. As such,
we shouldn't filter the diagnostics going to the output file.
Differential Revision: https://reviews.llvm.org/D25224
llvm-svn: 283236
Reid Kleckner [Tue, 4 Oct 2016 18:10:23 +0000 (18:10 +0000)]
Test what happens when tag lookup and redeclaration lookup disagree
Clang has a diagnostic for the what happens when an elaborated type
implicitly creates a tag declaration and the initial tag lookup fails,
but the redeclaration lookup succeeds and finds a non-tag type. However,
it wasn't tested, and looked like dead code. After much staring, we
discovered how to exercise it, and are now committing the test for
posterity.
In this example, the tag lookup will not find A, but then when we go to
insert a declaration of A at global scope, we discover the template
friend, which is not a tag type.
struct C {
template <typename> friend struct A;
};
struct B {
struct A *p;
};
llvm-svn: 283235
Chris Bieneman [Tue, 4 Oct 2016 17:44:28 +0000 (17:44 +0000)]
[CMake] Exclude intrinsics_gen from LLVM_COMMON_DEPENDS in LLVMConfig.cmake
CMake requires that all targets expressed as dependencies exist, so we can't have intrinsics_gen in LLVM_COMMON_DEPENDS when it is written out, otherwise projects building out of tree will have CMake errors.
llvm-svn: 283234
Michael Kruse [Tue, 4 Oct 2016 17:33:39 +0000 (17:33 +0000)]
[ScopInfo] Add -polly-unprofitable-scalar-accs option.
With this option one can disable the heuristic that assumes that statements with
a scalar write access cannot be profitably optimized. Such a statement instances
necessarily have WAW-dependences to itself. With DeLICM scalar accesses can be
changed to array accesses, which can avoid these WAW-dependence.
llvm-svn: 283233
Michael Kruse [Tue, 4 Oct 2016 17:33:34 +0000 (17:33 +0000)]
[ScopInfo] Scalar access do not have indirect base pointers.
ScopArrayInfo used to determine base pointer origins by looking up whether the
base pointer is a load. The "base pointer" for scalar accesses is the
llvm::Value being accessed. This is only a symbolic base pointer, it
represents the alloca variable (.s2a or .phiops) generated for it at code
generation.
This patch disables determining base pointer origin for scalars.
A test case where this caused a crash will be added in the next commit. In that
test SAI tried to get the origin base pointer that was only declared later,
therefore not existing. This is probably only possible for scalars used in
PHINode incoming blocks.
llvm-svn: 283232
Adam Nemet [Tue, 4 Oct 2016 17:05:04 +0000 (17:05 +0000)]
Serialize remark argument as a mapping to get proper quotation for the value.
llvm-svn: 283231
Adam Nemet [Tue, 4 Oct 2016 17:05:01 +0000 (17:05 +0000)]
Allow derived classes of OptimizationRemarkAnalysis in YAML
llvm-svn: 283230
Rui Ueyama [Tue, 4 Oct 2016 16:47:49 +0000 (16:47 +0000)]
Add a comment.
llvm-svn: 283229
Alex Lorenz [Tue, 4 Oct 2016 16:06:37 +0000 (16:06 +0000)]
[Sema] Format a comment line so that it fits 80 columns. NFC
llvm-svn: 283228
Reid Kleckner [Tue, 4 Oct 2016 15:57:49 +0000 (15:57 +0000)]
[MS] Move hex long long sign compat hack to -fms-compatibility
Treating large 0x*LL literals as signed instead of unsigned is not a
conforming language extension, so move it out of -fms-extensions.
Came up in PR30605
llvm-svn: 283227
George Rimar [Tue, 4 Oct 2016 15:19:20 +0000 (15:19 +0000)]
[ELF] - Do not crash on MIPS if there is no object files in input.
If we have input without object files, for example if we have only .so
code crashes in checkFlags(), getPicFlags(), getArchFlags() functions.
Patch fixes the issue.
Differential revision: https://reviews.llvm.org/D25237
llvm-svn: 283226
Alexey Bataev [Tue, 4 Oct 2016 15:07:23 +0000 (15:07 +0000)]
[SLPVectorizer] Add a test with non-vectorizable IR.
llvm-svn: 283225
Aaron Ballman [Tue, 4 Oct 2016 14:48:05 +0000 (14:48 +0000)]
Fix some false-positives with cppcoreguidelines-pro-type-member-init. Handle classes with default constructors that are defaulted or are not present in the AST.
Classes with virtual methods or virtual bases are not trivially default constructible, so their members and bases need to be initialized.
Patch by Malcolm Parsons.
llvm-svn: 283224
David Sheinkman [Tue, 4 Oct 2016 14:41:36 +0000 (14:41 +0000)]
[OpenMP] fix segfault when a variable referenced in reduction clause is a reference parameter\nDifferential Revision: reviews.llvm.org/D24524
llvm-svn: 283223
Marshall Clow [Tue, 4 Oct 2016 14:39:58 +0000 (14:39 +0000)]
Mark #2759 as ready and #2755 as complete
llvm-svn: 283222
Michael Kruse [Tue, 4 Oct 2016 14:14:33 +0000 (14:14 +0000)]
[ScopInfo] Make simplifySCoP() public. NFC.
This function may need to be called after the scop construction. The upcoming
DeLICM will use this to cleanup statement that all write accesses have been
removed from.
llvm-svn: 283221
Marshall Clow [Tue, 4 Oct 2016 14:08:50 +0000 (14:08 +0000)]
Mark #2598 as ready
llvm-svn: 283220
Anna Thomas [Tue, 4 Oct 2016 13:48:37 +0000 (13:48 +0000)]
[RS4GC] Handle ShuffleVector instruction in findBasePointer
Summary:
This patch modifies the findBasePointer to handle the shufflevector instruction.
Tests run: RS4GC tests, local downstream tests.
Reviewers: reames, sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25197
llvm-svn: 283219
Marshall Clow [Tue, 4 Oct 2016 13:41:56 +0000 (13:41 +0000)]
Mark #2739 as ready
llvm-svn: 283218
Davide Italiano [Tue, 4 Oct 2016 13:16:00 +0000 (13:16 +0000)]
[ThinLTO] Spell `llvm-ar` correctly.
llvm-svn: 283217