oota-llvm.git
9 years agoNew method SDep::isNormalMemoryOrBarrier() in ScheduleDAGInstrs.cpp.
Jonas Paulsson [Wed, 7 Jan 2015 13:38:29 +0000 (13:38 +0000)]
New method SDep::isNormalMemoryOrBarrier() in ScheduleDAGInstrs.cpp.

Used to iterate over previously added memory dependencies in
adjustChainDeps() and iterateChainSucc().

SDep::isCtrl() was previously used in these places, that also gave
anti and output edges. The code may be worse if these are followed,
because MisNeedChainEdge() will conservatively return true since a
non-memory instruction has no memory operands, and a false chain dep
will be added. It is also unnecessary since all memory accesses of
interest will be reached by memory dependencies, and there is a budget
limit for the number of edges traversed.

This problem was found on an out-of-tree target with enabled alias
analysis. No test case for an in-tree target has been found.

Reviewed by Hal Finkel.

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

9 years agoFix typos in comment and option help texts.
Jonas Paulsson [Wed, 7 Jan 2015 13:20:57 +0000 (13:20 +0000)]
Fix typos in comment and option help texts.

For -enable-aa-sched-mi and -use-tbaa-in-sched-mi.

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

9 years ago[ARM] Add missing Tag_DIV_use tests.
Charlie Turner [Wed, 7 Jan 2015 11:37:40 +0000 (11:37 +0000)]
[ARM] Add missing Tag_DIV_use tests.

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

9 years agoFix regression in r225266.
Asiri Rathnayake [Wed, 7 Jan 2015 11:22:58 +0000 (11:22 +0000)]
Fix regression in r225266.

The change in r225266 was reviewed under D6722. But the commit r225266 has a
typo, causing some MCHammer failures. This patch fixes it.

Change-Id: I573efcff25003af7478ac02548ebbe929fc7f5fd

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

9 years ago[PM] Give slightly less horrible names to the utility pass templates for
Chandler Carruth [Wed, 7 Jan 2015 11:14:51 +0000 (11:14 +0000)]
[PM] Give slightly less horrible names to the utility pass templates for
requiring and invalidating specific analyses. Also make their printed
names match their class names. Writing these out as prose really doesn't
make sense to me any more.

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

9 years ago[X86] Merge a switch statement inside a default case of another switch statement...
Craig Topper [Wed, 7 Jan 2015 08:10:38 +0000 (08:10 +0000)]
[X86] Merge a switch statement inside a default case of another switch statement on the same variable. There was no additional code in the default so this should be no functional change.

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

9 years ago[X86] Don't mark the shift by 1 instructions as isConvertibleToThreeAddress. There...
Craig Topper [Wed, 7 Jan 2015 08:10:36 +0000 (08:10 +0000)]
[X86] Don't mark the shift by 1 instructions as isConvertibleToThreeAddress. There is no handling for them.

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

9 years ago[X86] Remove some unused TYPE enums from the disassembler.
Craig Topper [Wed, 7 Jan 2015 07:47:52 +0000 (07:47 +0000)]
[X86] Remove some unused TYPE enums from the disassembler.

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

9 years agoRevert r225165 and r225169
Karthik Bhat [Wed, 7 Jan 2015 06:34:34 +0000 (06:34 +0000)]
Revert r225165 and r225169
Even thouh gcc produces simialr instructions as Owen pointed out the two patterns aren’t equivalent in the case
where the original subtraction could have caused an overflow.
Reverting the same.

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

9 years ago[ADT][SmallVector] Flip an assert comparison to avoid overflows yielding false-negati...
Ahmed Bougacha [Wed, 7 Jan 2015 02:42:01 +0000 (02:42 +0000)]
[ADT][SmallVector] Flip an assert comparison to avoid overflows yielding false-negatives. NFC.

r221973 changed SmallVector::operator[] to use size_t instead of unsigned.

Before that, on 64bit platforms, when a large index (say -1) was passed,
truncating it to unsigned avoided an overflow when computing 'begin() + idx',
and failed the range checking assertion, as expected.
With r221973, idx isn't truncated, so the addition wraps to
'(char*)begin() - 1', and doesn't fire anymore when it should have done so.

This commit changes the comparison to instead compute 'end() - begin()'
(i.e., 'size()'), which avoids potentially overflowing additions, and
correctly triggers the assertion when values such as -1 are passed.
Note that the problem already existed before that revision, on platforms
where sizeof(size_t) == sizeof(unsigned).

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

9 years agoIR: Remove MDNode::getWhenValsUnresolved()
Duncan P. N. Exon Smith [Wed, 7 Jan 2015 02:10:42 +0000 (02:10 +0000)]
IR: Remove MDNode::getWhenValsUnresolved()

Remove dead code.  Use `MDNode::get()` instead.

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

9 years agoRemove invalid TODO
Duncan P. N. Exon Smith [Wed, 7 Jan 2015 02:09:51 +0000 (02:09 +0000)]
Remove invalid TODO

We can't drop support for RAUW entirely in `MDNode`s, since it's
required for graph construction.  This comment was from before I'd done
the math on that (out-of-tree), and never should have been committed.

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

9 years ago[PM] Fix a pretty nasty bug where the new pass manager would invalidate
Chandler Carruth [Wed, 7 Jan 2015 01:58:35 +0000 (01:58 +0000)]
[PM] Fix a pretty nasty bug where the new pass manager would invalidate
passes too many time.

