Jan Vesely [Fri, 17 Jun 2016 20:30:41 +0000 (20:30 +0000)]
64 bit integers are legal in full profile without an extension
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 273042
Marcin Koscielnicki [Fri, 17 Jun 2016 20:24:35 +0000 (20:24 +0000)]
[sanitizers] [SystemZ] Add __tls_get_offset interceptor.
s390 is special again - instead of __tls_get_addr, it has __tls_get_offset
with special calling conventions: the result is TP relative, and
the argument is GOT-relative. Since we need to get address of the caller's
GOT, which is in %r12, we have to use assembly like glibc does.
Aside of __tls_get_offset, glibc also implements a slightly saner
__tls_get_addr_internal, which takes a pointer as argument, but still
returns a TP-relative offset. It is used for dlsym() called on TLS
symbols, so we have to intercept it was well. Our __tls_get_offset
is also implemented by delegating to it.
Differential Revision: http://reviews.llvm.org/D19778
llvm-svn: 273041
Marcin Koscielnicki [Fri, 17 Jun 2016 20:24:32 +0000 (20:24 +0000)]
[sanitizer] [SystemZ] Enable TLS functionality.
This enables TLS knowledge for s390 in sanitizers.
Differential Revision: http://reviews.llvm.org/D19594
llvm-svn: 273040
Marcin Koscielnicki [Fri, 17 Jun 2016 20:24:07 +0000 (20:24 +0000)]
[SelectionDAG] Don't treat library calls specially if marked with nobuiltin.
To be used by D19781.
Differential Revision: http://reviews.llvm.org/D19801
llvm-svn: 273039
Michael Kuperstein [Fri, 17 Jun 2016 20:21:17 +0000 (20:21 +0000)]
[X86] Add missing AVX512 anyext patterns.
Add AVX512 anyext patterns for i16 and i64, modeled on the existing i8 and
i32 patterns.
llvm-svn: 273038
Eric Fiselier [Fri, 17 Jun 2016 20:16:46 +0000 (20:16 +0000)]
Add missing space between >> in template declaration. Fixes C++03 build.
llvm-svn: 273037
Saleem Abdulrasool [Fri, 17 Jun 2016 19:59:01 +0000 (19:59 +0000)]
test: support / and \ as directory separators
Windows uses \ as the directory separator and this causes the tests to fail on
Windows.
llvm-svn: 273036
Eric Fiselier [Fri, 17 Jun 2016 19:57:54 +0000 (19:57 +0000)]
Fix a couple of warnings present in the filesystem tests.
llvm-svn: 273035
Eric Fiselier [Fri, 17 Jun 2016 19:46:40 +0000 (19:46 +0000)]
Add Filesystem TS -- Complete
Add the completed std::experimental::filesystem implementation and tests.
The implementation supports C++11 or newer.
The TS is built as part of 'libc++experimental.a'. Users of the TS need to
manually link this library. Building and testing the TS can be disabled using
the CMake option '-DLIBCXX_ENABLE_FILESYSTEM=OFF'.
Currently 'libc++experimental.a' is not installed by default. To turn on the
installation of the library use '-DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=ON'.
llvm-svn: 273034
Adrian McCarthy [Fri, 17 Jun 2016 19:45:59 +0000 (19:45 +0000)]
Revert "Properly handle short file names on the command line in Windows"
This reverts commit
3e5651782cfc985fca9d94595cad63059e587e2f.
llvm-svn: 273033
Davide Italiano [Fri, 17 Jun 2016 19:10:09 +0000 (19:10 +0000)]
[PM] Port MergedLoadStoreMotion to the new pass manager, take two.
This is indeed a much cleaner approach (thanks to Daniel Berlin
for pointing out), and also David/Sean for review.
Differential Revision: http://reviews.llvm.org/D21454
llvm-svn: 273032
Jan Vesely [Fri, 17 Jun 2016 19:02:14 +0000 (19:02 +0000)]
NVPTX: Add supported CL features
Fixes libclc compilation broken by r269670
Reviewers: jholewinsky
Differential Revision: http://reviews.llvm.org/D20389
llvm-svn: 273031
Benjamin Kramer [Fri, 17 Jun 2016 18:59:41 +0000 (18:59 +0000)]
Avoid duplicated map lookups. No functionality change intended.
llvm-svn: 273030
Tim Northover [Fri, 17 Jun 2016 18:40:46 +0000 (18:40 +0000)]
ARM: take account of possible bundle when erasing an instruction.
Fortunately this appears to be the only ARM-specific pass that runs while
bundles might be in play, so no other cases need modifying.
llvm-svn: 273029
Reid Kleckner [Fri, 17 Jun 2016 18:30:37 +0000 (18:30 +0000)]
Turn off -Wunused-parameter when building compiler-rt with clang on Windows, it is very noisy
It is turned on as part of "clang-cl /W4", which enables -Wextra.
llvm-svn: 273028
Davide Italiano [Fri, 17 Jun 2016 18:20:14 +0000 (18:20 +0000)]
[IRObjectFile] Handle .weak in RecordStreamer.
Differential Revision: http://reviews.llvm.org/D21476
llvm-svn: 273027
Reid Kleckner [Fri, 17 Jun 2016 18:12:50 +0000 (18:12 +0000)]
Fix most MSVC warnings in compiler-rt profiling library
Here's the warnings and how they were fixed:
- InstrProfilingUtil.c(110): warning C4013: '_open_osfhandle' undefined; assuming extern returning int
Include io.h to get the prototype.
- warning C4005: 'FILE_MAP_EXECUTE': macro redefinition
Stop trying to support pre-XP versions of Windows, don't attempt to
define this macro.
- InstrProfilingWriter.c(271): warning C4221: nonstandard extension used: 'Data': cannot be initialized using address of automatic variable 'Header'
- InstrProfilingWriter.c(275): warning C4221: nonstandard extension used: 'Data': cannot be initialized using address of automatic variable 'Zeroes'
Turn this warning off. This is definitely legal in C++, all compilers
accept it, and I only have room for half of one language standard in my
brain.
- InstrProfilingValue.c(320): warning C4113: 'uint32_t (__cdecl *)()' differs in parameter lists from 'uint32_t (__cdecl *)(void)'
Fix this with an explicit (void) in the prototype.
- InstrProfilingMerge.c.obj : warning LNK4006: _VPMergeHook already defined in InstrProfilingMergeFile.c.obj; second definition ignored
Last remaining warning. This is from linking a selectany definition with
a strong definition. We need to sort out weak symbols in compiler-rt in
general, though.
llvm-svn: 273026
James Y Knight [Fri, 17 Jun 2016 18:11:48 +0000 (18:11 +0000)]
Support expanding partial-word cmpxchg to full-word cmpxchg in AtomicExpandPass.
Many CPUs only have the ability to do a 4-byte cmpxchg (or ll/sc), not 1
or 2-byte. For those, you need to mask and shift the 1 or 2 byte values
appropriately to use the 4-byte instruction.
This change adds support for cmpxchg-based instruction sets (only SPARC,
in LLVM). The support can be extended for LL/SC-based PPC and MIPS in
the future, supplanting the ISel expansions those architectures
currently use.
Tests added for the IR transform and SPARCv9.
Differential Revision: http://reviews.llvm.org/D21029
llvm-svn: 273025
Davide Italiano [Fri, 17 Jun 2016 18:07:14 +0000 (18:07 +0000)]
[Codegen] Change PICLevel.
We convert `Default` to `NotPIC` so that target independent code
can reason about this correctly.
Differential Revision: http://reviews.llvm.org/D21394
llvm-svn: 273024
Justin Bogner [Fri, 17 Jun 2016 17:59:48 +0000 (17:59 +0000)]
LoopSimplifyCFG: Prefer `const auto &` to `auto &`, for clarity. NFC
llvm-svn: 273023
Rafael Espindola [Fri, 17 Jun 2016 17:53:57 +0000 (17:53 +0000)]
Don't use the new x86 relax relocations on the gold plugin.
Should bring back the bots with old versions.
llvm-svn: 273022
Reid Kleckner [Fri, 17 Jun 2016 17:48:52 +0000 (17:48 +0000)]
Fix some warnings in the MSVC build
- Fixes warnings about the ignored -fms-compatibility-version flag.
- Fixes warnings about overriding /W4 with /W3 and back.
- Fixes a warning where PREFETCH() expanded to nothing in a braceless if
block.
llvm-svn: 273021
David Majnemer [Fri, 17 Jun 2016 17:47:24 +0000 (17:47 +0000)]
[CodeGen] Use pointer-sized integers for ptrtoint sources
Given something like:
void *v = (void *)100;
We need to synthesize a ptrtoint operation from 100. During constant
emission, we choose i64 as the type for our constant because it
guaranteed not to drop any bits from our CharUnits representation of the
value. However, this is suboptimal for 32-bit targets: LLVM passes like
GlobalOpt will get confused by these sorts of casts resulting in
pessimization.
Instead, make sure the ptrtoint operand has a pointer-sized integer
type.
llvm-svn: 273020
Rafael Espindola [Fri, 17 Jun 2016 17:43:41 +0000 (17:43 +0000)]
Change RelaxELFRelocations for llc.
As a developer tool it makes sense for it to use the new relocations.
llvm-svn: 273019
Saleem Abdulrasool [Fri, 17 Jun 2016 17:33:36 +0000 (17:33 +0000)]
test: generalise the matching
Use a regex for the clang version as that will change all the time.
llvm-svn: 273018
Rafael Espindola [Fri, 17 Jun 2016 17:26:07 +0000 (17:26 +0000)]
Change RelaxELFRelocations' default.
NFC to the existing clients since they all set it already.
llvm-svn: 273017
Saleem Abdulrasool [Fri, 17 Jun 2016 17:23:16 +0000 (17:23 +0000)]
Driver: introduce and use `-isystem-after` for cross-windows
This mirrors the many other -i*after options to insert a new system search
directory at the end of the search path. This makes it possible to actually
inject a search path after the resource dir. This option is similar in spirit
to the /imsvc option in the clang-cl driver. This is needed to properly use the
driver for Windows targets where the clang headers wrap some of the system
headers.
This concept is actually useful on other targets (e.g. Linux) and would be
really easy to support on the core toolchain.
llvm-svn: 273016
Yaxun Liu [Fri, 17 Jun 2016 17:19:28 +0000 (17:19 +0000)]
[OpenCL] Allow -std={cl|CL}{|1.1|1.2|2.0} in driver
Fix a regression which forbids using -std=cl|CL1.1|CL1.2|CL2.0 in driver.
Allow -std and -cl-std={cl|CL}{|1.1|1.2|2.0}.
Differential Revision: http://reviews.llvm.org/D20630
llvm-svn: 273015
Rafael Espindola [Fri, 17 Jun 2016 17:04:56 +0000 (17:04 +0000)]
Change the default of -relax-relocations.
llvm-mc is a developer tool, as such it make sense for it to use new
features by default.
This doesn't change the user facing clang, which still defaults to non
relaxable relocations.
llvm-svn: 273014
Rafael Espindola [Fri, 17 Jun 2016 17:01:38 +0000 (17:01 +0000)]
This tests depends on non-relaxable relocations.
Make that explicit.
llvm-svn: 273013
Bryan Chan [Fri, 17 Jun 2016 16:47:14 +0000 (16:47 +0000)]
[Driver] Adapt Linux::GCCVersion::Parse to match GCC 5 installations
Summary:
Some GCC 5 installations store the libstdc++ includes and GCC-specific files in paths without
the minor part of the version number, such as
/usr/include/c++/5
/usr/lib64/gcc/x86_64-suse-linux/5
Reviewers: cfe-commits, thiagomacieira, jroelofs
Subscribers: tinti, jroelofs
Differential Revision: http://reviews.llvm.org/D14727
llvm-svn: 273012
Sanjay Patel [Fri, 17 Jun 2016 16:46:50 +0000 (16:46 +0000)]
[InstCombine] allow more than one use for vector bitcast folding with selects
The motivating example for this transform is similar to D20774 where bitcasts interfere
with a single cmp/select sequence, but in this case we have 2 uses of each bitcast to
produce min and max ops:
define void @minmax_bc_store(<4 x float> %a, <4 x float> %b, <4 x float>* %ptr1, <4 x float>* %ptr2) {
%cmp = fcmp olt <4 x float> %a, %b
%bc1 = bitcast <4 x float> %a to <4 x i32>
%bc2 = bitcast <4 x float> %b to <4 x i32>
%sel1 = select <4 x i1> %cmp, <4 x i32> %bc1, <4 x i32> %bc2
%sel2 = select <4 x i1> %cmp, <4 x i32> %bc2, <4 x i32> %bc1
%bc3 = bitcast <4 x float>* %ptr1 to <4 x i32>*
store <4 x i32> %sel1, <4 x i32>* %bc3
%bc4 = bitcast <4 x float>* %ptr2 to <4 x i32>*
store <4 x i32> %sel2, <4 x i32>* %bc4
ret void
}
With this patch, we move the selects up to use the input args which allows getting rid of
all of the bitcasts:
define void @minmax_bc_store(<4 x float> %a, <4 x float> %b, <4 x float>* %ptr1, <4 x float>* %ptr2) {
%cmp = fcmp olt <4 x float> %a, %b
%sel1.v = select <4 x i1> %cmp, <4 x float> %a, <4 x float> %b
%sel2.v = select <4 x i1> %cmp, <4 x float> %b, <4 x float> %a
store <4 x float> %sel1.v, <4 x float>* %ptr1, align 16
store <4 x float> %sel2.v, <4 x float>* %ptr2, align 16
ret void
}
The asm for x86 SSE then improves from:
movaps %xmm0, %xmm2
cmpltps %xmm1, %xmm2
movaps %xmm2, %xmm3
andnps %xmm1, %xmm3
movaps %xmm2, %xmm4
andnps %xmm0, %xmm4
andps %xmm2, %xmm0
orps %xmm3, %xmm0
andps %xmm1, %xmm2
orps %xmm4, %xmm2
movaps %xmm0, (%rdi)
movaps %xmm2, (%rsi)
To:
movaps %xmm0, %xmm2
minps %xmm1, %xmm2
maxps %xmm0, %xmm1
movaps %xmm2, (%rdi)
movaps %xmm1, (%rsi)
The TODO comments show that we're limiting this transform only to vectors and only to bitcasts
because we need to improve other transforms or risk creating worse codegen.
Differential Revision: http://reviews.llvm.org/D21190
llvm-svn: 273011
David Majnemer [Fri, 17 Jun 2016 16:13:21 +0000 (16:13 +0000)]
[CodeView] Refactor enumerator emission
This addresses Amjad's review comments on D21442.
llvm-svn: 273010
Reid Kleckner [Fri, 17 Jun 2016 16:11:20 +0000 (16:11 +0000)]
[codeview] Make function names more consistent with MSVC
Names in function id records don't include nested name specifiers or
template arguments, but names in the symbol stream include both.
For the symbol stream, instead of having Clang put the fully qualified
name in the subprogram display name, recreate it from the subprogram
scope chain. For the type stream, take the unqualified name and chop of
any template arguments.
This makes it so that CodeView DI metadata is more similar to DWARF DI
metadata.
llvm-svn: 273009
Reid Kleckner [Fri, 17 Jun 2016 16:11:20 +0000 (16:11 +0000)]
[codeview] Stop emitting fully qualified subprogram display names
This effectively reverts r255744, and leaves the printing option tweaks.
We can add the name qualifiers easily in the backend.
llvm-svn: 273008
Nirav Dave [Fri, 17 Jun 2016 16:06:17 +0000 (16:06 +0000)]
Refactor and cleanup Assembly Parsing / Lexing
Recommiting after fixing non-atomic insert to front of SmallVector in
MCAsmLexer.h
Add explicit Comment Token in Assembly Lexing for future support for
outputting explicit comments from inline assembly. As part of this,
CPPHash Directives are now explicitly distinguished from Hash line
comments in Lexer.
Line comments are recorded as EndOfStatement tokens, not Comment tokens
to simplify compatibility with current TargetParsers. This slightly
complicates comment output.
This remove all lexing tasks out of the parser, does minor cleanup
to remove extraneous newlines Asm Output, and some improvements white
space handling.
Reviewers: rtrieu, dwmw2, rnk
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D20009
llvm-svn: 273007
Rafael Espindola [Fri, 17 Jun 2016 15:42:36 +0000 (15:42 +0000)]
Don't confuse input and output section offsets.
llvm-svn: 273006
Igor Laevsky [Fri, 17 Jun 2016 15:19:41 +0000 (15:19 +0000)]
[MCContext] Don't use getenv inside class constructor
Differential Revision: http://reviews.llvm.org/D21471
llvm-svn: 273005
Rafael Espindola [Fri, 17 Jun 2016 15:01:50 +0000 (15:01 +0000)]
Simplify. NFC.
llvm-svn: 273004
Simon Pilgrim [Fri, 17 Jun 2016 14:28:16 +0000 (14:28 +0000)]
[X86][SSE4A] Use native IR for mask movntsd/movntss intrinsics.
Depends on llvm side commit r273002.
llvm-svn: 273003
Simon Pilgrim [Fri, 17 Jun 2016 14:27:38 +0000 (14:27 +0000)]
[X86][SSE4A] Remove the GCCBuiltins from the movntsd/movntss intrinsic defs so we can emit native IR from clang.
Clang-side sibling commit to follow.
llvm-svn: 273002
Benjamin Kramer [Fri, 17 Jun 2016 14:14:29 +0000 (14:14 +0000)]
[ARM] Strength reduce vectors to arrays.
No functionality change intended.
llvm-svn: 273001
Rafael Espindola [Fri, 17 Jun 2016 13:38:09 +0000 (13:38 +0000)]
Make local: optional.
Doing that in an anonymous version is a bit silly, but this opens the
way for supporting it in general.
Since we don't support actual versions, for now we just disable the
version script if we detect that it is missing a local.
llvm-svn: 273000
Benjamin Kramer [Fri, 17 Jun 2016 13:15:10 +0000 (13:15 +0000)]
[PPC] Strength-reduce SmallVectors into arrays.
No functionality change intended.
llvm-svn: 272999
Kostya Serebryany [Fri, 17 Jun 2016 13:07:06 +0000 (13:07 +0000)]
[libFuzzer] make the single-run output more reliable
llvm-svn: 272998
Craig Topper [Fri, 17 Jun 2016 12:20:50 +0000 (12:20 +0000)]
[X86] Pre-size several SmallVectors instead of calling push_back in a loop. NFC
llvm-svn: 272997
Craig Topper [Fri, 17 Jun 2016 12:20:48 +0000 (12:20 +0000)]
[X86] Fix formatting. NFC
llvm-svn: 272996
Alexander Kornienko [Fri, 17 Jun 2016 12:01:15 +0000 (12:01 +0000)]
[clang-tidy] More doc fixes. NFC.
llvm-svn: 272995
Alexander Kornienko [Fri, 17 Jun 2016 11:43:33 +0000 (11:43 +0000)]
[clang-tidy] Fix doxygen errors. NFC.
llvm-svn: 272994
Alexander Kornienko [Fri, 17 Jun 2016 09:25:24 +0000 (09:25 +0000)]
[clang-tidy] readability-identifier-naming - Support for Macros
Summary:
Added support for macro definitions.
--
1. Added a pre-processor callback to catch macro definitions
2. Changed the type of the failure map so that macros and declarations can share the same map
3. Added extra tests to ensure fix-ups work using the new map
4. Added fix-ups for type aliases in variable and function declarations as part of adding the new tests
Reviewers: alexfh
Subscribers: Eugene.Zelenko, cfe-commits
Patch by James Reynolds!
Differential Revision: http://reviews.llvm.org/D21020
llvm-svn: 272993
Adam Nemet [Fri, 17 Jun 2016 09:13:15 +0000 (09:13 +0000)]
[LLE] Don't hard-code the name of the preheader in test
Turns out a didn't get this right because symbolic stride versioning
changes the name. Relax the matching.
llvm-svn: 272992
Chandler Carruth [Fri, 17 Jun 2016 07:15:29 +0000 (07:15 +0000)]
[PM] Run clang-format over various parts of the new pass manager code
prior to some very substantial patches to isolate any formatting-only
changes.
llvm-svn: 272991
Matt Arsenault [Fri, 17 Jun 2016 06:28:53 +0000 (06:28 +0000)]
Revert "InstCombine: Reduce trunc (shl x, K) width."
This reverts commit r272987.
This might be causing crashes on some bots.
llvm-svn: 272990
Qin Zhao [Fri, 17 Jun 2016 04:50:20 +0000 (04:50 +0000)]
[esan|cfrag] Add the struct field size array in StructInfo
Summary:
Adds the struct field size array in struct StructInfo.
Updates test struct_field_count_basic.ll.
Reviewers: aizatsky
Subscribers: vitalybuka, zhaoqin, kcc, eugenis, bruening, llvm-commits
Differential Revision: http://reviews.llvm.org/D21341
llvm-svn: 272989
Qin Zhao [Fri, 17 Jun 2016 04:50:11 +0000 (04:50 +0000)]
[esan|cfrag] Add the struct field size array in StructInfo
Summary:
Adds the struct field size array in the struct StructInfo.
Prints struct field size info in the report.
Reviewers: aizatsky
Subscribers: vitalybuka, zhaoqin, kcc, eugenis, bruening, llvm-commits, kubabrecka
Differential Revision: http://reviews.llvm.org/D21342
llvm-svn: 272988
Matt Arsenault [Fri, 17 Jun 2016 04:43:22 +0000 (04:43 +0000)]
InstCombine: Reduce trunc (shl x, K) width.
llvm-svn: 272987
Jan Vesely [Fri, 17 Jun 2016 02:25:03 +0000 (02:25 +0000)]
AMDGPU: Fix supported CL features
Reviewers: arsenm
Differential Revision: http://reviews.llvm.org/D20388
llvm-svn: 272986
NAKAMURA Takumi [Fri, 17 Jun 2016 02:04:51 +0000 (02:04 +0000)]
ToolingTests/runToolOnCode.TestSkipFunctionBody: Appease msc targets.
llvm-svn: 272985
Rui Ueyama [Fri, 17 Jun 2016 01:18:46 +0000 (01:18 +0000)]
Rename Align -> Alignment.
I think it is me who named these variables, but I always find that
they are slightly confusing because align is a verb.
Adding four letters is worth it.
llvm-svn: 272984
Ranjeet Singh [Fri, 17 Jun 2016 00:59:41 +0000 (00:59 +0000)]
[ARM] Add mrrc/mrrc2 intrinsics and update existing mcrr/mcrr2 intrinsics.
Reapplying patch in r272777 which was reverted
because the llvm patch which added support
for generating the mcrr/mcrr2 instructions
from the intrinsic was causing an assertion
failure. This has now been fixed in llvm.
llvm-svn: 272983
Ranjeet Singh [Fri, 17 Jun 2016 00:52:41 +0000 (00:52 +0000)]
[ARM] Add support for mrrc/mrrc2 intrinsics.
Reapplying patch as it was reverted when it was first
committed because of an assertion failure when the
mrrc2 intrinsic was called in ARM mode. The failure
was happening because the instruction was being built
in ARMISelDAGToDAG.cpp and the tablegen description for
mrrc2 instruction doesn't allow you to use a predicate.
The ARM architecture manuals do say that mrrc2 in ARM
mode can be predicated with AL in assembly but this has
no effect on the encoding of the instruction as the top
4 bits will always be 1111 not 1110 which is the encoding
for the condition AL.
Differential Revision: http://reviews.llvm.org/D21408
llvm-svn: 272982
Sanjoy Das [Fri, 17 Jun 2016 00:45:00 +0000 (00:45 +0000)]
[RS4GC] Pass CallSite by value instead of const ref; NFC
That's the idiomatic LLVM pattern.
llvm-svn: 272981
Evgeniy Stepanov [Fri, 17 Jun 2016 00:43:11 +0000 (00:43 +0000)]
[msan] Intercept send/sendto/sendmsg.
send/sendmsg moved from tsan to sanitizer_common; sendto is new.
llvm-svn: 272980
Saleem Abdulrasool [Fri, 17 Jun 2016 00:27:02 +0000 (00:27 +0000)]
Headers: wordsmith error message
Use the marketing name for the MSVC release as pointed out by Nico Weber!
llvm-svn: 272979
Chandler Carruth [Fri, 17 Jun 2016 00:11:01 +0000 (00:11 +0000)]
[PM] Remove support for omitting the AnalysisManager argument to new
pass manager passes' `run` methods.
This removes a bunch of SFINAE goop from the pass manager and just
requires pass authors to accept `AnalysisManager<IRUnitT> &` as a dead
argument. This is a small price to pay for the simplicity of the system
as a whole, despite the noise that changing it causes at this stage.
This will also helpfull allow us to make the signature of the run
methods much more flexible for different kinds af passes to support
things like intelligently updating the pass's progression over IR units.
While this touches many, many, files, the changes are really boring.
Mostly made with the help of my trusty perl one liners.
Thanks to Sean and Hal for bouncing ideas for this with me in IRC.
llvm-svn: 272978
Chuang-Yu Cheng [Fri, 17 Jun 2016 00:04:39 +0000 (00:04 +0000)]
Use m_APInt in SimplifyCFG
Switch from m_Constant to m_APInt per David's request. NFC.
Author: Thomas Jablin (tjablin)
Reviewers: majnemer cycheng
http://reviews.llvm.org/D21440
llvm-svn: 272977
Rui Ueyama [Thu, 16 Jun 2016 23:50:25 +0000 (23:50 +0000)]
Remove default values that vary depending on target.
llvm-svn: 272976
Rui Ueyama [Thu, 16 Jun 2016 23:28:08 +0000 (23:28 +0000)]
Make a switch-case a function for the sake of simplicity.
llvm-svn: 272975
Rui Ueyama [Thu, 16 Jun 2016 23:28:06 +0000 (23:28 +0000)]
Merge cases that execute the same code.
llvm-svn: 272974
Rui Ueyama [Thu, 16 Jun 2016 23:28:05 +0000 (23:28 +0000)]
Early return. NFC.
llvm-svn: 272973
Rui Ueyama [Thu, 16 Jun 2016 23:28:03 +0000 (23:28 +0000)]
Simplify. NFC.
llvm-svn: 272972
George Burgess IV [Thu, 16 Jun 2016 23:06:04 +0000 (23:06 +0000)]
[CodeGen] Fix a segfault caused by pass_object_size.
This patch fixes a bug where we'd segfault (in some cases) if we saw a
variadic function with one or more pass_object_size arguments.
Differential Revision: http://reviews.llvm.org/D17462
llvm-svn: 272971
Adam Nemet [Thu, 16 Jun 2016 22:57:55 +0000 (22:57 +0000)]
[LV] Move management of symbolic strides to LAA. NFCI
This is still NFCI, so the list of clients that allow symbolic stride
speculation does not change (yes: LV and LoopVersioningLICM, no: LLE,
LDist). However since the symbolic strides are now managed by LAA
rather than passed by client a new bool parameter is used to enable
symbolic stride speculation.
The existing test Transforms/LoopVectorize/version-mem-access.ll checks
that stride speculation is performed for LV.
The previously added test Transforms/LoopLoadElim/symbolic-stride.ll
ensures that no speculation is performed for LLE.
The next patch will change the functionality and turn on symbolic stride
speculation in all of LAA's clients and remove the bool parameter.
llvm-svn: 272970
Evgeniy Stepanov [Thu, 16 Jun 2016 22:34:04 +0000 (22:34 +0000)]
[safestack] Sink unsafe address computation to each use.
This is a fix for PR27844.
When replacing uses of unsafe allocas, emit the new location
immediately after each use. Without this, the pointer stays live from
the function entry to the last use, while it's usually cheaper to
recalculate.
llvm-svn: 272969
Evgeniy Stepanov [Thu, 16 Jun 2016 22:34:00 +0000 (22:34 +0000)]
[safestack] Fixup llvm.dbg.value when rewriting unsafe allocas.
When moving unsafe allocas to the unsafe stack, dbg.declare intrinsics are
updated to refer to the new location.
This change does the same to dbg.value intrinsics.
llvm-svn: 272968
Adrian McCarthy [Thu, 16 Jun 2016 22:07:55 +0000 (22:07 +0000)]
Properly handle short file names on the command line in Windows
Some build systems use the short (8.3) file names on Windows, especially if the path has spaces in it. The shortening made it impossible for clang to distinguish between clang.exe, clang++.exe, and clang-cl.exe. So this expands short names in the first argument and does wildcard expansion for the rest.
Differential Revision: http://reviews.llvm.org/D21420
llvm-svn: 272967
Adam Nemet [Thu, 16 Jun 2016 21:55:10 +0000 (21:55 +0000)]
[LV] Make getSymbolicStrides return a pointer rather than a reference. NFC
Turns out SymbolicStrides is actually used in canVectorizeWithIfConvert
before it gets set up in canVectorizeMemory.
This works fine as long as SymbolicStrides resides in LV since we just
have an empty map. Based on this the conclusion is made that there are
no symbolic strides which is conservatively correct.
However once SymbolicStrides becomes part of LAI, LAI is nullptr at this
point so we need to differentiate the uninitialized state by returning a
nullptr for SymbolicStrides.
llvm-svn: 272966
Evgeniy Stepanov [Thu, 16 Jun 2016 21:45:13 +0000 (21:45 +0000)]
Fix BitVector move ctor/assignment.
Current implementation leaves the object in an invalid state.
This reverts commit
bf0c389ac683cd6c0e5959b16537e59e5f4589e3.
llvm-svn: 272965
Matt Arsenault [Thu, 16 Jun 2016 21:43:12 +0000 (21:43 +0000)]
TTI: Add hook for memory width to vectorize
llvm-svn: 272964
Olivier Goffart [Thu, 16 Jun 2016 21:40:06 +0000 (21:40 +0000)]
Fix a few issues while skipping function bodies
- In functions with try { } catch { }, only the try block would be
skipped, not the catch blocks
- The template functions would still be parsed.
- The initializers within a constructor would still be parsed.
- The inline functions within class would still be stored, only to be
discared later.
- Invalid code with try would assert (as in "int foo() try assert_here")
This attempt to do even less while skipping function bodies.
Differential Revision: http://reviews.llvm.org/D20821
llvm-svn: 272963
Olivier Goffart [Thu, 16 Jun 2016 21:39:55 +0000 (21:39 +0000)]
Keep invalid functions as part of the AST
Differential Revision: http://reviews.llvm.org/D19764
llvm-svn: 272962
Olivier Goffart [Thu, 16 Jun 2016 21:39:46 +0000 (21:39 +0000)]
Functions declared in a scope should not hide previous declaration in earlier scopes
This code should be an error:
void foo(int);
void f3() {
int foo(float);
{
float foo(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
}
}
the foo(float) function declared at function scope should not hide the float(int)
while trying to redeclare functions.
Differential Revision: http://reviews.llvm.org/D19763
llvm-svn: 272961
David Majnemer [Thu, 16 Jun 2016 21:32:16 +0000 (21:32 +0000)]
[CodeView] Implement support for enums
MSVC handles enums differently from structs and classes: a forward
declaration is not emitted unconditionally. MSVC does not emit an S_UDT
record for the enum.
Differential Revision: http://reviews.llvm.org/D21442
llvm-svn: 272960
Matt Arsenault [Thu, 16 Jun 2016 21:21:49 +0000 (21:21 +0000)]
AArch64: Fix range loop contradicting comment above it
llvm-svn: 272959
Changpeng Fang [Thu, 16 Jun 2016 21:20:47 +0000 (21:20 +0000)]
AMDGPU/SI: Propagate the Kill flag in storeRegToStackSlot and eliminateFrameIndex
Reviewers: arsenm, tstellarAMD
Differential Revision: http://reviews.llvm.org/21438
llvm-svn: 272958
Nirav Dave [Thu, 16 Jun 2016 21:19:23 +0000 (21:19 +0000)]
Revert "Refactor and cleanup Assembly Parsing / Lexing"
Reverting for unexpected crashes on various platforms.
This reverts commit r272953.
llvm-svn: 272957
Matt Arsenault [Thu, 16 Jun 2016 21:14:05 +0000 (21:14 +0000)]
AMDGPU: Fix maximum instruction size for amdgcn
This was causing the conservative estimate of inline asm
size to be twice as big as expected.
llvm-svn: 272956
Sanjoy Das [Thu, 16 Jun 2016 21:00:57 +0000 (21:00 +0000)]
[EarlyCSE] Minor cosmetic NFC changes
- Avoid implicit conversion from pointer to bool
- Add a comment when passing in a boolean value
llvm-svn: 272955
Sanjoy Das [Thu, 16 Jun 2016 20:47:57 +0000 (20:47 +0000)]
[EarlyCSE] Fold invariant loads
Redundant invariant loads can be CSE'ed with very little extra effort
over what early-cse already tracks, so it looks reasonable to make
early-cse handle this case.
llvm-svn: 272954
Nirav Dave [Thu, 16 Jun 2016 20:34:22 +0000 (20:34 +0000)]
Refactor and cleanup Assembly Parsing / Lexing
Add explicit Comment Token in Assembly Lexing for future support for
outputting explicit comments from inline assembly. As part of this,
CPPHash Directives are now explicitly distinguished from Hash line
comments in Lexer.
Line comments are recorded as EndOfStatement tokens, not Comment tokens
to simplify compatibility with current TargetParsers. This slightly
complicates comment output.
This remove all lexing tasks out of the parser, does minor cleanup
to remove extraneous newlines Asm Output, and some improvements white
space handling.
Reviewers: rtrieu, dwmw2, rnk
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D20009
llvm-svn: 272953
Jonathan Peyton [Thu, 16 Jun 2016 20:31:19 +0000 (20:31 +0000)]
Change hwloc discovery algorithm to print topology only for accessible resources
Change hwloc discovery algorithm to print topology for only accessible
resources, and report uniformity correspondingly, similar to what other topology
discovery algorithms do. Fixes minor inconsistency in total topology reported
and resources used for threads binding in case hwloc used.
Patch by Andrey Churbanov.
Differential Revision: http://reviews.llvm.org/D21389
llvm-svn: 272952
Jonathan Peyton [Thu, 16 Jun 2016 20:23:11 +0000 (20:23 +0000)]
Teach OpenMP Library to use Hwloc on Windows
This patch allows a user to enable Hwloc on windows. There are three main
changes in here:
1.kmp.h - Move definitions/declarations out of KMP_OS_WINDOWS guard (our windows
implementation of affinity) because they need to be defined when
KMP_USE_HWLOC is on as well.
2.teach __kmp_set_system_affinity, __kmp_get_system_affinity,
__kmp_get_proc_group, and __kmp_affinity_bind_thread how to use hwloc.
3.teach CMake how to include hwloc when building Windows
Another minor change in here is to make sure that anything under KMP_USE_HWLOC
is also guarded by KMP_AFFINITY_SUPPORTED as well. This is to prevent Mac
builds from requiring anything from Hwloc.
Differential Revision: http://reviews.llvm.org/D21441
llvm-svn: 272951
Jonathan Peyton [Thu, 16 Jun 2016 20:18:31 +0000 (20:18 +0000)]
Fix for crash in task dependencies
With single thread using __kmpc_omp_wait_deps segfaults in OpenMP runtime.
Offloading with depend also encounters this problem when we generate
kmpc_omp_wait_deps instead of kmpc_omp_task_with_deps.
Patch by Alex Duran
Differential Revision: http://reviews.llvm.org/D21384
llvm-svn: 272949
Kostya Serebryany [Thu, 16 Jun 2016 20:17:41 +0000 (20:17 +0000)]
[libFuzzer] use the new chainable malloc hooks instead of the old un-chainable ones, use atomic for malloc/free counters instead of a thread local counter in the main thread. This should make on-the-spot leak detection in libFuzzer more reliable
llvm-svn: 272948
Artem Belevich [Thu, 16 Jun 2016 20:16:49 +0000 (20:16 +0000)]
Minor fixes for miamcpu-opt.c test
Added -no-canonical-prefixes to make cc1 binary name more predictable.
Added appropriate REQUIRES keywords.
llvm-svn: 272947
Jonathan Peyton [Thu, 16 Jun 2016 20:14:54 +0000 (20:14 +0000)]
Fixed missing memory cleanup in __kmp_affinity_create_hwloc_map()
Cleanup: fixed missing memory cleanup in couple of corner cases. Fixes possible
memory leak in some corner cases
Patch by Andrey Churbanov
Differential Revision: http://reviews.llvm.org/D21355
llvm-svn: 272946
Jonathan Peyton [Thu, 16 Jun 2016 20:11:51 +0000 (20:11 +0000)]
Reduce perf impact of redundant ittnotify calls
Improved performance of ittnotify calls by request from ittnotify
owner: calls to __itt_string_handle_create made unique (it was
called multiple times).
Patch by Andrey Churbanov
Differential Revision: http://reviews.llvm.org/D21353
llvm-svn: 272945
Reid Kleckner [Thu, 16 Jun 2016 20:08:51 +0000 (20:08 +0000)]
[DebugInfo] Put the vftable index in the debug info
This won't always be enough info to call a virtual method from the
debugger, but it's a start.
llvm-svn: 272944
Kostya Serebryany [Thu, 16 Jun 2016 20:06:06 +0000 (20:06 +0000)]
[sanitizers] introduce yet another API function: __sanitizer_install_malloc_and_free_hooks
llvm-svn: 272943
Rui Ueyama [Thu, 16 Jun 2016 19:48:07 +0000 (19:48 +0000)]
Simplify *(x+y) to x[y]. NFC.
They are equivalent in C (and in C++ in this case).
llvm-svn: 272942