platform/upstream/llvm.git
9 years agoFully fix Bug #22115.
Justin Hibbits [Sat, 10 Jan 2015 01:57:21 +0000 (01:57 +0000)]
Fully fix Bug #22115.

Summary:
In the previous commit, the register was saved, but space was not allocated.
This resulted in the parameter save area potentially clobbering r30, leading to
nasty results.

Test Plan: Tests updated

Reviewers: hfinkel

Subscribers: llvm-commits

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

llvm-svn: 225573

9 years agoAdd C++ breakpoint tests where names are partially specified to ensure we don't regre...
Greg Clayton [Sat, 10 Jan 2015 01:35:02 +0000 (01:35 +0000)]
Add C++ breakpoint tests where names are partially specified to ensure we don't regress on this again.

Top of tree never regressed, but we have internal branches that we constantly merge and we need to make sure we don't regress.

<rdar://problem/19429907>

llvm-svn: 225572

9 years agoFix temporary lifetime extension from an initializer using braced "functional"
Richard Smith [Sat, 10 Jan 2015 01:28:13 +0000 (01:28 +0000)]
Fix temporary lifetime extension from an initializer using braced "functional"
cast notation T{...} when T is a reference type.

llvm-svn: 225571

9 years agoDon't emit implicit template instantiations eagerly (PR21718)
Hans Wennborg [Sat, 10 Jan 2015 01:19:48 +0000 (01:19 +0000)]
Don't emit implicit template instantiations eagerly (PR21718)

Their linkage can change if they are later explicitly instantiated. We would
previously emit such functions eagerly (as opposed to lazily on first use) if
they have a 'dllexport' or 'used' attribute, and fail an assert when hitting the
explicit instantiation.

This is achieved by replacing the old CodeGenModule::MayDeferGeneration() method
with two new ones: MustBeEmitted() and MayBeEmittedEagerly().

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

llvm-svn: 225570

9 years agoFix undefined behavior (shift of negative value) in RuntimeDyldMachOAArch64::encodeAd...
Alexey Samsonov [Sat, 10 Jan 2015 00:46:38 +0000 (00:46 +0000)]
Fix undefined behavior (shift of negative value) in RuntimeDyldMachOAArch64::encodeAddend.

Test Plan: regression test suite with/without UBSan.

Reviewers: lhames, ributzka

Subscribers: aemerson, llvm-commits

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

llvm-svn: 225568

9 years agoRespect the fact that the result object claims it doesn't want to be interactive...
Greg Clayton [Sat, 10 Jan 2015 00:42:12 +0000 (00:42 +0000)]
Respect the fact that the result object claims it doesn't want to be interactive by not forwarding STDIN to the python invocation when it isn't desired.

This fixes an issue of running "script" commands via SBDebugger::HandleCommand(...) and SBCommandInterpreter::HandleCommand(...) deadlocking Xcode.

<rdar://problem/18075038>

llvm-svn: 225567

9 years ago[PowerPC] Readjust the loop unrolling threshold
Hal Finkel [Sat, 10 Jan 2015 00:31:10 +0000 (00:31 +0000)]
[PowerPC] Readjust the loop unrolling threshold

Now that the way that the partial unrolling threshold for small loops is used
to compute the unrolling factor as been corrected, a slightly smaller threshold
is preferable. This is expected; other targets may need to re-tune as well.

llvm-svn: 225566

9 years ago[LoopUnroll] Fix the partial unrolling threshold for small loop sizes
Hal Finkel [Sat, 10 Jan 2015 00:30:55 +0000 (00:30 +0000)]
[LoopUnroll] Fix the partial unrolling threshold for small loop sizes

When we compute the size of a loop, we include the branch on the backedge and
the comparison feeding the conditional branch. Under normal circumstances,
these don't get replicated with the rest of the loop body when we unroll. This
led to the somewhat surprising behavior that really small loops would not get
unrolled enough -- they could be unrolled more and the resulting loop would be
below the threshold, because we were assuming they'd take
(LoopSize * UnrollingFactor) instructions after unrolling, instead of
(((LoopSize-2) * UnrollingFactor)+2) instructions. This fixes that computation.

llvm-svn: 225565

9 years ago[TestInferiorAssert] Differentiate DWARF and DSYM tests with suffixes.
Siva Chandra [Sat, 10 Jan 2015 00:25:23 +0000 (00:25 +0000)]
[TestInferiorAssert] Differentiate DWARF and DSYM tests with suffixes.

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 225564

9 years agoSupport Newlib as libc++'s C library [cstdio part, part 2]
Jonathan Roelofs [Sat, 10 Jan 2015 00:08:00 +0000 (00:08 +0000)]
Support Newlib as libc++'s C library [cstdio part, part 2]

Wrappers for clearerr, feof, ferror (which newlib implements as macros).

http://reviews.llvm.org/D5420

llvm-svn: 225563

9 years agoUse the DiagnosticHandler to print diagnostics when reading bitcode.
Rafael Espindola [Sat, 10 Jan 2015 00:07:30 +0000 (00:07 +0000)]
Use the DiagnosticHandler to print diagnostics when reading bitcode.

The bitcode reading interface used std::error_code to report an error to the
callers and it is the callers job to print diagnostics.

This is not ideal for error handling or diagnostic reporting:

* For error handling, all that the callers care about is 3 possibilities:
  * It worked
  * The bitcode file is corrupted/invalid.
  * The file is not bitcode at all.

* For diagnostic, it is user friendly to include far more information
  about the invalid case so the user can find out what is wrong with the
  bitcode file. This comes up, for example, when a developer introduces a
  bug while extending the format.

The compromise we had was to have a lot of error codes.

