oota-llvm.git
12 years agoChange where we enable the heuristic that delays inlining into functions
Chandler Carruth [Wed, 14 Mar 2012 20:16:41 +0000 (20:16 +0000)]
Change where we enable the heuristic that delays inlining into functions
which are small enough to themselves be inlined. Delaying in this manner
can be harmful if the function is inelligible for inlining in some (or
many) contexts as it pessimizes the code of the function itself in the
event that inlining does not eventually happen.

Previously the check was written to only do this delaying of inlining
for static functions in the hope that they could be entirely deleted and
in the knowledge that all callers of static functions will have the
opportunity to inline if it is in fact profitable. However, with C++ we
get two other important sources of functions where the definition is
always available for inlining: inline functions and templated functions.
This patch generalizes the inliner to allow linkonce-ODR (the linkage
such C++ routines receive) to also qualify for this delay-based
inlining.

Benchmarking across a range of large real-world applications shows
roughly 2% size increase across the board, but an average speedup of
about 0.5%. Some benhcmarks improved over 2%, and the 'clang' binary
itself (when bootstrapped with this feature) shows a 1% -O0 performance
improvement when run over all Sema, Lex, and Parse source code smashed
into a single file. A clean re-build of Clang+LLVM with a bootstrapped
Clang shows approximately 2% improvement, but that measurement is often
noisy.

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

12 years agoSome typos in lit command guide
Eli Bendersky [Wed, 14 Mar 2012 11:34:19 +0000 (11:34 +0000)]
Some typos in lit command guide

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

12 years agoSilence operator precedence warnings.
Benjamin Kramer [Wed, 14 Mar 2012 11:26:37 +0000 (11:26 +0000)]
Silence operator precedence warnings.

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

12 years agoUpdate the "hello world" example to resemble what we currently output.
Bill Wendling [Wed, 14 Mar 2012 08:07:43 +0000 (08:07 +0000)]
Update the "hello world" example to resemble what we currently output.
Also do some minor reformatting.

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

12 years agoRefactor the inline cost bonus calculation for constants to use
Chandler Carruth [Wed, 14 Mar 2012 07:32:53 +0000 (07:32 +0000)]
Refactor the inline cost bonus calculation for constants to use
a worklist rather than a recursive call.

No functionality changed.

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

12 years agoReapply r152486 with a fix for the nightly testers.
Bill Wendling [Wed, 14 Mar 2012 07:28:01 +0000 (07:28 +0000)]
Reapply r152486 with a fix for the nightly testers.

There were cases where a value could be used and it's both crossing an invoke
and NOT crossing an invoke. This could happen in the landing pads. In that case,
we will demote the value to the stack like we did before.
<rdar://problem/10609139>

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

12 years agoInsert the debugging instructions in one fell-swoop so that it doesn't call the
Bill Wendling [Wed, 14 Mar 2012 07:14:25 +0000 (07:14 +0000)]
Insert the debugging instructions in one fell-swoop so that it doesn't call the
expensive "getFirstTerminator" call. This reduces the time of compilation in
PR12258 from >10 minutes to < 10 seconds.

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

12 years agoClean up removed file after r152620
Eli Bendersky [Wed, 14 Mar 2012 06:16:57 +0000 (06:16 +0000)]
Clean up removed file after r152620

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

12 years agoTypo in lit command guide
Eli Bendersky [Wed, 14 Mar 2012 06:09:20 +0000 (06:09 +0000)]
Typo in lit command guide

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

12 years agomisched: implemented a framework for top-down or bottom-up scheduling.
Andrew Trick [Wed, 14 Mar 2012 04:00:41 +0000 (04:00 +0000)]
misched: implemented a framework for top-down or bottom-up scheduling.

New flags: -misched-topdown, -misched-bottomup. They can be used with
the default scheduler or with -misched=shuffle. Without either
topdown/bottomup flag -misched=shuffle now alternates scheduling
direction.

LiveIntervals update is unimplemented with bottom-up scheduling, so
only -misched-topdown currently works.