I think this is actually the issue that someone raised with me at the
developer's meeting and in an email, but that we never really got to the
bottom of. Having all the testing utilities made it much easier to dig
down and uncover the core issue.

When a pass manager is running many passes over a single function, we
need it to invalidate the analyses between each run so that they can be
re-computed as needed. We also need to track the intersection of
preserved higher-level analyses across all the passes that we run (for
example, if there is one module analysis which all the function analyses
preserve, we want to track that and propagate it). Unfortunately, this
interacted poorly with any enclosing pass adaptor between two IR units.
It would see the intersection of preserved analyses, and need to
invalidate any other analyses, but some of the un-preserved analyses
might have already been invalidated *and recomputed*! We would fail to
propagate the fact that the analysis had already been invalidated.

The solution to this struck me as really strange at first, but the more
I thought about it, the more natural it seemed. After a nice discussion
with Duncan about it on IRC, it seemed even nicer. The idea is that
invalidating an analysis *causes* it to be preserved! Preserving the
lack of result is trivial. If it is recomputed, great. Until something
*else* invalidates it again, we're good.

The consequence of this is that the invalidate methods on the analysis
manager which operate over many passes now consume their
PreservedAnalyses object, update it to "preserve" every analysis pass to
which it delivers an invalidation (regardless of whether the pass
chooses to be removed, or handles the invalidation itself by updating
itself). Then we return this augmented set from the invalidate routine,
letting the pass manager take the result and use the intersection of
*that* across each pass run to compute the final preserved set. This
accounts for all the places where the early invalidation of an analysis
has already "preserved" it for a future run.

I've beefed up the testing and adjusted the assertions to show that we
no longer repeatedly invalidate or compute the analyses across nested
pass managers.

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

9 years agoR600/SI: Add check for amdgcn triple forgotten in r225276.
Tom Stellard [Wed, 7 Jan 2015 01:17:37 +0000 (01:17 +0000)]
R600/SI: Add check for amdgcn triple forgotten in r225276.

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

9 years agoAnalysis: Reformulate WillNotOverflowUnsignedAdd for reusability
David Majnemer [Wed, 7 Jan 2015 00:39:50 +0000 (00:39 +0000)]
Analysis: Reformulate WillNotOverflowUnsignedAdd for reusability

WillNotOverflowUnsignedAdd's smarts will live in ValueTracking as
computeOverflowForUnsignedAdd.  It now returns a tri-state result:
never overflows, always overflows and sometimes overflows.

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

9 years agoInstCombine: Just a small tidy-up
David Majnemer [Wed, 7 Jan 2015 00:39:42 +0000 (00:39 +0000)]
InstCombine: Just a small tidy-up

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

9 years ago[PowerPC] Transform a README.txt entry into a FIXME
Hal Finkel [Wed, 7 Jan 2015 00:15:29 +0000 (00:15 +0000)]
[PowerPC] Transform a README.txt entry into a FIXME

Remove the README.txt entry regarding register allocation of CR logical ops,
and replace it with a FIXME in PPCInstrInfo.td. The text in the README.txt was
not really accurate, and thanks goes to Pat Haugen (and Bill Schmidt) from IBM
for clarifying what was intended and highlighting the relevant text in the ISA
specification.

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

9 years agocmake: Fix 'examples' target after r225319
Duncan P. N. Exon Smith [Tue, 6 Jan 2015 23:52:35 +0000 (23:52 +0000)]
cmake: Fix 'examples' target after r225319

Add the missing `DEPENDS` keyword.  r225319 did almost the right thing
(I didn't notice the problem with it because `Kaleidoscope-Ch8` wasn't
building at all).

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

9 years agoKaleidoscope: Value => Metadata
Duncan P. N. Exon Smith [Tue, 6 Jan 2015 23:48:22 +0000 (23:48 +0000)]
Kaleidoscope: Value => Metadata

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

9 years agocmake: Add 'examples' target
Duncan P. N. Exon Smith [Tue, 6 Jan 2015 23:42:49 +0000 (23:42 +0000)]
cmake: Add 'examples' target

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

9 years agocmake: Add Kaleidoscope target
Duncan P. N. Exon Smith [Tue, 6 Jan 2015 23:39:37 +0000 (23:39 +0000)]
cmake: Add Kaleidoscope target

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

9 years agoAdd a subdirectory in CMake for Chapter 8.
Eric Christopher [Tue, 6 Jan 2015 23:23:24 +0000 (23:23 +0000)]
Add a subdirectory in CMake for Chapter 8.

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

9 years agoRevert r224935 "Refactor duplicated code. No intended functionality change."
Lang Hames [Tue, 6 Jan 2015 23:04:36 +0000 (23:04 +0000)]
Revert r224935 "Refactor duplicated code. No intended functionality change."

This is affecting the behavior of some ObjC++ / AArch64 test cases on Darwin.
Reverting to get the bots green while I track down the source of the changed
behavior.

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

9 years agoR600/SI: Add combine for isinfinite pattern
Matt Arsenault [Tue, 6 Jan 2015 23:00:46 +0000 (23:00 +0000)]
R600/SI: Add combine for isinfinite pattern

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

9 years agoAdd isNegative helper to ConstantFPSDNode
Matt Arsenault [Tue, 6 Jan 2015 23:00:44 +0000 (23:00 +0000)]
Add isNegative helper to ConstantFPSDNode

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

9 years agoAdd isInfinity helper to ConstantFPSDNode
Matt Arsenault [Tue, 6 Jan 2015 23:00:43 +0000 (23:00 +0000)]
Add isInfinity helper to ConstantFPSDNode

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

