platform/upstream/llvm.git
9 years ago[X86] Simplify X87 stackifier pass.
Akira Hatanaka [Fri, 1 Aug 2014 22:19:41 +0000 (22:19 +0000)]
[X86] Simplify X87 stackifier pass.

Stop using ST registers for function returns and inline-asm instructions and use
FP registers instead. This allows removing a large amount of code in the
stackifier pass that was needed to track register liveness and handle copies
between ST and FP registers and function calls returning floating point values.

It also fixes a bug which manifests when an ST register defined by an
inline-asm instruction was live across another inline-asm instruction, as shown
in the following sequence of machine instructions:

1. INLINEASM <es:frndint> $0:[regdef], %ST0<imp-def,tied5>
2. INLINEASM <es:fldcw $0>
3. %FP0<def> = COPY %ST0

<rdar://problem/16952634>

llvm-svn: 214580

9 years agoActually fix problem with modules buildbot this time.
Richard Smith [Fri, 1 Aug 2014 22:17:28 +0000 (22:17 +0000)]
Actually fix problem with modules buildbot this time.

llvm-svn: 214579

9 years agollvm/test/CodeGen/Mips/cconv/arguments-varargs.ll: Add explicit -mtriple=(mips|mipsel...
NAKAMURA Takumi [Fri, 1 Aug 2014 22:15:38 +0000 (22:15 +0000)]
llvm/test/CodeGen/Mips/cconv/arguments-varargs.ll: Add explicit -mtriple=(mips|mipsel)-linux on 4 lines.

llvm-svn: 214578

9 years agoAdd -fbuild-session-file as an alternative to -fbuild-session-timestamp
Ben Langmuir [Fri, 1 Aug 2014 22:12:21 +0000 (22:12 +0000)]
Add -fbuild-session-file as an alternative to -fbuild-session-timestamp

Build systems tend to traffic in files and modification times, so having
them touch a file at the beginning of the build can be easier than
having them update the compile command they use every time they build.

llvm-svn: 214577

9 years agoDebug info: Infrastructure to support debug locations for fragmented
Adrian Prantl [Fri, 1 Aug 2014 22:11:58 +0000 (22:11 +0000)]
Debug info: Infrastructure to support debug locations for fragmented
variables (for example, by-value struct arguments passed in registers, or
large integer values split across several smaller registers).
On the IR level, this adds a new type of complex address operation OpPiece
to DIVariable that describes size and offset of a variable fragment.
On the DWARF emitter level, all pieces describing the same variable are
collected, sorted and emitted as DWARF expressions using the DW_OP_piece
and DW_OP_bit_piece operators.

http://reviews.llvm.org/D3373
rdar://problem/15928306

What this patch doesn't do / Future work:
- This patch only adds the backend machinery to make this work, patches
  that change SROA and SelectionDAG's type legalizer to actually create
  such debug info will follow. (http://reviews.llvm.org/D2680)
- Making the DIVariable complex expressions into an argument of dbg.value
  will reduce the memory footprint of the debug metadata.
- The sorting/uniquing of pieces should be moved into DebugLocEntry,
  to facilitate the merging of multi-piece entries.

llvm-svn: 214576

9 years agoDon't hand compute mydir, do it using "TestBase.compute_mydir(__file__)".
Greg Clayton [Fri, 1 Aug 2014 22:10:13 +0000 (22:10 +0000)]
Don't hand compute mydir, do it using "TestBase.compute_mydir(__file__)".

llvm-svn: 214575

9 years ago[SDAG] MorphNodeTo recursively deletes dead operands of the old
Chandler Carruth [Fri, 1 Aug 2014 22:09:43 +0000 (22:09 +0000)]
[SDAG] MorphNodeTo recursively deletes dead operands of the old
fromulation of the node, which isn't really the desired behavior from
within the combiner or legalizer, but is necessary within ISel. I've
added a hopefully helpful comment and fixed the only two places where
this took place.

Yet another step toward the combiner and legalizer not needing to use
update listeners with virtual calls to manage the worklists behind
legalization and combining.

llvm-svn: 214574

9 years ago[unwinder] Tell the assembler that functions are functions so that the linker knows...
Jonathan Roelofs [Fri, 1 Aug 2014 22:02:21 +0000 (22:02 +0000)]
[unwinder] Tell the assembler that functions are functions so that the linker knows how to link them.

This fixes an interworking problem when the unwinder/libcxxabi is built for
Thumb. When unw_getcontext is not marked as a function, 'bl' is used for the
branch instead of 'bx'.

llvm-svn: 214573

9 years agoRevert "R600: Move code for generating REGISTER_LOAD into R600ISelLowering.cpp"
Tom Stellard [Fri, 1 Aug 2014 21:55:50 +0000 (21:55 +0000)]
Revert "R600: Move code for generating REGISTER_LOAD into R600ISelLowering.cpp"

This reverts commit r214566.

I did not mean to commit this yet.

llvm-svn: 214572

9 years agoMS inline asm: Hide symbol to attempt to fix test failure on darwin
Reid Kleckner [Fri, 1 Aug 2014 21:54:37 +0000 (21:54 +0000)]
MS inline asm: Hide symbol to attempt to fix test failure on darwin

If the symbol comes from an external DSO, it apparently requires
indirection through a register.

llvm-svn: 214571

9 years agoBitcodeReader: Change mechanics of BlockAddress forward references, NFC
Duncan P. N. Exon Smith [Fri, 1 Aug 2014 21:51:52 +0000 (21:51 +0000)]
BitcodeReader: Change mechanics of BlockAddress forward references, NFC

Now that we can reliably handle forward references to `BlockAddress`
(r214563), change the mechanics to simplify predicting use-list order.

Previously, we created dummy `GlobalVariable`s to represent block
addresses.  After every function was materialized, we'd go through any
forward references to its blocks and RAUW them with a proper
`BlockAddress` constant.  This causes some (potentially a lot of)
unnecessary use-list churn, since any constant expression that it's a
part of will need to be rematerialized as well.

Instead, pre-construct a `BasicBlock` immediately -- without attaching
it to its (empty) `Function` -- and use that to construct a
`BlockAddress`.  This constant will not have to be regenerated.  When
the function body is parsed, hook this pre-constructed basic block up
in the right place using `BasicBlock::insertInto()`.

Both before and after this change, the IR is temporarily in an invalid
state that gets resolved when `materializeForwardReferencedFunctions()`
gets called.

This is a prep commit that's part of PR5680, but the only functionality
change is the reduction of churn in the constant pool.

llvm-svn: 214570

9 years agoR600/SI: Remove leftover debugging code
Tom Stellard [Fri, 1 Aug 2014 21:51:05 +0000 (21:51 +0000)]
R600/SI: Remove leftover debugging code

llvm-svn: 214569

9 years agorelational: Add islessequal(floatN) builtin
Jan Vesely [Fri, 1 Aug 2014 21:50:59 +0000 (21:50 +0000)]
relational: Add islessequal(floatN) builtin

v2: remove the initial undef

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 214568

9 years agorelational: Add isless(floatN) builtin
Jan Vesely [Fri, 1 Aug 2014 21:50:55 +0000 (21:50 +0000)]
relational: Add isless(floatN) builtin

v2: remove the initial undef

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 214567

9 years agoR600: Move code for generating REGISTER_LOAD into R600ISelLowering.cpp
Tom Stellard [Fri, 1 Aug 2014 21:50:47 +0000 (21:50 +0000)]
R600: Move code for generating REGISTER_LOAD into R600ISelLowering.cpp

SI doesn't use REGISTER_LOAD anymore, but it was still hitting this code
path for 8-bit and 16-bit private loads.

llvm-svn: 214566

9 years agodocs: Strongly recommend setting rpath when using a local GCC toolchain
Reid Kleckner [Fri, 1 Aug 2014 21:40:53 +0000 (21:40 +0000)]
docs: Strongly recommend setting rpath when using a local GCC toolchain

Users keep emailing us about the difficulties of getting LD_LIBRARY_PATH
into their environment, which should be completely unecessary. Try to
strengthen the rpath recommentation by putting in an example cmake
invocation.

Speaking of which, we might want to make CMake the recommended build
system in GettingStarted.html.

llvm-svn: 214565

9 years ago[Sanitizer] Introduce SanitizerMetadata class.
Alexey Samsonov [Fri, 1 Aug 2014 21:35:28 +0000 (21:35 +0000)]
[Sanitizer] Introduce SanitizerMetadata class.

It is responsible for generating metadata consumed by sanitizer instrumentation
passes in the backend. Move several methods from CodeGenModule to SanitizerMetadata.
For now the class is stateless, but soon it won't be the case.

Instead of creating globals providing source-level information to ASan, we will create
metadata nodes/strings which will be turned into actual global variables in the
backend (if needed).

No functionality change.

llvm-svn: 214564

9 years agoIR: Add BasicBlock::insertInto()
Duncan P. N. Exon Smith [Fri, 1 Aug 2014 21:22:04 +0000 (21:22 +0000)]
IR: Add BasicBlock::insertInto()

Although unlinked `BasicBlock`s can be created, there's currently no way
to insert them into `Function`s after the fact.  In particular,
`moveAfter()` and `moveBefore()` require that the basic block is already
linked.

Extract the logic for initially linking a `BasicBlock` out of the
constructor and into a member function that can be used for lazy
insertion.

  - Asserts that the basic block is currently unlinked.
  - Matches the logic of the constructor.
  - Changed the constructor to use it since the logic matches.

This is needed in a follow-up commit for PR5680.

llvm-svn: 214563

9 years agoLet's assume PowerPC has no SSE.
Joerg Sonnenberger [Fri, 1 Aug 2014 21:20:02 +0000 (21:20 +0000)]
Let's assume PowerPC has no SSE.

llvm-svn: 214562

9 years ago[dfsan] Correctly handle loads and stores of zero size.
Peter Collingbourne [Fri, 1 Aug 2014 21:18:18 +0000 (21:18 +0000)]
[dfsan] Correctly handle loads and stores of zero size.

llvm-svn: 214561

9 years agoAdd a non-const subtarget returning function to the target machine
Eric Christopher [Fri, 1 Aug 2014 21:18:01 +0000 (21:18 +0000)]
Add a non-const subtarget returning function to the target machine
so that we can use it to get the old-style JIT out of the subtarget.

This code should be removed when the old-style JIT is removed
(imminently).

llvm-svn: 214560

9 years agoBitcodeReader: Fix some BlockAddress forward reference corner cases
Duncan P. N. Exon Smith [Fri, 1 Aug 2014 21:11:34 +0000 (21:11 +0000)]
BitcodeReader: Fix some BlockAddress forward reference corner cases

`BlockAddress`es are interesting in that they can reference basic blocks
from *outside* the block's function.  Since basic blocks are not global
values, this presents particular challenges for lazy parsing.

One corner case was found in PR11677 and fixed in r147425.  In that
case, a global variable references a block address.  It's necessary to
load the relevant function to resolve the forward reference before doing
anything with the module.

By inspection, I found (and have fixed here) two other cases:

  - An instruction from one function references a block address from
    another function, and only the first function is lazily loaded.

    I fixed this the same way as PR11677: by eagerly loading the
    referenced function.

  - A function whose block address is taken is dematerialized, leaving
    invalid references to it.

    I fixed this by refusing to dematerialize functions whose block
    addresses are taken (if you have to load it, you can't unload it).

llvm-svn: 214559

9 years agoTry to fix configure+make after r214556
Duncan P. N. Exon Smith [Fri, 1 Aug 2014 21:06:59 +0000 (21:06 +0000)]
Try to fix configure+make after r214556

llvm-svn: 214558

9 years agoRewrite BitReaderTest, NFC
Duncan P. N. Exon Smith [Fri, 1 Aug 2014 21:01:04 +0000 (21:01 +0000)]
Rewrite BitReaderTest, NFC

Rewrite the single unit test in `BitReaderTest` so that it's easier to
add more tests.

  - Parse from an assembly string rather than using API.
  - Use more helper functions.
  - Use a separate context for the module on the other side.

Aside from relying on the assembly parser, there's no functionality
change intended.

llvm-svn: 214556

9 years agoRe-commit r214547 with tests fixed. Hopefully all the bots will be happy now.
Richard Smith [Fri, 1 Aug 2014 20:39:36 +0000 (20:39 +0000)]
Re-commit r214547 with tests fixed. Hopefully all the bots will be happy now.
Original message:

Fix iterator invalidation issues that are breaking my modules buildbot's
bootstrap.

llvm-svn: 214555

9 years agoMS inline asm: Tests for r214550
Reid Kleckner [Fri, 1 Aug 2014 20:23:29 +0000 (20:23 +0000)]
MS inline asm: Tests for r214550

These tests seem like an exception to the rule against assembly emitting
tests in clang.  I made an LLVM side change that can only be tested by
setting up the inline assembly machinery that is only implemented by
Clang.

llvm-svn: 214552

9 years agoMS inline asm: Add tests for LLVM r214468
Reid Kleckner [Fri, 1 Aug 2014 20:23:03 +0000 (20:23 +0000)]
MS inline asm: Add tests for LLVM r214468

This used to assert.

llvm-svn: 214551

9 years agoMS inline asm: Use memory constraints for functions instead of registers
Reid Kleckner [Fri, 1 Aug 2014 20:21:24 +0000 (20:21 +0000)]
MS inline asm: Use memory constraints for functions instead of registers

This is consistent with how we parse them in a standalone .s file, and
inline assembly shouldn't differ.

This fixes errors about requiring more registers than available in
cases like this:
  void f();
  void __declspec(naked) g() {
    __asm pusha
    __asm call f
    __asm popa
    __asm ret
  }

There are no registers available to pass the address of 'f' into the asm
blob.  The asm should now directly call 'f'.

Tests will land in Clang shortly.

llvm-svn: 214550

9 years agoRevert r214547 due to test breakage.
Richard Smith [Fri, 1 Aug 2014 20:09:39 +0000 (20:09 +0000)]
Revert r214547 due to test breakage.

llvm-svn: 214549

9 years agollvm-profdata: Replace redundant tests with more targeted ones
Justin Bogner [Fri, 1 Aug 2014 19:59:48 +0000 (19:59 +0000)]
llvm-profdata: Replace redundant tests with more targeted ones

llvm-svn: 214548

9 years agoFix iterator invalidation issues that are breaking my modules buildbot's bootstrap.
Richard Smith [Fri, 1 Aug 2014 19:59:14 +0000 (19:59 +0000)]
Fix iterator invalidation issues that are breaking my modules buildbot's bootstrap.

llvm-svn: 214547

9 years ago[SDAG] Begin simplifying the way in which the legalizer deletes nodes.
Chandler Carruth [Fri, 1 Aug 2014 19:49:59 +0000 (19:49 +0000)]
[SDAG] Begin simplifying the way in which the legalizer deletes nodes.

This lifts the (very few) places the legalizer would delete dead nodes
into the outer loop around the legalizer. This is significantly simpler
because it doesn't require the legalizer itself to manage the iterator
validity, and it doesn't require the legalizer to be a DAG update
listener in order to remove things from the legalized set. It also makes
the interface much less contrived for the case of the legalizer running
inside the last phase of DAG combining.

I'm working on centralizing the deletion of nodes during both legalizing
and combining as much as possible. My hope is to remove the need for DAG
update listeners from the combiner next, which would remove a costly
virtual dispatch chain on every deletion. This in turn should allow us
to more aggressively delete DAG nodes during combining which will in
turn allow us to combine more aggressively by exposing the actual nodes
which have single users to the combine phases.

llvm-svn: 214546

9 years ago[FastISel][AArch64] Fold offset into the memory operation.
Juergen Ributzka [Fri, 1 Aug 2014 19:40:16 +0000 (19:40 +0000)]
[FastISel][AArch64] Fold offset into the memory operation.

Fold simple offsets into the memory operation:
  add x0, x0, #8
  ldr x0, [x0]
-->
  ldr x0, [x0, #8]

Fixes <rdar://problem/17887945>.

llvm-svn: 214545

9 years agoAdd FreeBSD support to the address sanitizer's deep_stack_uaf.cc test case
Viktor Kutuzov [Fri, 1 Aug 2014 19:37:05 +0000 (19:37 +0000)]
Add FreeBSD support to the address sanitizer's deep_stack_uaf.cc test case
Differential Revision: http://reviews.llvm.org/D4668

llvm-svn: 214544

9 years agoFix the waitid sanitizer interceptor to work on FreeBSD in 32-bit mode
Viktor Kutuzov [Fri, 1 Aug 2014 19:33:14 +0000 (19:33 +0000)]
Fix the waitid sanitizer interceptor to work on FreeBSD in 32-bit mode
Differential Revision: http://reviews.llvm.org/D4670

llvm-svn: 214543

9 years agoInclude Archive.h
Rafael Espindola [Fri, 1 Aug 2014 19:28:15 +0000 (19:28 +0000)]
Include Archive.h

MSVC was complaining about Archive being an incomplete type.

llvm-svn: 214542

9 years agoFix building with in-tree libc++abi on FreeBSD
Viktor Kutuzov [Fri, 1 Aug 2014 19:23:15 +0000 (19:23 +0000)]
Fix building with in-tree libc++abi on FreeBSD
Differential Revision: http://reviews.llvm.org/D4743

llvm-svn: 214541

9 years agoMove virtual method out of line.
Rafael Espindola [Fri, 1 Aug 2014 18:49:24 +0000 (18:49 +0000)]
Move virtual method out of line.

Should fix the MSVC build.

llvm-svn: 214539

9 years agoAdd support for StackMap section for ELF/Linux systems
Philip Reames [Fri, 1 Aug 2014 18:47:09 +0000 (18:47 +0000)]
Add support for StackMap section for ELF/Linux systems

This patch adds code to emits the StackMap section on ELF systems. This section is required to support llvm.experimental.stackmap and llvm.experimental.patchpoint intrinsics.

Reviewers: ributzka, echristo

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

llvm-svn: 214538

9 years ago[FastISel][AArch64] Add branch weights.
Juergen Ributzka [Fri, 1 Aug 2014 18:39:24 +0000 (18:39 +0000)]
[FastISel][AArch64] Add branch weights.

Add branch weights to branch instructions, so that the following passes can
optimize based on it (i.e. basic block ordering).

Fixes <rdar://problem/17887137>.

llvm-svn: 214537

9 years agoConvert over to using pipes for the initial LLDB commands in the Driver.
Greg Clayton [Fri, 1 Aug 2014 18:32:07 +0000 (18:32 +0000)]
Convert over to using pipes for the initial LLDB commands in the Driver.

This will avoid having to use a temp file and adding temp file related calls to the public API.

llvm-svn: 214536

9 years agoUse object::Archive::create instead of new object::Archive.
Rafael Espindola [Fri, 1 Aug 2014 18:31:17 +0000 (18:31 +0000)]
Use object::Archive::create instead of new object::Archive.

Also fix the error handling. No testcaes, issue found by inspection.

Thanks to David Blaikie for the suggestion.

llvm-svn: 214535

9 years agoExplicitly report runtime stack realignment in StackMap section
Philip Reames [Fri, 1 Aug 2014 18:26:27 +0000 (18:26 +0000)]
Explicitly report runtime stack realignment in StackMap section

This change adds code to explicitly mark a function which requires runtime stack realignment as not having a fixed frame size in the StackMap section. As it happens, this is not actually a functional change. The size that would be reported without the check is also "-1", but as far as I can tell, that's an accident. The code change makes this explicit.

Note: There's a separate bug in handling of stackmaps and patchpoints in functions which need dynamic frame realignment. The current code assumes that offsets can be calculated from RBP, but realigned frames must use RSP. (There's a variable gap between RBP and the spill slots.) This change set does not address that issue.

Reviewers: atrick, ributzka

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

llvm-svn: 214534

9 years agoReplace comment about ownership with std::unique_ptr.
Rafael Espindola [Fri, 1 Aug 2014 18:09:32 +0000 (18:09 +0000)]
Replace comment about ownership with std::unique_ptr.

llvm-svn: 214533

9 years ago[ASan] Support the asan_loadN/asan_storeN functions in the DLL thunk library
Ehsan Akhgari [Fri, 1 Aug 2014 18:04:53 +0000 (18:04 +0000)]
[ASan] Support the asan_loadN/asan_storeN functions in the DLL thunk library

Summary:
This is required for linking DLLs with large functions exceeding
san-instrumentation-with-call-threshold.  One such function is
vp9_fdct16x16_sse2 in libvpx.

Reviewers: timurrrr

Subscribers: llvm-commits

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

llvm-svn: 214532

9 years ago[FastISel][ARM] Do not emit stores for undef arguments.
Juergen Ributzka [Fri, 1 Aug 2014 18:04:14 +0000 (18:04 +0000)]
[FastISel][ARM] Do not emit stores for undef arguments.

This is a followup patch for r214366, which added the same behavior to the
AArch64 and X86 FastISel code. This fix reproduces the already existing
behavior of SelectionDAG in FastISel.

llvm-svn: 214531

9 years agoUse range loop.
Rafael Espindola [Fri, 1 Aug 2014 18:04:14 +0000 (18:04 +0000)]
Use range loop.

llvm-svn: 214530

9 years agoUpdate build instructions for the clang-format VS plugin
Hans Wennborg [Fri, 1 Aug 2014 17:38:53 +0000 (17:38 +0000)]
Update build instructions for the clang-format VS plugin

llvm-svn: 214529

9 years agoAdd missing breaks to AArch64InstrInfo::isGPRCopy
Renato Golin [Fri, 1 Aug 2014 17:27:31 +0000 (17:27 +0000)]
Add missing breaks to AArch64InstrInfo::isGPRCopy

llvm-svn: 214528

9 years agoAdd decorator for FreeBSD test failure - malloc() breakpoint issue
Ed Maste [Fri, 1 Aug 2014 17:04:31 +0000 (17:04 +0000)]
Add decorator for FreeBSD test failure - malloc() breakpoint issue

llvm.org/pr20476

llvm-svn: 214527

9 years agoDropping some else-after-returns. No functional changes intended.
Aaron Ballman [Fri, 1 Aug 2014 17:02:34 +0000 (17:02 +0000)]
Dropping some else-after-returns. No functional changes intended.

llvm-svn: 214526

9 years agoR600: Cleanup test
Matt Arsenault [Fri, 1 Aug 2014 17:00:29 +0000 (17:00 +0000)]
R600: Cleanup test

Remove -CHECKs, use multiple prefixes, name values,
also test the @llvm.fabs version

llvm-svn: 214525

9 years agoMake getNamedOperandIdx readonly
Matt Arsenault [Fri, 1 Aug 2014 17:00:27 +0000 (17:00 +0000)]
Make getNamedOperandIdx readonly

llvm-svn: 214524

9 years agoR600/SI: Don't display GDS bit for read2
Matt Arsenault [Fri, 1 Aug 2014 17:00:26 +0000 (17:00 +0000)]
R600/SI: Don't display GDS bit for read2

This isn't displayed for any other instructions anymore,
and isn't ever used.

llvm-svn: 214523

9 years agoFix test execution: the cmake keyword is CACHE, not CACHED
Ed Maste [Fri, 1 Aug 2014 16:57:46 +0000 (16:57 +0000)]
Fix test execution: the cmake keyword is CACHE, not CACHED

llvm-svn: 214522

9 years ago[AArch64] Fix test from r214518 in an attempt to appease buildbots.
Chad Rosier [Fri, 1 Aug 2014 15:30:41 +0000 (15:30 +0000)]
[AArch64] Fix test from r214518 in an attempt to appease buildbots.

llvm-svn: 214521

9 years agoAdd IR Mangler for more stable mangling.
Eli Bendersky [Fri, 1 Aug 2014 15:01:10 +0000 (15:01 +0000)]
Add IR Mangler for more stable mangling.

llvm-svn: 214520

9 years agoRemove lto_codegen_set_attr.
Rafael Espindola [Fri, 1 Aug 2014 14:57:05 +0000 (14:57 +0000)]
Remove lto_codegen_set_attr.

It was never exported, so no functionality change.

llvm-svn: 214519

9 years ago[AArch64] Generate tbz/tbnz when comparing against zero.
Chad Rosier [Fri, 1 Aug 2014 14:48:56 +0000 (14:48 +0000)]
[AArch64] Generate tbz/tbnz when comparing against zero.

The tbz/tbnz checks the sign bit to convert

op w1, w1, w10
cmp w1, #0
b.lt .LBB0_0

to

op w1, w1, w10
tbnz w1, #31, .LBB0_0

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

llvm-svn: 214518

9 years ago[PowerPC] PR20280 - Slots for byval parameters are not immutable
Ulrich Weigand [Fri, 1 Aug 2014 14:35:58 +0000 (14:35 +0000)]
[PowerPC] PR20280 - Slots for byval parameters are not immutable

Found by inspection while looking at PR20280: code would mark slots
in the parameter save area where a byval parameter is passed as
"immutable".  This is not correct since code is allowed to modify
byval parameters in place in the parameter save area.

llvm-svn: 214517

9 years agoRemove some calls to std::move.
Rafael Espindola [Fri, 1 Aug 2014 14:31:55 +0000 (14:31 +0000)]
Remove some calls to std::move.

Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get
a reference to it.

Thanks to David Blaikie for the suggestion.

llvm-svn: 214516

9 years ago[pr20127] Check for leading \1 in the Twine version of getNameWithPrefix.
Rafael Espindola [Fri, 1 Aug 2014 14:16:40 +0000 (14:16 +0000)]
[pr20127] Check for leading \1 in the Twine version of getNameWithPrefix.

No functionality change, but will simplify an upcoming patch that uses the
Twine version.

llvm-svn: 214515

9 years agoSimplify the code a bit with std::unique_ptr.
Rafael Espindola [Fri, 1 Aug 2014 14:11:14 +0000 (14:11 +0000)]
Simplify the code a bit with std::unique_ptr.

llvm-svn: 214514

9 years agoThe GNU-style aligned attribute has an optional expression, but the generated pretty...
Aaron Ballman [Fri, 1 Aug 2014 13:49:00 +0000 (13:49 +0000)]
The GNU-style aligned attribute has an optional expression, but the generated pretty printing logic was unaware of this. Fixed the pretty printing logic, and added a test to ensure it no longer asserts.

Added a FIXME to the code about eliding the parenthesis when pretty printing such a construct.

llvm-svn: 214513

9 years agoRevert r214497: [mips] Defer va_arg expansion to the backend.
Daniel Sanders [Fri, 1 Aug 2014 13:26:28 +0000 (13:26 +0000)]
Revert r214497: [mips] Defer va_arg expansion to the backend.

It appears that the backend does not handle all cases that were handled by clang.
In particular, it does not handle structs as used in
SingleSource/UnitTests/2003-05-07-VarArgs.

llvm-svn: 214512

9 years agoReplacing some more complex logic with a helper function call to ObjCMethod::getRetur...
Aaron Ballman [Fri, 1 Aug 2014 13:20:09 +0000 (13:20 +0000)]
Replacing some more complex logic with a helper function call to ObjCMethod::getReturnTypeSourceRange. No functional changes intended.

llvm-svn: 214511

9 years agoXcore target: Fix CXXStdlibIncludeArgs to check 'nostdinc++' flag too.
Robert Lytton [Fri, 1 Aug 2014 13:11:46 +0000 (13:11 +0000)]
Xcore target: Fix CXXStdlibIncludeArgs to check 'nostdinc++' flag too.

Summary:
There are no tests as it is dependant upon the environment variables
XCC_C_INCLUDE_PATH & XCC_CPLUS_INCLUDE_PATH  being set.

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

llvm-svn: 214510

9 years agollvm-objdump: implement printing for MachO __compact_unwind info.
Tim Northover [Fri, 1 Aug 2014 13:07:19 +0000 (13:07 +0000)]
llvm-objdump: implement printing for MachO __compact_unwind info.

llvm-svn: 214509

9 years agoclang-format: Add a space in ObjC protocols.
Daniel Jasper [Fri, 1 Aug 2014 13:03:05 +0000 (13:03 +0000)]
clang-format: Add a space in ObjC protocols.

Before:
  @interface Foo (HackStuff)<MyProtocol>

After:
  @interface Foo (HackStuff) <MyProtocol>

llvm-svn: 214508

9 years agoImproving diagnostic source ranges for the nonnull attribute. Now it highlights the...
Aaron Ballman [Fri, 1 Aug 2014 12:58:11 +0000 (12:58 +0000)]
Improving diagnostic source ranges for the nonnull attribute. Now it highlights the attribute and the faulty nonpointer type when possible.

llvm-svn: 214507

9 years agoFix a memory leak - dispose of the CXString after printing it in mangling.
Eli Bendersky [Fri, 1 Aug 2014 12:55:44 +0000 (12:55 +0000)]
Fix a memory leak - dispose of the CXString after printing it in mangling.

Thanks to kcc@ for noticing.

llvm-svn: 214506

9 years agoAllow only disassembling of M-class MSR masks that the assembler knows how to assembl...
James Molloy [Fri, 1 Aug 2014 12:42:11 +0000 (12:42 +0000)]
Allow only disassembling of M-class MSR masks that the assembler knows how to assemble back.

Note: The current code in DecodeMSRMask() rejects the unpredictable A/R MSR mask '0000' with Fail. The code in the patch follows this style and rejects unpredictable M-class MSR masks also with Fail (instead of SoftFail). If SoftFail is preferred in this case then additional changes to ARMInstPrinter (to print non-symbolic masks) and ARMAsmParser (to parse non-symbolic masks) will be needed.

Patch by Petr Pavlu!

llvm-svn: 214505

9 years agoInitializing the loop hint option token again.
Aaron Ballman [Fri, 1 Aug 2014 12:41:37 +0000 (12:41 +0000)]
Initializing the loop hint option token again.

llvm-svn: 214504

9 years agoImprove some const-correctness to remove a -Wcast-qual warning. No functional changes...
Aaron Ballman [Fri, 1 Aug 2014 12:34:58 +0000 (12:34 +0000)]
Improve some const-correctness to remove a -Wcast-qual warning. No functional changes intended.

llvm-svn: 214503

9 years agoInitializing the loop hint option token.
Aaron Ballman [Fri, 1 Aug 2014 12:20:20 +0000 (12:20 +0000)]
Initializing the loop hint option token.

llvm-svn: 214502

9 years agoUpdate the code with clang changes r214450 (FunctionProtoType::ExtProtoInfo update)
Sylvestre Ledru [Fri, 1 Aug 2014 12:19:15 +0000 (12:19 +0000)]
Update the code with clang changes r214450 (FunctionProtoType::ExtProtoInfo update)

llvm-svn: 214501

9 years ago[ARM] Make the assembler reject unpredictable pre/post-indexed ARM LDRB/LDRSB instruc...
Tilmann Scheller [Fri, 1 Aug 2014 12:08:04 +0000 (12:08 +0000)]
[ARM] Make the assembler reject unpredictable pre/post-indexed ARM LDRB/LDRSB instructions.

The ARM ARM prohibits LDRB/LDRSB instructions with writeback into the destination register. With this commit this constraint is now enforced and we stop assembling LDRH/LDRSH instructions with unpredictable behavior.

llvm-svn: 214500

9 years ago[ARM] Make the assembler reject unpredictable pre/post-indexed ARM LDRH/LDRSH instruc...
Tilmann Scheller [Fri, 1 Aug 2014 11:33:47 +0000 (11:33 +0000)]
[ARM] Make the assembler reject unpredictable pre/post-indexed ARM LDRH/LDRSH instructions.

The ARM ARM prohibits LDRH/LDRSH instructions with writeback into the source register. With this commit this constraint is now enforced and we stop assembling LDRH/LDRSH instructions with unpredictable behavior.

llvm-svn: 214499

9 years ago[ARM] Make the assembler reject unpredictable pre/post-indexed ARM LDR instructions.
Tilmann Scheller [Fri, 1 Aug 2014 11:08:51 +0000 (11:08 +0000)]
[ARM] Make the assembler reject unpredictable pre/post-indexed ARM LDR instructions.

The ARM ARM prohibits LDR instructions with writeback into the destination register. With this commit this constraint is now enforced and we stop assembling LDR instructions with unpredictable behavior.

llvm-svn: 214498

9 years ago[mips] Defer va_arg expansion to the backend.
Daniel Sanders [Fri, 1 Aug 2014 10:29:21 +0000 (10:29 +0000)]
[mips] Defer va_arg expansion to the backend.

Summary:
This patch causes clang to emit va_arg instructions to the backend instead of
expanding them into an implementation itself. The backend already implements
va_arg since this is necessary for NaCl so this patch is removing redundant
code.

Together with the llvm patch (D4556) that accounts for the effect of endianness
on the expansion of va_arg, this fixes PR19612.

Depends on D4556

Reviewers: sstankovic, dsanders

Reviewed By: dsanders

Subscribers: rnk, cfe-commits

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

llvm-svn: 214497

9 years agoSLPVectorizer: fix build problem in Release configuration
Erik Eckstein [Fri, 1 Aug 2014 09:47:38 +0000 (09:47 +0000)]
SLPVectorizer: fix build problem in Release configuration

llvm-svn: 214496

9 years ago[Mips] Replace assembler code by YAML to make the 'interpreter.test' test
Simon Atanasyan [Fri, 1 Aug 2014 09:47:21 +0000 (09:47 +0000)]
[Mips] Replace assembler code by YAML to make the 'interpreter.test' test
target independent.

llvm-svn: 214495

9 years agoSLPVectorizer: improved scheduling algorithm.
Erik Eckstein [Fri, 1 Aug 2014 09:20:42 +0000 (09:20 +0000)]
SLPVectorizer: improved scheduling algorithm.

llvm-svn: 214494

9 years ago[mips][PR19612] Fix va_arg for big-endian mode.
Daniel Sanders [Fri, 1 Aug 2014 09:17:39 +0000 (09:17 +0000)]
[mips][PR19612] Fix va_arg for big-endian mode.

Summary:
Big-endian mode was not correctly adjusting the offset for types smaller
than an ABI slot.

Fixes PR19612

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: sstankovic, llvm-commits

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

llvm-svn: 214493

9 years ago[Format] Remove blank line in Dependences.h
Johannes Doerfert [Fri, 1 Aug 2014 08:44:49 +0000 (08:44 +0000)]
[Format] Remove blank line in Dependences.h

llvm-svn: 214492

9 years ago[Fix] Annotate the IslAst with broken reductions (Missing files)
Johannes Doerfert [Fri, 1 Aug 2014 08:20:26 +0000 (08:20 +0000)]
[Fix] Annotate the IslAst with broken reductions (Missing files)

  + test cases of r214489.

llvm-svn: 214491

9 years ago[Typo] Added dot at the end of a sentence.
Johannes Doerfert [Fri, 1 Aug 2014 08:18:39 +0000 (08:18 +0000)]
[Typo] Added dot at the end of a sentence.

llvm-svn: 214490

9 years agoAnnotate the IslAst with broken reductions
Johannes Doerfert [Fri, 1 Aug 2014 08:17:19 +0000 (08:17 +0000)]
Annotate the IslAst with broken reductions

  + Split all reduction dependences and map them to the causing memory accesses.
  + Print the types & base addresses of broken reductions for each "reduction
    parallel" marked loop (OpenMP style).
  + 3 test cases to show how reductions are now represented in the isl ast.

  The mapping "(ast) loops -> broken reductions" is also needed to find the
  memory accesses we need to privatize in a loop.

llvm-svn: 214489

9 years agoChange the semantics of is*Parallel
Johannes Doerfert [Fri, 1 Aug 2014 08:14:28 +0000 (08:14 +0000)]
Change the semantics of is*Parallel

  The functions isParallel, isInnermostParallel and IsOutermostParallel in
  IslAstInfo will now return true even in the presence of broken reductions.
  To compensate for this change the negated result of isReductionParallel can
  be used.

llvm-svn: 214488

9 years agoSLP Vectorizer: added statistics counter
Erik Eckstein [Fri, 1 Aug 2014 08:14:28 +0000 (08:14 +0000)]
SLP Vectorizer: added statistics counter

llvm-svn: 214487

9 years agoChange the printing of reduction types
Johannes Doerfert [Fri, 1 Aug 2014 08:13:25 +0000 (08:13 +0000)]
Change the printing of reduction types

  We use the C operator representation when applicable.

  + Update all the test cases accordingly.

llvm-svn: 214486

9 years agoSLP Vectorizer: improve canonicalize tree operands of commutitive binary operands.
Erik Eckstein [Fri, 1 Aug 2014 08:05:55 +0000 (08:05 +0000)]
SLP Vectorizer: improve canonicalize tree operands of commutitive binary operands.

This reverts r214338 (except the test file) and replaces it with a more general algorithm.

llvm-svn: 214485

9 years agoAdding ABI information to linux test results
Eric Fiselier [Fri, 1 Aug 2014 06:30:18 +0000 (06:30 +0000)]
Adding ABI information to linux test results

llvm-svn: 214484

9 years agoUpdate information about compiler used during linux tests and reformat run information.
Eric Fiselier [Fri, 1 Aug 2014 06:27:40 +0000 (06:27 +0000)]
Update information about compiler used during linux tests and reformat run information.

llvm-svn: 214483

9 years agoRevert of 214418:
Sylvestre Ledru [Fri, 1 Aug 2014 06:16:03 +0000 (06:16 +0000)]
Revert of 214418:
"Create a default symver on Linux like ELF OSes."

Fails the build under Debian with ld.gold:
/usr/bin/ld.gold: --default-symver: unknown option

llvm-svn: 214482

9 years ago[PowerPC] Generate unaligned vector loads using intrinsics instead of regular loads
Hal Finkel [Fri, 1 Aug 2014 05:20:41 +0000 (05:20 +0000)]
[PowerPC] Generate unaligned vector loads using intrinsics instead of regular loads

Altivec vector loads on PowerPC have an interesting property: They always load
from an aligned address (by rounding down the address actually provided if
necessary). In order to generate an actual unaligned load, you can generate two
load instructions, one with the original address, one offset by one vector
length, and use a special permutation to extract the bytes desired.

When this was originally implemented, I generated these two loads using regular
ISD::LOAD nodes, now marked as aligned. Unfortunately, there is a problem with
this:

The alignment of a load does not contribute to its identity, and SDNodes
are uniqued. So, imagine that we have some unaligned load, L1, that is not
aligned. The routine will create two loads, L1(aligned) and (L1+16)(aligned).
Further imagine that there had already existed a load (L1+16)(unaligned) with
the same chain operand as the load L1. When (L1+16)(aligned) is created as part
of the lowering of L1, this load *is* also the (L1+16)(unaligned) node, just
now marked as aligned (because the new alignment overwrites the old). But the
original users of (L1+16)(unaligned) now get the data intended for the
permutation yielding the data for L1, and (L1+16)(unaligned) no longer exists
to get its own permutation-based expansion. This was PR19991.

A second potential problem has to do with the MMOs on these loads, which can be
used by AA during instruction scheduling to break chain-based dependencies. If
the new "aligned" loads get the MMO from the original unaligned load, this does
not represent the fact that it will load data from below the original address.
Normally, this would not matter, but this load might be combined with another
load pair for a previous vector, and then the dependency on the otherwise-
ignored lower bytes can matter.

To fix both problems, instead of generating the necessary loads using regular
ISD::LOAD instructions, ppc_altivec_lvx intrinsics are used instead. These are
provided with MMOs with a conservative address range.

Unfortunately, I no longer have a failing test case (since PR19991 was
reported, other changes in CodeGen have forced this bug back into hiding it
again). Nevertheless, this should fix the underlying problem.

llvm-svn: 214481

9 years agoChange the encoding of the Triple string exchanged across GDB-RSP
Matthew Gardiner [Fri, 1 Aug 2014 05:12:23 +0000 (05:12 +0000)]
Change the encoding of the Triple string exchanged across GDB-RSP
and update documentation to suit, as suggested by Jason Molenda and
discussed in:

http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140721/011978.html

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

llvm-svn: 214480

9 years agoThis patch implements transform for pattern "(A & ~B) ^ (~A) -> ~(A & B)".
Suyog Sarda [Fri, 1 Aug 2014 05:07:20 +0000 (05:07 +0000)]
This patch implements transform for pattern "(A & ~B) ^ (~A) -> ~(A & B)".

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

llvm-svn: 214479

9 years agoThis patch implements transform for pattern "(A | B) & ((~A) ^ B) -> (A & B)".
Suyog Sarda [Fri, 1 Aug 2014 04:59:26 +0000 (04:59 +0000)]
This patch implements transform for pattern "(A | B) & ((~A) ^ B) -> (A & B)".

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

llvm-svn: 214478

9 years agoThis patch implements transform for pattern "( A & (~B)) | (A ^ B) -> (A ^ B)"
Suyog Sarda [Fri, 1 Aug 2014 04:50:31 +0000 (04:50 +0000)]
This patch implements transform for pattern "( A & (~B)) | (A ^ B) -> (A ^ B)"

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

llvm-svn: 214477