oota-llvm.git
9 years ago[Hexagon] Converting ALU32/ALU intrinsics to new patterns.
Colin LeMahieu [Mon, 19 Jan 2015 18:22:19 +0000 (18:22 +0000)]
[Hexagon] Converting ALU32/ALU intrinsics to new patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226478 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove support for DIVariable's FlagIndirectVariable and expect
Adrian Prantl [Mon, 19 Jan 2015 17:57:29 +0000 (17:57 +0000)]
Remove support for DIVariable's FlagIndirectVariable and expect
frontends to use a DIExpression with a DW_OP_deref instead.

This is not only a much more natural place for this informationl; there
is also a technical reason: The FlagIndirectVariable is used to mark a
variable that is turned into a reference by virtue of the calling
convention; this happens for example to aggregate return values.
The inliner, for example, may actually need to undo this indirection to
correctly represent the value in its new context. This is impossible to
implement because the DIVariable can't be safely modified. We can however
safely construct a new DIExpression on the fly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226476 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[AArch64] Implement GHC calling convention
Greg Fitzgerald [Mon, 19 Jan 2015 17:40:05 +0000 (17:40 +0000)]
[AArch64] Implement GHC calling convention

Original patch by Luke Iannini.  Minor improvements and test added by
Erik de Castro Lopo.

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

From: Erik de Castro Lopo <erikd@mega-nerd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226473 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Converting halfword to double accumulating multiply intrinsics.
Colin LeMahieu [Mon, 19 Jan 2015 17:36:32 +0000 (17:36 +0000)]
[Hexagon] Converting halfword to double accumulating multiply intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226472 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoProduce errors when an assignment expression would use a common symbol.
Rafael Espindola [Mon, 19 Jan 2015 17:30:24 +0000 (17:30 +0000)]
Produce errors when an assignment expression would use a common symbol.

An assignment will produce a symbol with a given section and offset. There is
no way to represent something like "1 byte after a common symbol".

This matches the behavior of GNU as.

Part of PR22217.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226470 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] SSAT/USAT with an 'asr #32' shift should result in an undefined encoding rather...
Bradley Smith [Mon, 19 Jan 2015 16:37:17 +0000 (16:37 +0000)]
[ARM] SSAT/USAT with an 'asr #32' shift should result in an undefined encoding rather than unpredictable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226469 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] Fixup sign extend instruction availability w.r.t. DSP extension
Bradley Smith [Mon, 19 Jan 2015 16:36:02 +0000 (16:36 +0000)]
[ARM] Fixup sign extend instruction availability w.r.t. DSP extension

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226468 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoBring r226038 back.
Rafael Espindola [Mon, 19 Jan 2015 15:16:06 +0000 (15:16 +0000)]
Bring r226038 back.

No change in this commit, but clang was changed to also produce trivial comdats when
needed.

Original message:

Don't create new comdats in CodeGen.

This patch stops the implicit creation of comdats during codegen.

Clang now sets the comdat explicitly when it is required. With this patch clang and gcc
now produce the same result in pr19848.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226467 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Replace the Pass argument to SplitEdge with specific analyses used
Chandler Carruth [Mon, 19 Jan 2015 12:36:53 +0000 (12:36 +0000)]
[PM] Replace the Pass argument to SplitEdge with specific analyses used
and updated.

This may appear to remove handling for things like alias analysis when
splitting critical edges here, but in fact no callers of SplitEdge
relied on this. Similarly, all of them wanted to preserve LCSSA if there
was any update of the loop info. That makes the interface much simpler.

With this, all of BasicBlockUtils.h is free of Pass arguments and
prepared for the new pass manager. This is tho majority of utilities
that relied on pass arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226459 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Cleanup a dead option to critical edge splitting that I noticed
Chandler Carruth [Mon, 19 Jan 2015 12:12:00 +0000 (12:12 +0000)]
[PM] Cleanup a dead option to critical edge splitting that I noticed
while refactoring this API for the new pass manager.

No functionality changed here, the code didn't actually support this
option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226457 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Remove the Pass argument from all of the critical edge splitting
Chandler Carruth [Mon, 19 Jan 2015 12:09:11 +0000 (12:09 +0000)]
[PM] Remove the Pass argument from all of the critical edge splitting
APIs and replace it and numerous booleans with an option struct.

The critical edge splitting API has a really large surface of flags and
so it seems worth burning a small option struct / builder. This struct
can be constructed with the various preserved analyses and then flags
can be flipped in a builder style.

The various users are now responsible for directly passing along their
analysis information. This should be enough for the critical edge
splitting to work cleanly with the new pass manager as well.

This API is still pretty crufty and could be cleaned up a lot, but I've
focused on this change just threading an option struct rather than
a pass through the API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226456 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[NFC] Update createMachineScheduler() comment
Sergey Dmitrouk [Mon, 19 Jan 2015 12:02:25 +0000 (12:02 +0000)]
[NFC] Update createMachineScheduler() comment