With this patch we use the DiagnosticHandler to communicate with the
human and std::error_code to communicate with the caller.

This allows us to have far fewer error codes and adds the infrastructure to
print better diagnostics. This is so because the diagnostics are printed when
he issue is found. The code that detected the problem in alive in the stack and
can pass down as much context as needed. As an example the patch updates
test/Bitcode/invalid.ll.

Using a DiagnosticHandler also moves the fatal/non-fatal error decision to the
caller. A simple one like llvm-dis can just use fatal errors. The gold plugin
needs a bit more complex treatment because of being passed non-bitcode files. An
hypothetical interactive tool would make all bitcode errors non-fatal.

llvm-svn: 225562

9 years agoRemove unnecessary/incorrect XFAIL after the revert of 225000
David Blaikie [Fri, 9 Jan 2015 23:38:45 +0000 (23:38 +0000)]
Remove unnecessary/incorrect XFAIL after the revert of 225000

llvm-svn: 225561

9 years agoRevert "Reapply debug info changes now that more precise column information is availa...
David Blaikie [Fri, 9 Jan 2015 23:27:12 +0000 (23:27 +0000)]
Revert "Reapply debug info changes now that more precise column information is available."

While the clang patch is reverted pending investigation/fixes.

This reverts commit r225001.

llvm-svn: 225560

9 years agoclang-format: [Java] Support formatting qualified annotations.
Nico Weber [Fri, 9 Jan 2015 23:25:06 +0000 (23:25 +0000)]
clang-format: [Java] Support formatting qualified annotations.

llvm-svn: 225559

9 years agoFix UBSan error reports in ValueMapCallbackVH and AssertingVH<T> empty/tombstone...
Alexey Samsonov [Fri, 9 Jan 2015 23:17:25 +0000 (23:17 +0000)]
Fix UBSan error reports in ValueMapCallbackVH and AssertingVH<T> empty/tombstone keys generation.

Summary:
One more attempt to fix UBSan reports: make sure DenseMapInfo::getEmptyKey()
and DenseMapInfo::getTombstoneKey() doesn't do any upcasts/downcasts to/from Value*.

Test Plan: check-llvm test suite with/without UBSan bootstrap

Reviewers: chandlerc, dexonsmith

Subscribers: llvm-commits, majnemer

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

llvm-svn: 225558

9 years agoDisable Go bindings test under UBSan.
Alexey Samsonov [Fri, 9 Jan 2015 23:17:23 +0000 (23:17 +0000)]
Disable Go bindings test under UBSan.

llvm-svn: 225557

9 years agoRemove AsanInterceptsSignal in favor of (equivalent) IsDeadlySignal.
Alexey Samsonov [Fri, 9 Jan 2015 23:03:31 +0000 (23:03 +0000)]
Remove AsanInterceptsSignal in favor of (equivalent) IsDeadlySignal.

llvm-svn: 225556

9 years agoRevert "DebugInfo: Generalize debug info location handling" and related commits
David Blaikie [Fri, 9 Jan 2015 23:00:28 +0000 (23:00 +0000)]
Revert "DebugInfo: Generalize debug info location handling" and related commits

This reverts commit r225000, r225021, r225083, r225086, r225090.

The root change (r225000) still has several issues where it's caused
calls to be emitted without debug locations. This causes assertion
failures if/when those calls are inlined.

I'll work up some test cases and fixes before recommitting this.

llvm-svn: 225555

9 years agoFix the JIT event listeners and replace the associated tests.
Andrew Kaylor [Fri, 9 Jan 2015 22:53:24 +0000 (22:53 +0000)]
Fix the JIT event listeners and replace the associated tests.

The changes to EventListenerCommon.h were contributed by Arch Robison.

This fixes bug 22095.

http://reviews.llvm.org/D6905

llvm-svn: 225554

9 years agoUpdate comment.
Michael Zolotukhin [Fri, 9 Jan 2015 22:15:06 +0000 (22:15 +0000)]
Update comment.

llvm-svn: 225553

9 years agoSimplifyCFG: check uses of constant-foldable instrs in switch destinations (PR20210)
Hans Wennborg [Fri, 9 Jan 2015 22:13:31 +0000 (22:13 +0000)]
SimplifyCFG: check uses of constant-foldable instrs in switch destinations (PR20210)

The previous code assumed that such instructions could not have any uses
outside CaseDest, with the motivation that the instruction could not
dominate CommonDest because CommonDest has phi nodes in it. That simply
isn't true; e.g., CommonDest could have an edge back to itself.

llvm-svn: 225552

9 years ago[X86][SSE] Avoid vector byte shuffles with zero by using pshufb to create zeros
Simon Pilgrim [Fri, 9 Jan 2015 22:03:19 +0000 (22:03 +0000)]
[X86][SSE] Avoid vector byte shuffles with zero by using pshufb to create zeros

pshufb can shuffle in zero bytes as well as bytes from a source vector - we can use this to avoid having to shuffle 2 vectors and ORing the result when the used inputs from a vector are all zeroable.

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

llvm-svn: 225551

