platform/upstream/llvm.git
9 years ago[mips] Fix out-of-date debug information in test file.
Vasileios Kalintiris [Thu, 30 Jul 2015 13:13:09 +0000 (13:13 +0000)]
[mips] Fix out-of-date debug information in test file.

Update the debug info in the check-lines because the change in r243638
introduced a constant initialization before the prologue's end as part
of a register spill.

llvm-svn: 243640

9 years agoMCJITTests/MCJITCAPITest.cpp: Try to appease i686-win32.
NAKAMURA Takumi [Thu, 30 Jul 2015 13:06:53 +0000 (13:06 +0000)]
MCJITTests/MCJITCAPITest.cpp: Try to appease i686-win32.

llvm-svn: 243639

9 years ago[mips][FastISel] Remove hidden mips-fast-isel option.
Vasileios Kalintiris [Thu, 30 Jul 2015 12:39:33 +0000 (12:39 +0000)]
[mips][FastISel] Remove hidden mips-fast-isel option.

Summary:
This hidden option would disable code generation through FastISel by
default. It was removed from the available options and from the
Fast-ISel tests that required it in order to run the tests.

Reviewers: dsanders

Subscribers: qcolombet, llvm-commits

Differential Revision: http://reviews.llvm.org/D11610

llvm-svn: 243638

9 years agoFix issues with separate symbolfile handling
Tamas Berghammer [Thu, 30 Jul 2015 12:38:18 +0000 (12:38 +0000)]
Fix issues with separate symbolfile handling

Differential revision: http://reviews.llvm.org/D11595

llvm-svn: 243637

9 years ago[mips][FastISel] Apply only zero-extension to constants prior to their materialization.
Vasileios Kalintiris [Thu, 30 Jul 2015 11:51:44 +0000 (11:51 +0000)]
[mips][FastISel] Apply only zero-extension to constants prior to their materialization.

Summary:
Previously, we would sign-extend non-boolean negative constants and
zero-extend otherwise. This was problematic for PHI instructions with
negative values that had a type with bitwidth less than that of the
register used for materialization.

More specifically, ComputePHILiveOutRegInfo() assumes the constants
present in a PHI node are zero extended in their container and
afterwards deduces the known bits.

For example, previously we would materialize an i16 -4 with the
following instruction:

  addiu $r, $zero, -4

The register would end-up with the 32-bit 2's complement representation
of -4. However, ComputePHILiveOutRegInfo() would generate a constant
with the upper 16-bits set to zero. The SelectionDAG builder would use
that information to generate an AssertZero node that would remove any
subsequent trunc & zero_extend nodes.

In theory, we should modify ComputePHILiveOutRegInfo() to consult
target-specific hooks about the way they prefer to materialize the
given constants. However, git-blame reports that this specific code
has not been touched since 2011 and it seems to be working well for every
target so far.

Reviewers: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11592

llvm-svn: 243636

9 years ago[OPENMP 4.1] Initial support for extended 'ordered' clause.
Alexey Bataev [Thu, 30 Jul 2015 11:36:16 +0000 (11:36 +0000)]
[OPENMP 4.1] Initial support for extended 'ordered' clause.

OpenMP 4.1 introduces optional argument '(n)' for 'ordered' clause, where 'n' is a number of loops that immediately follow the directive.
'n' must be constant positive integer expressions and it must be less or equal than the number of the loops in the resulting loop nest.
Patch adds parsing and semantic analysis for this optional argument.

llvm-svn: 243635

9 years ago[test-release.sh] Add -no-libunwind to disable it on targets that don't support it.
Daniel Sanders [Thu, 30 Jul 2015 10:14:57 +0000 (10:14 +0000)]
[test-release.sh] Add -no-libunwind to disable it on targets that don't support it.

Summary:
Mips doesn't implement unw_getcontext() or libunwind::Registers_*::jumpto() yet
so we must disable libunwind for this release.

Reviewers: hans

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11563

llvm-svn: 243633

9 years ago[X86] Recognize "flags" as an identifier, not a register in Intel-syntax inline asm
Michael Kuperstein [Thu, 30 Jul 2015 10:10:47 +0000 (10:10 +0000)]
[X86] Recognize "flags" as an identifier, not a register in Intel-syntax inline asm

This contains the test-case for r243630.

Patch by: marina.yatsina@intel.com
Differential Revision: http://reviews.llvm.org/D11513

llvm-svn: 243632

9 years ago[X86] Recognize "flags" as an identifier, not a register in Intel-syntax inline asm
Michael Kuperstein [Thu, 30 Jul 2015 10:10:25 +0000 (10:10 +0000)]
[X86] Recognize "flags" as an identifier, not a register in Intel-syntax inline asm

Patch by: marina.yatsina@intel.com
Differential Revision: http://reviews.llvm.org/D11512

llvm-svn: 243630

9 years agoMark TestMiBreak as falkey on Linux
Tamas Berghammer [Thu, 30 Jul 2015 09:09:22 +0000 (09:09 +0000)]
Mark TestMiBreak as falkey on Linux

llvm-svn: 243628

9 years agoAdd amdopencl environment to triple
Matt Arsenault [Thu, 30 Jul 2015 08:16:51 +0000 (08:16 +0000)]
Add amdopencl environment to triple

This is used by the AMD x86 OpenCL implementation
to change some ABI details on Windows and Linux.

llvm-svn: 243627