It became invalid after signature changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226455 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSuppress the newly added Clang warning for the inaccessible base in this
Chandler Carruth [Mon, 19 Jan 2015 10:43:00 +0000 (10:43 +0000)]
Suppress the newly added Clang warning for the inaccessible base in this
test. Do that after we suppress the warnings for unknown pragmas as this
warning flag is quite new in Clang and so old Clang's would warn all the
time on this file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226444 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Relax asserts and always try to reconstruct loop simplify form when
Chandler Carruth [Mon, 19 Jan 2015 10:23:00 +0000 (10:23 +0000)]
[PM] Relax asserts and always try to reconstruct loop simplify form when
we can while splitting critical edges.

The only code which called this and didn't require simplified loops to
be preserved is polly, and the code behaves correctly there anyways.
Without this change, it becomes really hard to share this code with the
new pass manager where things like preserving loop simplify form don't
make any sense.

If anyone discovers this code behaving incorrectly, what it *should* be
testing for is whether the loops it needs to be in simplified form are
in fact in that form. It should always be trying to preserve that form
when it exists.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226443 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSLPVectorizer: limit the number of alias checks to reduce the runtime.
Erik Eckstein [Mon, 19 Jan 2015 09:33:38 +0000 (09:33 +0000)]
SLPVectorizer: limit the number of alias checks to reduce the runtime.

In case of blocks with many memory-accessing instructions, alias checking can take lot of time
(because calculating the memory dependencies has quadratic complexity).
I chose a limit which resulted in no changes when running the benchmarks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226439 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Minor correction to r226432
Hal Finkel [Mon, 19 Jan 2015 07:44:45 +0000 (07:44 +0000)]
[PowerPC] Minor correction to r226432

We don't need to exclude patchpoints from the implicit r2 dependence in
FastISel because it is added as an implicit operand and, thus, should not
confuse that StackMap code.

By inspection / no test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226434 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MIScheduler] Slightly better handling of constrainLocalCopy when both source and...
Michael Kuperstein [Mon, 19 Jan 2015 07:30:47 +0000 (07:30 +0000)]
[MIScheduler] Slightly better handling of constrainLocalCopy when both source and dest are local
This fixes PR21792.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226433 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Add r2 as an operand for all calls under both PPC64 ELF V1 and V2
Hal Finkel [Mon, 19 Jan 2015 07:20:27 +0000 (07:20 +0000)]
[PowerPC] Add r2 as an operand for all calls under both PPC64 ELF V1 and V2

Our PPC64 ELF V2 call lowering logic added r2 as an operand to all direct call
instructions in order to represent the dependency on the TOC base pointer
value. Restricting this to ELF V2, however, does not seem to make sense: calls
under ELF V1 have the same dependence, and indirect calls have an r2 dependence
just as direct ones. Make sure the dependence is noted for all calls under both
ELF V1 and ELF V2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226432 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Change AVX512 intrinsics to take a 8-bit immediate for the comparision kind...
Craig Topper [Mon, 19 Jan 2015 06:07:27 +0000 (06:07 +0000)]
[x86] Change AVX512 intrinsics to take a 8-bit immediate for the comparision kind instead of a 32-bit immediate. This better aligns with the emitted instruction. It also matches SSE and AVX1 equivalents. Also add auto upgrade support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226430 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[tinyptrvector] Add in a MutableArrayRef implicit conversion operator to complement...
Michael Gottesman [Mon, 19 Jan 2015 03:25:33 +0000 (03:25 +0000)]
[tinyptrvector] Add in a MutableArrayRef implicit conversion operator to complement the ArrayRef implicit conversion operator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226428 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Lift the analyses into the interface for
Chandler Carruth [Mon, 19 Jan 2015 03:03:39 +0000 (03:03 +0000)]
[PM] Lift the analyses into the interface for
SplitLandingPadPredecessors and remove the Pass argument from its
interface.

Another step to the utilities being usable with both old and new pass
managers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226426 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoChange using => typedef to please the MSVC bots.
Michael Gottesman [Mon, 19 Jan 2015 02:38:16 +0000 (02:38 +0000)]
Change using => typedef to please the MSVC bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226425 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoHide the state of TinyPtrVector and remove the single element constructor.
Michael Gottesman [Mon, 19 Jan 2015 02:09:54 +0000 (02:09 +0000)]
Hide the state of TinyPtrVector and remove the single element constructor.

There is no reason for this state to be exposed as public. The single element
constructor was superfulous in light of the single element ArrayRef
constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226424 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReorder.
NAKAMURA Takumi [Mon, 19 Jan 2015 00:35:33 +0000 (00:35 +0000)]
Reorder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226419 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] examples/Kaleidoscope: Prune redundant libdeps.
NAKAMURA Takumi [Mon, 19 Jan 2015 00:35:25 +0000 (00:35 +0000)]
[CMake] examples/Kaleidoscope: Prune redundant libdeps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226418 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[CMake] Update libdeps in examples/Kaleidoscope/Chapter4.
NAKAMURA Takumi [Mon, 19 Jan 2015 00:35:18 +0000 (00:35 +0000)]
[CMake] Update libdeps in examples/Kaleidoscope/Chapter4.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226417 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agounique_ptrify the RelInfo parameter to TargetRegistry::createMCSymbolizer
David Blaikie [Sun, 18 Jan 2015 20:45:48 +0000 (20:45 +0000)]
unique_ptrify the RelInfo parameter to TargetRegistry::createMCSymbolizer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226416 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAttempt to fix the MSVC build by working around a layering issue
David Blaikie [Sun, 18 Jan 2015 20:43:57 +0000 (20:43 +0000)]
Attempt to fix the MSVC build by working around a layering issue