9 years agoR600/SI: Pattern match isinf to v_cmp_class instructions
Matt Arsenault [Tue, 6 Jan 2015 23:00:41 +0000 (23:00 +0000)]
R600/SI: Pattern match isinf to v_cmp_class instructions

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

9 years agoR600/SI: Add basic DAG combines for fp_class
Matt Arsenault [Tue, 6 Jan 2015 23:00:39 +0000 (23:00 +0000)]
R600/SI: Add basic DAG combines for fp_class

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

9 years agoR600/SI: Add class intrinsic
Matt Arsenault [Tue, 6 Jan 2015 23:00:37 +0000 (23:00 +0000)]
R600/SI: Add class intrinsic

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

9 years agoFix using wrong intrinsic in test
Matt Arsenault [Tue, 6 Jan 2015 23:00:33 +0000 (23:00 +0000)]
Fix using wrong intrinsic in test

This is a leftover from renaming the intrinsic.
It's surprising the unknown llvm. intrinsic wasn't rejected.

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

9 years agoChange the .ll syntax for comdats and add a syntactic sugar.
Rafael Espindola [Tue, 6 Jan 2015 22:55:16 +0000 (22:55 +0000)]
Change the .ll syntax for comdats and add a syntactic sugar.

In order to make comdats always explicit in the IR, we decided to make
the syntax a bit more compact for the case of a GlobalObject in a
comdat with the same name.

Just dropping the $name causes problems for

@foo = globabl i32 0, comdat
$bar = comdat ...

and

declare void @foo() comdat
$bar = comdat ...

So the syntax is changed to

@g1 = globabl i32 0, comdat($c1)
@g2 = globabl i32 0, comdat

and

declare void @foo() comdat($c1)
declare void @foo() comdat

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

9 years ago[PowerPC] Reuse a load operand in int->fp conversions
Hal Finkel [Tue, 6 Jan 2015 22:31:02 +0000 (22:31 +0000)]
[PowerPC] Reuse a load operand in int->fp conversions

int->fp conversions on PPC must be done through memory loads and stores. On a
modern core, this process begins by storing the int value to memory, then
loading it using a (sometimes special) FP load instruction. Unfortunately, we
would do this even when the value to be converted was itself a load, and we can
just use that same memory location instead of copying it to another first.
There is a slight complication when handling int_to_fp(fp_to_int(x)) pairs,
because the fp_to_int operand has not been lowered when the int_to_fp is being
lowered. We handle this specially by invoking fp_to_int's lowering logic
(partially) and getting the necessary memory location (some trivial refactoring
was done to make this possible).

This is all somewhat ugly, and it would be nice if some later CodeGen stage
could just clean this stuff up, but because doing so would involve modifying
target-specific nodes (or instructions), it is not immediately clear how that
would work.

Also, remove a related entry from the README.txt for which we now generate
reasonable code.

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

9 years agoUse a Factory Method for MachineFunctionInfo Creation
Mehdi Amini [Tue, 6 Jan 2015 20:05:02 +0000 (20:05 +0000)]
Use a Factory Method for MachineFunctionInfo Creation

The goal is to allows MachineFunctionInfo to override this create
function to customize the creation.
No change intended in existing backend in this patch.

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

9 years ago[Hexagon] Adding compound jump encodings.
Colin LeMahieu [Tue, 6 Jan 2015 20:03:31 +0000 (20:03 +0000)]
[Hexagon] Adding compound jump encodings.

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

9 years agoR600/SI: Insert s_waitcnt before s_barrier instructions.
Tom Stellard [Tue, 6 Jan 2015 19:52:07 +0000 (19:52 +0000)]
R600/SI: Insert s_waitcnt before s_barrier instructions.

This ensures that all memory operations are complete when all threads
reach the barrier.

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

9 years agoR600/SI: Fix dependency calculation for DS writes instructions in SIInsertWaits
Tom Stellard [Tue, 6 Jan 2015 19:52:04 +0000 (19:52 +0000)]
R600/SI: Fix dependency calculation for DS writes instructions in SIInsertWaits

In DS write instructions, the address operand comes before the value
operand(s) which is reversed from every other instruction type.

The SIInsertWait assumed that the first use for each instruction
was the value, so for DS write it was protecting the address
operand with s_waitcnt instructions when it should have been
protecting the value operand.

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

9 years agoRevert "Reapply: Teach SROA how to update debug info for fragmented variables."
Adrian Prantl [Tue, 6 Jan 2015 19:47:27 +0000 (19:47 +0000)]
Revert "Reapply: Teach SROA how to update debug info for fragmented variables."
because of a tsan buildbot failure.
This reverts commit 225272.

Fix should be coming soon.

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

9 years ago[Hexagon] Adding encoding for misc v4 instructions: boundscheck, tlbmatch, dcfetch.
Colin LeMahieu [Tue, 6 Jan 2015 19:03:20 +0000 (19:03 +0000)]
[Hexagon] Adding encoding for misc v4 instructions: boundscheck, tlbmatch, dcfetch.

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