9 years agoFix an ASAN failure introduced with r225537 (adding the -universal-headers to llvm...
Kevin Enderby [Fri, 9 Jan 2015 21:55:03 +0000 (21:55 +0000)]
Fix an ASAN failure introduced with r225537 (adding the -universal-headers to llvm-obdump).
And a fly by fix to some formatting issues with the same commit.

llvm-svn: 225550

9 years agoModify dotest.py to be able to run without an lldb build.
Stephane Sezer [Fri, 9 Jan 2015 21:54:27 +0000 (21:54 +0000)]
Modify dotest.py to be able to run without an lldb build.

Summary: This will ease llgs development a bit by not requiring an lldb/lldb.py build to launch the tests. Also, we can now use LLDB_DEBUGSERVER_PATH to point to a debug server to use to run the tests. I used that to point to a ds2 build and run llgs tests against ds2.

Reviewers: clayborg, tfiala, vharron

Subscribers: lldb-commits

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

llvm-svn: 225549

9 years agoFix issues with LLDB's interpreter and MS ABI guard variables.
Zachary Turner [Fri, 9 Jan 2015 21:12:22 +0000 (21:12 +0000)]
Fix issues with LLDB's interpreter and MS ABI guard variables.

MS ABI guard variables end with @4IA, so this patch teaches the
interpreter about that.  Additionally, there was an issue with
TurnGuardLoadIntoZero which was causing some guard uses of a
variable to be missed.  This fixes that by calling
Instruction::replaceAllUsesWith() instead of trying to replicate
that function.

llvm-svn: 225547

9 years ago[sanitizer] use the right memory order
Kostya Serebryany [Fri, 9 Jan 2015 21:01:34 +0000 (21:01 +0000)]
[sanitizer] use the right memory order

llvm-svn: 225546

9 years agoAdd a testcase of llvm-lto error handling.
Rafael Espindola [Fri, 9 Jan 2015 20:55:09 +0000 (20:55 +0000)]
Add a testcase of llvm-lto error handling.

llvm-svn: 225545

9 years agoRemove duplicating code. NFC.
Michael Zolotukhin [Fri, 9 Jan 2015 20:36:19 +0000 (20:36 +0000)]
Remove duplicating code. NFC.

The removed condition is checked in the previous loop.

llvm-svn: 225542

9 years agoWalter Brown sent a list of tests which needed 'additional includes' to match what...
Marshall Clow [Fri, 9 Jan 2015 20:25:52 +0000 (20:25 +0000)]
Walter Brown sent a list of tests which needed 'additional includes' to match what was in the standard. Added these includes to the tests. No changes to the library or test results.

llvm-svn: 225541

9 years agoChange int32_t to uint32_t to fix warnings.
Zachary Turner [Fri, 9 Jan 2015 20:15:21 +0000 (20:15 +0000)]
Change int32_t to uint32_t to fix warnings.

Variable was being declared as signed, but treated as unsigned at
every point of use.

Patch by Dan Sinclair
Differential Revision: http://reviews.llvm.org/D6897

llvm-svn: 225540

9 years agoChange auto to size_t to fix warning.
Zachary Turner [Fri, 9 Jan 2015 20:15:03 +0000 (20:15 +0000)]
Change auto to size_t to fix warning.

Patch by Dan Sinclair
Differential Revision: http://reviews.llvm.org/D6899

llvm-svn: 225539

9 years agoMake the list of synthetic children thread safe
Enrico Granata [Fri, 9 Jan 2015 19:47:45 +0000 (19:47 +0000)]
Make the list of synthetic children thread safe

I have been seeing a few crashes where LLDB tries to acquire a cached synthetic child by index, and crashes in the ClusterManager obtaining a shared_ptr for that ValueObject
That kind of crash most often means that I am holding on to a raw pointer to a ValueObject that was let go from the cluster

The main way that could happen is that the synthetic provider is being updated at the same time that some child is being accessed from the previous provider state

This fixes the problem by making the children be stored in a thread-safe map

Fixes rdar://18627964

llvm-svn: 225538

9 years agoAdd the option, -universal-headers, used with -macho to print the Mach-O universal...
Kevin Enderby [Fri, 9 Jan 2015 19:22:37 +0000 (19:22 +0000)]
Add the option, -universal-headers, used with -macho to print the Mach-O universal headers to llvm-objdump.

llvm-svn: 225537

9 years agoRe-reapply r221924: "[GVN] Perform Scalar PRE on gep indices that feed loads before
Tim Northover [Fri, 9 Jan 2015 19:19:56 +0000 (19:19 +0000)]
Re-reapply r221924: "[GVN] Perform Scalar PRE on gep indices that feed loads before
doing Load PRE"

It's not really expected to stick around, last time it provoked a weird LTO
build failure that I can't reproduce now, and the bot logs are long gone. I'll
re-revert it if the failures recur.

Original description: Perform Scalar PRE on gep indices that feed loads before
doing Load PRE.

llvm-svn: 225536

9 years agoFixed an issue where you couldn't delete a user defined regex, python, or multi-word...
Greg Clayton [Fri, 9 Jan 2015 19:08:20 +0000 (19:08 +0000)]
Fixed an issue where you couldn't delete a user defined regex, python, or multi-word command by adding a new "command delete" command.

This new command will delete user defined regular commands, but not aliases. We still have "command unalias" to remove aliases as they are currently in different buckets. Appropriate error messages are displayed to inform the user when "command unalias" is used on removable user defined commands that points users to the "command delete" command.

Added a test to verify we can remove user defined commands and also verify that "command unalias" fails when used on a user defined command.
<rdar://problem/18248300>

llvm-svn: 225535

9 years agoRecommit r224935 with a fix for the ObjC++/AArch64 bug that that revision
Lang Hames [Fri, 9 Jan 2015 18:55:42 +0000 (18:55 +0000)]
Recommit r224935 with a fix for the ObjC++/AArch64 bug that that revision
introduced.

A test case for the bug was already committed in r225385.

Patch by Rafael Espindola.

llvm-svn: 225534

9 years agoParse: Don't crash when an annotation token shows up in a C++11 attr
David Majnemer [Fri, 9 Jan 2015 18:09:39 +0000 (18:09 +0000)]
Parse: Don't crash when an annotation token shows up in a C++11 attr

It's not safe to blindly call getIdentifierInfo without checking the
token is not an annotation token.

llvm-svn: 225533

9 years ago[libc++] Refactor test components into modules.
Dan Albert [Fri, 9 Jan 2015 18:03:29 +0000 (18:03 +0000)]
[libc++] Refactor test components into modules.

Summary:
I've moved the bulk of `lit.cfg` into `test/libcxx/testconfig.py` and
`test/libcxx/testformat.py`. All that remains in `lit.cfg` is the
logic to discover lit.site.cfg if lit.cfg was run directly, and the
logic for loading configuration variants.

The configuration variant flow has changed with this patch. Rather
than instantiating an object of type `<VARIANT>Configuration`, we now
instatiate an object of type `Configuration` that was loaded from the
module `<VARIANT>.testconfig.py`.

This has to be done on a per-project basis rather than in LIT itself
because LIT doesn't actually know where the real test directory is,
only where the site configuration is (which is usually in the output
directory). It's simple enough to do though, so it's fine to require
each project to do it themselves.

I also cleaned up all the pylint issues while I was here, which was
mostly just a matter of fixing long lines.

Reviewers: mclow.lists, jroelofs, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

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

llvm-svn: 225532

9 years agoRevert "Bitcode: Move the DEBUG_LOC record to DEBUG_LOC_OLD"
Duncan P. N. Exon Smith [Fri, 9 Jan 2015 17:53:27 +0000 (17:53 +0000)]
Revert "Bitcode: Move the DEBUG_LOC record to DEBUG_LOC_OLD"

This reverts commit r225498 (but leaves r225499, which was a worthy
cleanup).

My plan was to change `DEBUG_LOC` to store the `MDNode` directly rather
than its operands (patch was to go out this morning), but on reflection
it's not clear that it's strictly better.  (I had missed that the
current code is unlikely to emit the `MDNode` at all.)

Conflicts:
lib/Bitcode/Reader/BitcodeReader.cpp (due to r225499)

llvm-svn: 225531

9 years agoDriver: tweak the code for determining default image name
Hans Wennborg [Fri, 9 Jan 2015 17:38:53 +0000 (17:38 +0000)]
Driver: tweak the code for determining default image name

It seemed odd to have to make DefaultImageName be a mutable member of Driver.
We don't need to the full result of computeTargetTriple() to determine the
image name; just base it on DefaultTargetTriple.

llvm-svn: 225530

9 years ago[mips] Add support for accessing $gp as a named register.
Daniel Sanders [Fri, 9 Jan 2015 17:21:30 +0000 (17:21 +0000)]
[mips] Add support for accessing $gp as a named register.

Summary:
Mips Linux uses $gp to hold a pointer to thread info structure and accesses it
with a named register. This makes this work for LLVM.

The N32 ABI doesn't quite work yet since the frontend generates incorrect IR
for this case. It neglects to truncate the 64-bit GPR to a 32-bit value before
converting to a pointer. Given correct IR (as in the testcase in this patch),
it works correctly.

Reviewers: sstankovic, vmedic, atanasyan

Reviewed By: atanasyan

Subscribers: llvm-commits

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

llvm-svn: 225529

9 years agofix typos; remove names from comments; NFC
Sanjay Patel [Fri, 9 Jan 2015 17:11:51 +0000 (17:11 +0000)]
fix typos; remove names from comments; NFC

llvm-svn: 225528

9 years agoK-Ballo found a place where we were using 'V' as a template parameter. Replace with...
Marshall Clow [Fri, 9 Jan 2015 17:03:36 +0000 (17:03 +0000)]
K-Ballo found a place where we were using 'V' as a template parameter. Replace with '_Vp' for protection against user-defined macros.

llvm-svn: 225527

9 years agoremove names from comments; NFC
Sanjay Patel [Fri, 9 Jan 2015 16:47:20 +0000 (16:47 +0000)]
remove names from comments; NFC

llvm-svn: 225526

9 years agofix typos; NFC
Sanjay Patel [Fri, 9 Jan 2015 16:35:37 +0000 (16:35 +0000)]
fix typos; NFC

llvm-svn: 225525

9 years agofix typo; NFC
Sanjay Patel [Fri, 9 Jan 2015 16:29:50 +0000 (16:29 +0000)]
fix typo; NFC

llvm-svn: 225524

9 years agomore efficient use of a dyn_cast; no functional change intended
Sanjay Patel [Fri, 9 Jan 2015 16:28:15 +0000 (16:28 +0000)]
more efficient use of a dyn_cast; no functional change intended

llvm-svn: 225523

9 years ago[PowerPC] Enable late partial unrolling on the POWER7
Hal Finkel [Fri, 9 Jan 2015 15:51:16 +0000 (15:51 +0000)]
[PowerPC] Enable late partial unrolling on the POWER7

The P7 benefits from not have really-small loops so that we either have
multiple dispatch groups in the loop and/or the ability to form more-full
dispatch groups during scheduling. Setting the partial unrolling threshold to
44 seems good, empirically, for the P7. Compared to using no late partial
unrolling, this yields the following test-suite speedups:

SingleSource/Benchmarks/Adobe-C++/simple_types_constant_folding
-66.3253% +/- 24.1975%
SingleSource/Benchmarks/Misc-C++/oopack_v1p8
-44.0169% +/- 29.4881%
SingleSource/Benchmarks/Misc/pi
-27.8351% +/- 12.2712%
SingleSource/Benchmarks/Stanford/Bubblesort
-30.9898% +/- 22.4647%

I've speculatively added a similar setting for the P8. Also, I've noticed that
the unroller does not quite calculate the unrolling factor correctly for really
tiny loops because it neglects to account for the fact that not every loop body
replicant contains an ending branch and counter increment. I'll fix that later.

llvm-svn: 225522

9 years ago[mips] Add comment which explains why we need to change the assembler options before...
Toma Tabacu [Fri, 9 Jan 2015 15:00:30 +0000 (15:00 +0000)]
[mips] Add comment which explains why we need to change the assembler options before and after inline asm blocks. NFC.

llvm-svn: 225521

9 years agoclang-tidy: [misc-use-override] Simplify regular expressions in test.
Daniel Jasper [Fri, 9 Jan 2015 14:10:15 +0000 (14:10 +0000)]
clang-tidy: [misc-use-override] Simplify regular expressions in test.

No functional changes.

llvm-svn: 225520

9 years agoclang-tidy: [misc-use-override] Fix 'override' insertion.
Daniel Jasper [Fri, 9 Jan 2015 13:56:35 +0000 (13:56 +0000)]
clang-tidy: [misc-use-override] Fix 'override' insertion.

Before:
  void f() __attribute__((override unused))

After:
  void f() override __attribute__((unused))

llvm-svn: 225519

9 years agoSema: Don't crash when variable is redefined as a constexpr function
David Majnemer [Fri, 9 Jan 2015 10:33:23 +0000 (10:33 +0000)]
Sema: Don't crash when variable is redefined as a constexpr function

We have a diagnostic describing that constexpr changed in C++14 when
compiling in C++11 mode.  While doing this, it examines the previous
declaration and assumes that it is a function.  However it is possible,
in the context of error recovery, for this to not be the case.

llvm-svn: 225518

9 years agoAssumption that "VectorizedValue" will always be an Instruction is not correct.
Suyog Sarda [Fri, 9 Jan 2015 10:23:48 +0000 (10:23 +0000)]
Assumption that "VectorizedValue" will always be an Instruction is not correct.
It can be a constant or a vector argument.

ex :

define i32 @hadd(<4 x i32> %a) #0 {
entry:
  %vecext = extractelement <4 x i32> %a, i32 0
  %vecext1 = extractelement <4 x i32> %a, i32 1
  %add = add i32 %vecext, %vecext1
  %vecext2 = extractelement <4 x i32> %a, i32 2
  %add3 = add i32 %add, %vecext2
  %vecext4 = extractelement <4 x i32> %a, i32 3
  %add5 = add i32 %add3, %vecext4
  ret i32 %add5
}