Since MCStreamer isn't part of Support, the dtor can't be called from
here - so just pass by reference instead. This is rather imperfect, but
will hopefully suffice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226415 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agostd::unique_ptrify the MCStreamer argument to createAsmPrinter
David Blaikie [Sun, 18 Jan 2015 20:29:04 +0000 (20:29 +0000)]
std::unique_ptrify the MCStreamer argument to createAsmPrinter

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226414 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600: Remove redundant test
Matt Arsenault [Sun, 18 Jan 2015 19:30:32 +0000 (19:30 +0000)]
R600: Remove redundant test

This is already covered in ftrunc.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226412 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] 'CHECK :' is not a valid check directive. Fixed.
Daniel Sanders [Sun, 18 Jan 2015 18:43:10 +0000 (18:43 +0000)]
[mips] 'CHECK :' is not a valid check directive. Fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226409 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Make whitespace in disassembler tests more consistent. NFC.
Daniel Sanders [Sun, 18 Jan 2015 18:38:36 +0000 (18:38 +0000)]
[mips] Make whitespace in disassembler tests more consistent. NFC.

The tests for the ISA's should now be approximately diffable. That is, the
output of 'diff valid-mips1.txt valid-mips2.txt' should be emit the lines
for instructions that were added/removed to/from MIPS-I by MIPS-II. This
doesn't work perfectly at the moment due to ordering differences but it
should be close.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226408 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Make whitespace of disassembler tests more consistent by removing blank lines...
Daniel Sanders [Sun, 18 Jan 2015 18:21:19 +0000 (18:21 +0000)]
[mips] Make whitespace of disassembler tests more consistent by removing blank lines. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226407 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86][SSE] Added scalar min/max folding tests. NFC.
Simon Pilgrim [Sun, 18 Jan 2015 18:06:23 +0000 (18:06 +0000)]
[X86][SSE] Added scalar min/max folding tests. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226406 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86][SSE] Added float extract and xmm extract/insert stack folding tests. NFC.
Simon Pilgrim [Sun, 18 Jan 2015 17:04:32 +0000 (17:04 +0000)]
[X86][SSE] Added float extract and xmm extract/insert stack folding tests. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226405 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86][SSE] Added scalar conversion stack folding tests. NFC.
Simon Pilgrim [Sun, 18 Jan 2015 16:22:15 +0000 (16:22 +0000)]
[X86][SSE] Added scalar conversion stack folding tests. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226404 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Don't hard-code R2 as register when processing TOC relocations
Hal Finkel [Sun, 18 Jan 2015 15:59:44 +0000 (15:59 +0000)]
[PowerPC] Don't hard-code R2 as register when processing TOC relocations

Instructions that have high-order TOC relocations always carry R2 as their base
register, so it does not matter whether we take the register from the
instruction or just hard-code it in PPCAsmPrinter. In the future, however, we
might want to apply these relocations to instructions using a different
register, so taking the register from the instruction is a better thing to do.
No change in functionality here, however.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226403 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Add some FIXMEs for fastcc and FPR <-> GPR moves
Hal Finkel [Sun, 18 Jan 2015 14:31:10 +0000 (14:31 +0000)]
[PowerPC] Add some FIXMEs for fastcc and FPR <-> GPR moves

So we don't forget, once we support FPR <-> GPR moves on the P8, we'll likely
want to re-visit this part of the calling convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226401 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAVX1 stack folding tests. NFC.
Simon Pilgrim [Sun, 18 Jan 2015 12:56:39 +0000 (12:56 +0000)]
AVX1 stack folding tests. NFC.

Begun adding more exhaustive tests - all floating point instructions should now be either tested or have placeholders. We do seem to have a number of missing instructions, I will add a patch for review once the remaining working instructions are added.

I'll then move on to SSE tests and then the integer instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226400 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Initial PPC64 calling-convention changes for fastcc
Hal Finkel [Sun, 18 Jan 2015 12:08:47 +0000 (12:08 +0000)]
[PowerPC] Initial PPC64 calling-convention changes for fastcc

The default calling convention specified by the PPC64 ELF (V1 and V2) ABI is
designed to work with both prototyped and non-prototyped/varargs functions. As
a result, GPRs and stack space are allocated for every argument, even those
that are passed in floating-point or vector registers.

GlobalOpt::OptimizeFunctions will transform local non-varargs functions (that
do not have their address taken) to use the 'fast' calling convention.