9 years agoThis patch teaches IndVarSimplify to add nuw and nsw to certain kinds
Sanjoy Das [Tue, 6 Jan 2015 19:02:56 +0000 (19:02 +0000)]
This patch teaches IndVarSimplify to add nuw and nsw to certain kinds
of operations that provably don't overflow. For example, we can prove
%civ.inc below does not sign-overflow. With this change,
IndVarSimplify changes %civ.inc to an add nsw.

  define i32 @foo(i32* %array, i32* %length_ptr, i32 %init) {
   entry:
    %length = load i32* %length_ptr, !range !0
    %len.sub.1 = sub i32 %length, 1
    %upper = icmp slt i32 %init, %len.sub.1
    br i1 %upper, label %loop, label %exit

   loop:
    %civ = phi i32 [ %init, %entry ], [ %civ.inc, %latch ]
    %civ.inc = add i32 %civ, 1
    %cmp = icmp slt i32 %civ.inc, %length
    br i1 %cmp, label %latch, label %break

   latch:
    store i32 0, i32* %array
    %check = icmp slt i32 %civ.inc, %len.sub.1
    br i1 %check, label %loop, label %break

   break:
    ret i32 %civ.inc

   exit:
    ret i32 42
  }

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

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

9 years ago[Hexagon] Adding encoding information for absolute address loads.
Colin LeMahieu [Tue, 6 Jan 2015 18:38:26 +0000 (18:38 +0000)]
[Hexagon] Adding encoding information for absolute address loads.

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

9 years agoSelectionDAGBuilder: move constant initialization out of loop
Mehdi Amini [Tue, 6 Jan 2015 18:20:04 +0000 (18:20 +0000)]
SelectionDAGBuilder: move constant initialization out of loop

No semantic change intended.

Reviewers: resistor

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

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

9 years agoR600/SI: Add a stub GCNTargetMachine
Tom Stellard [Tue, 6 Jan 2015 18:00:21 +0000 (18:00 +0000)]
R600/SI: Add a stub GCNTargetMachine

This is equivalent to the AMDGPUTargetMachine now, but it is the
starting point for separating R600 and GCN functionality into separate
targets.

It is recommened that users start using the gcn triple for GCN-based
GPUs, because using the r600 triple for these GPUs will be deprecated in
the future.

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

9 years agoTriple: Add amdgcn triple
Tom Stellard [Tue, 6 Jan 2015 18:00:00 +0000 (18:00 +0000)]
Triple: Add amdgcn triple

This will be used for AMD GPUs with the Graphics Core Next architecture,
which are currently using by the r600 triple.

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

9 years agoR600/SI: Remove MachineFunction dump from AsmPrinter
Tom Stellard [Tue, 6 Jan 2015 17:59:56 +0000 (17:59 +0000)]
R600/SI: Remove MachineFunction dump from AsmPrinter

The dump was dependent on a feature string, which meant that it couldn't
be disabled or enable on a per compile basis.

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

9 years ago[CodeGenPrepare] Improved logic to speculate calls to cttz/ctlz.
Andrea Di Biagio [Tue, 6 Jan 2015 17:41:18 +0000 (17:41 +0000)]
[CodeGenPrepare] Improved logic to speculate calls to cttz/ctlz.

This patch improves the logic added at revision 224899 (see review D6728) that
teaches the backend when it is profitable to speculate calls to cttz/ctlz.

The original algorithm conservatively avoided speculating more than one
instruction from a basic block in a control flow grap modelling an if-statement.
In particular, the only allowed instruction (excluding the terminator) was a
call to cttz/ctlz. However, there are cases where we could be less conservative
and still be able to speculate a call to cttz/ctlz.

With this patch, CodeGenPrepare now tries to speculate a cttz/ctlz if the
result is zero extended/truncated in the same basic block, and the zext/trunc
instruction is "free" for the target.

Added new test cases to CodeGen/X86/cttz-ctlz.ll

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

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

9 years agoReapply: Teach SROA how to update debug info for fragmented variables.
Adrian Prantl [Tue, 6 Jan 2015 17:14:10 +0000 (17:14 +0000)]
Reapply: Teach SROA how to update debug info for fragmented variables.
This also rolls in the changes discussed in http://reviews.llvm.org/D6766.
Defers migrating the debug info for new allocas until after all partitions
are created.

Thanks to Chandler for reviewing!

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

9 years agoDon't loop endlessly for MachO files with 0 ncmds
Filipe Cabecinhas [Tue, 6 Jan 2015 17:08:26 +0000 (17:08 +0000)]
Don't loop endlessly for MachO files with 0 ncmds

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

9 years ago[Hexagon] Fix 225267. GP register is not yet fully implemented. Removing Uses ...
Colin LeMahieu [Tue, 6 Jan 2015 16:52:38 +0000 (16:52 +0000)]
[Hexagon] Fix 225267.  GP register is not yet fully implemented.  Removing Uses [GP] maintains existing behavior.

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

9 years agoImplement a very basic colored syntax highlighting for llvm-dwarfdump.
Adrian Prantl [Tue, 6 Jan 2015 16:50:25 +0000 (16:50 +0000)]
Implement a very basic colored syntax highlighting for llvm-dwarfdump.
The color scheme is the same as the one used by the colorize dwarfdump
script on Darwin.
A new --color option can be used to forcibly turn color on or off.

http://reviews.llvm.org/D6852

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

9 years ago[PowerPC] Add a regression test for r225251
Hal Finkel [Tue, 6 Jan 2015 16:46:37 +0000 (16:46 +0000)]
[PowerPC] Add a regression test for r225251