llvm-svn: 225517

9 years agoAdd the shifted cursor position to XML output, so it can be used by editor integrations.
Manuel Klimek [Fri, 9 Jan 2015 10:03:47 +0000 (10:03 +0000)]
Add the shifted cursor position to XML output, so it can be used by editor integrations.

llvm-svn: 225516

9 years agoFix test from my previous commit
Olivier Goffart [Fri, 9 Jan 2015 09:42:32 +0000 (09:42 +0000)]
Fix test from my previous commit

(I should have re-run the test after running clang-format)

llvm-svn: 225515

9 years agoParse: Don't crash when namespace is in GNU statement expr
David Majnemer [Fri, 9 Jan 2015 09:38:14 +0000 (09:38 +0000)]
Parse: Don't crash when namespace is in GNU statement expr

Parser::ParseNamespace can get a little confused when it found itself
inside a compound statement inside of a non-static data member
initializer.

Try to determine that the statement expression's scope makes sense
before trying to parse it's contents.

llvm-svn: 225514

9 years agoFix crash in typo correction while correcting enum within a struct in C
Olivier Goffart [Fri, 9 Jan 2015 09:37:26 +0000 (09:37 +0000)]
Fix crash in typo correction while correcting enum within a struct in C

llvm-svn: 225513

9 years agoAdjust test for the new 'distinct' metadata nodes
Tobias Grosser [Fri, 9 Jan 2015 08:10:36 +0000 (08:10 +0000)]
Adjust test for the new 'distinct' metadata nodes