When functions are using the 'fast' calling convention, don't allocate GPRs for
arguments passed in other types of registers, and don't allocate stack space for
arguments passed in registers. Other changes for the fast calling convention
may be added in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226399 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Pull the analyses used for another utility routine into its API
Chandler Carruth [Sun, 18 Jan 2015 09:21:15 +0000 (09:21 +0000)]
[PM] Pull the analyses used for another utility routine into its API
rather than relying on the pass object.

This one is a bit annoying, but will pay off. First, supporting this one
will make the next one much easier, and for utilities like LoopSimplify,
this is moving them (slowly) closer to not having to pass the pass
object around throughout their APIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226396 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Sink the specific analyses preserved by SplitBlock into its
Chandler Carruth [Sun, 18 Jan 2015 02:39:37 +0000 (02:39 +0000)]
[PM] Sink the specific analyses preserved by SplitBlock into its
interface, removing Pass from its interface.

This also makes those analyses optional so that passes which don't even
preserve these (or use them) can skip the logic entirely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226394 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Replace another Pass argument with specific analyses that are
Chandler Carruth [Sun, 18 Jan 2015 02:11:23 +0000 (02:11 +0000)]
[PM] Replace another Pass argument with specific analyses that are
optionally updated by MergeBlockIntoPredecessors.

No functionality changed, just refactoring to clear the way for the new
pass manager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226392 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Refactor how the LoopRotation pass access the DominatorTree.
Chandler Carruth [Sun, 18 Jan 2015 02:08:05 +0000 (02:08 +0000)]
[PM] Refactor how the LoopRotation pass access the DominatorTree.

Instead of querying the pass every where we need to, do that once and
cache a pointer in the pass object. This is both simpler and I'm about
to add yet another place where we need to dig out that pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226391 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Lift the actual analyses used into the inferface rather than
Chandler Carruth [Sun, 18 Jan 2015 01:45:07 +0000 (01:45 +0000)]
[PM] Lift the actual analyses used into the inferface rather than
accepting a Pass and querying it for analyses.

This is necessary to allow the utilities to work both with the old and
new pass managers, and I also think this makes the interface much more
clear and helps the reader know what analyses the utility can actually
handle. I plan to repeat this process iteratively to clean up all the
pass utilities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226386 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Now that LoopInfo isn't in the Pass type hierarchy, it is much
Chandler Carruth [Sun, 18 Jan 2015 01:25:51 +0000 (01:25 +0000)]
[PM] Now that LoopInfo isn't in the Pass type hierarchy, it is much
cleaner to derive from the generic base.

Thise removes a ton of boiler plate code and somewhat strange and
pointless indirections. It also remove a bunch of the previously needed
friend declarations. To fully remove these, I also lifted the verify
logic into the generic LoopInfoBase, which seems good anyways -- it is
generic and useful logic even for the machine side.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226385 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Cleanup more warnings my refactoring exposed where now we have
Chandler Carruth [Sat, 17 Jan 2015 14:49:23 +0000 (14:49 +0000)]
[PM] Cleanup more warnings my refactoring exposed where now we have
unused variables in a no-asserts build.

I've fixed this by putting the entire loop behind an #ifndef as it
contains nothing other than asserts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226377 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Remove a dead field.
Chandler Carruth [Sat, 17 Jan 2015 14:31:35 +0000 (14:31 +0000)]
[PM] Remove a dead field.

This was dead even before I refactored how we initialized it, but my
refactoring made it trivially dead and it is now caught by a Clang
warning. This fixes the warning and should clean up the -Werror bot
failures (sorry!).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226376 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Split the LoopInfo object apart from the legacy pass, creating
Chandler Carruth [Sat, 17 Jan 2015 14:16:18 +0000 (14:16 +0000)]
[PM] Split the LoopInfo object apart from the legacy pass, creating
a LoopInfoWrapperPass to wire the object up to the legacy pass manager.

This switches all the clients of LoopInfo over and paves the way to port
LoopInfo to the new pass manager. No functionality change is intended
with this iteration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226373 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Don't list R11 as a patchpoint scratch register
Hal Finkel [Sat, 17 Jan 2015 03:57:34 +0000 (03:57 +0000)]
[PowerPC] Don't list R11 as a patchpoint scratch register

R11's status is the same under both the PPC64 ELF V1 and V2 ABIs: it is
reserved for use as an "environment pointer" for compilation models that
require such a thing. We don't, we also don't need a second scratch register,
and because we support only "local" patchpoint call targets, we might as well
let R11 be used for anyregcc patchpoints.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226369 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoProgrammersManual.rst: fix a typo
Hans Wennborg [Sat, 17 Jan 2015 03:19:21 +0000 (03:19 +0000)]
ProgrammersManual.rst: fix a typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226367 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoImprove DAG combine pass on certain IR vector patterns
Mehdi Amini [Sat, 17 Jan 2015 01:35:56 +0000 (01:35 +0000)]
Improve DAG combine pass on certain IR vector patterns

Loading 2 2x32-bit float vectors into the bottom half of a 256-bit vector
produced suboptimal code in AVX2 mode with certain IR combinations.