9 years ago[Mips] Implement definition of DT_MIPS_RLD_MAP dynamic tag, .rld_map section, and...
Simon Atanasyan [Thu, 30 Jul 2015 07:45:55 +0000 (07:45 +0000)]
[Mips] Implement definition of DT_MIPS_RLD_MAP dynamic tag, .rld_map section, and __RLD_MAP symbol

llvm-svn: 243626

9 years agoAdd a comment explaining differing Windows behavior.
Sean Silva [Thu, 30 Jul 2015 07:30:24 +0000 (07:30 +0000)]
Add a comment explaining differing Windows behavior.

llvm-svn: 243625

9 years agoEnable accidentally-disabled tests.
Sean Silva [Thu, 30 Jul 2015 07:23:17 +0000 (07:23 +0000)]
Enable accidentally-disabled tests.

I think I was isolating the failure in the last RUN: line during
development, and forgot to re-enable the others.

llvm-svn: 243624

9 years ago[X86][AVX512BW] Remove whitespaces
Asaf Badouh [Thu, 30 Jul 2015 06:52:26 +0000 (06:52 +0000)]
[X86][AVX512BW] Remove whitespaces

llvm-svn: 243623

9 years ago[LLDB][MIPS] Added expected failure for "test disassembler settings"
Mohit K. Bhakkad [Thu, 30 Jul 2015 05:45:56 +0000 (05:45 +0000)]
[LLDB][MIPS] Added expected failure for "test disassembler settings"
Patch by Nitesh Jain

Reviewers: clayborg, ovyalov.
Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar, emaste, lldb-commits.
Differential Revision: http://reviews.llvm.org/D11562

llvm-svn: 243622

9 years agoClean up test/tools/lldb-mi/variable/main.cpp after r243619
Ilia K [Thu, 30 Jul 2015 05:39:31 +0000 (05:39 +0000)]
Clean up test/tools/lldb-mi/variable/main.cpp after r243619

llvm-svn: 243621

9 years ago[LLDB][MIPS] To handle SI_KERNEL generated for invalid 64 bit address
Mohit K. Bhakkad [Thu, 30 Jul 2015 05:38:11 +0000 (05:38 +0000)]
[LLDB][MIPS] To handle SI_KERNEL generated for invalid 64 bit address
Patch by Nitesh Jain

Reviewers: clayborg, ovyalov.
Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar, emaste, lldb-commits.
Differential Revision: http://reviews.llvm.org/D11176

llvm-svn: 243620

9 years agoFix bug in expression display when determining if a pointer should be treated as...
Ilia K [Thu, 30 Jul 2015 05:32:41 +0000 (05:32 +0000)]
Fix bug in expression display when determining if a pointer should be treated as a string

Summary:
Currently if the "first child" of the pointer is a char type then the pointer is displayed as a string. This test succeeds incorrectly when the pointer is to a structured type with a char type as its first field. Fix this by switching the test to retrieve the pointee type and checking that it is a char type.

Reviewers: abidh, ChuckR, ki.stfu

Subscribers: greggm, lldb-commits

Differential Revision: http://reviews.llvm.org/D11488

llvm-svn: 243619

9 years ago[LLDB][MIPS] Create Unix Signals based on target architecture
Jaydeep Patil [Thu, 30 Jul 2015 05:06:51 +0000 (05:06 +0000)]
[LLDB][MIPS] Create Unix Signals based on target architecture
    SUMMARY:
    The patch creates Unix Signals based on target architecture. For MIPS it creates MipsLinuxSignals.

    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, lldb-commits
    Differential Revision: http://reviews.llvm.org/D11455

llvm-svn: 243618

9 years ago[LoopVer] Add missing std::move
Adam Nemet [Thu, 30 Jul 2015 04:21:13 +0000 (04:21 +0000)]
[LoopVer] Add missing std::move

The reason I was passing this vector by value in the constructor so that
I wouldn't have to copy when initializing the corresponding member but
then I forgot the std::move.

The use-case is LoopDistribution which filters the checks then
std::moves it to LoopVersioning's constructor.  With this interface we
can avoid any copies.

llvm-svn: 243616

9 years agoRevert r243604, it (very likely) caused PR24312.
Nico Weber [Thu, 30 Jul 2015 03:41:05 +0000 (03:41 +0000)]
Revert r243604, it (very likely) caused PR24312.

llvm-svn: 243615

9 years agoRemove some noise "this->"s left behind by r243213.
Richard Smith [Thu, 30 Jul 2015 03:37:16 +0000 (03:37 +0000)]
Remove some noise "this->"s left behind by r243213.

llvm-svn: 243614

9 years ago[LDist] Filter the checks locally rather than in LAA, NFC
Adam Nemet [Thu, 30 Jul 2015 03:29:16 +0000 (03:29 +0000)]
[LDist] Filter the checks locally rather than in LAA, NFC

Before, we were passing the pointer partitions to LAA.  Now, we get all
the checks from LAA and filter out the checks within partitions in
LoopDistribution.

This effectively concludes the steps to move filtering memchecks from
LAA into its clients.  There is still some cleanup left to remove the
unused interfaces in LAA that still take PtrPartition.

(Moving this functionality to LoopDistribution also requires
needsChecking on pointers to be made public.)

llvm-svn: 243613

9 years ago[modules] Remove redundant information written into DeclContext name lookup tables...
Richard Smith [Thu, 30 Jul 2015 03:17:16 +0000 (03:17 +0000)]
[modules] Remove redundant information written into DeclContext name lookup tables. We don't need to store the data length twice.

llvm-svn: 243612