'distinct' was introduced in 225474. We now adjust the test cases
to match for the additional 'distinct' marker.

llvm-svn: 225512

9 years agoSema: RecordDecl shouldn't have a FunctionDecl as a Decl
David Majnemer [Fri, 9 Jan 2015 07:36:13 +0000 (07:36 +0000)]
Sema: RecordDecl shouldn't have a FunctionDecl as a Decl

RecordDecls should have things like CXXMethodDecls or FriendDecls as a
decl but not things like FunctionDecls.

llvm-svn: 225511

9 years agoARM: add support for R_ARM_ABS16
Saleem Abdulrasool [Fri, 9 Jan 2015 06:57:24 +0000 (06:57 +0000)]
ARM: add support for R_ARM_ABS16

Add support for R_ARM_ABS16 relocation mapping.  Addresses PR22156.

llvm-svn: 225510

9 years agotest: add additional test for SVN r225507
Saleem Abdulrasool [Fri, 9 Jan 2015 06:57:18 +0000 (06:57 +0000)]
test: add additional test for SVN r225507

Add an additional test case to ensure that we generate the relocation even if
the thumb target is used.

llvm-svn: 225509

9 years agoSema: Don't crash when specializing a global scope function in a class
David Majnemer [Fri, 9 Jan 2015 06:10:21 +0000 (06:10 +0000)]
Sema: Don't crash when specializing a global scope function in a class

We assumed that class-scope specializations would result in a
CXXMethodDecl for that class.  However, globally qualified functions
will result in normal FunctionDecls.

llvm-svn: 225508