In particular, the IR optimizer folded 2f32 + 2f32 -> 4f32, 4f32 + 4f32
(undef) -> 8f32 into a 2f32 + 2f32 -> 8f32, which seems more canonical,
but then mysteriously generated rather bad code; the movq/movhpd combination
didn't match.

The problem lay in the BUILD_VECTOR optimization path. The 2f32 inputs
would get promoted to 4f32 by the type legalizer, eventually resulting
in a BUILD_VECTOR on two 4f32 into an 8f32. The BUILD_VECTOR then, recognizing
these were both half the output size, concatted them and then produced
a shuffle. However, the resulting concat + shuffle was more complex than
it should be; in the case where the upper half of the output is undef, we
probably want to generate shuffle + concat instead.

This enhancement causes the vector_shuffle combine step to recognize this
suboptimal pattern and correct it. I included it there instead of in BUILD_VECTOR
in case the same suboptimal pattern occurs for other reasons.

This results in the optimizer correctly producing the optimal movq + movhpd
sequence for all three variations on this IR, even with AVX2.

I've included a test case.

Radar link: rdar://problem/19287012
Fix for PR 21943.

From: Fiona Glaser <fglaser@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226360 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[RuntimeDyld] Tidy up emitCommonSymbols a little. NFC.
Lang Hames [Sat, 17 Jan 2015 00:55:05 +0000 (00:55 +0000)]
[RuntimeDyld] Tidy up emitCommonSymbols a little. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226358 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove std::move that was preventing return value optimization.
Richard Trieu [Sat, 17 Jan 2015 00:46:44 +0000 (00:46 +0000)]
Remove std::move that was preventing return value optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226356 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRegisterCoalescer: Cleanup and improved comment for a subtle detail.
Matthias Braun [Sat, 17 Jan 2015 00:33:13 +0000 (00:33 +0000)]
RegisterCoalescer: Cleanup and improved comment for a subtle detail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226353 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRegisterCoalescer: Cleanup by factoring out a common expression
Matthias Braun [Sat, 17 Jan 2015 00:33:11 +0000 (00:33 +0000)]
RegisterCoalescer: Cleanup by factoring out a common expression

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226352 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRegisterCoalescer: Cleanup comment style
Matthias Braun [Sat, 17 Jan 2015 00:33:09 +0000 (00:33 +0000)]
RegisterCoalescer: Cleanup comment style

- Consistenly put comments above the function declaration, not the
  definition. To achieve this some duplicate comments got merged and
  some comment parts describing implementation details got moved into their
  functions.
- Consistently use doxygen comments above functions.
- Do not use doxygen comments inside functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226351 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRegisterCoalescer: Drive-by typo + whitespace fix
Matthias Braun [Sat, 17 Jan 2015 00:33:06 +0000 (00:33 +0000)]
RegisterCoalescer: Drive-by typo + whitespace fix

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226350 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[RuntimeDyld] Remove the brace initialization that was introduced in r226341.
Lang Hames [Sat, 17 Jan 2015 00:32:56 +0000 (00:32 +0000)]
[RuntimeDyld] Remove the brace initialization that was introduced in r226341.
Evidently MSVC doesn't like it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226349 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoChange the test case for llvm-objdump’s -archive-headers option to not check the...
Kevin Enderby [Fri, 16 Jan 2015 23:29:07 +0000 (23:29 +0000)]
Change the test case for llvm-objdump’s -archive-headers option to not check the size
while I once again try to figure out why only the clang-cmake-armv7-a15-full bot
is getting that value wrong.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226345 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate a comment
Philip Reames [Fri, 16 Jan 2015 23:21:07 +0000 (23:21 +0000)]
Update a comment

Be a bit more explicit about the fact that addrspace(1) is not reserved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226344 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format all the GC related files (NFC)
Philip Reames [Fri, 16 Jan 2015 23:16:12 +0000 (23:16 +0000)]
clang-format all the GC related files (NFC)

Nothing interesting here...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226342 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[RuntimeDyld] Track symbol visibility in RuntimeDyld.
Lang Hames [Fri, 16 Jan 2015 23:13:56 +0000 (23:13 +0000)]
[RuntimeDyld] Track symbol visibility in RuntimeDyld.

RuntimeDyld symbol info previously consisted of just a Section/Offset pair. This
patch replaces that pair type with a SymbolInfo class that also tracks symbol
visibility. A new method, RuntimeDyld::getExportedSymbolLoadAddress, is
introduced which only returns a non-zero result for exported symbols. For
non-exported or non-existant symbols this method will return zero. The
RuntimeDyld::getSymbolAddress method retains its current behavior, returning
non-zero results for all symbols regardless of visibility.

No in-tree clients of RuntimeDyld are changed. The newly introduced
functionality will be used by the Orc APIs.

No test case: Since this patch doesn't modify the behavior for any in-tree
clients we don't have a good tool to test this with yet. Once Orc is in we can
use it to write regression tests that test these changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226341 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600: Clean up floor tests
Matt Arsenault [Fri, 16 Jan 2015 22:11:00 +0000 (22:11 +0000)]
R600: Clean up floor tests