In r225251, I removed an old entry from the README.txt file. While there are
several contributing factors (including pieces in Clang's ABI code), upon
further reflection, the backend part deserves a regression test.

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

9 years ago[Hexagon] Adding dealloc_return encoding and absolute address stores.
Colin LeMahieu [Tue, 6 Jan 2015 16:15:15 +0000 (16:15 +0000)]
[Hexagon] Adding dealloc_return encoding and absolute address stores.

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

9 years ago[ARM] Cleanup so_imm* tblgen defintions
Asiri Rathnayake [Tue, 6 Jan 2015 15:55:09 +0000 (15:55 +0000)]
[ARM] Cleanup so_imm* tblgen defintions

No functional changes. Support for ARM's modified immediate syntax was added
in r223113 and r223115 (review: D6408). That patch introduced the mod_imm*
tblegen definitions which renders the existing so_imm* definitions redundant.
This patch gets rid of them completely.

Reviewed as: D6722

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

9 years agoConvert fcmp with 0.0 from casted integers to icmp
Matt Arsenault [Tue, 6 Jan 2015 15:50:59 +0000 (15:50 +0000)]
Convert fcmp with 0.0 from casted integers to icmp

This is already handled in general when it is known the
conversion can't lose bits with smaller integer types
casted into wider floating point types.

This pattern happens somewhat often in GPU programs that cast
workitem intrinsics to float, which are often compared with 0.

Specifically handle the special case of compares with zero which
should also be known to not lose information. I had a more general
version of this which allows equality compares if the casted float is
exactly representable in the integer, but I'm not 100% confident that
is always correct.

Also fold cases that aren't integers to true / false.

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

9 years ago[CMake] Silence stderr on "COMMAND ${CMAKE_C_COMPILER} -Wl,--version". It was noisy...
NAKAMURA Takumi [Tue, 6 Jan 2015 09:44:44 +0000 (09:44 +0000)]
[CMake] Silence stderr on "COMMAND ${CMAKE_C_COMPILER} -Wl,--version". It was noisy during configuraion.

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

9 years agoReformat.
NAKAMURA Takumi [Tue, 6 Jan 2015 09:44:29 +0000 (09:44 +0000)]
Reformat.

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

9 years ago[PM] Hide a function we only use in an assert behind NDEBUG.
Chandler Carruth [Tue, 6 Jan 2015 09:10:47 +0000 (09:10 +0000)]
[PM] Hide a function we only use in an assert behind NDEBUG.

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

9 years ago[PM] Introduce a utility pass that preserves no analyses.
Chandler Carruth [Tue, 6 Jan 2015 09:06:35 +0000 (09:06 +0000)]
[PM] Introduce a utility pass that preserves no analyses.

Use this to test that path of invalidation. This test actually shows
redundant invalidation here that is really bad. I'm going to work on
fixing that next, but wanted to commit the test harness now that its all
working.

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

9 years ago[X86] Add OpSize32 to XBEGIN_4. Add XBEGIN_2 with OpSize16.
Craig Topper [Tue, 6 Jan 2015 08:59:30 +0000 (08:59 +0000)]
[X86] Add OpSize32 to XBEGIN_4. Add XBEGIN_2 with OpSize16.

Requires new AsmParserOperand types that detect 16-bit and 32/64-bit mode so that we choose the right instruction based on default sizing without predicates. This is necessary since predicates mess up the disassembler table building.

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

9 years agoInstCombine: Bitcast call arguments from/to pointer/integer type
David Majnemer [Tue, 6 Jan 2015 08:41:31 +0000 (08:41 +0000)]
InstCombine: Bitcast call arguments from/to pointer/integer type

Try harder to get rid of bitcast'd calls by ptrtoint/inttoptr'ing
arguments and return values when DataLayout says it is safe to do so.

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

9 years ago[PM] Simplify how we parse the outer layer of the pass pipeline text and
Chandler Carruth [Tue, 6 Jan 2015 08:37:58 +0000 (08:37 +0000)]
[PM] Simplify how we parse the outer layer of the pass pipeline text and
remove an extra, redundant pass manager wrapping every run.

I had kept seeing these when manually testing, but it was getting really
annoying and was going to cause problems with overly eager invalidation.
The root cause was an overly complex and unnecessary pile of code for
parsing the outer layer of the pass pipeline. We can instead delegate
most of this to the recursive pipeline parsing.

I've added some somewhat more basic and precise tests to catch this.

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

9 years ago[X86] Make isel select the 2-byte register form of INC/DEC even in non-64-bit mode...
Craig Topper [Tue, 6 Jan 2015 07:35:50 +0000 (07:35 +0000)]
[X86] Make isel select the 2-byte register form of INC/DEC even in non-64-bit mode. Convert to the 1-byte form in non-64-bit mode as part of MCInst lowering.

Overall this seems simpler. It reduces duplication of patterns between both modes and it simplifies the memory folding/unfolding tables as they don't need to create fake instructions just to keep track of 64-bitness.

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

9 years ago[PowerPC] Remove old README.txt entry regarding struct passing
Hal Finkel [Tue, 6 Jan 2015 07:23:13 +0000 (07:23 +0000)]
[PowerPC] Remove old README.txt entry regarding struct passing

Because of how Clang represents structs as arrays (at least on non-Darwin
platforms), and what SROA does, etc. this is no longer a problem.

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

9 years agoX86: Don't make illegal GOTTPOFF relocations
David Majnemer [Tue, 6 Jan 2015 07:12:52 +0000 (07:12 +0000)]
X86: Don't make illegal GOTTPOFF relocations

"ELF Handling for Thread-Local Storage" specifies that R_X86_64_GOTTPOFF
relocation target a movq or addq instruction.

Prohibit the truncation of such loads to movl or addl.

This fixes PR22083.

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

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

9 years ago[PowerPC] Add some missing names in getTargetNodeName
Hal Finkel [Tue, 6 Jan 2015 07:02:15 +0000 (07:02 +0000)]
[PowerPC] Add some missing names in getTargetNodeName

These are used for debugging output; NFC.

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

9 years ago[PowerPC] Improve int_to_fp(fp_to_int(x)) combining
Hal Finkel [Tue, 6 Jan 2015 06:01:57 +0000 (06:01 +0000)]
[PowerPC] Improve int_to_fp(fp_to_int(x)) combining

The old target DAG combine that allowed for performing int_to_fp(fp_to_int(x))
without a load/store pair is updated here with support for unsigned integers,
and to support single-precision values without a third rounding step, on newer
cores with the appropriate instructions.

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

9 years ago[PM] Add a utility pass template that synthesizes the invalidation of
Chandler Carruth [Tue, 6 Jan 2015 04:49:44 +0000 (04:49 +0000)]
[PM] Add a utility pass template that synthesizes the invalidation of
a specific analysis result.

This is quite handy to test things, and will also likely be very useful
for debugging issues. You could narrow down pass validation failures by
walking these invalidate pass runs up and down the pass pipeline, etc.
I've added support to the pass pipeline parsing to be able to create one
of these for any analysis pass desired.

Just adding this class uncovered one latent bug where the
AnalysisManager CRTP base class had a hard-coded Module type rather than
using IRUnitT.

I've also added tests for invalidation and caching of analyses in
a basic way across all the pass managers. These in turn uncovered two
more bugs where we failed to correctly invalidate an analysis -- its
results were invalidated but the key for re-running the pass was never
cleared and so it was never re-run. Quite nasty. I'm very glad to debug
this here rather than with a full system.

Also, yes, the naming here is horrid. I'm going to update some of the
names to be slightly less awful shortly. But really, I've no "good"
ideas for naming. I'll be satisfied if I can get it to "not bad".

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

9 years ago[PM] Simplify how we use the registry by including it only once. Still
Chandler Carruth [Tue, 6 Jan 2015 04:49:38 +0000 (04:49 +0000)]
[PM] Simplify how we use the registry by including it only once. Still
more verbose than I'd like, but the code really isn't that interesting,
and this still seems vastly simpler than any other solutions I've come
up with. =] Maybe if we get to the 10th IR unit, this will be a problem
in practice.

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