9 years agoARM: add support for R_ARM_ABS8 relocations
Saleem Abdulrasool [Fri, 9 Jan 2015 05:59:12 +0000 (05:59 +0000)]
ARM: add support for R_ARM_ABS8 relocations

Add support for R_ARM_ABS8 relocation.  Addresses PR22126.

llvm-svn: 225507

9 years agoSema: Remove some dead code from CreateNewFunctionDecl
David Majnemer [Fri, 9 Jan 2015 05:56:10 +0000 (05:56 +0000)]
Sema: Remove some dead code from CreateNewFunctionDecl

The same code is already in Sema::ActOnFunctionDeclarator, the only
caller of CreateNewFunctionDecl.

llvm-svn: 225506

9 years agoParse: Don't crash when trailing return type is missing
David Majnemer [Fri, 9 Jan 2015 05:10:55 +0000 (05:10 +0000)]
Parse: Don't crash when trailing return type is missing

Sema::CheckParmsForFunctionDef can't cope with a null TypeSourceInfo.
Don't let the AST contain the malformed lambda.

This fixes PR22122.

llvm-svn: 225505

9 years agoDriver: begin threading frontend support for SymbolRewriter
Saleem Abdulrasool [Fri, 9 Jan 2015 05:10:20 +0000 (05:10 +0000)]
Driver: begin threading frontend support for SymbolRewriter

Allow blessed access to the symbol rewriter from the driver. Although the
symbol rewriter could be invoked through tools like opt and llc, it would not
accessible from the frontend. This allows us to read the rewrite map files in
the frontend rather than the backend and enable symbol rewriting for actually
performing the symbol interpositioning.

llvm-svn: 225504

9 years agoRegisterCoalescer: Fix removeCopyByCommutingDef with subreg liveness
Matthias Braun [Fri, 9 Jan 2015 03:01:31 +0000 (03:01 +0000)]
RegisterCoalescer: Fix removeCopyByCommutingDef with subreg liveness

The code that eliminated additional coalescable copies in
removeCopyByCommutingDef() used MergeValueNumberInto() which internally
may merge A into B or B into A. In this case A and B had different Def
points, so we have to reset ValNo.Def to the intended one after merging.

llvm-svn: 225503

9 years agoRegisterCoalescer: Some cleanup in removeCopyByCommutingDef(), NFC
Matthias Braun [Fri, 9 Jan 2015 03:01:28 +0000 (03:01 +0000)]
RegisterCoalescer: Some cleanup in removeCopyByCommutingDef(), NFC

llvm-svn: 225502

9 years agoRegisterCoalescer: No need to set kill flags, they are recompute later anyway
Matthias Braun [Fri, 9 Jan 2015 03:01:26 +0000 (03:01 +0000)]
RegisterCoalescer: No need to set kill flags, they are recompute later anyway

llvm-svn: 225501

9 years agoRegisterCoalescer: Turn some impossible conditions into asserts
Matthias Braun [Fri, 9 Jan 2015 03:01:23 +0000 (03:01 +0000)]
RegisterCoalescer: Turn some impossible conditions into asserts

llvm-svn: 225500

9 years agoBitcode: Share logic for last instruction, NFC
Duncan P. N. Exon Smith [Fri, 9 Jan 2015 02:51:45 +0000 (02:51 +0000)]
Bitcode: Share logic for last instruction, NFC

Share logic for getting the last instruction emitted.

llvm-svn: 225499

9 years agoBitcode: Move the DEBUG_LOC record to DEBUG_LOC_OLD
Duncan P. N. Exon Smith [Fri, 9 Jan 2015 02:48:48 +0000 (02:48 +0000)]
Bitcode: Move the DEBUG_LOC record to DEBUG_LOC_OLD

Prepare to simplify the `DebugLoc` record.

llvm-svn: 225498

9 years ago[PowerPC] Add a flag for experimenting with subreg liveness tracking
Hal Finkel [Fri, 9 Jan 2015 02:03:11 +0000 (02:03 +0000)]
[PowerPC] Add a flag for experimenting with subreg liveness tracking

This cannot yet be enabled by default, it causes ~50 miscompiles in the test
suite.

llvm-svn: 225497

9 years ago[InlineTest] getRerunArgs returns an empty string if the test was skipped.
Siva Chandra [Fri, 9 Jan 2015 01:54:44 +0000 (01:54 +0000)]
[InlineTest] getRerunArgs returns an empty string if the test was skipped.

Summary:
The main issue that this patch is trying to address is that the current
implementation of getRerunArgs of InlineTest relies on the attribute
'using_dsym' which could be absent if the test was skipped altogether.
[That is, if both dsym and dwarf tests were skipped.]

While at it, the use of deprecated Python module 'new' is eliminated.

Test Plan: [Linux] dotest.py -p TestExprPathSynthetic

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 225496

9 years agoInstrProf: Don't emit counter increments in dead code
Justin Bogner [Fri, 9 Jan 2015 01:46:40 +0000 (01:46 +0000)]
InstrProf: Don't emit counter increments in dead code

We were previously emitting counter increments even if we didn't have
an insertion point, which would result in a CallInst with no
parent. This leads to a crash, as in pr22166, if we try to do
GlobalDCE.

llvm-svn: 225495

9 years agoSema: Dependent array designators cannot be checked
David Majnemer [Fri, 9 Jan 2015 01:39:09 +0000 (01:39 +0000)]
Sema: Dependent array designators cannot be checked

We forgot to mark designated initializer expression that contain type
dependent array designators as type dependent.  This would lead to
crashes when we try to determine which array element we were trying to
initialize.

This fixes PR22056.

llvm-svn: 225494