These were using different naming schemes,
not using multiple check prefixes and not using
-LABEL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226333 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix the Archive::Child::getRawSize() method used by llvm-objdump’s -archive-headers...
Kevin Enderby [Fri, 16 Jan 2015 22:10:36 +0000 (22:10 +0000)]
Fix the Archive::Child::getRawSize() method used by llvm-objdump’s -archive-headers option
and tweak its use in llvm-objdump.  Add back the test case for the -archive-headers option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226332 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Kaleidoscope] Run clang-format over chapter 4 of kaleidoscope.
Lang Hames [Fri, 16 Jan 2015 21:42:07 +0000 (21:42 +0000)]
[Kaleidoscope] Run clang-format over chapter 4 of kaleidoscope.

I forgot to do this for r226308. Thanks to Eric Christopher for the reminder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226327 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Converting halfword to doubleword multiply intrinsics.
Colin LeMahieu [Fri, 16 Jan 2015 21:41:57 +0000 (21:41 +0000)]
[Hexagon] Converting halfword to doubleword multiply intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226326 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Converting accumulating halfword multiply intrinsics to patterns.
Colin LeMahieu [Fri, 16 Jan 2015 21:36:34 +0000 (21:36 +0000)]
[Hexagon] Converting accumulating halfword multiply intrinsics to patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226324 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Beginning converting intrinsics to patterns instead of duplicated definitio...
Colin LeMahieu [Fri, 16 Jan 2015 20:38:54 +0000 (20:38 +0000)]
[Hexagon] Beginning converting intrinsics to patterns instead of duplicated definitions.  Converting halfword multiply intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226318 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[RuntimeDyld] Add 'stub_addr' to comment describing RuntimeDyldChecker's syntax.
Lang Hames [Fri, 16 Jan 2015 20:31:38 +0000 (20:31 +0000)]
[RuntimeDyld] Add 'stub_addr' to comment describing RuntimeDyldChecker's syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226316 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Fix 226309, replacement atomic store patterns didn't actually exist, added...
Colin LeMahieu [Fri, 16 Jan 2015 20:16:14 +0000 (20:16 +0000)]
[Hexagon] Fix 226309, replacement atomic store patterns didn't actually exist, added new versions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226315 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agollvm-readobj: add IMAGE_REL_ARM_MOV32(T) to the enumeration
Saleem Abdulrasool [Fri, 16 Jan 2015 20:16:09 +0000 (20:16 +0000)]
llvm-readobj: add IMAGE_REL_ARM_MOV32(T) to the enumeration

Add an additional based relocation to the enumeration of based relocation names.
The lack of the enumerator value causes issues when inspecting WoA binaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226314 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoX86: fix comment typo in AsmParser
Saleem Abdulrasool [Fri, 16 Jan 2015 20:16:06 +0000 (20:16 +0000)]
X86: fix comment typo in AsmParser

Fix a typo.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226313 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMove ownership of GCStrategy objects to LLVMContext
Philip Reames [Fri, 16 Jan 2015 20:07:33 +0000 (20:07 +0000)]
Move ownership of GCStrategy objects to LLVMContext

Note: This change ended up being slightly more controversial than expected.  Chandler has tentatively okayed this for the moment, but I may be revisiting this in the near future after we settle some high level questions.

Rather than have the GCStrategy object owned by the GCModuleInfo - which is an immutable analysis pass used mainly by gc.root - have it be owned by the LLVMContext. This simplifies the ownership logic (i.e. can you have two instances of the same strategy at once?), but more importantly, allows us to access the GCStrategy in the middle end optimizer. To this end, I add an accessor through Function which becomes the canonical way to get at a GCStrategy instance.

In the near future, this will allows me to move some of the checks from http://reviews.llvm.org/D6808 into the Verifier itself, and to introduce optimization legality predicates for some of the recent additions to InstCombine. (These will follow as separate changes.)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226311 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Removing old duplicate atomic load/store patterns.
Colin LeMahieu [Fri, 16 Jan 2015 19:53:35 +0000 (19:53 +0000)]
[Hexagon] Removing old duplicate atomic load/store patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226309 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Kaleidoscope] Fix a bug in Chapter 4 of the Kaleidoscope tutorial where repeat
Lang Hames [Fri, 16 Jan 2015 19:44:46 +0000 (19:44 +0000)]
[Kaleidoscope] Fix a bug in Chapter 4 of the Kaleidoscope tutorial where repeat
calls to functions weren't evaluated correctly.

Patch by Charlie Turner. Thanks Charlie!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226308 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove gc.root's findCustomSafePoints mechanism
Philip Reames [Fri, 16 Jan 2015 19:33:28 +0000 (19:33 +0000)]
Remove gc.root's findCustomSafePoints mechanism

Searching all of the existing gc.root implementations I'm aware of (all three of them), there was exactly one use of this mechanism, and that was to implement a performance improvement that should have been applied to the default lowering.

Having this function is requiring a dependency on a CodeGen class (MachineFunction), in a class which is otherwise completely independent of CodeGen. I could solve this differently, but given that I see absolutely no value in preserving this mechanism, I going to just get rid of it.