9 years ago[X86] Remove 16-bit and 32-bit offset jump instructions from the AsmParser. We always...
Craig Topper [Tue, 6 Jan 2015 04:23:57 +0000 (04:23 +0000)]
[X86] Remove 16-bit and 32-bit offset jump instructions from the AsmParser. We always select the 8-bit size and let the assembler backend relax to the larger size.

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

9 years ago[X86] Make isel select the shorter form of jump instructions instead of the long...
Craig Topper [Tue, 6 Jan 2015 04:23:53 +0000 (04:23 +0000)]
[X86] Make isel select the shorter form of jump instructions instead of the long form.

The assembler backend will relax to the long form if necessary. This removes a swap from long form to short form in the MCInstLowering code. Selecting the long form used to be required by the old JIT.

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

9 years ago[PM] Add a collection of no-op analysis passes and switch the new pass
Chandler Carruth [Tue, 6 Jan 2015 02:50:06 +0000 (02:50 +0000)]
[PM] Add a collection of no-op analysis passes and switch the new pass
manager tests to use them and be significantly more comprehensive.

This, naturally, uncovered a bug where the CGSCC pass manager wasn't
printing analyses when they were run.

The only remaining core manipulator is I think an invalidate pass
similar to the require pass. That'll be next. =]

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

9 years ago[PM] Sink the no-op pass parsing logic into the .def-based registry to
Chandler Carruth [Tue, 6 Jan 2015 02:37:55 +0000 (02:37 +0000)]
[PM] Sink the no-op pass parsing logic into the .def-based registry to
simplify things. This will become more important as I add no-op analyses
that want to re-use the logic we already have for analyses in the
registry. For now, no functionality changed.

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

9 years ago[PM] Move the analysis registry into the Passes.cpp file and provide
Chandler Carruth [Tue, 6 Jan 2015 02:21:37 +0000 (02:21 +0000)]
[PM] Move the analysis registry into the Passes.cpp file and provide
a normal interface for it in Passes.h.

This gives us essentially a single interface for running pass managers
which are provided from the bottom of the LLVM stack through interfaces
at the top of the LLVM stack that populate them with all of the
different analyses available throughout. It also means there is a single
blob of code that needs to include all of the pass headers and needs to
deal with the registry of passes and parsing names.

No functionality changed intended, should just be cleanup.

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

9 years ago[PM] Add a utility to the new pass manager for generating a pass which
Chandler Carruth [Tue, 6 Jan 2015 02:10:51 +0000 (02:10 +0000)]
[PM] Add a utility to the new pass manager for generating a pass which
is a no-op other than requiring some analysis results be available.

This can be used in real pass pipelines to force the usually lazy
analysis running to eagerly compute something at a specific point, and
it can be used to test the pass manager infrastructure (my primary use
at the moment).

I've also added bit of pipeline parsing magic to support generating
these directly from the opt command so that you can directly use these
when debugging your analysis. The syntax is:

  require<analysis-name>

This can be used at any level of the pass manager. For example:

  cgscc(function(require<my-analysis>,no-op-function))

This would produce a no-op function pass requiring my-analysis, followed
by a fully no-op function pass, both of these in a function pass manager
which is nested inside of a bottom-up CGSCC pass manager which is in the
top-level (implicit) module pass manager.