9 years ago[PowerPC] Fold [sz]ext with fp_to_int lowering where possible
Hal Finkel [Fri, 9 Jan 2015 01:34:30 +0000 (01:34 +0000)]
[PowerPC] Fold [sz]ext with fp_to_int lowering where possible

On modern cores with lfiw[az]x, we can fold a sign or zero extension from i32
to i64 into the load necessary for an i64 -> fp conversion.

llvm-svn: 225493

9 years ago[DAGCombine] Remainder of fix to r225380 (More FMA folding opportunities)
Hal Finkel [Fri, 9 Jan 2015 01:29:29 +0000 (01:29 +0000)]
[DAGCombine] Remainder of fix to r225380 (More FMA folding opportunities)

As pointed out by Aditya (and Owen), when we elide an FP extend to form an FMA,
we need to extend the incoming operands so that the resulting node will really
be legal. This is currently enabled only for PowerPC, and it happens to work
there regardless, but this should fix the functionality for everyone else
should anyone else wish to use it.

llvm-svn: 225492

9 years ago[x86] Add a flag to control the vector shuffle legality predicates that
Chandler Carruth [Fri, 9 Jan 2015 01:24:36 +0000 (01:24 +0000)]
[x86] Add a flag to control the vector shuffle legality predicates that
complements the new vector shuffle lowering code path. This flag,
naturally, is *off* because we've not tested or evaluated the results of
this at all. However, the flag will make it much easier to evaluate
whether we can be this aggressive and whether there are missing vector
shuffle lowering optimizations.

llvm-svn: 225491

9 years agoPR22117: Fix a case where we would get confused about which function parameter
Richard Smith [Fri, 9 Jan 2015 01:19:56 +0000 (01:19 +0000)]
PR22117: Fix a case where we would get confused about which function parameter
we're instantiating, if there's a ParmVarDecl within a FunctionDecl context
that is not a parameter of that function. Add some asserts to catch this kind
of issue more generally, and fix another bug exposed by those asserts where we
were missing a local instantiation scope around substitution of
explicitly-specified template arguments.

llvm-svn: 225490

9 years agoDon't invent a '$auto-x-y' name for auto types in generic lambdas. This is no
Richard Smith [Fri, 9 Jan 2015 00:59:40 +0000 (00:59 +0000)]
Don't invent a '$auto-x-y' name for auto types in generic lambdas. This is no
better than the 'template-parameter-x-y' name that we'd get in AST printing,
and is worse in several ways (it's harder to distinguish it from a
user-supplied name, it's wrong after substituting some number of outer
levels, it wastes time and space constructing an IdentifierInfo, ...).

llvm-svn: 225489

9 years agoUse APSInt::isSameValue instead of operator== in a place where two APSInt's
Richard Trieu [Fri, 9 Jan 2015 00:58:16 +0000 (00:58 +0000)]
Use APSInt::isSameValue instead of operator== in a place where two APSInt's
may have different sizes.  Fixes PR22017

llvm-svn: 225488

9 years agoCleaup ValueHandle to no longer keep a PointerIntPair for the Value*.
Chandler Carruth [Fri, 9 Jan 2015 00:48:47 +0000 (00:48 +0000)]
Cleaup ValueHandle to no longer keep a PointerIntPair for the Value*.
This was used previously for metadata but is no longer needed there. Not
doing this simplifies ValueHandle and will make it easier to fix things
like AssertingVH's DenseMapInfo.

llvm-svn: 225487

9 years agoDynamic values have been around (and stable and reliable) for long enough that we...
Enrico Granata [Fri, 9 Jan 2015 00:47:24 +0000 (00:47 +0000)]
Dynamic values have been around (and stable and reliable) for long enough that we can turn them on by default

Change the default of prefer-dynamic-value to eDynamicDontRunTarget (i.e. enable dynamic values, but do not run code to do so)

Of course, disable this for the test suite, since testing no-dynamic-values is actually valuable

Fixes rdar://17363061

llvm-svn: 225486

9 years agoPartial fix to r225380 (More FMA folding opportunities)
Hal Finkel [Fri, 9 Jan 2015 00:45:54 +0000 (00:45 +0000)]
Partial fix to r225380 (More FMA folding opportunities)

As pointed out by Aditya (and Owen), there are two things wrong with this code.
First, it adds patterns which elide FP extends when forming FMAs, and that might
not be profitable on all targets (it belongs behind the pre-existing
aggressive-FMA-formation flag). This is fixed by this change.

Second, the resulting nodes might have operands of different types (the
extensions need to be re-added). That will be fixed in the follow-up commit.

llvm-svn: 225485

9 years ago[asan] Adding a regression test for https://code.google.com/p/address-sanitizer/issue...
Kuba Brecka [Fri, 9 Jan 2015 00:26:45 +0000 (00:26 +0000)]
[asan] Adding a regression test for https://code.google.com/p/address-sanitizer/issues/detail?id=368

llvm-svn: 225484

9 years ago[REFACTOR] Push logic from MemDepPrinter into getNonLocalPointerDependency
Philip Reames [Fri, 9 Jan 2015 00:26:45 +0000 (00:26 +0000)]
[REFACTOR] Push logic from MemDepPrinter into getNonLocalPointerDependency

Previously, MemDepPrinter handled volatile and unordered accesses without involving MemoryDependencyAnalysis.  By making a slight tweak to the documented interface - which is respected by both callers - we can move this responsibility to MDA for the benefit of any future callers.  This is basically just cleanup.

In the future, we may decide to extend MDA's non local dependency analysis to return useful results for ordered or volatile loads.  I believe (but have not really checked in detail) that local dependency analyis does get useful results for ordered, but not volatile, loads.