Note: Tis is the first time I'm intentionally breaking previously supported gc.root functionality. Given 3.6 has branched, I believe this is a good time to do this.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226305 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Converting old patterns to new versions using classes.
Colin LeMahieu [Fri, 16 Jan 2015 19:29:59 +0000 (19:29 +0000)]
[Hexagon] Converting old patterns to new versions using classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226304 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCheck commit access
Sumanth Gundapaneni [Fri, 16 Jan 2015 19:23:34 +0000 (19:23 +0000)]
Check commit access

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226302 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[AVX512] Add intrinsics for masked aligned FP loads and stores
Adam Nemet [Fri, 16 Jan 2015 18:50:09 +0000 (18:50 +0000)]
[AVX512] Add intrinsics for masked aligned FP loads and stores

Similar to the unaligned cases.

Test was generated with update_llc_test_checks.py.

Part of <rdar://problem/17688758>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226296 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[AVX512] Remove trailing whitespaces in this test
Adam Nemet [Fri, 16 Jan 2015 18:50:07 +0000 (18:50 +0000)]
[AVX512] Remove trailing whitespaces in this test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226295 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Allow 16-bits for column info
Duncan P. N. Exon Smith [Fri, 16 Jan 2015 17:33:08 +0000 (17:33 +0000)]
IR: Allow 16-bits for column info

Raise the limit for column information from 8 bits to 16 bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226291 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Cleanup dead code, NFC
Duncan P. N. Exon Smith [Fri, 16 Jan 2015 17:31:29 +0000 (17:31 +0000)]
IR: Cleanup dead code, NFC

Line/column fixups already exist in `MDLocation`.  Delete the duplicated
logic in `DebugLoc`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226290 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Updating call/jump instruction patterns.
Colin LeMahieu [Fri, 16 Jan 2015 17:05:27 +0000 (17:05 +0000)]
[Hexagon] Updating call/jump instruction patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226288 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86][DAG] Disable target specific combine on INSERTPS dag nodes at -O0.
Andrea Di Biagio [Fri, 16 Jan 2015 14:55:26 +0000 (14:55 +0000)]
[X86][DAG] Disable target specific combine on INSERTPS dag nodes at -O0.

This patch disables target specific combine on X86ISD::INSERTPS dag nodes
if optlevel is CodeGenOpt::None.

The backend currently implements a target specific combine rule that converts
a vector load used by an INSERTPS dag node into a scalar load plus a
scalar_to_vector. This allows ISel to select a single INSERTPSrm instead of
two instructions (i.e. a vector load plus INSERTPSrr).

However, the existing target combine rule on INSERTPS nodes only works under
the assumption that ISel will always be able to match an INSERTPSrm. This is
not true in general at -O0, since the backend only allows folding a load into
the memory operand of an instruction if the optimization level is not
CodeGenOpt::None.

In the example below:

//
__m128 test(__m128 a, __m128 *b) {
  __m128 c = _mm_insert_ps(a, *b, 1 << 6);
  return c;
}
//

Before this patch, at -O0, the backend would have canonicalized the load to 'b'
into a scalar load plus scalar_to_vector. Later on, ISel would have selected an
INSERTPSrr leaving the insertps mask in an inconsistent state:

  movss 4(%rdi), %xmm1
  insertps  $64, %xmm1, %xmm0 # xmm0 = xmm1[1],xmm0[1,2,3].

With this patch, the backend avoids folding the vector load into the operand of
the INSERTPS. The new codegen at -O0 is:

  movaps (%rdi), %xmm1
  insertps  $64, %xmm1, %xmm0 # %xmm1[1],xmm0[1,2,3].

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226277 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Remove a redundant semicolon and add space before curly brackets. NFC.
Toma Tabacu [Fri, 16 Jan 2015 10:45:15 +0000 (10:45 +0000)]
[mips] Remove a redundant semicolon and add space before curly brackets. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226269 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Refactored stack memory folding tests to explicitly force register spilling
Simon Pilgrim [Fri, 16 Jan 2015 09:32:54 +0000 (09:32 +0000)]
[X86] Refactored stack memory folding tests to explicitly force register spilling

The current 'big vectors' stack folded reload testing pattern is very bulky and makes it difficult to test all instructions as big vectors will tend to use only the ymm instruction implementations.

This patch changes the tests to use a nop call that lists explicit xmm registers as sideeffects, with this we can force a partial register spill of the relevant registers and then check that the reload is correctly folded. The asm generated only adds the forced spill, a nop instruction and a couple of extra labels (a fraction of the current approach).

More exhaustive tests will follow shortly, I've added some extra tests (the xmm versions of some of the existing folding tests) as a starting point.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226264 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r226242 - Revert Revert Don't create new comdats in CodeGen
Timur Iskhodzhanov [Fri, 16 Jan 2015 08:38:45 +0000 (08:38 +0000)]
Revert r226242 - Revert Revert Don't create new comdats in CodeGen