I have zero attachment to the particular syntax I'm using here. Consider
it a straw man for use while I'm testing and fleshing things out.
Suggestions for better syntax welcome, and I'll update everything based
on any consensus that develops.

I've used this new functionality to more directly test the analysis
printing rather than relying on the cgscc pass manager running an
analysis for me. This is still minimally tested because I need to have
analyses to run first! ;] That patch is next, but wanted to keep this
one separate for easier review and discussion.

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

9 years agoAdd a testcase that would have found the problem in r225048.
Rafael Espindola [Tue, 6 Jan 2015 01:41:24 +0000 (01:41 +0000)]
Add a testcase that would have found the problem in r225048.

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

9 years agoRemove dead variable.
Eric Christopher [Tue, 6 Jan 2015 01:12:42 +0000 (01:12 +0000)]
Remove dead variable.

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

9 years agoUse the same call off of the TargetMachine rather than the subtarget.
Eric Christopher [Tue, 6 Jan 2015 01:12:40 +0000 (01:12 +0000)]
Use the same call off of the TargetMachine rather than the subtarget.

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

9 years agoRewrite the Mips16HardFloat pass to avoid using the Subtarget.
Eric Christopher [Tue, 6 Jan 2015 01:12:30 +0000 (01:12 +0000)]
Rewrite the Mips16HardFloat pass to avoid using the Subtarget.

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

9 years agoRevert r225048: It broke ObjC on AArch64.
Lang Hames [Tue, 6 Jan 2015 00:54:32 +0000 (00:54 +0000)]
Revert r225048: It broke ObjC on AArch64.

I've filed http://llvm.org/PR22100 to track this issue.

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

9 years agoRemove X86 .quad workaround for buggy GNU assembler on OpenBSD / Bitrig.
Brad Smith [Tue, 6 Jan 2015 00:53:52 +0000 (00:53 +0000)]
Remove X86 .quad workaround for buggy GNU assembler on OpenBSD / Bitrig.

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

9 years agoIR: Don't drop MDNode uniquing on null operands
Duncan P. N. Exon Smith [Mon, 5 Jan 2015 23:31:54 +0000 (23:31 +0000)]
IR: Don't drop MDNode uniquing on null operands

Now that `LLVMContextImpl` can call `MDNode::dropAllReferences()` to
prevent teardown madness, stop dropping uniquing just because an operand
drops to null.

Part of PR21532.

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

9 years agoRevert "Use the integrated assembler by default on 32-bit PowerPC and SPARC"
Duncan P. N. Exon Smith [Mon, 5 Jan 2015 23:31:51 +0000 (23:31 +0000)]
Revert "Use the integrated assembler by default on 32-bit PowerPC and SPARC"

This reverts commit r225213.  It's failing on multiple buildbots [1][2].

[1]: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/22032
[2]: http://lab.llvm.org:8080/green/view/Clang/job/clang-stage1-cmake-RA-incremental_check/2357/

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

9 years ago[PowerPC] Fix test to pass on Darwin hosts
Hal Finkel [Mon, 5 Jan 2015 23:17:43 +0000 (23:17 +0000)]
[PowerPC] Fix test to pass on Darwin hosts

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

9 years ago[PowerPC] Remove old README.txt entry
Hal Finkel [Mon, 5 Jan 2015 22:20:22 +0000 (22:20 +0000)]
[PowerPC] Remove old README.txt entry

We no longer generate horrible code for the stated function:

void f(signed char *a, _Bool b, _Bool c) {
  signed char t = 0;
  if (b)  t = *a;
  if (c)  *a = t;
}

for which we now generate:

.L.f:
        andi. 5, 5, 1
        cmpldi 1, 4, 0
        li 5, 0
        beq 1, .LBB0_2
        lbz 5, 0(3)
.LBB0_2:                                # %if.end
        bclr 4, 1, 0
        stb 5, 0(3)
        blr

so we don't need the README.txt entry.

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

9 years ago[X86][SSE] lowerVectorShuffleAsByteShift tidyup
Simon Pilgrim [Mon, 5 Jan 2015 22:08:48 +0000 (22:08 +0000)]
[X86][SSE] lowerVectorShuffleAsByteShift tidyup

Removed local isSequential predicate and use standard helper isSequentialOrUndefInRange instead.

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

9 years ago[PowerPC] Convert a README.txt entry into a better test
Hal Finkel [Mon, 5 Jan 2015 21:53:52 +0000 (21:53 +0000)]
[PowerPC] Convert a README.txt entry into a better test

We now produce the desired code as noted in the README.txt file (no spurious
or). Remove the README entry and improve the regression test.

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

9 years agoUse the integrated assembler by default on 32-bit PowerPC and SPARC
Brad Smith [Mon, 5 Jan 2015 21:48:16 +0000 (21:48 +0000)]
Use the integrated assembler by default on 32-bit PowerPC and SPARC

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

9 years ago[PowerPC] Remove README.txt entry
Hal Finkel [Mon, 5 Jan 2015 21:41:26 +0000 (21:41 +0000)]
[PowerPC] Remove README.txt entry

This entry has been rendered irrelevant now that we have proper CR bit
tracking.

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

9 years ago[Hexagon] Adding add/sub with carry, logical shift left by immediate and memop instru...
Colin LeMahieu [Mon, 5 Jan 2015 21:36:38 +0000 (21:36 +0000)]
[Hexagon] Adding add/sub with carry, logical shift left by immediate and memop instructions.  Removing old defs without bits and updating references.

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