llvm-svn: 225483

9 years agoReleaseNotes.rst: these are for 3.6
Hans Wennborg [Fri, 9 Jan 2015 00:21:26 +0000 (00:21 +0000)]
ReleaseNotes.rst: these are for 3.6

llvm-svn: 225482

9 years ago[Refactor] Have getNonLocalPointerDependency take the query instruction
Philip Reames [Fri, 9 Jan 2015 00:04:22 +0000 (00:04 +0000)]
[Refactor] Have getNonLocalPointerDependency take the query instruction

Previously, MemoryDependenceAnalysis::getNonLocalPointerDependency was taking a list of properties about the instruction being queried. Since I'm about to need one more property to be passed down through the infrastructure - I need to know a query instruction is non-volatile in an inner helper - fix the interface once and for all.

I also added some assertions and behaviour clarifications around volatile and ordered field accesses. At the moment, this is mostly to document expected behaviour. The only non-standard instructions which can currently reach this are atomic, but unordered, loads and stores. Neither ordered or volatile accesses can reach here.

The call in GVN is protected by an isSimple check when it first considers the load. The calls in MemDepPrinter are protected by isUnordered checks. Both utilities also check isVolatile for loads and stores.

llvm-svn: 225481

9 years agoAdd experimental support for unsigned expressions
Tobias Grosser [Fri, 9 Jan 2015 00:01:33 +0000 (00:01 +0000)]
Add experimental support for unsigned expressions

This support is still incomplete and consequently hidden behind a switch that
needs to be enabled. One problem is ATM that we incorrectly interpret very large
unsigned values as negative values even if used in an unsigned comparision.

llvm-svn: 225480

9 years agoLangRef: Add usage points for distinct MDNodes
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 23:50:26 +0000 (23:50 +0000)]
LangRef: Add usage points for distinct MDNodes

Omission pointed out by Sean Silva!

llvm-svn: 225479

9 years ago[asan] make a test consume 2x less RAM (we observe flaky bot failures that seem like...
Kostya Serebryany [Thu, 8 Jan 2015 23:37:09 +0000 (23:37 +0000)]
[asan] make a test consume 2x less RAM (we observe flaky bot failures that seem like OOMs)

llvm-svn: 225478

9 years agoIR: Drop TODO now that PR22111 is finished
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 22:43:19 +0000 (22:43 +0000)]
IR: Drop TODO now that PR22111 is finished

llvm-svn: 225477

9 years agoUtils: Keep distinct MDNodes distinct in MapMetadata()
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 22:42:30 +0000 (22:42 +0000)]
Utils: Keep distinct MDNodes distinct in MapMetadata()

Create new copies of distinct `MDNode`s instead of following the
uniquing `MDNode` logic.

Just like self-references (or other cycles), `MapMetadata()` creates a
new node.  In practice most calls use `RF_NoModuleLevelChanges`, in
which case nothing is duplicated anyway.

Part of PR22111.

llvm-svn: 225476

9 years agoIR: Add 'distinct' MDNodes to bitcode and assembly (clang)
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 22:39:28 +0000 (22:39 +0000)]
IR: Add 'distinct' MDNodes to bitcode and assembly (clang)

Update testcases for LLVM change in r225474 to make `MDNode`s explicitly
distinct (when they aren't uniqued).

Part of PR22111.

llvm-svn: 225475

9 years agoIR: Add 'distinct' MDNodes to bitcode and assembly
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 22:38:29 +0000 (22:38 +0000)]
IR: Add 'distinct' MDNodes to bitcode and assembly

Propagate whether `MDNode`s are 'distinct' through the other types of IR
(assembly and bitcode).  This adds the `distinct` keyword to assembly.

Currently, no one actually calls `MDNode::getDistinct()`, so these nodes
only get created for:

  - self-references, which are never uniqued, and
  - nodes whose operands are replaced that hit a uniquing collision.

The concept of distinct nodes is still not quite first-class, since
distinct-ness doesn't yet survive across `MapMetadata()`.

Part of PR22111.

llvm-svn: 225474

9 years agoremove function names from comments; NFC
Sanjay Patel [Thu, 8 Jan 2015 22:36:56 +0000 (22:36 +0000)]
remove function names from comments; NFC

llvm-svn: 225473

9 years agoFix memory leaks in GetListOfModules() users.
Alexey Samsonov [Thu, 8 Jan 2015 22:31:14 +0000 (22:31 +0000)]
Fix memory leaks in GetListOfModules() users.

llvm-svn: 225472

9 years ago[PowerPC] Mark all instructions as non-cheap for MachineLICM
Hal Finkel [Thu, 8 Jan 2015 22:11:49 +0000 (22:11 +0000)]
[PowerPC] Mark all instructions as non-cheap for MachineLICM

MachineLICM uses a callback named hasLowDefLatency to determine if an
instruction def operand has a 'low' latency. If all relevant operands have a
'low' latency, the instruction is considered too cheap to hoist out of loops
even in low-register-pressure situations. On PowerPC cores, both the embedded
cores and the others, there is no reason to believe that this is a good choice:
all instructions have a cost inside a loop, and hoisting them when not limited
by register pressure is a reasonable default.

llvm-svn: 225471

9 years ago[MachineLICM] A command-line option to hoist even cheap instructions
Hal Finkel [Thu, 8 Jan 2015 22:10:48 +0000 (22:10 +0000)]
[MachineLICM] A command-line option to hoist even cheap instructions

Add a command-line option to enable hoisting even cheap instructions (in
low-register-pressure situations). This is turned off by default, but has
proved useful for testing purposes.

llvm-svn: 225470