Aaron Ballman [Wed, 26 Nov 2014 16:17:20 +0000 (16:17 +0000)]
Adding an explicit triple to this test to get it to pass all build bots.
llvm-svn: 222837
Evgeniy Stepanov [Wed, 26 Nov 2014 15:44:15 +0000 (15:44 +0000)]
[asan] Disable preload tests on Android.
They don't test what they claim to because LD_PRELOAD applies to "not" instead
of the actual test binary. And all Android tests run with LD_PRELOAD anyway.
llvm-svn: 222835
Anastasia Stulova [Wed, 26 Nov 2014 15:36:41 +0000 (15:36 +0000)]
[OpenCL] Implemented restrictions for pointer conversions specified in OpenCL v2.0.
OpenCL v2.0 s6.5.5 restricts conversion of pointers to different address spaces:
- the named address spaces (__global, __local, and __private) => __generic - implicitly converted;
- __generic => named - with an explicit cast;
- named <=> named - disallowed;
- __constant <=> any other - disallowed.
llvm-svn: 222834
Aaron Ballman [Wed, 26 Nov 2014 15:27:39 +0000 (15:27 +0000)]
Reverting r222828 and r222810-r222812 as they broke the build on Windows.
http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/11753
llvm-svn: 222833
Anastasia Stulova [Wed, 26 Nov 2014 14:14:05 +0000 (14:14 +0000)]
[OpenCL] Generic address space parsing and diagnostics test (forgotten previously)
llvm-svn: 222832
Anastasia Stulova [Wed, 26 Nov 2014 14:10:06 +0000 (14:10 +0000)]
[OpenCL] Generic address space has been added in OpenCL v2.0.
To support it in the frontend, the following has been added:
- generic address space type attribute;
- documentation for the OpenCL address space attributes;
- parsing of __generic(generic) keyword;
- test code for the parser and diagnostics.
llvm-svn: 222831
Aaron Ballman [Wed, 26 Nov 2014 13:55:55 +0000 (13:55 +0000)]
Removing a spurious semicolon; NFC
llvm-svn: 222830
Daniel Jasper [Wed, 26 Nov 2014 12:31:19 +0000 (12:31 +0000)]
clang-format: [Java] Improve formatting of throws declarations.
Before:
public void doSoooooooooo() throws LoooooooooongException,
LooooooooooongException {}
After:
public void doSoooooooooo()
throws LoooooooooongException, LooooooooooongException {}
llvm-svn: 222829
Evgeniy Stepanov [Wed, 26 Nov 2014 12:26:03 +0000 (12:26 +0000)]
Add missing "override".
Fixes compilation failure in r222810.
llvm-svn: 222828
Daniel Jasper [Wed, 26 Nov 2014 12:23:10 +0000 (12:23 +0000)]
clang-format: [Java] Improve cast detection.
Before:
a[b >> 1] = (byte)(c() << 4);
After:
a[b >> 1] = (byte) (c() << 4);
llvm-svn: 222827
Viktor Kutuzov [Wed, 26 Nov 2014 11:38:45 +0000 (11:38 +0000)]
[Asan] Fix the heavy_uar_test.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D6406
llvm-svn: 222826
Daniel Jasper [Wed, 26 Nov 2014 11:20:43 +0000 (11:20 +0000)]
clang-format: [Java] Fix breaking after annotations.
Before:
@Annotation1 // comment
@Annotation2 class C {}
After:
@Annotation1 // comment
@Annotation2
class C {}
llvm-svn: 222825
Will Newton [Wed, 26 Nov 2014 11:00:03 +0000 (11:00 +0000)]
Rename R_AARCH64_TLSDESC_ADR_PAGE to R_AARCH64_TLSDESC_ADR_PAGE21
llvm-svn: 222823
Viktor Kutuzov [Wed, 26 Nov 2014 10:51:49 +0000 (10:51 +0000)]
[Msan] Exclude non-FreeBSD interceptors on FreeBSD
Differential Revision: http://reviews.llvm.org/D6404
llvm-svn: 222822
Will Newton [Wed, 26 Nov 2014 10:49:18 +0000 (10:49 +0000)]
Update AArch64 ELF relocations to ABI 1.0
This mostly entails adding relocations, however there are a couple of
changes to existing relocations:
1. R_AARCH64_NONE is defined to be zero rather than 256
R_AARCH64_NONE has been defined to be zero for a long time elsewhere
e.g. binutils and glibc since the submission of the AArch64 port in
2012 so this is required for compatibility.
2. R_AARCH64_TLSDESC_ADR_PAGE renamed to R_AARCH64_TLSDESC_ADR_PAGE21
I don't think there is any way for relocation names to leak out of LLVM
so this should not break anything.
Tested with check-all with no regressions.
llvm-svn: 222821
Elena Demikhovsky [Wed, 26 Nov 2014 10:46:49 +0000 (10:46 +0000)]
AVX-512: Scalar ERI intrinsics
including SAE mode and memory operand.
Added AVX512_maskable_scalar template, that should cover all scalar instructions in the future.
The main difference between AVX512_maskable_scalar<> and AVX512_maskable<> is using X86select instead of vselect.
I need it, because I can't create vselect node for MVT::i1 mask for scalar instruction.
http://reviews.llvm.org/D6378
llvm-svn: 222820
Daniel Jasper [Wed, 26 Nov 2014 10:43:58 +0000 (10:43 +0000)]
clang-format: Add SFS_Empty to only empty functions on a single line.
Activated for and tested by Google's Java style.
This fixes llvm.org/PR21667.
llvm-svn: 222819
Viktor Kutuzov [Wed, 26 Nov 2014 10:42:02 +0000 (10:42 +0000)]
[Msan] Check returning value of DTLS_Get()
Differential Revision: http://reviews.llvm.org/D6403
llvm-svn: 222818
Will Newton [Wed, 26 Nov 2014 10:36:03 +0000 (10:36 +0000)]
Update ARM ELF relocations to ABI 2.09
Add R_ARM_IRELATIVE.
llvm-svn: 222817
Hafiz Abid Qadeer [Wed, 26 Nov 2014 10:19:32 +0000 (10:19 +0000)]
Re-order the base classes to prevent a crash in Linux.
In the initialization list of IOHandlerConfirm, *this is basically casting
IOHandlerConfirm to its base IOHandlerDelegate and passing it to constructor of
IOHandlerEditline which uses it and crashes as constructor of IOHandlerDelegate
is still not called. Re-ordering the base classes makes sure that constructor of
IOHandlerDelegate runs first.
It would be good to have a test case for this case too.
llvm-svn: 222816
Will Newton [Wed, 26 Nov 2014 09:51:54 +0000 (09:51 +0000)]
Fix comment in AArch64 ELF backend
llvm-svn: 222814
Daniel Jasper [Wed, 26 Nov 2014 08:17:08 +0000 (08:17 +0000)]
clang-format: [Java] Support Foo.class;
Before:
SomeClass.
class.getName();
After:
SomeClass.class.getName();
This fixes llvm.org/PR21665.
llvm-svn: 222813
Lang Hames [Wed, 26 Nov 2014 07:39:03 +0000 (07:39 +0000)]
[MCJIT] Re-enable GDB registration (temporarily disabled in r222811), but check
that we actually have an object to register first.
For MachO objects, RuntimeDyld::LoadedObjectInfo::getObjectForDebug returns an
empty OwningBinary<ObjectFile> which was causing crashes in the GDB registration
code.
llvm-svn: 222812
Lang Hames [Wed, 26 Nov 2014 07:25:26 +0000 (07:25 +0000)]
[MCJIT] Temporarily disable automatic JIT debugger registration.
The RuntimeDyld cleanup patch r222810 turned on GDB registration for MachO
objects. I expected this to be harmless, but it seems to have broken on
MacsOS. Temporarily disabling debugger registration while I dig in to what's
gone wrong.
llvm-svn: 222811
Lang Hames [Wed, 26 Nov 2014 06:53:26 +0000 (06:53 +0000)]
[MCJIT] Clean up RuntimeDyld's quirky object-ownership/modification scheme.
Previously, when loading an object file, RuntimeDyld (1) took ownership of the
ObjectFile instance (and associated MemoryBuffer), (2) potentially modified the
object in-place, and (3) returned an ObjectImage that managed ownership of the
now-modified object and provided some convenience methods. This scheme accreted
over several years as features were tacked on to RuntimeDyld, and was both
unintuitive and unsafe (See e.g. http://llvm.org/PR20722).
This patch fixes the issue by removing all ownership and in-place modification
of object files from RuntimeDyld. Existing behavior, including debugger
registration, is preserved.
Noteworthy changes include:
(1) ObjectFile instances are now passed to RuntimeDyld by const-ref.
(2) The ObjectImage and ObjectBuffer classes have been removed entirely, they
existed to model ownership within RuntimeDyld, and so are no longer needed.
(3) RuntimeDyld::loadObject now returns an instance of a new class,
RuntimeDyld::LoadedObjectInfo, which can be used to construct a modified
object suitable for registration with the debugger, following the existing
debugger registration scheme.
(4) The JITRegistrar class has been removed, and the GDBRegistrar class has been
re-written as a JITEventListener.
This should fix http://llvm.org/PR20722 .
llvm-svn: 222810
Craig Topper [Wed, 26 Nov 2014 04:11:14 +0000 (04:11 +0000)]
Remove neverHasSideEffects support from TableGen CodeGenInstruction. Everyone should use hasSideEffects now.
llvm-svn: 222809
Richard Smith [Wed, 26 Nov 2014 03:44:47 +0000 (03:44 +0000)]
Try to make the modules buildbot happy again.
llvm-svn: 222808
Richard Smith [Wed, 26 Nov 2014 03:26:53 +0000 (03:26 +0000)]
[c++1z] Most of N4268 (allow constant evaluation for non-type template arguments).
We don't yet support pointer-to-member template arguments that have undergone
pointer-to-member conversions, mostly because we don't have a mangling for them yet.
llvm-svn: 222807
Eric Christopher [Wed, 26 Nov 2014 02:57:33 +0000 (02:57 +0000)]
Reformat with gofmt.
llvm-svn: 222806
Eric Christopher [Wed, 26 Nov 2014 02:54:24 +0000 (02:54 +0000)]
Make SetMCJITOptimizationLevel more of a method and pass options
as a reference. Move closer to the type.
llvm-svn: 222805
Eric Christopher [Wed, 26 Nov 2014 02:27:46 +0000 (02:27 +0000)]
Make sure that the go bindings call LLVMInitializeMCJITCompilerOptions
so that they initialize the code generation model to the correct
(non-zero) default model.
llvm-svn: 222804
Alexey Samsonov [Wed, 26 Nov 2014 01:48:39 +0000 (01:48 +0000)]
[Sanitizer] Bump kMaxPathLength to 4096 and use it more extensively instead of hardcoded constants
llvm-svn: 222803
Rui Ueyama [Wed, 26 Nov 2014 01:45:24 +0000 (01:45 +0000)]
Use SafelyCloseFileDescriptor instead of close.
Opening a file using openFileForWrite and closing it using close
was asymmetric. It also had a subtle portability problem (details are
described in the commit message for r219189).
llvm-svn: 222802
Craig Topper [Wed, 26 Nov 2014 00:46:26 +0000 (00:46 +0000)]
Replace neverHasSideEffects=1 with hasSideEffects=0 in all .td files.
llvm-svn: 222801
Alexey Samsonov [Wed, 26 Nov 2014 00:23:51 +0000 (00:23 +0000)]
[ASan] Fix typo in test
llvm-svn: 222800
Rui Ueyama [Wed, 26 Nov 2014 00:21:27 +0000 (00:21 +0000)]
[PECOFF] Properly close a file descriptor.
This was basically benign resource leak on Unix, but on Windows
it could cause builds to fail because opened file descriptor
prevents other processes from moving or removing the file.
llvm-svn: 222799
David Majnemer [Tue, 25 Nov 2014 23:44:32 +0000 (23:44 +0000)]
CodeGen: Fix emission of __atomic_compare_exchange
We (wrongly) discarded the return value of the call.
llvm-svn: 222798
Kaelyn Takata [Tue, 25 Nov 2014 23:04:09 +0000 (23:04 +0000)]
Ensure that any TypoExprs in the arguments to bultins with custom type
checking are handled before the custom type checking is performed.
Fixes PR21669.
llvm-svn: 222797
Simon Pilgrim [Tue, 25 Nov 2014 22:34:59 +0000 (22:34 +0000)]
[X86][SSE] Improvements to byte shift shuffle matching
Since (v)pslldq / (v)psrldq instructions resolve to a single input argument it is useful to match it much earlier than we currently do - this prevents more complicated shuffles (notably insertion into a zero vector) matching before it.
Differential Revision: http://reviews.llvm.org/D6409
llvm-svn: 222796
Colin LeMahieu [Tue, 25 Nov 2014 22:15:44 +0000 (22:15 +0000)]
[Hexagon] Adding add64 and sub64 instructions.
llvm-svn: 222795
Eric Fiselier [Tue, 25 Nov 2014 21:57:41 +0000 (21:57 +0000)]
Fixes to get libc++ building on sun solaris. Patch from C Bergstrom.
llvm-svn: 222794
Colin LeMahieu [Tue, 25 Nov 2014 21:39:57 +0000 (21:39 +0000)]
Reverting 222792
llvm-svn: 222793
Colin LeMahieu [Tue, 25 Nov 2014 21:30:28 +0000 (21:30 +0000)]
[Hexagon] Adding compare with immediate instructions.
llvm-svn: 222792
Colin LeMahieu [Tue, 25 Nov 2014 21:23:07 +0000 (21:23 +0000)]
[Hexagon] Adding NOP encoding bits.
llvm-svn: 222791
Peter Collingbourne [Tue, 25 Nov 2014 21:05:04 +0000 (21:05 +0000)]
Go bindings: add DIBuilder.InsertValueAtEnd
Expose llvm::DIBuilder::insertDbgValueIntrinsic as
DIBuilder.InsertValueAtEnd in the Go bindings, to support attaching
debug metadata to register values.
Patch by Andrew Wilkins!
Differential Revision: http://reviews.llvm.org/D6374
llvm-svn: 222790
Matt Arsenault [Tue, 25 Nov 2014 21:03:22 +0000 (21:03 +0000)]
R600/SI: Only use one DEBUG()
llvm-svn: 222789
Rafael Espindola [Tue, 25 Nov 2014 20:56:56 +0000 (20:56 +0000)]
This test requires asserts because of -stats.
Sorry about that.
llvm-svn: 222788
Rafael Espindola [Tue, 25 Nov 2014 20:52:49 +0000 (20:52 +0000)]
gold plugin: call llvm_shutdown so that -stats works.
llvm-svn: 222787
Cameron McInally [Tue, 25 Nov 2014 20:41:51 +0000 (20:41 +0000)]
[AVX512] Add 512b integer shift by variable intrinsics and patterns.
llvm-svn: 222786
Colin LeMahieu [Tue, 25 Nov 2014 20:22:24 +0000 (20:22 +0000)]
[Hexagon] [NFC] Adding trailing whitespace to test files.
llvm-svn: 222785
Colin LeMahieu [Tue, 25 Nov 2014 20:20:09 +0000 (20:20 +0000)]
[Hexagon] Adding C2_mux instruction.
llvm-svn: 222784
Craig Topper [Tue, 25 Nov 2014 20:11:34 +0000 (20:11 +0000)]
Remove unncessary check for Int_* and *_Int in AsmMatcherEmitter. These are all marked isCodeGenOnly these days.
llvm-svn: 222783
Craig Topper [Tue, 25 Nov 2014 20:11:31 +0000 (20:11 +0000)]
Use range-based for loops.
llvm-svn: 222782
Craig Topper [Tue, 25 Nov 2014 20:11:29 +0000 (20:11 +0000)]
Remove dead code.
llvm-svn: 222781
Craig Topper [Tue, 25 Nov 2014 20:11:27 +0000 (20:11 +0000)]
Remove unused MaxSize variable.
llvm-svn: 222780
Craig Topper [Tue, 25 Nov 2014 20:11:25 +0000 (20:11 +0000)]
Move a vector instead of copying it.
llvm-svn: 222779
Craig Topper [Tue, 25 Nov 2014 20:11:23 +0000 (20:11 +0000)]
Remove space before tab in all AVX512 mnemonic strings.
llvm-svn: 222778
Rui Ueyama [Tue, 25 Nov 2014 19:51:28 +0000 (19:51 +0000)]
[PECOFF] Ignore /maxilkfile option.
.ilk file is a file for incremental linking. We don't create nor use
that file.
/MAXILKFILE is an undocumented option to specify the maximum size
of the .ilk file, IIUC. We should just ignore the option.
llvm-svn: 222777
Zachary Turner [Tue, 25 Nov 2014 19:03:19 +0000 (19:03 +0000)]
When a process stops, set the StopInfo object on Windows.
llvm-svn: 222776
Zachary Turner [Tue, 25 Nov 2014 19:03:08 +0000 (19:03 +0000)]
Disable GetSTDOUT, GetSTDERR, and PutSTDIN on Windows.
These methods are difficult / impossible to implement in a way
that is semantically equivalent to the expectations set by LLDB
for using them. In the future, we should find an alternative
strategy (for example, i/o redirection) for achieving similar
functionality, and hopefully deprecate these APIs someday.
llvm-svn: 222775
Zachary Turner [Tue, 25 Nov 2014 19:02:47 +0000 (19:02 +0000)]
Add some more comments explaining the purpose of some Register classes.
llvm-svn: 222774
Rui Ueyama [Tue, 25 Nov 2014 19:01:01 +0000 (19:01 +0000)]
[PECOFF] Create an empty PDB file if debug option is enabled.
There are many build files in the wild that depend on the fact that
link.exe produces a PDB file if /DEBUG option is given. They fail
if the file is not created.
This patch is to make LLD create an empty (dummy) file to satisfy
such build targets. This doesn't do anything other than "touching"
the file.
If a target depends on the content of the PDB file, this workaround
is no help, of course. Otherwise this patch should help build some
stuff.
llvm-svn: 222773
Hans Wennborg [Tue, 25 Nov 2014 18:45:23 +0000 (18:45 +0000)]
Remove useless rdar:// comment from switch_to_lookup_table.ll test.
llvm-svn: 222772
Colin LeMahieu [Tue, 25 Nov 2014 18:20:52 +0000 (18:20 +0000)]
[Hexagon] Replacing cmp* instructions with ones that contain encoding bits.
llvm-svn: 222771
Colin LeMahieu [Tue, 25 Nov 2014 18:03:08 +0000 (18:03 +0000)]
Cleaning out google tests from MC.
llvm-svn: 222770
Paul Robinson [Tue, 25 Nov 2014 17:28:54 +0000 (17:28 +0000)]
Try to fix a ppc64 bot. What is this 'signext' stuff anyway?
No wonder most people use specific triples.
llvm-svn: 222769
Hans Wennborg [Tue, 25 Nov 2014 17:23:05 +0000 (17:23 +0000)]
LazyValueInfo: Actually re-visit partially solved block-values in solveBlockValue()
If solveBlockValue() needs results from predecessors that are not already
computed, it returns false with the intention of resuming when the dependencies
have been resolved. However, the computation would never be resumed since an
'overdefined' result had been placed in the cache, preventing any further
computation.
The point of placing the 'overdefined' result in the cache seems to have been
to break cycles, but we can check for that when inserting work items in the
BlockValue stack instead. This makes the "stop and resume" mechanism of
solveBlockValue() work as intended, unlocking more analysis.
Using this patch shaves 120 KB off a 64-bit Chromium build on Linux.
I benchmarked compiling bzip2.c at -O2 but couldn't measure any difference in
compile time.
Tests by Jiangning Liu from r215343 / PR21238, Pete Cooper, and me.
Differential Revision: http://reviews.llvm.org/D6397
llvm-svn: 222768
Joerg Sonnenberger [Tue, 25 Nov 2014 17:14:22 +0000 (17:14 +0000)]
Small model and JIT generally don't go well with each other.
On LP64 platforms, it will work or not depending on the choosen memory
layout, so neither PASS nor XFAIL is appropiate.
As UNSUPPORTED as per-test target doesn't exist (yet), remove the test
instead to unbreak the builds.
llvm-svn: 222767
Tobias Grosser [Tue, 25 Nov 2014 17:09:21 +0000 (17:09 +0000)]
Add PreHeader always to OuterLoop
This fixes a bug introduce in r217525.
llvm-svn: 222766
Manuel Klimek [Tue, 25 Nov 2014 17:01:06 +0000 (17:01 +0000)]
Re-apply r222646 (was reverted in r222667). Adding 4 ASTMatchers: typedefDecl, isInMainFile, isInSystemFile, isInFileMatchingName
Change to original: ifndef out tests in Windows due to /-separated
paths.
Summary:
Often one is only interested in matches within the main-file or matches
that are not within a system-header, for which this patch adds
isInMainFile and isInSystemFile. They take no arguments and narrow down
the matches.
The isInFileMatchingName is mainly thought for interactive
clang-query-sessions, to make a matcher more specific without restarting
the session with the files you are interested in for that moment. It
takes a string that will be used as regular-expression to match the
filename of where the matched node is expanded.
Patch by Hendrik von Prince.
llvm-svn: 222765
Rafael Espindola [Tue, 25 Nov 2014 15:33:40 +0000 (15:33 +0000)]
Set the body of a new struct as soon as it is created.
This changes the order in which different types are passed to get, but
one order is not inherently better than the other.
The main motivation is that this simplifies linkDefinedTypeBodies now that
it is only linking "real" opaque types. It is also means that we only have to
call it once and that we don't need getImpl.
A small change in behavior is that we don't copy type names when resolving
opaque types. This is an improvement IMHO, but it can be added back if
desired. A test is included with the new behavior.
llvm-svn: 222764
Evgeniy Stepanov [Tue, 25 Nov 2014 15:24:07 +0000 (15:24 +0000)]
[msan] Annotate zlib functions for MemorySanitizer.
Mark destination buffer in zlib::compress and zlib::decompress as fully
initialized.
When building LLVM with system zlib and MemorySanitizer instrumentation,
MSan does not observe memory writes in zlib code and erroneously considers
zlib output buffers as uninitialized, resulting in false use-of-uninitialized
memory reports. This change helps MSan understand the state of that memory
and prevents such reports.
llvm-svn: 222763
Evgeniy Stepanov [Tue, 25 Nov 2014 15:00:23 +0000 (15:00 +0000)]
[msan] Remove leftover MSanDR bits in tests.
llvm-svn: 222762
Rafael Espindola [Tue, 25 Nov 2014 14:35:53 +0000 (14:35 +0000)]
Misc style fixes. NFC.
This just reduces the noise in the next patch.
llvm-svn: 222761
Joerg Sonnenberger [Tue, 25 Nov 2014 13:37:55 +0000 (13:37 +0000)]
Reapply 222538 and update tests to explicitly request small code model
and PIC:
Allow FDE references outside the +/-2GB range supported by PC relative
offsets for code models other than small/medium. For JIT application,
memory layout is less controlled and can result in truncations
otherwise.
Patch from Akos Kiss.
Differential Revision: http://reviews.llvm.org/D6079
llvm-svn: 222760
Joerg Sonnenberger [Tue, 25 Nov 2014 13:28:56 +0000 (13:28 +0000)]
Mark as explicit failing on x86-64 -- small memory model doesn't agree
with default address selections.
llvm-svn: 222759
Rafael Espindola [Tue, 25 Nov 2014 13:19:46 +0000 (13:19 +0000)]
Remove a bit of duplicated code.
Exactly the same checks are present in areTypesIsomorphic.
This might have been a premature performance optimization. I cannot reproduce
any slowdown with this patch.
llvm-svn: 222758
Viktor Kutuzov [Tue, 25 Nov 2014 13:08:02 +0000 (13:08 +0000)]
[Sanitizers] Intercept __tls_get_addr() and shmctl() on FreeBSD
Differential Revision: http://reviews.llvm.org/D6384
llvm-svn: 222757
Viktor Kutuzov [Tue, 25 Nov 2014 13:00:21 +0000 (13:00 +0000)]
[Asan] Pack signal context into a structure
Differential Revision: http://reviews.llvm.org/D6148
llvm-svn: 222756
Daniel Jasper [Tue, 25 Nov 2014 12:32:14 +0000 (12:32 +0000)]
clang-tidy: [misc-use-override] Add testcase with reversed attribute order
llvm-svn: 222755
Tobias Grosser [Tue, 25 Nov 2014 10:51:12 +0000 (10:51 +0000)]
Assume GetElementPtr offsets to be inbounds
In case a GEP instruction references into a fixed size array e.g., an access
A[i][j] into an array A[100x100], LLVM-IR does not guarantee that the subscripts
always compute values that are within array bounds. We now derive the set of
parameter values for which all accesses are within bounds and add the assumption
that the scop is only every executed with this set of parameter values.
Example:
void foo(float A[][20], long n, long m {
for (long i = 0; i < n; i++)
for (long j = 0; j < m; j++)
A[i][j] = ...
This loop yields out-of-bound accesses if m is at least 20 and at the same time
at least one iteration of the outer loop is executed. Hence, we assume:
n <= 0 or m <= 20.
Doing so simplifies the dependence analysis problem, allows us to perform
more optimizations and generate better code.
TODO: The location where the GEP instruction is executed is not necessarily the
location where the memory is actually accessed. As a result scanning for GEP[s]
is imprecise. Even though this is not a correctness problem, this imprecision
may result in missed optimizations or non-optimal run-time checks.
In polybench where this mismatch between parametric loop bounds and fixed size
arrays is common, we see with this patch significant reductions in compile time
(up to 50%) and execution time (up to 70%). We see two significant compile time
regressions (fdtd-2d, jacobi-2d-imper), and one execution time regression
(trmm). Both regressions arise due to additional optimizations that have been
enabled by this patch. They can be addressed in subsequent commits.
http://reviews.llvm.org/D6369
llvm-svn: 222754
Chandler Carruth [Tue, 25 Nov 2014 10:50:41 +0000 (10:50 +0000)]
Revert r222746: That commit did not update any tests and caused two R600
tests to start failing.
Original commit log: R600/SI: Disable commutativity for MIN/MAX_LEGACY
llvm-svn: 222753
Zoran Jovanovic [Tue, 25 Nov 2014 10:50:00 +0000 (10:50 +0000)]
[mips][micromips] Use call instructions with short delay slots
Differential Revision: http://reviews.llvm.org/D6338
llvm-svn: 222752
Daniel Jasper [Tue, 25 Nov 2014 10:45:23 +0000 (10:45 +0000)]
clang-tidy: Add override before the first attribute.
Apparently attributes aren't sorted by source location.
llvm-svn: 222751
Hafiz Abid Qadeer [Tue, 25 Nov 2014 10:41:57 +0000 (10:41 +0000)]
Add initial lldb-mi tests.
Test 'test_lldbmi_interrupt' is only enabled for Darwin as
it seems to cause a timeout error on Linux.
Patch from dawn@burble.org.
llvm-svn: 222750
Chandler Carruth [Tue, 25 Nov 2014 10:10:37 +0000 (10:10 +0000)]
Update Clang tests that run the LLVM optimizer to reflect the changed
canonicalization in r222748. No interesting functionality changed here.
llvm-svn: 222749
Chandler Carruth [Tue, 25 Nov 2014 10:09:51 +0000 (10:09 +0000)]
[InstCombine] Change LLVM To canonicalize toward the value type being
stored rather than the pointer type.
This change is analogous to r220138 which changed the canonicalization
for loads. The rationale is the same: memory does not have a type,
operations (and thus the values they produce) have a type. We should
match that type as closely as possible rather than reading some form of
semantics into the pointer type.
With this change, loads and stores should no longer be made with
nonsensical types for the values that tehy load and store. This is
particularly important when trying to match specific loaded and stored
types in the process of doing other instcombines, which is what led me
down this twisty maze of miscanonicalization.
I've put quite some effort into looking through IR to find places where
LLVM's optimizer was being unreasonably conservative in the face of
mismatched load and store types, however it is possible (let's say,
likely!) I have missed some. If you see regressions here, or from
r220138, the likely cause is some part of LLVM failing to cope with load
and store types differing. Test cases appreciated, it is important that
we root all of these out of LLVM.
llvm-svn: 222748
Daniel Jasper [Tue, 25 Nov 2014 10:05:17 +0000 (10:05 +0000)]
clang-format: Refactoring.
Re-apply r222638 and r222641 without variadic templates.
llvm-svn: 222747
Marek Olsak [Tue, 25 Nov 2014 09:49:23 +0000 (09:49 +0000)]
R600/SI: Disable commutativity for MIN/MAX_LEGACY
llvm-svn: 222746
Daniel Jasper [Tue, 25 Nov 2014 09:45:48 +0000 (09:45 +0000)]
Add flag -f(no-)modules-implicit-maps.
This suppresses the implicit search for files called 'module.modulemap' and
similar.
llvm-svn: 222745
Charlie Turner [Tue, 25 Nov 2014 09:30:09 +0000 (09:30 +0000)]
Correctly handle Tag_CPU_arch_profile.
Fix ARMAttributeParser::CPU_arch_profile so that it doesn't switch on the value
'0' as a legal value of this build attribute.
Change-Id: Ie05a08900a82bb10b78c841b437df747ce3bb38e
llvm-svn: 222743
Chandler Carruth [Tue, 25 Nov 2014 08:59:34 +0000 (08:59 +0000)]
Add a missing override, caught by clang's inconsistent override warning.
llvm-svn: 222742
Sergey Dmitrouk [Tue, 25 Nov 2014 08:57:36 +0000 (08:57 +0000)]
[ARM] Define __ARM_FEATURE_DSP macro for CPUs that have DSP instructions
Summary:
This resolves [[ http://llvm.org/bugs/show_bug.cgi?id=17391 | PR17391 ]].
GCC's sources were used as a guide (couldn't find much information in ARM documentation).
Reviewers: doug.gregor, asl
Reviewed By: asl
Subscribers: asl, aemerson, cfe-commits
Differential Revision: http://reviews.llvm.org/D6339
llvm-svn: 222741
Suyog Sarda [Tue, 25 Nov 2014 08:44:56 +0000 (08:44 +0000)]
Change the test case file to use FileCheck instead of grep. NFC.
Change by Ankur Garg.
Differential Revision: http://reviews.llvm.org/D6382
llvm-svn: 222740
Chandler Carruth [Tue, 25 Nov 2014 08:20:27 +0000 (08:20 +0000)]
Revert r220349 to re-instate r220277 with a fix for PR21330 -- quite
clearly only exactly equal width ptrtoint and inttoptr casts are no-op
casts, it says so right there in the langref. Make the code agree.
Original log from r220277:
Teach the load analysis to allow finding available values which require
inttoptr or ptrtoint cast provided there is datalayout available.
Eventually, the datalayout can just be required but in practice it will
always be there today.
To go with the ability to expose available values requiring a ptrtoint
or inttoptr cast, helpers are added to perform one of these three casts.
These smarts are necessary to finish canonicalizing loads and stores to
the operational type requirements without regressing fundamental
combines.
I've added some test cases. These should actually improve as the load
combining and store combining improves, but they may fundamentally be
highlighting some missing combines for select in addition to exercising
the specific added logic to load analysis.
llvm-svn: 222739
Jay Foad [Tue, 25 Nov 2014 07:56:04 +0000 (07:56 +0000)]
[ASan] Fix leak tests on 64-bit targets other than x86-64 (take two)
Summary:
First, remove lit configuration that sets ASAN_OPTIONS to detect_leaks=1
because this is already the default when leak detection is supported.
This removes a bit of duplication between various lit.cfg files.
Second, add a new feature 'leak-detection' if we're targetting x86_64
(not i386) on Linux.
Third, change a couple of tests that need leak detection to require the
new 'leak-detection' feature.
Reviewers: kcc, earthdok, samsonov
Reviewed By: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6396
llvm-svn: 222738
Matt Arsenault [Tue, 25 Nov 2014 07:53:06 +0000 (07:53 +0000)]
R600/SI: Fix allocating flat_scr_lo / flat_scr_hi
Only the super register flat_scr was marked as reserved,
so in some cases with high register usage it would still
try to allocate the subregisters.
llvm-svn: 222737
David Majnemer [Tue, 25 Nov 2014 07:45:56 +0000 (07:45 +0000)]
Forgot to add a file for r222734
llvm-svn: 222736
David Majnemer [Tue, 25 Nov 2014 07:43:14 +0000 (07:43 +0000)]
COFF: Add back an assertion that is superseded by r222124
llvm-svn: 222735
David Majnemer [Tue, 25 Nov 2014 07:42:36 +0000 (07:42 +0000)]
COFF: Add another test for r222124
llvm-svn: 222734