9 years ago[PowerPC] Add a test for truncating a shifted load
Hal Finkel [Mon, 5 Jan 2015 21:33:14 +0000 (21:33 +0000)]
[PowerPC] Add a test for truncating a shifted load

We now produce the desired code as noted in the README.txt file. Remove the
README entry and add a regression test.

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

9 years agoMake DIE.h a public CodeGen header.
Frederic Riss [Mon, 5 Jan 2015 21:29:41 +0000 (21:29 +0000)]
Make DIE.h a public CodeGen header.

dsymutil would like to use all the AsmPrinter/MCStreamer infrastructure
to stream out the DWARF. In order to do so, it will reuse the DIE object
and so this header needs to be public.

The interface exposed here has some corners that cannot be used without a
DwarfDebug object, but clients that want to stream Dwarf can just avoid
these.

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

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

9 years ago[dsymutil] Implement the BinaryHolder object and gain archive support.
Frederic Riss [Mon, 5 Jan 2015 21:29:28 +0000 (21:29 +0000)]
[dsymutil] Implement the BinaryHolder object and gain archive support.

This object is meant to own the ObjectFiles and their underlying
MemoryBuffer. It is basically the equivalent of an OwningBinary
except that it efficiently handles Archives. It is optimized for
efficiently providing mappings of members of the same archive when
they are opened successively (which is standard in Darwin debug
maps, objects from the same archive will be contiguous).

Of course, the BinaryHolder will also be used by the DWARF linker
once it is commited, but for now only the debug map parser uses it.

With this change, you can run llvm-dsymutil on your Darwin debug build
of clang and get a complete debug map for it.

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

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

9 years ago[autoconf] llvm/cmake/modules/Makefile: Make sure to regenerate LLVMConfig.cmake...
NAKAMURA Takumi [Mon, 5 Jan 2015 21:24:36 +0000 (21:24 +0000)]
[autoconf] llvm/cmake/modules/Makefile: Make sure to regenerate LLVMConfig.cmake whenever Makefile is updated.

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

9 years ago[PowerPC] Add another test for load/store with update
Hal Finkel [Mon, 5 Jan 2015 21:22:42 +0000 (21:22 +0000)]
[PowerPC] Add another test for load/store with update

We now produce the desired code as noted in the README.txt file. Remove the
README entry and add a regression test.

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

9 years ago[autoconf] Export LLVM_LIBDIR_SUFFIX with empty string in LLVMConfig.cmake. tools...
NAKAMURA Takumi [Mon, 5 Jan 2015 21:14:14 +0000 (21:14 +0000)]
[autoconf] Export LLVM_LIBDIR_SUFFIX with empty string in LLVMConfig.cmake. tools/llvm-config is also doing so.

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

9 years ago[PowerPC] Fold i1 extensions with other ops
Hal Finkel [Mon, 5 Jan 2015 21:10:24 +0000 (21:10 +0000)]
[PowerPC] Fold i1 extensions with other ops

Consider this function from our README.txt file:

  int foo(int a, int b) { return (a < b) << 4; }

We now explicitly track CR bits by default, so the comment in the README.txt
about not really having a SETCC is no longer accurate, but we did generate this
somewhat silly code:

        cmpw 0, 3, 4
        li 3, 0
        li 12, 1
        isel 3, 12, 3, 0
        sldi 3, 3, 4
        blr

which generates the zext as a select between 0 and 1, and then shifts the
result by a constant amount. Here we preprocess the DAG in order to fold the
results of operations on an extension of an i1 value into the SELECT_I[48]
pseudo instruction when the resulting constant can be materialized using one
instruction (just like the 0 and 1). This was not implemented as a DAGCombine
because the resulting code would have been anti-canonical and depends on
replacing chained user nodes, which does not fit well into the lowering
paradigm. Now we generate:

        cmpw 0, 3, 4
        li 3, 0
        li 12, 16
        isel 3, 12, 3, 0
        blr

which is less silly.

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

9 years ago[X86][SSE] Fixed description for isSequentialOrUndefInRange. NFC.
Simon Pilgrim [Mon, 5 Jan 2015 21:09:48 +0000 (21:09 +0000)]
[X86][SSE] Fixed description for isSequentialOrUndefInRange. NFC.

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

9 years ago[Hexagon] Adding rounding reg/reg variants, accumulating multiplies, and accumulating...
Colin LeMahieu [Mon, 5 Jan 2015 20:56:41 +0000 (20:56 +0000)]
[Hexagon] Adding rounding reg/reg variants, accumulating multiplies, and accumulating shifts.

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

9 years agoIR: Prune arguments to ValueAsMetadata::ValueAsMetadata()
Duncan P. N. Exon Smith [Mon, 5 Jan 2015 20:41:25 +0000 (20:41 +0000)]
IR: Prune arguments to ValueAsMetadata::ValueAsMetadata()

`LLVMContext` isn't actually used.

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

9 years ago[Hexagon] Adding V4 bit manipulating instructions, removing ALU defs without encoding...
Colin LeMahieu [Mon, 5 Jan 2015 20:35:54 +0000 (20:35 +0000)]
[Hexagon] Adding V4 bit manipulating instructions, removing ALU defs without encoding bits.

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

9 years ago[Hexagon] Adding V4 logic-logic instructions and tests.
Colin LeMahieu [Mon, 5 Jan 2015 20:14:58 +0000 (20:14 +0000)]
[Hexagon] Adding V4 logic-logic instructions and tests.

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