Capped the ScheduleDAG hierarchy with a concrete ScheduleDAGMI class.
ScheduleDAGMI is aware of the top and bottom of the unscheduled zone
within the current region. Scheduling policy can be plugged into
the ScheduleDAGMI driver by implementing MachineSchedStrategy.
ConvergingScheduler is now the default scheduling algorithm.
It exercises the new driver but still does no reordering.

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

12 years agomisched comments
Andrew Trick [Wed, 14 Mar 2012 04:00:38 +0000 (04:00 +0000)]
misched comments

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

12 years agoRemove the DW_AT_MIPS_linkage name attribute when we don't need it
Eric Christopher [Wed, 14 Mar 2012 02:59:17 +0000 (02:59 +0000)]
Remove the DW_AT_MIPS_linkage name attribute when we don't need it
output (we're emitting a specification already and the information
isn't changing).

Saves 1% on the debug information for a build of llvm.

Fixes rdar://11043421

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

12 years agoMove APInt::operator[] inline.
Benjamin Kramer [Wed, 14 Mar 2012 00:38:15 +0000 (00:38 +0000)]
Move APInt::operator[] inline.

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

12 years agoMove APInt::operator! inline, it's small and fuses well with surrounding code when...
Benjamin Kramer [Wed, 14 Mar 2012 00:01:35 +0000 (00:01 +0000)]
Move APInt::operator! inline, it's small and fuses well with surrounding code when inlined.

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

12 years agoFortify r152675 a bit. Although I'm not able to come up with a test case that would...
Evan Cheng [Tue, 13 Mar 2012 22:16:11 +0000 (22:16 +0000)]
Fortify r152675 a bit. Although I'm not able to come up with a test case that would trigger the truncation case.

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

12 years agoDAG combine incorrectly optimize (i32 vextract (v4i16 load $addr), c) to
Evan Cheng [Tue, 13 Mar 2012 22:00:52 +0000 (22:00 +0000)]
DAG combine incorrectly optimize (i32 vextract (v4i16 load $addr), c) to
(i16 load $addr+c*sizeof(i16)) and replace uses of (i32 vextract) with the
i16 load. It should issue an extload instead: (i32 extload $addr+c*sizeof(i16)).

rdar://11035895

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

12 years agoTarget override to allow CodeGenPrepare to sink address operands to intrinsics in...
Pete Cooper [Tue, 13 Mar 2012 20:59:56 +0000 (20:59 +0000)]
Target override to allow CodeGenPrepare to sink address operands to intrinsics in the same way it current does for loads and stores

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

12 years agoAdd a sanity check in MemoryBuffer::getOpenFile() to make sure we don't hang
Argyrios Kyrtzidis [Tue, 13 Mar 2012 20:18:42 +0000 (20:18 +0000)]
Add a sanity check in MemoryBuffer::getOpenFile() to make sure we don't hang
if the passed in FileSize is inaccurate.

rdar://11034179

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

12 years agoRemove an old hack for pre-2005 MSVC. We don't support ancient microsoft compilers...
Benjamin Kramer [Tue, 13 Mar 2012 20:07:36 +0000 (20:07 +0000)]
Remove an old hack for pre-2005 MSVC. We don't support ancient microsoft compilers anymore.

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

12 years agos/SjLjEHPass/SjLjEHPrepare/
Bill Wendling [Tue, 13 Mar 2012 20:04:21 +0000 (20:04 +0000)]
s/SjLjEHPass/SjLjEHPrepare/
No functionality change.

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

12 years agoChange the X86 assembler to not require a segment register on string
Kevin Enderby [Tue, 13 Mar 2012 19:47:55 +0000 (19:47 +0000)]
Change the X86 assembler to not require a segment register on string
instruction's destination operand like it does for the source operand.
Also fix a typo in the comment for X86AsmParser::isSrcOp().

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

12 years agoenhance jump threading to preserve TBAA information when PRE'ing loads,
Chris Lattner [Tue, 13 Mar 2012 18:07:41 +0000 (18:07 +0000)]
enhance jump threading to preserve TBAA information when PRE'ing loads,
fixing rdar://11039258, an issue that came up when inspecting clang's
bootstrapped codegen.

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

12 years agoTeach globalopt how to evaluate an invoke with a non-void return type.
Dan Gohman [Tue, 13 Mar 2012 18:01:37 +0000 (18:01 +0000)]
Teach globalopt how to evaluate an invoke with a non-void return type.

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

12 years agoGeneralize the "trunc(ptrtoint(x)) - trunc(ptrtoint(y)) ->
Duncan Sands [Tue, 13 Mar 2012 14:07:05 +0000 (14:07 +0000)]
Generalize the "trunc(ptrtoint(x)) - trunc(ptrtoint(y)) ->
trunc(ptrtoint(x-y))" optimization introduced by Chandler.

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

12 years agoFixed comments for SwitchInst::addCase and for SwitchInst::removeCase.
Stepan Dyatkovskiy [Tue, 13 Mar 2012 12:37:10 +0000 (12:37 +0000)]
Fixed comments for SwitchInst::addCase and for SwitchInst::removeCase.

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

12 years agoUniformize the InstructionSimplify interface by ensuring that all routines
Duncan Sands [Tue, 13 Mar 2012 11:42:19 +0000 (11:42 +0000)]
Uniformize the InstructionSimplify interface by ensuring that all routines
take a TargetLibraryInfo parameter.  Internally, rather than passing TD, TLI
and DT parameters around all over the place, introduce a struct for holding
them.

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

12 years agoAdd profiling support for Intel Parallel Amplifier XE (VTune) for JITted code in...
Eli Bendersky [Tue, 13 Mar 2012 08:33:15 +0000 (08:33 +0000)]
Add profiling support for Intel Parallel Amplifier XE (VTune) for JITted code in LLVM.

Also refactor the existing OProfile profiling code to reuse the same interfaces with the VTune profiling code.
In addition, unit tests for the profiling interfaces were added.

This patch was prepared by Andrew Kaylor and Daniel Malea, and reviewed in the llvm-commits list by Jim Grosbach

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

12 years agoRemove unused field from FixedLenDecoderEmitter. Move NumberedInstructions declaratio...
Craig Topper [Tue, 13 Mar 2012 06:39:00 +0000 (06:39 +0000)]
Remove unused field from FixedLenDecoderEmitter. Move NumberedInstructions declaration from class to run method since its only used there and was being reinitialized anyway.

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

12 years agoAdd a return type.
Bill Wendling [Tue, 13 Mar 2012 05:52:28 +0000 (05:52 +0000)]
Add a return type.

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

12 years agoInline the d'tor and add an anchor instead.
Bill Wendling [Tue, 13 Mar 2012 05:51:56 +0000 (05:51 +0000)]
Inline the d'tor and add an anchor instead.

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

12 years agoRefactor the SelectionDAG's 'dump' methods into their own .cpp file.
Bill Wendling [Tue, 13 Mar 2012 05:47:27 +0000 (05:47 +0000)]
Refactor the SelectionDAG's 'dump' methods into their own .cpp file.
No functionality change.

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

12 years agoFixed typo in comment.
Lang Hames [Tue, 13 Mar 2012 05:43:30 +0000 (05:43 +0000)]
Fixed typo in comment.

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

12 years agoFix regression from r151466: an we can't replace uses of an instruction reachable...
Eli Friedman [Tue, 13 Mar 2012 01:06:07 +0000 (01:06 +0000)]
Fix regression from r151466: an we can't replace uses of an instruction reachable from the entry block with uses of an instruction not reachable from the entry block.  PR12231.

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

12 years agoAddress some review comments from Duncan. This moves the iterative
Chandler Carruth [Tue, 13 Mar 2012 00:06:15 +0000 (00:06 +0000)]
Address some review comments from Duncan. This moves the iterative
offset accumulation to use a boring APInt instead of ConstantExprs.
I didn't go all the way to an 'int64_t' because I wanted APInt to handle
any magic required to properly wrap the arithmetic when the pointer
width is <64 bits. If there is a significant penalty from using APInt
here, first off WTF, and secondly let me know and I'll do the math by
hand.

I've left one layer still operating w/ ConstantExpr because it makes the
interface quite a bit simpler, and that one isn't iterative so has much
lower cost.

I suppose this may potentially speed up some strang compilation
situations, but I don't really expect much. It should have no functional
impact either way.

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

12 years agolit: Pass %INCLUDE% to tests on Win32. clang may expect existence of %INCLUDE% in...
NAKAMURA Takumi [Tue, 13 Mar 2012 00:02:06 +0000 (00:02 +0000)]
lit: Pass %INCLUDE% to tests on Win32. clang may expect existence of %INCLUDE% in vcvarsall.bat.

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

12 years agoChange the second line of the test added for r152414 to use CHECK-NEXT.
Kevin Enderby [Mon, 12 Mar 2012 21:38:09 +0000 (21:38 +0000)]
Change the second line of the test added for r152414 to use CHECK-NEXT.
Suggestion by Bill Wendling!

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

12 years agoDFAPacketizerEmitter: Prune includes.
Benjamin Kramer [Mon, 12 Mar 2012 21:32:58 +0000 (21:32 +0000)]
DFAPacketizerEmitter: Prune includes.

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

12 years agoAdded a missing error check for X86 assembly with mismatched base and index
Kevin Enderby [Mon, 12 Mar 2012 21:32:09 +0000 (21:32 +0000)]
Added a missing error check for X86 assembly with mismatched base and index
registers not both being 64-bit or both being 32-bit registers.

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

12 years agoInline a trivial helper function.
Benjamin Kramer [Mon, 12 Mar 2012 21:18:53 +0000 (21:18 +0000)]
Inline a trivial helper function.

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

12 years agosort by alpha.
Bill Wendling [Mon, 12 Mar 2012 21:12:59 +0000 (21:12 +0000)]
sort by alpha.

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

12 years agoUse a posix compliant regexp in export file construction.
Eric Christopher [Mon, 12 Mar 2012 20:58:14 +0000 (20:58 +0000)]
Use a posix compliant regexp in export file construction.

Patch by John Spencer

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

12 years agoRevert due to nightly test failures.
Bill Wendling [Mon, 12 Mar 2012 20:19:41 +0000 (20:19 +0000)]
Revert due to nightly test failures.

--- Reverse-merging r152486 into '.':
U    lib/CodeGen/SjLjEHPrepare.cpp

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

12 years ago[asan] move x86-specific test to a separate X86 directory with a custom lit.local...
Kostya Serebryany [Mon, 12 Mar 2012 18:49:11 +0000 (18:49 +0000)]
[asan] move x86-specific test to a separate X86 directory with a custom lit.local.cfg file

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

12 years agoWhen inlining a function and adding its inner call sites to the
Chandler Carruth [Mon, 12 Mar 2012 11:19:33 +0000 (11:19 +0000)]
When inlining a function and adding its inner call sites to the
candidate set for subsequent inlining, try to simplify the arguments to
the inner call site now that inlining has been performed.

The goal here is to propagate and fold constants through deeply nested
call chains. Without doing this, we loose the inliner bonus that should
be applied because the arguments don't match the exact pattern the cost
estimator uses.

Reviewed on IRC by Benjamin Kramer.

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

12 years agoTeach instsimplify how to constant fold pointer differences.
Chandler Carruth [Mon, 12 Mar 2012 11:19:31 +0000 (11:19 +0000)]
Teach instsimplify how to constant fold pointer differences.

Typically instcombine has handled this, but pointer differences show up
in several contexts where we would like to get constant folding, and
cannot afford to run instcombine. Specifically, I'm working on improving
the constant folding of arguments used in inline cost analysis with
instsimplify.

Doing this in instsimplify implies some algorithm changes. We have to
handle multiple layers of all-constant GEPs because instsimplify cannot
fold them into a single GEP the way instcombine can. Also, we're only
interested in all-constant GEPs. The result is that this doesn't really
replace the instcombine logic, it's just complimentary and focused on
constant folding.

Reviewed on IRC by Benjamin Kramer.

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

12 years agoFileCheck-ize this test.
Chandler Carruth [Mon, 12 Mar 2012 11:19:28 +0000 (11:19 +0000)]
FileCheck-ize this test.

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

12 years agoDon't cast away constant qualifier.
Duncan Sands [Mon, 12 Mar 2012 10:51:06 +0000 (10:51 +0000)]
Don't cast away constant qualifier.

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

12 years agoSwitch to unified syntax for VFP instructions in inline assembly.
Bob Wilson [Mon, 12 Mar 2012 06:15:36 +0000 (06:15 +0000)]
Switch to unified syntax for VFP instructions in inline assembly.
<rdar://problem/11024696>

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

12 years agoReplace a hand-coded leading one counting loop with the magic from MathExtras.h.
Benjamin Kramer [Sun, 11 Mar 2012 19:32:35 +0000 (19:32 +0000)]
Replace a hand-coded leading one counting loop with the magic from MathExtras.h.

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

12 years agoRemove global map. This code isn't even hot.
Benjamin Kramer [Sun, 11 Mar 2012 18:12:04 +0000 (18:12 +0000)]
Remove global map. This code isn't even hot.

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

12 years agoDwarfDebug: Store the filename/dirname pair as a zero-separated string in a stringmap...
Benjamin Kramer [Sun, 11 Mar 2012 14:56:26 +0000 (14:56 +0000)]
DwarfDebug: Store the filename/dirname pair as a zero-separated string in a stringmap, instead of using a highly inefficient std::map of a pair of std::strings.

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

12 years agoConvert more static tables of registers used by calling convention to uint16_t to...
Craig Topper [Sun, 11 Mar 2012 07:57:25 +0000 (07:57 +0000)]
Convert more static tables of registers used by calling convention to uint16_t to reduce space.

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

12 years agoUse uint16_t to store registers and opcode in static tables in the target specific...
Craig Topper [Sun, 11 Mar 2012 07:16:55 +0000 (07:16 +0000)]
Use uint16_t to store registers and opcode in static tables in the target specific backends.

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

12 years agoRemove unused functions getArgRegs and getNumArgRegs.
Craig Topper [Sun, 11 Mar 2012 06:46:40 +0000 (06:46 +0000)]
Remove unused functions getArgRegs and getNumArgRegs.

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

12 years agollvm::SwitchInst
Stepan Dyatkovskiy [Sun, 11 Mar 2012 06:09:17 +0000 (06:09 +0000)]
llvm::SwitchInst
Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default.
Added some notes relative to case iterators.

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

12 years ago[llvm.py] Implement disassembler interface
Gregory Szorc [Sun, 11 Mar 2012 02:32:56 +0000 (02:32 +0000)]
[llvm.py] Implement disassembler interface

It doesn't currently support the op info and symbol lookup callbacks,
but it is better than nothing.

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

12 years agoAdd a few missing 'template' keywords
Douglas Gregor [Sun, 11 Mar 2012 02:22:41 +0000 (02:22 +0000)]
Add a few missing 'template' keywords

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

12 years agoShrink and reorder some fields in MCOperandInfo to fit it in 8 bytes to reduce size...
Craig Topper [Sun, 11 Mar 2012 01:57:56 +0000 (01:57 +0000)]
Shrink and reorder some fields in MCOperandInfo to fit it in 8 bytes to reduce size of static tables.

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

12 years agoFix warnings when building with VS11.
Michael J. Spencer [Sun, 11 Mar 2012 01:20:23 +0000 (01:20 +0000)]
Fix warnings when building with VS11.

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

12 years agoFix warnings.
Michael J. Spencer [Sun, 11 Mar 2012 00:51:01 +0000 (00:51 +0000)]
Fix warnings.

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

12 years agoFixing a compile warning triggered in MSVC about constant truncation.
Aaron Ballman [Sat, 10 Mar 2012 23:03:01 +0000 (23:03 +0000)]
Fixing a compile warning triggered in MSVC about constant truncation.

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

12 years agoMake StringRef::getAsInteger work with all integer types. Before this change
Michael J. Spencer [Sat, 10 Mar 2012 23:02:54 +0000 (23:02 +0000)]
Make StringRef::getAsInteger work with all integer types. Before this change
it would fail with {,u}int64_t on x86-64 Linux.

This also removes code duplication.

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

12 years agoMake helper static, so it can be inlined into its sole caller.
Benjamin Kramer [Sat, 10 Mar 2012 22:41:06 +0000 (22:41 +0000)]
Make helper static, so it can be inlined into its sole caller.

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

12 years agoRevert "[llvm.py] Implement interface to enhanced disassembler"
Gregory Szorc [Sat, 10 Mar 2012 21:44:03 +0000 (21:44 +0000)]
Revert "[llvm.py] Implement interface to enhanced disassembler"

Chris Lattner says the edis interface is going away. It doesn't make
sense to land something that will go away in the near future.

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

12 years ago*fix typo in comment; test of commit access
Kay Tiong Khoo [Sat, 10 Mar 2012 21:29:49 +0000 (21:29 +0000)]
*fix typo in comment; test of commit access

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

12 years ago[llvm.py] Implement interface to enhanced disassembler
Gregory Szorc [Sat, 10 Mar 2012 21:05:05 +0000 (21:05 +0000)]
[llvm.py] Implement interface to enhanced disassembler

This requires a C++ change to EDDisassembler's ctor to function properly
(the llvm::InitializeAll* functions aren't being called currently and
there is no way to call them from Python).

Code is partially tested and works well enough for initial commit. There
are probably many small bugs.

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

12 years ago[llvm.py] Make LLVMObject.__del__ work if called during __init__
Gregory Szorc [Sat, 10 Mar 2012 21:01:14 +0000 (21:01 +0000)]
[llvm.py] Make LLVMObject.__del__ work if called during __init__

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

12 years agoMove llc + target triple tests into X86
Andrew Trick [Sat, 10 Mar 2012 19:03:51 +0000 (19:03 +0000)]
Move llc + target triple tests into X86

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

12 years agoAs Duncan pointed out, pointers tend not to be in floating point format...for now.
Bill Wendling [Sat, 10 Mar 2012 18:20:55 +0000 (18:20 +0000)]
As Duncan pointed out, pointers tend not to be in floating point format...for now.

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

12 years agoDon't try to filecheck bitcode.
Benjamin Kramer [Sat, 10 Mar 2012 18:07:46 +0000 (18:07 +0000)]
Don't try to filecheck bitcode.

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

12 years agoMake this transformation slightly less agressive and more correct.
Bill Wendling [Sat, 10 Mar 2012 17:56:03 +0000 (17:56 +0000)]
Make this transformation slightly less agressive and more correct.

The 'CmpInst::isFalseWhenEqual' function returns 'false' for values other than
simply equality. For instance, it returns 'false' for <= or >=. This isn't the
correct behavior for this transformation, which is checking for strict equality
and non-equality. It was causing the gcc.c-torture/execute/frame-address.c test
to fail because it would completely (and incorrectly) optimize a whole function
into a 'ret i32 0'.

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

12 years agoC files in llvm still have to be C89 compliant, remove C++-style comments.
Benjamin Kramer [Sat, 10 Mar 2012 15:10:06 +0000 (15:10 +0000)]
C files in llvm still have to be C89 compliant, remove C++-style comments.

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

12 years agoMicrooptimize getVRegDef. def_begin isn't free, don't compute it twice.
Benjamin Kramer [Sat, 10 Mar 2012 12:50:44 +0000 (12:50 +0000)]
Microoptimize getVRegDef. def_begin isn't free, don't compute it twice.

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

12 years agoRefactor some methods to look through bitcasts and GEPs on pointers into
Chandler Carruth [Sat, 10 Mar 2012 08:39:09 +0000 (08:39 +0000)]
Refactor some methods to look through bitcasts and GEPs on pointers into
a common collection of methods on Value, and share their implementation.
We had two variations in two different places already, and I need the
third variation for inline cost estimation.

Reviewed by Duncan Sands on IRC, but further comments here welcome.

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

12 years agoFix disasm of iret, sysexit, and sysret when displayed with Intel syntax.
Bill Wendling [Sat, 10 Mar 2012 07:37:27 +0000 (07:37 +0000)]
Fix disasm of iret, sysexit, and sysret when displayed with Intel syntax.
Patch by Kay Tiong Khoo!

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

12 years agoImplement a more intelligent way of spilling uses across an invoke boundary.
Bill Wendling [Sat, 10 Mar 2012 07:11:55 +0000 (07:11 +0000)]
Implement a more intelligent way of spilling uses across an invoke boundary.

The old way of determine when and where to spill a value that was used inside of
a landing pad resulted in spilling that value everywhere and not just at the
invoke edge.

This algorithm determines which values are used within a landing pad. It then
spills those values before the invoke and reloads them before the uses. This
should prevent excessive spilling in many cases, e.g. inside of loops.
<rdar://problem/10609139>

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

12 years ago[llvm.py] Define enumerations from Core.h; add OpCode class
Gregory Szorc [Sat, 10 Mar 2012 05:50:56 +0000 (05:50 +0000)]
[llvm.py] Define enumerations from Core.h; add OpCode class

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

12 years ago[llvm.py] Implement interface to object files
Gregory Szorc [Sat, 10 Mar 2012 04:41:24 +0000 (04:41 +0000)]
[llvm.py] Implement interface to object files

It is now possible to load object files and scan over sections, symbols,
and relocations! Includes test code with partial coverage.

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

12 years agoFix uses of the C99 PRI format macros not to conflict with C++11 UDLs.
Benjamin Kramer [Sat, 10 Mar 2012 02:04:38 +0000 (02:04 +0000)]
Fix uses of the C99 PRI format macros not to conflict with C++11 UDLs.

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

12 years agoReport the defining instruction.
Jakob Stoklund Olesen [Sat, 10 Mar 2012 00:44:11 +0000 (00:44 +0000)]
Report the defining instruction.

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

12 years agoAdd SSA verification to MachineVerifier.
Jakob Stoklund Olesen [Sat, 10 Mar 2012 00:36:06 +0000 (00:36 +0000)]
Add SSA verification to MachineVerifier.

Somehow we never verified SSA dominance before.

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

12 years agoUse SmallPtrSet instead of DenseSet.
Jakob Stoklund Olesen [Sat, 10 Mar 2012 00:36:04 +0000 (00:36 +0000)]
Use SmallPtrSet instead of DenseSet.

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

12 years agoGive dagcombiner's worklist some inline capacity.
Benjamin Kramer [Sat, 10 Mar 2012 00:23:58 +0000 (00:23 +0000)]
Give dagcombiner's worklist some inline capacity.

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

12 years agoDo not custom lower i64 nodes if i64 is not a legal type. Move lines that set
Akira Hatanaka [Sat, 10 Mar 2012 00:03:50 +0000 (00:03 +0000)]
Do not custom lower i64 nodes if i64 is not a legal type. Move lines that set
operation action of nodes.

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

12 years agoLower SETCC nodes during legalization. Previously, it was lowered in DAG combine...
Akira Hatanaka [Fri, 9 Mar 2012 23:46:03 +0000 (23:46 +0000)]
Lower SETCC nodes during legalization. Previously, it was lowered in DAG combine pass.

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

12 years agoAssert on SSA errors in LiveVariables.
Jakob Stoklund Olesen [Fri, 9 Mar 2012 23:41:44 +0000 (23:41 +0000)]
Assert on SSA errors in LiveVariables.

All uses of a virtual register must be dominated by its def.

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

12 years agoRemove unused header files.
Akira Hatanaka [Fri, 9 Mar 2012 23:28:30 +0000 (23:28 +0000)]
Remove unused header files.

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

12 years agomisched: handle scheduler that insert instructions at empty region boundaries.
Andrew Trick [Fri, 9 Mar 2012 22:34:56 +0000 (22:34 +0000)]
misched: handle scheduler that insert instructions at empty region boundaries.

And add comments, since this is obviously confusing.

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

12 years agoAdd the missing call to Error when a bad X86 scale expression is parsed.
Kevin Enderby [Fri, 9 Mar 2012 22:24:10 +0000 (22:24 +0000)]
Add the missing call to Error when a bad X86 scale expression is parsed.

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

12 years agoSupport reading GNU symbol versions in ELFObjectFile
David Meyer [Fri, 9 Mar 2012 20:59:52 +0000 (20:59 +0000)]
Support reading GNU symbol versions in ELFObjectFile

* Add enums and structures for GNU version information.
* Implement extraction of that information on a per-symbol basis (ELFObjectFile::getSymbolVersion).
* Implement a generic interface, GetELFSymbolVersion(), for getting the symbol version from the ObjectFile (hides the templating).
* Have llvm-readobj print out the version, when available.
* Add a test for the new feature: readobj-elf-versioning.test

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

12 years ago[Object]
David Meyer [Fri, 9 Mar 2012 20:41:57 +0000 (20:41 +0000)]
[Object]
Make Binary::TypeID more granular, to distinguish between ELF 32/64 little/big

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

12 years agoAdd statistics on removed switch cases, and fix the phi statistic
Duncan Sands [Fri, 9 Mar 2012 19:21:15 +0000 (19:21 +0000)]
Add statistics on removed switch cases, and fix the phi statistic
to count the number of phis changed, not the number visited.

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

12 years ago[llvm.py] Make ObjectFile destructor work
Gregory Szorc [Fri, 9 Mar 2012 18:56:33 +0000 (18:56 +0000)]
[llvm.py] Make ObjectFile destructor work

Previous code had a double free in MemoryBuffer. The tests now pass.

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

12 years agoWhen identifying exit nodes for the reverse-CFG reverse-post-order
Dan Gohman [Fri, 9 Mar 2012 18:50:52 +0000 (18:50 +0000)]
When identifying exit nodes for the reverse-CFG reverse-post-order
traversal, consider nodes for which the only successors are backedges
which the traversal is ignoring to be exit nodes. This fixes a problem
where the bottom-up traversal was failing to visit split blocks along
split loop backedges. This fixes rdar://10989035.

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

12 years agoFix the x86 disassembler to at least print the lock prefix if it is the first
Kevin Enderby [Fri, 9 Mar 2012 17:52:49 +0000 (17:52 +0000)]
Fix the x86 disassembler to at least print the lock prefix if it is the first
prefix.  Added a FIXME to remind us this still does not work when it is not the
first prefix.

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

12 years ago[Support] Drop verbose _ATTRIBUTE from LLVM_ATTRIBUTE_{READONLY,READNONE} macro
Daniel Dunbar [Fri, 9 Mar 2012 16:30:33 +0000 (16:30 +0000)]
[Support] Drop verbose _ATTRIBUTE from LLVM_ATTRIBUTE_{READONLY,READNONE} macro
names.

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

12 years agoTableGen/CodeEmitterGen.cpp: Fix an expression of generating bitmask.
NAKAMURA Takumi [Fri, 9 Mar 2012 14:52:44 +0000 (14:52 +0000)]
TableGen/CodeEmitterGen.cpp: Fix an expression of generating bitmask.

~0U might be i32 on 32-bit hosts, then (uint64_t)~0U might not be expected as (i64)0xFFFFFFFF_FFFFFFFF, but as (i64)0x00000000_FFFFFFFF.

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

12 years agotest/MC/X86/lit.local.cfg: Fix up to detect 'X86' in targets.
NAKAMURA Takumi [Fri, 9 Mar 2012 14:52:38 +0000 (14:52 +0000)]
test/MC/X86/lit.local.cfg: Fix up to detect 'X86' in targets.

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

12 years agoEliminate switch cases that can never match, for example removes all
Duncan Sands [Fri, 9 Mar 2012 13:45:18 +0000 (13:45 +0000)]
Eliminate switch cases that can never match, for example removes all
negative switch cases if the branch condition is known to be positive.
Inspired by a recent improvement to GCC's VRP.

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

12 years agoAdd support for r600 (AMD GPUs HD2XXX - HD6XXX) target triplet.
Anton Korobeynikov [Fri, 9 Mar 2012 10:09:36 +0000 (10:09 +0000)]
Add support for r600 (AMD GPUs HD2XXX - HD6XXX) target triplet.

Patch by Tom Stellard!

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