9 years ago[libFuzzer] implement strncmp hook for data-flow-guided fuzzing (w/ and w/o dfsan...
Kostya Serebryany [Thu, 30 Jul 2015 02:33:45 +0000 (02:33 +0000)]
[libFuzzer] implement strncmp hook for data-flow-guided fuzzing (w/ and w/o dfsan), add a test

llvm-svn: 243611

9 years ago[sanitizer] add a weak hook for strncmp interceptor, both to dfsan and other sanitize...
Kostya Serebryany [Thu, 30 Jul 2015 02:32:51 +0000 (02:32 +0000)]
[sanitizer] add a weak hook for strncmp interceptor, both to dfsan and other sanitizers. Hide the declaration and the calls in better macros

llvm-svn: 243610

9 years ago[MCJIT] Fix a memory leak in a unit test that was introduced in r243589.
Lang Hames [Thu, 30 Jul 2015 02:05:37 +0000 (02:05 +0000)]
[MCJIT] Fix a memory leak in a unit test that was introduced in r243589.

llvm-svn: 243609

9 years ago[CMake] Pass -march=i686 when targeting i686 (PR24222)
Hans Wennborg [Thu, 30 Jul 2015 01:45:17 +0000 (01:45 +0000)]
[CMake] Pass -march=i686 when targeting i686 (PR24222)

Clang will not define __i686__, even when the target triple is i686,
without -march=i686.

With this patch, the compiler-rt build will successfully detect that
Clang can target i686.

The open_memstream.cc test is a little funny. Before my patch, it
was invoked with "-m32 -m64". To make it work after my -march
change, I had to add '-march=x86-64'.

Differential Revision: http://reviews.llvm.org/D11618

llvm-svn: 243604

9 years ago[libFuzzer] implement memcmp hook for data-flow-guided fuzzing (w/o dfsan), extend...
Kostya Serebryany [Thu, 30 Jul 2015 01:34:58 +0000 (01:34 +0000)]
[libFuzzer] implement memcmp hook for data-flow-guided fuzzing (w/o dfsan), extend the memcmp fuzzer test

llvm-svn: 243603

9 years agoRemove bad test.
Sean Silva [Thu, 30 Jul 2015 01:21:56 +0000 (01:21 +0000)]
Remove bad test.

We currently don't canonicalize paths in the preprocessed files.
But we do when writing to PCH.
This causes a discrepancy on Windows with the test below.
This test fails even on unix if you change the test to use
`%S//preprocess.h`.

I am led to conclude that the invariant that this test was intending to
test has not been upheld for a while (and may never have been).

llvm-svn: 243602

9 years ago[sanitizer] add a weak hook for memcmp interceptor, to be used primarily for fuzzing...
Kostya Serebryany [Thu, 30 Jul 2015 01:19:17 +0000 (01:19 +0000)]
[sanitizer] add a weak hook for memcmp interceptor, to be used primarily for fuzzing. More hooks will be added later. So far this is a Linux-only feature

llvm-svn: 243601

9 years agoAttempt to make clang-x64-ninja-win7 happy.
Sean Silva [Thu, 30 Jul 2015 00:52:32 +0000 (00:52 +0000)]
Attempt to make clang-x64-ninja-win7 happy.

It looks like we were somehow relying somewhere on removing 'foo/./bar'
but *not* 'foo/../foo/bar'. Currently investigating.

llvm-svn: 243600

9 years ago[Sanitizer] Replace diagnostic string literal to workaround CMake 2.8 bug.
Alexey Samsonov [Thu, 30 Jul 2015 00:50:40 +0000 (00:50 +0000)]
[Sanitizer] Replace diagnostic string literal to workaround CMake 2.8 bug.

Let me tell you a story. Suppose you want to build your project (e.g. LLVM)
with CMake 2.8, Clang and AddressSanitizer. You also want to ensure that
Clang is fresh enough and check that CMAKE_CXX_COMPILER_VERSION is 3.1+.
This check would fail - CMake would fail to correctly calculate compiler
version if you pass CMAKE_CXX_FLAGS=-fsanitize=address.

The problem is funky compiler version calculation in
CMakeDetermineCompilerId.cmake module: it compiles the sample source
file with provided compiler and compile flags, runs "strings" and greps
for "INFO:" ASCII strings contained on the executable to fetch
"INFO:compiler", "INFO:compiler_version" etc. It limits the output of
grep to just 4 lines.

Unfortunately, if your executable was built with ASan, it would also contain
an ASCII string
  INFO: %s ignores mlock/mlockall/munlock/munlockall
and INFO:compiler_version string would never be parsed.

All of the above actually happened after r243574 when we tried to
configure libcxx with just-built Clang with TSan/MSan, and the version
check mentioned above failed in HandleLLVMOptions.cmake

(╯°□°)╯.~.┻━┻

llvm-svn: 243599

9 years agoPrefix make_reverse_iterator with llvm namespace.
Pete Cooper [Thu, 30 Jul 2015 00:40:42 +0000 (00:40 +0000)]
Prefix make_reverse_iterator with llvm namespace.

This was fallout from r243581.  Turns out C++14 has make_reverse_iterator.

Thanks to Filipe and David for the quick fix suggestion.

llvm-svn: 243598

9 years agoAvoid failure to canonicalize '..'.
Sean Silva [Thu, 30 Jul 2015 00:26:34 +0000 (00:26 +0000)]
Avoid failure to canonicalize '..'.

Also fix completely broken and untested code which was hiding the
primary bug. The !LLVM_ON_UNIX branch of the ifdef was actually a no-op.

I ran into this in the wild. It was causing failures in our SDK build.

Ideally we'd have a perfect llvm::sys::fs::canonical, but at least this
is a step in the right direction, and fixes an obviously broken case.
In some sense the test case I've added here is an integration test. We
should have these routines thoroughly unit tested in llvm::sys::fs.

llvm-svn: 243597

9 years agopush fast-math check for machine-combiner reassociations into instruction-type check...
Sanjay Patel [Thu, 30 Jul 2015 00:04:21 +0000 (00:04 +0000)]
push fast-math check for machine-combiner reassociations into instruction-type check; NFC

This makes it simpler to add instruction types that don't depend on fast-math.

llvm-svn: 243596

9 years ago[asan,tsan,msan] move the memcmp interceptor from asan/tsan to sanitizer_common....
Kostya Serebryany [Wed, 29 Jul 2015 23:53:08 +0000 (23:53 +0000)]
[asan,tsan,msan] move the memcmp interceptor from asan/tsan to sanitizer_common. This may potentially lead to more reports from msan as it now sees the reads inside memcmp. To disable, use the flag intercept_memcmp=0. Likewise, it may potentially cause new races to appear due to more strict memcmp checking (flag strict_memcmp=1)

llvm-svn: 243595

9 years agoFix -Wredundant-move warning.
Richard Trieu [Wed, 29 Jul 2015 23:47:19 +0000 (23:47 +0000)]
Fix -Wredundant-move warning.

Without DR1579 implemented, the only case for -Wredundant-move is for a
parameter being returned with the same type as the function return type.  Also
include a check to verify that the move constructor will be used by matching
nodes in the AST dump.

llvm-svn: 243594

9 years agoRevert recent CMake changes again due to failing compiler-rt builds
Eric Fiselier [Wed, 29 Jul 2015 23:46:55 +0000 (23:46 +0000)]
Revert recent CMake changes again due to failing compiler-rt builds

llvm-svn: 243593

9 years ago[modules] When performing redeclaration lookup for a using declaration, prefer
Richard Smith [Wed, 29 Jul 2015 23:38:25 +0000 (23:38 +0000)]
[modules] When performing redeclaration lookup for a using declaration, prefer
UsingShadowDecls over other declarations of the same entity in the lookup
results. This ensures that we build correct redeclaration chains for the
UsingShadowDecls (otherwise we could see assertions and other misbehavior in
modules builds, when merging combines multiple redeclaration chains for the
same entity from the same module into one chain).

llvm-svn: 243592

9 years agoAttempt to fix build issues introduced by
Eric Fiselier [Wed, 29 Jul 2015 23:23:18 +0000 (23:23 +0000)]
Attempt to fix build issues introduced by
r243574

llvm-svn: 243591

9 years agoIR: Implement Value::mergeUseLists() iteratively
Matthias Braun [Wed, 29 Jul 2015 23:22:48 +0000 (23:22 +0000)]
IR: Implement Value::mergeUseLists() iteratively

This avoids stack overflows when the the compiler does not perform tail call
elimination. Apparently this happens for MSVC with the /Ob2 switch which
may be used by external code including this header.

Reported by and based on a patch from Jean-Francois Riendeau.

Related to rdar://21900756

llvm-svn: 243590

9 years ago[MCJIT] Fix PR20656 by teaching MCJIT to honor ExecutionEngine's global mapping.
Lang Hames [Wed, 29 Jul 2015 23:12:33 +0000 (23:12 +0000)]
[MCJIT] Fix PR20656 by teaching MCJIT to honor ExecutionEngine's global mapping.

This is important for users of the C API who can't supply custom symbol
resolvers yet.

llvm-svn: 243589

9 years agoRemove unused #includes.
Rui Ueyama [Wed, 29 Jul 2015 22:53:29 +0000 (22:53 +0000)]
Remove unused #includes.

llvm-svn: 243588

9 years agoCOFF: Suppress "Duplicate entry" warning of lib.exe
Rui Ueyama [Wed, 29 Jul 2015 22:38:27 +0000 (22:38 +0000)]
COFF: Suppress "Duplicate entry" warning of lib.exe

We create a module-definition file and give that to lib.exe to
create an import library file. A module-definition has to be
syntactically and semantically correct, of course.

There was a case that we created a module-definition file that
lib.exe would complain for duplicate entries. If a user gives
an unmangled and mangled name for the same symbol, we would end
up having two duplicate lines for the mangled name in a module-
definition file.

This patch fixes that issue by uniquefying entries by mangled
symbol name.

llvm-svn: 243587

9 years agoFix typo in unused variable name.
Nick Lewycky [Wed, 29 Jul 2015 22:38:23 +0000 (22:38 +0000)]
Fix typo in unused variable name.

llvm-svn: 243586

9 years agoFix typo "fuction" noticed in comments in AssumptionCache.h, and also all the other...
Nick Lewycky [Wed, 29 Jul 2015 22:32:47 +0000 (22:32 +0000)]
Fix typo "fuction" noticed in comments in AssumptionCache.h, and also all the other files that have the same typo. All comments, no functionality change! (Merely a "fuctionality" change.)

Bonus change to remove emacs major mode marker from SystemZMachineFunctionInfo.cpp because emacs already knows it's C++ from the extension. Also fix typo "appeary" in AMDGPUMCAsmInfo.h.

llvm-svn: 243585

9 years ago[dsymutil] Re-add command line option -v this time printing the version.
Frederic Riss [Wed, 29 Jul 2015 22:29:50 +0000 (22:29 +0000)]
[dsymutil] Re-add command line option -v this time printing the version.

llvm-svn: 243584

9 years ago[dsymutil] Use option categories.
Frederic Riss [Wed, 29 Jul 2015 22:29:46 +0000 (22:29 +0000)]
[dsymutil] Use option categories.

Prevent all the unrelated LLVM options to appear in the -help output
by introducing a tool specific option category. As a drive-by improve
the wording of the help message.

llvm-svn: 243583

9 years ago[dsymutil] Rename -v option to -verbose
Frederic Riss [Wed, 29 Jul 2015 22:29:34 +0000 (22:29 +0000)]
[dsymutil] Rename -v option to -verbose

The dsymutil-classic -v option dumps the tool version rather than
putting it in verbose mode. Rename -v to -verbose and update the
tests that use it (in the process removing it from a few tests that
didn't require it anymore since the -dump-debug-map option was
introduced).
A followup commit will reintroduce the -v option that dumps the
version.

llvm-svn: 243582

9 years agoReapply "Add reverse(ContainerTy) range adapter."
Pete Cooper [Wed, 29 Jul 2015 22:19:09 +0000 (22:19 +0000)]
Reapply "Add reverse(ContainerTy) range adapter."

This reverts commit r243567, which ultimately reapplies r243563.

The fix here was to use std::enable_if for overload resolution.  Thanks to David
Blaikie for lots of help on this, and for the extra tests!

Original commit message follows:

For cases where we needed a foreach loop in reverse over a container,
we had to do something like

 for (const GlobalValue *GV : make_range(TypeInfos.rbegin(),
                                         TypeInfos.rend())) {

This provides a convenience method which shortens this to

 for (const GlobalValue *GV : reverse(TypeInfos)) {

There are 2 versions of this, with a preference to the rbegin() version.

The first uses rbegin() and rend() to construct an iterator_range.

The second constructs an iterator_range from the begin() and end() methods
wrapped in std::reverse_iterator's.

Reviewed by David Blaikie.

llvm-svn: 243581

9 years agoMake DWARF at_comp_dir symbolic links configurable via plugin.symbol-file.dwarf.comp...
Oleksiy Vyalov [Wed, 29 Jul 2015 22:18:16 +0000 (22:18 +0000)]
Make DWARF at_comp_dir symbolic links configurable via plugin.symbol-file.dwarf.comp-dir-symlink-paths setting.

http://reviews.llvm.org/D11586

llvm-svn: 243580

9 years ago[ELF2] Templatize addChunk and handle section flags.
Michael J. Spencer [Wed, 29 Jul 2015 22:14:50 +0000 (22:14 +0000)]
[ELF2] Templatize addChunk and handle section flags.

llvm-svn: 243579

9 years agoRename hasCompatibleFunctionAttributes->areInlineCompatible based
Eric Christopher [Wed, 29 Jul 2015 22:09:48 +0000 (22:09 +0000)]
Rename hasCompatibleFunctionAttributes->areInlineCompatible based
on suggestions. Currently the function is only used for inline purposes
and this is more descriptive for the use.

llvm-svn: 243578

9 years ago[X86][SSE] Keep 32-bit target i64 vector shifts on SSE unit.
Simon Pilgrim [Wed, 29 Jul 2015 21:44:27 +0000 (21:44 +0000)]
[X86][SSE] Keep 32-bit target i64 vector shifts on SSE unit.

This patch improves the 32-bit target i64 constant matching to detect the shuffle vector splats that are introduced by i64 vector shift vectorization (D8416).

Differential Revision: http://reviews.llvm.org/D11327

llvm-svn: 243577

9 years agoAArch64: use 32-bit MOV rather than UBFX to truncate registers.
Tim Northover [Wed, 29 Jul 2015 21:34:32 +0000 (21:34 +0000)]
AArch64: use 32-bit MOV rather than UBFX to truncate registers.

It's potentially more efficient on Cyclone, and from the optimization guides &
schedulers looks like it has no effect on Cortex-A53 or A57. In general you'd
expect a MOV to be about the most efficient instruction with its semantics,
even though the official "UXTW" alias is really a UBFX.

llvm-svn: 243576

9 years agoMIR Serialization: Serialize the frame info's save and restore points.
Alex Lorenz [Wed, 29 Jul 2015 21:09:09 +0000 (21:09 +0000)]
MIR Serialization: Serialize the frame info's save and restore points.

This commit serializes the save and restore machine basic block references from
the machine frame information class.

llvm-svn: 243575

9 years agoRecommit r243503 "[libcxx] Cleanup CMake configuration and integrate with LLVM"
Eric Fiselier [Wed, 29 Jul 2015 21:07:28 +0000 (21:07 +0000)]
Recommit r243503 "[libcxx] Cleanup CMake configuration and integrate with LLVM"

This change was reverted in r243550 because it broke clang-format builds
(see PR24306).

This patch recommits a fixed version of the original.

llvm-svn: 243574

9 years agoCOFF: Fix command line option spelling.
Rui Ueyama [Wed, 29 Jul 2015 21:01:15 +0000 (21:01 +0000)]
COFF: Fix command line option spelling.

llvm-svn: 243573

9 years agoMIR Parser: Extract the code that parses MBB references into a new method. NFC.
Alex Lorenz [Wed, 29 Jul 2015 20:57:11 +0000 (20:57 +0000)]
MIR Parser: Extract the code that parses MBB references into a new method. NFC.

This commit extracts the code that's used by the class 'MIRParserImpl' to parse
the machine basic block references into a new method named 'parseMBBReference'.

llvm-svn: 243572

9 years ago[SemaAccess] Provide meaningful message when we hit llvm_unreachable().
Davide Italiano [Wed, 29 Jul 2015 20:55:04 +0000 (20:55 +0000)]
[SemaAccess] Provide meaningful message when we hit llvm_unreachable().

llvm-svn: 243571

9 years agoRemove astyle-options.
Rui Ueyama [Wed, 29 Jul 2015 20:48:02 +0000 (20:48 +0000)]
Remove astyle-options.

We have our own code formatting tool, clang-format.
I believe no one is using "astyle" to format the code.

llvm-svn: 243570

9 years ago[X86][SSE] Vectorize i64 ASHR operations
Simon Pilgrim [Wed, 29 Jul 2015 20:31:45 +0000 (20:31 +0000)]
[X86][SSE] Vectorize i64 ASHR operations

This patch vectorizes the v2i64/v4i64 ASHR shift operations - the last remaining integer vector shifts that are still being transferred to/from the scalar unit to be completed.

Differential Revision: http://reviews.llvm.org/D11439

llvm-svn: 243569

9 years agoCOFF: Ignore /ThrowNew command line option.
Rui Ueyama [Wed, 29 Jul 2015 20:29:15 +0000 (20:29 +0000)]
COFF: Ignore /ThrowNew command line option.

This command line option is added since MSVC 2015. Our wild guess is
that the flag is for LTCG and we can safely ignore that.

llvm-svn: 243568

9 years agoRevert "Add reverse(ContainerTy) range adapter."
Pete Cooper [Wed, 29 Jul 2015 20:29:10 +0000 (20:29 +0000)]
Revert "Add reverse(ContainerTy) range adapter."

This reverts commit r243563.

The GCC buildbots were extremely unhappy about this.  Reverting while
we discuss a better way of doing overload resolution.

llvm-svn: 243567

9 years ago[opaque pointers] Remove use of PointerType::getElementType in favor of GEPOperator...
David Blaikie [Wed, 29 Jul 2015 20:26:23 +0000 (20:26 +0000)]
[opaque pointers] Remove use of PointerType::getElementType in favor of GEPOperator::getSourceElementType

llvm-svn: 243566

9 years agoCOFF: Add /safeseh command line option.
Rui Ueyama [Wed, 29 Jul 2015 20:25:40 +0000 (20:25 +0000)]
COFF: Add /safeseh command line option.

If /safeseh is specified, all input files must be compatible with Safe SEH.

llvm-svn: 243565

9 years ago[asan] XFAIL 1 test on Android.
Evgeniy Stepanov [Wed, 29 Jul 2015 20:17:21 +0000 (20:17 +0000)]
[asan] XFAIL 1 test on Android.

The test uses source file relative paths which does not work when the
test is executed on a remote device.

llvm-svn: 243564

9 years agoAdd reverse(ContainerTy) range adapter.
Pete Cooper [Wed, 29 Jul 2015 20:00:39 +0000 (20:00 +0000)]
Add reverse(ContainerTy) range adapter.

For cases where we needed a foreach loop in reverse over a container,
we had to do something like

  for (const GlobalValue *GV : make_range(TypeInfos.rbegin(),
                                          TypeInfos.rend())) {

This provides a convenience method which shortens this to

  for (const GlobalValue *GV : reverse(TypeInfos)) {

There are 2 versions of this, with a preference to the rbegin() version.

The first uses rbegin() and rend() to construct an iterator_range.

The second constructs an iterator_range from the begin() and end() methods
wrapped in std::reverse_iterator's.

Reviewed by David Blaikie.

llvm-svn: 243563

9 years ago[ASan] Disable dynamic alloca and UAR detection in presence of returns_twice calls.
Alexey Samsonov [Wed, 29 Jul 2015 19:36:08 +0000 (19:36 +0000)]
[ASan] Disable dynamic alloca and UAR detection in presence of returns_twice calls.

Summary:
returns_twice (most importantly, setjmp) functions are
optimization-hostile: if local variable is promoted to register, and is
changed between setjmp() and longjmp() calls, this update will be
undone. This is the reason why "man setjmp" advises to mark all these
locals as "volatile".

This can not be enough for ASan, though: when it replaces static alloca
with dynamic one, optionally called if UAR mode is enabled, it adds a
whole lot of SSA values, and computations of local variable addresses,
that can involve virtual registers, and cause unexpected behavior, when
these registers are restored from buffer saved in setjmp.

To fix this, just disable dynamic alloca and UAR tricks whenever we see
a returns_twice call in the function.

Reviewers: rnk

Subscribers: llvm-commits, kcc

Differential Revision: http://reviews.llvm.org/D11495

llvm-svn: 243561

9 years agoCOFF: ARM: Fix relocations to thumb code.
Rui Ueyama [Wed, 29 Jul 2015 19:25:00 +0000 (19:25 +0000)]
COFF: ARM: Fix relocations to thumb code.

Windows ARM is the thumb ARM environment, and pointers to thumb code
needs to have its LSB set. When we apply relocations, we need to
adjust the LSB if it points to an executable section.

llvm-svn: 243560

9 years agoCOFF: ARM: Fix DLL import table.
Rui Ueyama [Wed, 29 Jul 2015 19:24:58 +0000 (19:24 +0000)]
COFF: ARM: Fix DLL import table.

The previous test was testing -flavor link. This patch correctly
tests link2 and fixes a bug that we didn't emit import thunks.

llvm-svn: 243559

9 years ago[llvm-objdump] Inverting logic to match the word "predicate". Returning true when...
Colin LeMahieu [Wed, 29 Jul 2015 19:21:13 +0000 (19:21 +0000)]
[llvm-objdump] Inverting logic to match the word "predicate".  Returning true when we want it rather than when we want to discard it.

llvm-svn: 243558

9 years agoCOFF: Fix seh.test.
Rui Ueyama [Wed, 29 Jul 2015 19:17:15 +0000 (19:17 +0000)]
COFF: Fix seh.test.

seh.test was testing -flavor link. This should have been testing
-flavor link2.

llvm-svn: 243557

9 years ago[llvm-objdump] Merging MachO DumpSections in to FilterSections. Simplifying some...
Colin LeMahieu [Wed, 29 Jul 2015 19:08:10 +0000 (19:08 +0000)]
[llvm-objdump] Merging MachO DumpSections in to FilterSections.  Simplifying some predicate logic.

llvm-svn: 243556

9 years agoRoll forward r242871
Jingyue Wu [Wed, 29 Jul 2015 18:59:09 +0000 (18:59 +0000)]
Roll forward r242871

r242871 missed one place that should be guarded with isPhysicalReg. This patch
fixes that.

llvm-svn: 243555

9 years agoMIR Serialization: Serialize the '.cfi_def_cfa' CFI instruction.
Alex Lorenz [Wed, 29 Jul 2015 18:57:23 +0000 (18:57 +0000)]
MIR Serialization: Serialize the '.cfi_def_cfa' CFI instruction.

llvm-svn: 243554

9 years agoMIR Parser: Parse multiple LHS register machine operands.
Alex Lorenz [Wed, 29 Jul 2015 18:51:21 +0000 (18:51 +0000)]
MIR Parser: Parse multiple LHS register machine operands.

llvm-svn: 243553

9 years agoUse the AddAllArgs overload which accepts an ArrayRef of OptSpecifier.
Douglas Katzman [Wed, 29 Jul 2015 18:39:14 +0000 (18:39 +0000)]
Use the AddAllArgs overload which accepts an ArrayRef of OptSpecifier.

Differential Revision: http://reviews.llvm.org/D11599

llvm-svn: 243552

9 years agoCentralize where we update the source file contents in SourceManager::GetFile() in...
Greg Clayton [Wed, 29 Jul 2015 18:37:25 +0000 (18:37 +0000)]
Centralize where we update the source file contents in SourceManager::GetFile() in case APIs are called that don't update the source.

The following functions were the only functions that updates the source file:

SourceManager::File::DisplaySourceLines()
SourceManager::File::FindLinesMatchingRegex()

But there we API calls that were using the SourceManager::File and asking it questions, like "is line 12 valid" and that might respond incorrectly if the source file had been updated.

<rdar://problem/21269402>

llvm-svn: 243551

9 years agoRevert r243503 "[libcxx] Cleanup CMake configuration and integrate with LLVM"
Hans Wennborg [Wed, 29 Jul 2015 18:32:21 +0000 (18:32 +0000)]
Revert r243503 "[libcxx] Cleanup CMake configuration and integrate with LLVM"

This caused clang-format to stop linking on Mac; see PR24306.

llvm-svn: 243550

9 years agomove DAGCombiner's allowableAlignment() helper function into the TLI
Sanjay Patel [Wed, 29 Jul 2015 18:24:18 +0000 (18:24 +0000)]
move DAGCombiner's allowableAlignment() helper function into the TLI

Making allowableAlignment() more accessible was suggested as a predecessor patch
for D10662, so I've pulled it into TargetLowering. This let's us remove 4 instances
of duplicate logic in LegalizeDAG.

There's a subtle functional change in the implementation: the existing
allowableAlignment() code was using getPrefTypeAlignment() when checking
alignment with the DataLayout and assumed that was fast. In this implementation,
we use getABITypeAlignment() and assume that is fast. See the TODO comment or the
discussion in the Phab review for future improvements in this implementation
(don't use the data layout at all).

There are no regression test changes from this difference, and I'm not sure how to
expose it via a test. I think we actually do want to provide the 'Fast' param when
checking this from DAGCombiner::MergeConsecutiveStores(). Ie, we shouldn't merge
stores if the new stores are not going to be fast. But that change will require
fixing allowsMisalignedMemoryAccess() overrides as noted in D10662.

Differential Revision: http://reviews.llvm.org/D10905

llvm-svn: 243549

9 years ago[asan] Remove special case mapping on Android/AArch64.
Evgeniy Stepanov [Wed, 29 Jul 2015 18:22:25 +0000 (18:22 +0000)]
[asan] Remove special case mapping on Android/AArch64.

ASan shadow on Android starts at address 0 for both historic and
performance reasons. This is possible because the platform mandates
-pie, which makes lower memory region always available.

This is not such a good idea on 64-bit platforms because of MAP_32BIT
incompatibility.

This patch changes Android/AArch64 mapping to be the same as that of
Linux/AAarch64.

llvm-svn: 243548

9 years agoCFI: Update tests for various bit vector sizes following lowerbitsets optzns.
Peter Collingbourne [Wed, 29 Jul 2015 18:12:45 +0000 (18:12 +0000)]
CFI: Update tests for various bit vector sizes following lowerbitsets optzns.

Also add a test to ensure that this doesn't regress.

Differential Revision: http://reviews.llvm.org/D11584

llvm-svn: 243547

9 years agoLowerBitSets: Add debugging output.
Peter Collingbourne [Wed, 29 Jul 2015 18:12:36 +0000 (18:12 +0000)]
LowerBitSets: Add debugging output.

Differential Revision: http://reviews.llvm.org/D11583

llvm-svn: 243546

9 years ago[Unroll] Handle SwitchInst properly.
Michael Zolotukhin [Wed, 29 Jul 2015 18:10:33 +0000 (18:10 +0000)]
[Unroll] Handle SwitchInst properly.

Previously successor selection was simply wrong.

llvm-svn: 243545

9 years ago[Unroll] Don't crash when simplified branch condition is undef.
Michael Zolotukhin [Wed, 29 Jul 2015 18:10:29 +0000 (18:10 +0000)]
[Unroll] Don't crash when simplified branch condition is undef.

llvm-svn: 243544

9 years agoRename test full-unroll-bad-geps.ll to full-unroll-crashers.ll.
Michael Zolotukhin [Wed, 29 Jul 2015 18:10:23 +0000 (18:10 +0000)]
Rename test full-unroll-bad-geps.ll to full-unroll-crashers.ll.

No reason to limit it only to GEP-related crashes. More tests are to
come here.

llvm-svn: 243543

9 years agoFix typos in comments. NFC.
Lang Hames [Wed, 29 Jul 2015 18:07:48 +0000 (18:07 +0000)]
Fix typos in comments. NFC.

llvm-svn: 243542

9 years agoAdd a function to make a mutex-protected copy of a breakpoint site's
Jim Ingham [Wed, 29 Jul 2015 17:51:36 +0000 (17:51 +0000)]
Add a function to make a mutex-protected copy of a breakpoint site's
owners list, so the StopInfo machinery can get the list of owners without
some other thread being able to mess up the list by deleting/disabline one of its
locations in the process of doing so.

<rdar://problem/18685197>

llvm-svn: 243541

9 years agoRevert "[PeepholeOptimizer] Look through PHIs to find additional register sources"
Bruno Cardoso Lopes [Wed, 29 Jul 2015 17:46:47 +0000 (17:46 +0000)]
Revert "[PeepholeOptimizer] Look through PHIs to find additional register sources"

Reported to Broke some internal tests: PR24303

This reverts commit r243486.

llvm-svn: 243540

9 years agoAdd an ArgList::AddAllArgs that accepts a vector of OptSpecifier.
Douglas Katzman [Wed, 29 Jul 2015 17:34:41 +0000 (17:34 +0000)]
Add an ArgList::AddAllArgs that accepts a vector of OptSpecifier.

This lifts the somewhat arbitrary restriction on 3 OptSpecifiers.

Differential Revision: http://reviews.llvm.org/D11597

llvm-svn: 243539

9 years agoDisable -Wpessimizing-move and -Wredundant-move in template instantiations.
Richard Trieu [Wed, 29 Jul 2015 17:03:34 +0000 (17:03 +0000)]
Disable -Wpessimizing-move and -Wredundant-move in template instantiations.

Dependent types can throw off the analysis for these warnings, possibly giving
conflicting warnings and fix-its.  Disabling the warning in template
instantiations will prevent this problem, and will still catch the
non-dependent cases in templates.

llvm-svn: 243538

9 years agoAArch64: use AddressingModes.h accessors for compare shifts
Tim Northover [Wed, 29 Jul 2015 16:39:56 +0000 (16:39 +0000)]
AArch64: use AddressingModes.h accessors for compare shifts

No functional change because "lsl #12" is actually encoded as 12, but one less
bug if someone ever decides to change that for the giggles.

llvm-svn: 243536

9 years agoCOFF: Fix SECREL and SECTION relocations.
Rui Ueyama [Wed, 29 Jul 2015 16:30:45 +0000 (16:30 +0000)]
COFF: Fix SECREL and SECTION relocations.

SECREL should sets the 32-bit offset of the target from the beginning
of *target's* output section. Previously, the offset from the beginning
of source's output section was used instead.

SECTION means the target section's index, and not the source section's
index. This patch fixes that issue too.

llvm-svn: 243535

9 years agoELF2: Use DenseMap instead of std::map for a symbol table.
Rui Ueyama [Wed, 29 Jul 2015 16:30:40 +0000 (16:30 +0000)]
ELF2: Use DenseMap instead of std::map for a symbol table.

We use DenseMap for COFF too.

llvm-svn: 243534

9 years agoCOFF: Remove unused command line option.
Rui Ueyama [Wed, 29 Jul 2015 16:30:34 +0000 (16:30 +0000)]
COFF: Remove unused command line option.

llvm-svn: 243533

9 years agoCOFF: Set load config table entry on non-x86.
Rui Ueyama [Wed, 29 Jul 2015 16:30:31 +0000 (16:30 +0000)]
COFF: Set load config table entry on non-x86.

llvm-svn: 243532

9 years agotest-release.sh: Add option for building the OpenMP run-time
Hans Wennborg [Wed, 29 Jul 2015 16:29:06 +0000 (16:29 +0000)]
test-release.sh: Add option for building the OpenMP run-time

This isn't part of the official release process, but provides a convenient way
to build binaries for those who want to experiment with it. Hopefully the run-
time can be part of the regular build and release process for 3.8.

Differential Revision: http://reviews.llvm.org/D11494

llvm-svn: 243531