This breaks AddressSanitizer (ninja check-asan) on Windows

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226251 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse report_fatal_error instead of llvm_unreachable, so we don't crash on user input
Filipe Cabecinhas [Fri, 16 Jan 2015 04:54:12 +0000 (04:54 +0000)]
Use report_fatal_error instead of llvm_unreachable, so we don't crash on user input

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226248 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Adjust PatchPoints for ppc64le
Hal Finkel [Fri, 16 Jan 2015 04:40:58 +0000 (04:40 +0000)]
[PowerPC] Adjust PatchPoints for ppc64le

Bill Schmidt pointed out that some adjustments would be needed to properly
support powerpc64le (using the ELF V2 ABI). For one thing, R11 is not available
as a scratch register, so we need to use R12. R12 is also available under ELF
V1, so to maintain consistency, I flipped the order to make R12 the first
scratch register in the array under both ABIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226247 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix Reassociate handling of constant in presence of undef float
Mehdi Amini [Fri, 16 Jan 2015 03:00:58 +0000 (03:00 +0000)]
Fix Reassociate handling of constant in presence of undef float

http://reviews.llvm.org/D6993

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226245 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Revert Don't create new comdats in CodeGen"
Rafael Espindola [Fri, 16 Jan 2015 02:22:55 +0000 (02:22 +0000)]
Revert "Revert Don't create new comdats in CodeGen"

This reverts commit r226173, adding r226038 back.

No change in this commit, but clang was changed to also produce trivial comdats for
costructors, destructors and vtables when needed.

Original message:

Don't create new comdats in CodeGen.

This patch stops the implicit creation of comdats during codegen.

Clang now sets the comdat explicitly when it is required. With this patch clang and gcc
now produce the same result in pr19848.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226242 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWork around to get the build bot clang-cmake-armv7-a15-full green by
Kevin Enderby [Fri, 16 Jan 2015 02:08:11 +0000 (02:08 +0000)]
Work around to get the build bot clang-cmake-armv7-a15-full green by
removing the macho-archive-headers.test added with r226228 that it is
failing on for now while I try to figure out what is going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226241 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAnother attempt to fix the build bot clang-cmake-armv7-a15-full failing on
Kevin Enderby [Fri, 16 Jan 2015 01:09:54 +0000 (01:09 +0000)]
Another attempt to fix the build bot clang-cmake-armv7-a15-full failing on
the macho-archive-headers.test added with r226228.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226239 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd a new pass "inductive range check elimination"
Sanjoy Das [Fri, 16 Jan 2015 01:03:22 +0000 (01:03 +0000)]
Add a new pass "inductive range check elimination"

IRCE eliminates range checks of the form

  0 <= A * I + B < Length

by splitting a loop's iteration space into three segments in a way
that the check is completely redundant in the middle segment.  As an
example, IRCE will convert

  len = < known positive >
  for (i = 0; i < n; i++) {
    if (0 <= i && i < len) {
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }

to

  len = < known positive >
  limit = smin(n, len)
  // no first segment
  for (i = 0; i < limit; i++) {
    if (0 <= i && i < len) { // this check is fully redundant
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }
  for (i = limit; i < n; i++) {
    if (0 <= i && i < len) {
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }

IRCE can deal with multiple range checks in the same loop (it takes
the intersection of the ranges that will make each of them redundant
individually).

Currently IRCE does not do any profitability analysis.  That is a
TODO.

Please note that the status of this pass is *experimental*, and it is
not part of any default pass pipeline.  Having said that, I will love
to get feedback and general input from people interested in trying
this out.

This pass was originally r226201.  It was reverted because it used C++
features not supported by MSVC 2012.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226238 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThis should fix the build bot clang-cmake-armv7-a15-full failing on
Kevin Enderby [Fri, 16 Jan 2015 00:27:31 +0000 (00:27 +0000)]
This should fix the build bot clang-cmake-armv7-a15-full failing on
the macho-archive-headers.test added with r226228.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226232 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Add patterns for v_cvt_{flr|rpi}_i32_f32
Matt Arsenault [Thu, 15 Jan 2015 23:58:35 +0000 (23:58 +0000)]
R600/SI: Add patterns for v_cvt_{flr|rpi}_i32_f32

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226230 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix edge case when Start overflowed in 32 bit mode
Filipe Cabecinhas [Thu, 15 Jan 2015 23:50:44 +0000 (23:50 +0000)]
Fix edge case when Start overflowed in 32 bit mode

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226229 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd the option, -archive-headers, used with -macho to print the Mach-O archive header...
Kevin Enderby [Thu, 15 Jan 2015 23:19:11 +0000 (23:19 +0000)]
Add the option, -archive-headers, used with -macho to print the Mach-O archive headers to llvm-objdump.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226228 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Fix trailing comma with modifiers
Matt Arsenault [Thu, 15 Jan 2015 23:17:03 +0000 (23:17 +0000)]
R600/SI: Fix trailing comma with modifiers

Instructions with 1 operand can still use source modifiers,
so make sure we don't print an extra comma afterwards.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226226 91177308-0d34-0410-b5e6-96231b3b80d8