Commit Graph

52483 Commits

Author SHA1 Message Date
Devang Patel 1709e8c084 Remove unnecessary include.
llvm-svn: 83013
2009-09-28 21:06:38 +00:00
Dan Gohman 82ef61857e Add a testcase for r83011.
llvm-svn: 83012
2009-09-28 21:03:02 +00:00
Dan Gohman f230656a02 When extending the operands of an addrec, iterate through all
the operands, rather than trying to partition them into a start
and a step. This handles non-affine add recurrences correctly.

llvm-svn: 83011
2009-09-28 21:01:47 +00:00
Devang Patel 565371b4c9 Do not hardcode metadata names.
llvm-svn: 83010
2009-09-28 20:56:00 +00:00
Dan Gohman 46945e38ea Add a CHECK line to check the position of the second divsd.
llvm-svn: 83009
2009-09-28 20:48:39 +00:00
Evan Cheng 4854ef0023 Fix Thumb2 IT block pass bug. t2MOVi32imm may not be the start of a IT block.
llvm-svn: 83008
2009-09-28 20:47:15 +00:00
Jakob Stoklund Olesen 0bb5af345a Use KILL instead of IMPLICIT_DEF in LowerSubregs pass.
llvm-svn: 83007
2009-09-28 20:32:46 +00:00
Jakob Stoklund Olesen dc9efe8078 Introduce the TargetInstrInfo::KILL machine instruction and get rid of the
unused DECLARE instruction.

KILL is not yet used anywhere, it will replace TargetInstrInfo::IMPLICIT_DEF
in the places where IMPLICIT_DEF is just used to alter liveness of physical
registers.

llvm-svn: 83006
2009-09-28 20:32:26 +00:00
Dan Gohman 21c0774ba9 Add a testcase to help test analysis preservation.
llvm-svn: 83002
2009-09-28 18:40:27 +00:00
Dan Gohman d1415a8e56 Create a README.txt for lib/Analysis, and add an entry.
llvm-svn: 83001
2009-09-28 18:38:53 +00:00
Devang Patel 59c0c1388f Remove dead code.
llvm-svn: 82999
2009-09-28 18:31:56 +00:00
Dan Gohman 6905f15256 Use VerifySchedule instead of doing the work manually.
llvm-svn: 82995
2009-09-28 16:09:41 +00:00
Dan Gohman 86dc886584 Fix this debug output to handle the case where the loop has been deleted.
llvm-svn: 82994
2009-09-28 15:40:01 +00:00
Dan Gohman 0bd312afd8 Include the name of the loop header in debug messages.
llvm-svn: 82993
2009-09-28 15:07:18 +00:00
Dan Gohman 7d3b0be05b Remove a redundant #ifndef and add an assertion string.
llvm-svn: 82991
2009-09-28 14:38:19 +00:00
Dan Gohman 9a7320c711 Convert LoopSimplify and LoopExtractor from FunctionPass to LoopPass.
llvm-svn: 82990
2009-09-28 14:37:51 +00:00
Bob Wilson 2dd957fff6 Pass the optimization level when constructing the ARM instruction selector.
Otherwise, it is always set to "default", which prevents debug info from
even being generated during isel.  Radar 7250345.

llvm-svn: 82988
2009-09-28 14:30:20 +00:00
Evan Cheng 83e0d481ae Make ARM and Thumb2 32-bit immediate materialization into a single 32-bit pseudo
instruction. This makes it re-materializable.

Thumb2 will split it back out into two instructions so IT pass will generate the
right mask. Also, this expose opportunies to optimize the movw to a 16-bit move.

llvm-svn: 82982
2009-09-28 09:14:39 +00:00
Daniel Dunbar 86d4c28932 Don't traverse into .svn directories.
llvm-svn: 82978
2009-09-28 07:32:45 +00:00
Anton Korobeynikov c30d816d7a Fix thinko in my recent movt commit: it's not safe to remat movt, since it has input reg argument.
Disable rematting of it for now.

llvm-svn: 82975
2009-09-28 07:26:46 +00:00
Chris Lattner 0261b5d2d2 The select instruction is not neccesarily in the same block as the
phi nodes.  Make sure to phi translate from the right block. 

This fixes a llvm-building-llvm failure on GVN-PRE.cpp

llvm-svn: 82970
2009-09-28 06:49:44 +00:00
Evan Cheng e0c5313493 Coalescer should not delete extract_subreg, insert_subreg, and subreg_to_reg of
physical registers. This is especially critical for the later two since they
start the live interval of a super-register. e.g.
%DO<def> = INSERT_SUBREG %D0<undef>, %S0<kill>, 1
If this instruction is eliminated, the register scavenger will not be happy as
D0 is not defined previously.
This fixes PR5055.

llvm-svn: 82968
2009-09-28 05:28:43 +00:00
Erick Tryzelaar 16787bda38 Document a bug in the ocaml bindings has wrong linkage values.
llvm-svn: 82966
2009-09-28 04:42:55 +00:00
Erick Tryzelaar c3a9a08e49 Expose the rest of the attribute settings.
llvm-svn: 82965
2009-09-28 04:42:47 +00:00
Erick Tryzelaar b0d17ac4ef Fix a bug in ocaml bindings that has incorrect linkage options.
llvm-svn: 82964
2009-09-28 04:42:36 +00:00
Mikhail Glushenkov 89cbdf0209 Regenerate.
llvm-svn: 82958
2009-09-28 01:28:26 +00:00
Mikhail Glushenkov efc9763468 Add a way to query the number of input files.
llvm-svn: 82957
2009-09-28 01:16:42 +00:00
Mikhail Glushenkov b7787297f5 Document the 'not' combinator.
llvm-svn: 82956
2009-09-28 01:16:07 +00:00
Mikhail Glushenkov 1766617386 A bit prettier formatting.
llvm-svn: 82955
2009-09-28 01:15:44 +00:00
Dan Gohman 08d86dac71 Remove temporary debugging hack.
llvm-svn: 82953
2009-09-28 00:44:15 +00:00
Dan Gohman 4dbb301f17 Move the dominator verification code out of special code embedded within
the PassManager code into a regular verifyAnalysis method.

Also, reorganize loop verification. Make the LoopPass infrastructure
call verifyLoop as needed instead of having LoopInfo::verifyAnalysis
check every loop in the function after each looop pass. Add a new
command-line argument, -verify-loop-info, to enable the expensive
full checking.

llvm-svn: 82952
2009-09-28 00:27:48 +00:00
Dan Gohman 2963777d0c Move this assert to check the condition as soon as it is known.
llvm-svn: 82951
2009-09-28 00:10:28 +00:00
Dan Gohman 277e767578 Extend the StartPassTimer and StopPassTimer functions so that the
code that stops the timer doesn't have to search to find the timer
object before it stops the timer. This avoids a lock acquisition
and a few other things done with the timer running.

llvm-svn: 82949
2009-09-28 00:07:05 +00:00
Anton Korobeynikov 7c2b1e71c1 Use movt/movw pair to materialize 32 bit constants on ARMv6T2+.
This should be better than single load from constpool.

llvm-svn: 82948
2009-09-27 23:52:58 +00:00
Dan Gohman b0934cdd1c Fix an old copy+pasto.
llvm-svn: 82947
2009-09-27 23:52:07 +00:00
Dan Gohman adde5dfde2 Extract the code for inserting a loop into the loop queue into
a separate function.

llvm-svn: 82946
2009-09-27 23:49:43 +00:00
Dan Gohman 37a99664ff When a loop is deleted, immediately release all of the active
LoopPasses for that loop. This avoids trouble with the PassManager
trying to call verifyAnalysis on them, and frees up some memory
sooner rather than later.

llvm-svn: 82945
2009-09-27 23:43:07 +00:00
Dan Gohman 5e8ba5d514 Extract the code for releasing a pass into a separate function, and
tidy it up a little.

llvm-svn: 82944
2009-09-27 23:38:27 +00:00
Nick Lewycky 93e06a57c9 Remove the "metadata*" type and simplify the code it complicated. This was only
used to support GlobalVariables storing MDNodes, back when they were derived
from Constant before the introduction of NamedMDNode, but never removed.

llvm-svn: 82943
2009-09-27 23:27:42 +00:00
Dan Gohman a5fc03562f LBRX no longer has an explicit SrcValueSDNode operand, so the type
operand is now at index 2, rather than 3. This fixes the
"Invalid child # of SDNode!" failures on PowerPC.

llvm-svn: 82942
2009-09-27 23:17:47 +00:00
Chris Lattner 4425660b1f simplify some code.
llvm-svn: 82936
2009-09-27 21:46:50 +00:00
Chris Lattner b2e88cd01c The bitcast case is not needed here: instcombine turns icmp(bitcast(x), null) -> icmp(x, null) already.
llvm-svn: 82935
2009-09-27 21:42:46 +00:00
Nick Lewycky 1f71578e0d New unit test for the cloning module, which so far only covers cloning of
instructions' optimization flags.

llvm-svn: 82934
2009-09-27 21:39:46 +00:00
Chris Lattner 8b4d3dfbbf calls are already unmovable, malloc doesn't need a special case.
llvm-svn: 82933
2009-09-27 21:36:19 +00:00
Chris Lattner f9e0c7f84b calls to external functions are already marked overdefined, special casing
malloc isn't needed.

llvm-svn: 82932
2009-09-27 21:35:11 +00:00
Chris Lattner 5abb1e4cd2 calls are already handled, malloc doesn't need a special case.
llvm-svn: 82931
2009-09-27 21:33:46 +00:00
Nick Lewycky 28a5f25d87 Round out the API for the new optimization flags.
llvm-svn: 82930
2009-09-27 21:33:04 +00:00
Chris Lattner 466d57f6c1 calls are rejected above, no need to special case malloc here.
llvm-svn: 82929
2009-09-27 21:31:39 +00:00
Chris Lattner 43d0db70ac remove special handling of bitcast(malloc), it will be handled
when the loop inspects the bitcast operand.

llvm-svn: 82928
2009-09-27 21:29:28 +00:00
Chris Lattner a8627272c1 unlike the malloc instruction, "malloc" calls do not claim to be readonly, just nounwind.
llvm-svn: 82927
2009-09-27 21:23:38 +00:00
Chris Lattner 351a7ef01a add a new DirectiveMap stringmap, which allows more efficient dispatching
to directive handlers and allows for easier extensibility.

I only switched a few over for now.

llvm-svn: 82926
2009-09-27 21:16:52 +00:00
Nick Lewycky 199c563cc8 Link order: it matters.
llvm-svn: 82925
2009-09-27 20:58:01 +00:00
Chris Lattner b391e87263 allow pushing icmps through phis with multiple uses and across critical edges.
These are important to push up to encourage jump threading.  This shrinks 176.gcc a bit.

llvm-svn: 82923
2009-09-27 20:46:36 +00:00
Chris Lattner ae289632ef Enhance the previous fix for PR4895 to allow more values than just
simple constants for the true/false value of the select.  We now
do phi translation etc.  This really fixes PR4895 :)

llvm-svn: 82917
2009-09-27 20:18:49 +00:00
Chris Lattner facb867af3 implement PR4895, by making FoldOpIntoPhi handle select conditions
that are phi nodes.  Also tighten up FoldOpIntoPhi to treat constantexpr
operands to phis just like other variables, avoiding moving constantexpr
computations around.

Patch by Daniel Dunbar.

llvm-svn: 82913
2009-09-27 19:57:57 +00:00
Chris Lattner 10a1cfd0f9 avoid copying MCAsmInfo by value, add an (extremely low prio) fixme.
llvm-svn: 82911
2009-09-27 19:38:39 +00:00
Tilmann Scheller 336e2bd91b Use explicit structs instead of std::pair to map callee saved regs to spill slots.
llvm-svn: 82909
2009-09-27 17:58:47 +00:00
Dan Gohman cb663d749d Delete a bogus comment.
llvm-svn: 82908
2009-09-27 17:50:44 +00:00
Dan Gohman 2115154d44 Remove a redundant assert.
llvm-svn: 82907
2009-09-27 17:48:37 +00:00
Jeffrey Yasskin c3273dca48 Enable -g with DEBUG_SYMBOLS and --enable-debug-symbols instead of
DEBUG_RUNTIME.

llvm-svn: 82906
2009-09-27 17:47:29 +00:00
Dan Gohman 2aab867048 Fix SCEVExpander's canonical addrec expansion code to work on loops that
aren't in canonical loop-simplify form, since it doesn't itself depend
on LoopSimplify. This means handling loops without preheaders and loops
with multiple backedges.

llvm-svn: 82905
2009-09-27 17:46:40 +00:00
Dan Gohman bb85dd6f33 Add dominates and releaseMemory member functions to PostDominatorTree.
llvm-svn: 82904
2009-09-27 17:39:12 +00:00
Dan Gohman 0e70af36c0 Grab an LLVM Context from an instruction that exists rather than one
that is deleted in some situations. This fixes a use-after-free.

llvm-svn: 82903
2009-09-27 16:10:30 +00:00
Dan Gohman e28bd65aed Clarify a comment.
llvm-svn: 82902
2009-09-27 15:41:19 +00:00
Dan Gohman fc20b67e80 Tell ScalarEvolution to forget everything it knows about a loop before
rotating the loop, since loop rotation is a very significant change.

llvm-svn: 82901
2009-09-27 15:37:03 +00:00
Dan Gohman 4338f905b7 Micro-optimize DerivedType::dropAllTypeUses.
llvm-svn: 82900
2009-09-27 15:32:21 +00:00
Dan Gohman 6daa565cf9 Instead of testing whether an instruction dominates the loop preheader,
test whether it properly dominates the loop header. This is equivalent
when the loop has a preheader, and has the advantage of working when
the loop doesn't have a preheader. Since IVUsers doesn't Require
LoopSimplify, the loop isn't guaranteed to have a preheader.

llvm-svn: 82899
2009-09-27 15:30:00 +00:00
Dan Gohman f39a3a9288 Add a properlyDominates member function to ScalarEvolution.
llvm-svn: 82898
2009-09-27 15:26:03 +00:00
Dan Gohman 0523507a2f Remove a redundant #include.
llvm-svn: 82897
2009-09-27 15:21:52 +00:00
Torok Edwin 819d15c7d9 Avoid using mutex locks if not in multithreaded mode by using a SmartScopedMutex
in RegisterStatistic.

llvm-svn: 82896
2009-09-27 11:08:03 +00:00
Evan Cheng a6b9cab822 Enable pre-regalloc load / store multiple pass for Thumb2.
llvm-svn: 82893
2009-09-27 09:46:04 +00:00
Chris Lattner 5e0c74780a rename REG -> REGISTER to make it explicit in the doc. <tt>ify some stuff.
llvm-svn: 82892
2009-09-27 08:01:44 +00:00
Chris Lattner 8879e06d0a implement and document support for filecheck variables. This
allows matching and remembering a string and then matching and
verifying that the string occurs later in the file.

Change X86/xor.ll to use this in some cases where the test was
checking for an arbitrary register allocation decision.

llvm-svn: 82891
2009-09-27 07:56:52 +00:00
Nick Lewycky 14d1cccc2b Remove dead code from this function and optimize. Update its corresponding
LangRef entry too.

llvm-svn: 82890
2009-09-27 07:55:32 +00:00
Nick Lewycky 42fb7452df Instruction::clone does not need to take an LLVMContext&. Remove that and
update all the callers.

llvm-svn: 82889
2009-09-27 07:38:41 +00:00
Nick Lewycky b56e1ab033 Filecheckify this one test.
llvm-svn: 82888
2009-09-27 06:25:05 +00:00
Nick Lewycky 147d40d4a2 Leave a pointer to the documentation so that people don't end up change one but
not the other in the future.

llvm-svn: 82887
2009-09-27 04:57:35 +00:00
Nick Lewycky f32f698919 Correct the version numbers to match those actually tested for by
autoconf/AutoRegen.sh.

llvm-svn: 82886
2009-09-27 04:56:27 +00:00
Nick Lewycky 84a1eeb7ed Move the integer type out of 'derived' and into 'primitive'. This permits us
to explain that derived types are all composed of other types, which primitive
types aren't. Without moving integer out of derived, this wouldn't be true.

Perform a few trivial cleanups; 'i1' went from a link to #t_primitive to
#t_integer (a holdover from when it was a bool type I suppose).

llvm-svn: 82884
2009-09-27 00:45:11 +00:00
Chris Lattner 37d8015dc1 remove support for "NoSub" from regex. It seems like a minor optimization
and makes the API more annoying.  Add a Regex::getNumMatches() method.

llvm-svn: 82877
2009-09-26 21:27:04 +00:00
Torok Edwin fd5438edee Speed up clang-only link, by really linking only clang, and not the unittests
too.

llvm-svn: 82873
2009-09-26 20:18:58 +00:00
Evan Cheng cf2a9c9962 Remove this test.
llvm-svn: 82869
2009-09-26 18:51:37 +00:00
Dan Gohman 62995c71a2 Fix SimplifyLibCalls to transfer attributes from callees rather than
calls, since direct calls don't always reflect the attributes of their
callees.

llvm-svn: 82867
2009-09-26 18:10:13 +00:00
Dan Gohman 5bafe38916 Fix a case where ScalarEvolution was expanding pointer arithmetic
to inttoptr/ptrtoint unnecessarily.

llvm-svn: 82864
2009-09-26 16:11:57 +00:00
Duncan Sands 129de48982 For the NSWSub support in the builder to actually be useable,
there need to be corresponding changes to the constant folders,
done in this patch.

llvm-svn: 82862
2009-09-26 15:35:35 +00:00
Dan Gohman 832800aa6f Convert comparisons like (x == infinity) to (x >= infinity) on targets
where FCMP_OEQ is not legal and FCMP_OGE is, such as x86. 

llvm-svn: 82861
2009-09-26 15:24:17 +00:00
Duncan Sands 8c0fb28992 Add methods for creating NSW subtraction, as already exists
for addition.

llvm-svn: 82860
2009-09-26 15:21:48 +00:00
Dan Gohman 534ad04302 Add a comment describing natural loops.
llvm-svn: 82859
2009-09-26 15:09:53 +00:00
Daniel Dunbar ccde96e96b "Update" tests for -disable-if-conversion removal. I think branch.ll should just
be removed, but I XFAIL'd it for now.

llvm-svn: 82847
2009-09-26 05:29:36 +00:00
Evan Cheng 6a3bdd872c Really remove this option.
llvm-svn: 82838
2009-09-26 02:49:49 +00:00
Evan Cheng d0fe5abc23 Remove a couple of unused command line options.
llvm-svn: 82837
2009-09-26 02:45:45 +00:00
Evan Cheng 4a949408fb Add comment.
llvm-svn: 82836
2009-09-26 02:43:36 +00:00
Evan Cheng d080f7bf26 Convert test to filecheck.
llvm-svn: 82835
2009-09-26 02:41:17 +00:00
Dan Gohman 2f5bdcb7c2 Don't hoist or sink instructions with physreg uses if the physreg is
allocatable. Even if it doesn't appear to have any defs, it may latter
on after register allocation.

llvm-svn: 82834
2009-09-26 02:34:00 +00:00
Dan Gohman 48f7da742a I put the wrong rdar number in this test.
llvm-svn: 82829
2009-09-26 01:11:57 +00:00
Dan Gohman e30d63f1d8 Unbreak MachineLICM for instructions that reference RIP on x86-64 too.
llvm-svn: 82825
2009-09-25 23:58:45 +00:00
Dan Gohman 394468dc8e Rename ConstantFP's getInf to getInfinity.
llvm-svn: 82823
2009-09-25 23:40:21 +00:00
Dan Gohman 5a6b11cb71 Move MachineMemOperand::getAlignment out of line, to avoid needing
MathExtras.h in MachineMemOperand.h.

llvm-svn: 82822
2009-09-25 23:33:20 +00:00
Daniel Dunbar f6dbd6f26e Remove unused variable.
llvm-svn: 82821
2009-09-25 23:26:56 +00:00
Dan Gohman 5ffd53892d Transform pow(x, 0.5) to (x == -inf ? inf : fabs(sqrt(x))), which is
typically faster then doing a general pow.

llvm-svn: 82819
2009-09-25 23:10:17 +00:00
Dan Gohman feb5021134 Add a ConstantFP::getInf utility function for creating infinity ConstantFPs.
llvm-svn: 82818
2009-09-25 23:00:48 +00:00
Dan Gohman a317687e85 Fix MachineSink to be able to sink instructions that use physical registers
which have no defs anywhere in the function. In particular, this fixes sinking
of instructions that reference RIP on x86-64, which is currently being modeled
as a register.

llvm-svn: 82815
2009-09-25 22:53:29 +00:00
Anton Korobeynikov a3090655d5 Regenerate
llvm-svn: 82814
2009-09-25 22:53:17 +00:00
Anton Korobeynikov 8493c5de0f Provide proper masks for neon perfect shuffle table.
I definitely need to read documentation better :(

llvm-svn: 82813
2009-09-25 22:52:29 +00:00
Dan Gohman e603710d11 Simplify a few more uses of reg_iterator.
llvm-svn: 82812
2009-09-25 22:26:13 +00:00
Dan Gohman 5edd45a76b Simplify this code by using use_iterator instead of reg_iterator
and skipping the defs.

llvm-svn: 82811
2009-09-25 22:24:52 +00:00
Evan Cheng fd6aad7f1c Code clean up and prepare for Thumb2 support. No functionality changes.
llvm-svn: 82805
2009-09-25 21:44:53 +00:00
Evan Cheng 3872b3c13e Flip -disable-post-RA-scheduler to -post-RA-scheduler.
llvm-svn: 82803
2009-09-25 21:38:11 +00:00
Jeffrey Yasskin 14a5cc54e5 Fix a compile failure introduced by r82675 on MinGW which doesn't have
setenv().  This patch just disables the test rather than getting putenv() to
work.  Thanks to Sandeep Patel for reporting the problem.

llvm-svn: 82797
2009-09-25 21:07:20 +00:00
Dale Johannesen f6a987b784 Handle sqrt in CannotBeNegativeZero. absf and absl
appear to be misspellings, removed in favor of fabs*.

llvm-svn: 82796
2009-09-25 20:54:50 +00:00
Dan Gohman 48b185d6f7 Improve MachineMemOperand handling.
- Allocate MachineMemOperands and MachineMemOperand lists in MachineFunctions.
   This eliminates MachineInstr's std::list member and allows the data to be
   created by isel and live for the remainder of codegen, avoiding a lot of
   copying and unnecessary translation. This also shrinks MemSDNode.
 - Delete MemOperandSDNode. Introduce MachineSDNode which has dedicated
   fields for MachineMemOperands.
 - Change MemSDNode to have a MachineMemOperand member instead of its own
   fields with the same information. This introduces some redundancy, but
   it's more consistent with what MachineInstr will eventually want.
 - Ignore alignment when searching for redundant loads for CSE, but remember
   the greatest alignment.

Target-specific code which previously used MemOperandSDNodes with generic
SDNodes now use MemIntrinsicSDNodes, with opcodes in a designated range
so that the SelectionDAG framework knows that MachineMemOperand information
is available.

llvm-svn: 82794
2009-09-25 20:36:54 +00:00
Dan Gohman 32f71d714b Rename getTargetNode to getMachineNode, for consistency with the
naming scheme used in SelectionDAG, where there are multiple kinds
of "target" nodes, but "machine" nodes are nodes which represent
a MachineInstr.

llvm-svn: 82790
2009-09-25 18:54:59 +00:00
David Goodwin bea6848f9d Finish scheduling itineraries for NEON.
llvm-svn: 82788
2009-09-25 18:38:29 +00:00
Dale Johannesen 114e105662 Add readonly to some sin and cos calls; transformations
being checked aren't valid without it.

llvm-svn: 82786
2009-09-25 18:15:29 +00:00
Victor Hernandez e6ff7662b6 Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it causes regressions in the nightly tests.
llvm-svn: 82784
2009-09-25 18:11:52 +00:00
Dale Johannesen a318d91a1e Make sure sin, cos, sqrt calls are marked readonly
before producing FSIN, FCOS, FSQRT.  If they aren't
so marked we have to assume they might set errno.

llvm-svn: 82781
2009-09-25 18:00:35 +00:00
Chris Lattner 0a4c44bdf4 reject attempts to use ()'s in patterns, these are reserved for filecheck.
llvm-svn: 82780
2009-09-25 17:29:36 +00:00
Chris Lattner b16ab0c40a reimplement the regex matching strategy by building a single
regex and matching it instead of trying to match chunks at a time.
Matching chunks at a time broke with check lines like 
  CHECK: foo {{.*}}bar
because the .* would eat the entire rest of the line and bar would
never match.

Now we just escape the fixed strings for the user, so that something
like:
  CHECK: a() {{.*}}???
is matched as:
  CHECK: {{a\(\) .*\?\?\?}}
transparently "under the covers".

llvm-svn: 82779
2009-09-25 17:23:43 +00:00
Dale Johannesen c72134269f Generate FSQRT from calls to the sqrt function, which
allows appropriate backends to generate a sqrt instruction.

On x86, this isn't done at -O0 because we go through
FastISel instead.  This is a behavior change from before
this series of sqrt patches started.  I think this is OK
considering that compile speed is most important at -O0, but
could be convinced otherwise.

llvm-svn: 82778
2009-09-25 17:23:22 +00:00
Chris Lattner 221460e0be special case Patterns that are a single fixed string. This is a microscopic
perf win and is needed for future changes.

llvm-svn: 82777
2009-09-25 17:09:12 +00:00
Dale Johannesen 722212d1a0 Revise C library functions description to be vaguer, per Chris.
llvm-svn: 82776
2009-09-25 17:04:42 +00:00
Jeffrey Yasskin db281085c5 This patch causes the --enable-debug-runtime configure flag and the
DEBUG_RUNTIME Makefile variable to pass -g to gcc when building LLVM's objects.
Without this, it's very hard to debug crashes that happen in Release-Asserts
mode but not Debug mode.

llvm-svn: 82775
2009-09-25 16:46:09 +00:00
Bob Wilson f7fe0132c9 Add some comments to clarify things that I discovered this week.
llvm-svn: 82773
2009-09-25 16:34:46 +00:00
Daniel Dunbar e813b22b13 Make llvm-bcanalyzer percentages more readable.
llvm-svn: 82772
2009-09-25 16:04:21 +00:00
Daniel Dunbar 75359a7c2f Strip trailing whitespace.
llvm-svn: 82771
2009-09-25 16:03:57 +00:00
Bob Wilson d60367c198 pr4926: ARM requires the stack pointer to be aligned, even for leaf functions.
For the AAPCS ABI, SP must always be 4-byte aligned, and at any "public
interface" it must be 8-byte aligned.  For the older ARM APCS ABI, the stack
alignment is just always 4 bytes.  For X86, we currently align SP at
entry to a function (e.g., to 16 bytes for Darwin), but no stack alignment
is needed at other times, such as for a leaf function.

After discussing this with Dan, I decided to go with the approach of adding
a new "TransientStackAlignment" field to TargetFrameInfo.  This value
specifies the stack alignment that must be maintained even in between calls.
It defaults to 1 except for ARM, where it is 4.  (Some other targets may
also want to set this if they have similar stack requirements. It's not
currently required for PPC because it sets targetHandlesStackFrameRounding
and handles the alignment in target-specific code.) The existing StackAlignment
value specifies the alignment upon entry to a function, which is how we've
been using it anyway.

llvm-svn: 82767
2009-09-25 14:41:49 +00:00
Duncan Sands 3cf0cdee4c Print INST_INBOUNDS_GEP rather than UnknownCode30.
Likewise for constant inbounds GEP.

llvm-svn: 82763
2009-09-25 12:28:37 +00:00
Chris Lattner 233117b7f6 convert testcases to filecheck.
llvm-svn: 82759
2009-09-25 06:49:41 +00:00
Chris Lattner 712e8e03a5 filecheck should not match a \n with a .
llvm-svn: 82758
2009-09-25 06:47:09 +00:00
Chris Lattner 812e594454 remove a large unreduced testcase
llvm-svn: 82756
2009-09-25 06:37:22 +00:00
Chris Lattner b121a24f25 turn a std::pair into a real class.
llvm-svn: 82754
2009-09-25 06:32:47 +00:00
Nate Begeman 18150d5abc Fix combiner-aa issue with bases which are different, but can alias.
Previously, it treated GV+28 GV+0 as different bases, and assumed they could
not alias.

llvm-svn: 82753
2009-09-25 06:05:26 +00:00
Bob Wilson 0bb2a929a2 Update the description of MachineFrameInfo's OffsetAdjustment. The value of
this adjustment does not change the direction or the signs of the object
offsets, and the details of the offset calculations can be target-specific.
Also mention that for most targets this value is only used to generate debug
info.

llvm-svn: 82750
2009-09-25 05:30:55 +00:00
Dan Gohman 28328db571 Don't try to use pre-indexed addressing with sthbrx/stwbrx
instructions. This fixes a PowerPC bug exposed by some unrelated
changes I'm working on.

llvm-svn: 82743
2009-09-25 00:57:30 +00:00
Dan Gohman ebdfe4af62 Add a version of dumpr() that has a SelectionDAG* argument.
llvm-svn: 82742
2009-09-25 00:34:34 +00:00
Jim Grosbach 372e9a389b Start of revamping the register scavenging in PEI. ARM Thumb1 is the driving
interest for this, as it currently reserves a register rather than using
the scavenger for matierializing constants as needed.

Instead of scavenging registers on the fly while eliminating frame indices,
new virtual registers are created, and then a scavenged collectively in a
post-pass over the function. This isolates the bits that need to interact
with the scavenger, and sets the stage for more intelligent use, and reuse,
of scavenged registers.

For the time being, this is disabled by default. Once the bugs are worked out,
the current scavenging calls in replaceFrameIndices() will be removed and
the post-pass scavenging will be the default. Until then,
-enable-frame-index-scavenging enables the new code. Currently, only the
Thumb1 back end is set up to use it.

llvm-svn: 82734
2009-09-24 23:52:18 +00:00
Dale Johannesen c594890a82 Reenable sqrt IR generation test.
llvm-svn: 82731
2009-09-24 23:37:40 +00:00
Mike Stump 944fa25934 Delete space after function name, before (, reflow a comment and
delete a few blank lines.

llvm-svn: 82729
2009-09-24 23:21:26 +00:00
Mike Stump d6f9a2f90b Fix spacing.
llvm-svn: 82727
2009-09-24 23:11:08 +00:00
Chris Lattner f08d2db928 add and document regex support for FileCheck. You can now do stuff like:
; CHECK: movl {{%e[a-z][xi]}}, %eax

or whatever.

llvm-svn: 82717
2009-09-24 21:47:32 +00:00
Chris Lattner abab11abb2 unconditionally request MMI
llvm-svn: 82716
2009-09-24 21:45:57 +00:00
Chris Lattner 688f991b38 wrap long lines.
llvm-svn: 82715
2009-09-24 21:44:20 +00:00
Chris Lattner a2f8fc5a72 Use CanonicalizeInputFile to canonicalize the entire buffer containing the
CHECK strings, instead of canonicalizing the patterns directly.  This allows
Pattern to just contain a StringRef instead of std::string.

llvm-svn: 82713
2009-09-24 20:45:07 +00:00
Chris Lattner 74d50731c1 change 'not' matching to use Pattern, move pattern parsing logic into
the Pattern class.

llvm-svn: 82712
2009-09-24 20:39:13 +00:00
Chris Lattner 3b40b44528 refactor out the match string into its own Pattern class.
llvm-svn: 82711
2009-09-24 20:25:55 +00:00
Bob Wilson 6cd4aee5e9 Convert to FileCheck.
llvm-svn: 82710
2009-09-24 20:23:02 +00:00
David Goodwin bf97147a7e Make the end-of-itinerary mark explicit. Some cleanup.
llvm-svn: 82709
2009-09-24 20:22:50 +00:00
Dan Gohman c0ecc6f4f9 Add nounwind to this test.
llvm-svn: 82708
2009-09-24 20:20:08 +00:00
Chris Lattner 1ce83629df tidy up, fix a memory leak in Regex::isValid
llvm-svn: 82707
2009-09-24 20:15:51 +00:00
Dale Johannesen 68f971b1d6 Clarify that llvm attaches C language semantics to
functions with names that match the C library.

llvm-svn: 82701
2009-09-24 18:38:21 +00:00
Torok Edwin 21bd8c9fc5 Constant propagating byval pointer is safe if function is readonly.
llvm-svn: 82700
2009-09-24 18:33:42 +00:00
Victor Hernandez 46cd467310 Auto-upgrade malloc instructions to malloc calls.
Reviewed by Devang Patel.

llvm-svn: 82694
2009-09-24 17:47:49 +00:00
Bob Wilson 5fe313d6e0 Fix a hypothetical problem for targets with StackGrowsUp and a non-zero
LocalAreaOffset.  (We don't have any of those right now.)
PEI::calculateFrameObjectOffsets includes the absolute value of the
LocalAreaOffset in the cumulative offset value used to calculate the
stack frame size.  It then adds the raw value of the LocalAreaOffset
to the stack size.  For a StackGrowsDown target, that raw value is negative
and has the effect of cancelling out the absolute value that was added
earlier, but that obviously won't work for a StackGrowsUp target.  Change
to subtract the absolute value of the LocalAreaOffset.

llvm-svn: 82693
2009-09-24 16:42:27 +00:00
Devang Patel 4e6f2e46e8 Move parent assertion check before metadata deletion.
llvm-svn: 82692
2009-09-24 16:19:11 +00:00
Torok Edwin f95a450ef9 Don't constant propagate byval pointers, since they are not really pointers, but
rather structs passed by value.
This fixes PR5038.

llvm-svn: 82689
2009-09-24 09:47:18 +00:00
Daniel Dunbar 00dd448cff Add count/not tools as executables.
- Apparently, I'm willing to do incredibly stupid things in the name of portability.

llvm-svn: 82685
2009-09-24 06:23:57 +00:00
Chris Lattner 87d8f2b9d5 unconditionally compute MMI even if the target doesn't support EH or Debug info, because the target may use it for other things, this fixes PR5036
llvm-svn: 82684
2009-09-24 05:44:53 +00:00
Chris Lattner 4e37f877b5 reapply r82348 with a fix, thanks Jeffrey.
llvm-svn: 82683
2009-09-24 05:38:36 +00:00
Evan Cheng 26ea28eb5f Fix PR5024 with a big hammer: disable the double-def assertion in the scavenger.
LiveVariables add implicit kills to correctly track partial register kills. This works well enough and is fairly accurate. But coalescer can make it impossible to maintain these markers. e.g.

        BL <ga:sss1>, %R0<kill,undef>, %S0<kill>, %R0<imp-def>, %R1<imp-def,dead>, %R2<imp-def,dead>, %R3<imp-def,dead>, %R12<imp-def,dead>, %LR<imp-def,dead>, %D0<imp-def>, ...
...
	%reg1031<def> = FLDS <cp#1>, 0, 14, %reg0, Mem:LD4[ConstantPool]
...
   	%S0<def> = FCPYS %reg1031<kill>, 14, %reg0, %D0<imp-use,kill>

When reg1031 and S0 are coalesced, the copy (FCPYS) will be eliminated the the implicit-kill of D0 is lost. In this case it's possible to move the marker to the FLDS. But in many cases, this is not possible. Suppose

	%reg1031<def> = FOO <cp#1>, %D0<imp-def>
...
   	%S0<def> = FCPYS %reg1031<kill>, 14, %reg0, %D0<imp-use,kill>

When FCPYS goes away, the definition of S0 is the "FOO" instruction. However, transferring the D0 implicit-kill to FOO doesn't work since it is the def of D0 itself. We need to fix this in another time by introducing a "kill" pseudo instruction to track liveness.

Disabling the assertion is not ideal, but machine verifier is doing that job now. It's important to know double-def is not a miscomputation since it means a register should be free but it's not tracked as free. It's a performance issue instead.

llvm-svn: 82677
2009-09-24 02:27:09 +00:00
Evan Cheng a21aac3811 Clean up LiveVariables and change how it deals with partial updates and kills. This also eliminate the horrible check which scan forward to the end of the basic block. It should be faster and more accurate.
llvm-svn: 82676
2009-09-24 02:15:22 +00:00
Jeffrey Yasskin a75d6bf3a8 Roll back r82348, which introduced an infinite loop in ParseCStringVector() that
a trivial unittest would have caught.  This revision also adds the trivial
unittest.

llvm-svn: 82675
2009-09-24 01:14:07 +00:00
Dale Johannesen fb1b55bc9c A minor improvment in accuracy to inline cost
computation, and some cosmetics.

llvm-svn: 82660
2009-09-23 22:05:24 +00:00
Dale Johannesen ea406ed0a6 Disable test; what it's testing for is wrong.
llvm-svn: 82658
2009-09-23 21:46:36 +00:00
David Goodwin afcaf79603 Checkpoint NEON scheduling itineraries.
llvm-svn: 82657
2009-09-23 21:38:08 +00:00
Dan Gohman 203d53ed79 Use getStoreSize() instead of getStoreSizeInBits()/8.
llvm-svn: 82656
2009-09-23 21:07:02 +00:00
Dan Gohman 99bdae2992 Spruce up some comments.
llvm-svn: 82655
2009-09-23 21:06:36 +00:00
Dan Gohman 08c0a95ac6 Rename several variables from EVT to more descriptive names, now that EVT
is also the name of their type, as declarations like "EVT EVT" look
really odd.

llvm-svn: 82654
2009-09-23 21:02:20 +00:00
Dan Gohman 2366ffd2cb Add an EVT::getStoreSize function, like getStoreSizeInBits but in bytes.
llvm-svn: 82653
2009-09-23 20:59:10 +00:00
Jakob Stoklund Olesen 75b9c2741d Fix verification of explicit operands.
The machine code verifier did not check for explicit operands correctly. It
used MachineInstr::getNumExplicitOperands, but that method may cheat and use
the declared count in the TargetInstrDesc.

Now we check the explicit operands one at a time in visitMachineOperand.

llvm-svn: 82652
2009-09-23 20:57:55 +00:00
Bob Wilson abfdbbfd1a Remove BlackfinRegisterInfo::getFrameIndexOffset since it is the same as the
default implementation.  Update comment on the default version, which made it
sound like most targets override it.  Currently only X86 and SystemZ override
this method.

llvm-svn: 82651
2009-09-23 20:57:02 +00:00
Dan Gohman 49f271afb3 Correct a comment.
llvm-svn: 82648
2009-09-23 20:40:16 +00:00
Devang Patel 52e819c7cf Delete attached metadata when an instruction is deleted.
llvm-svn: 82647
2009-09-23 20:33:51 +00:00
Anton Korobeynikov 29a44df5f8 ARM does not support offset folding (yet). Disable it for now.
This fixes PR5031. Unfortunately, there is no small testcase :(

llvm-svn: 82643
2009-09-23 19:04:09 +00:00
Bob Wilson c2c86cede6 Edit a comment.
llvm-svn: 82641
2009-09-23 18:53:19 +00:00
Devang Patel add586526e Do not leave behind metadata while cloning an instruction.
llvm-svn: 82638
2009-09-23 18:32:25 +00:00
Evan Cheng 3cf0ddf094 Add nounwind.
llvm-svn: 82637
2009-09-23 18:20:27 +00:00
Devang Patel e4e8181111 s/*Location/*DebugLocation/g
llvm-svn: 82635
2009-09-23 17:20:43 +00:00
Jeffrey Yasskin 42a49dfb02 PR4047: Permit configure --enable-targets=host,cpp for example. "host" has the
same effect that "host-only" used to have, but can be combined with other
targets.  host-only is still available as a synonym but no longer documented.

llvm-svn: 82634
2009-09-23 17:05:42 +00:00
David Goodwin a4c98a3e34 Fix bug in kill flag updating for post-register-allocation scheduling. When the kill flag of a superreg needs to be cleared because there are one or more subregs live, we instead add implicit-defs of those subregs and leave the kill flag on the superreg. This allows us to end the live-range of the superreg without ending the live-ranges of the subregs.
llvm-svn: 82629
2009-09-23 16:35:25 +00:00
Benjamin Kramer 43355aec61 Fix a struct/class mismatch.
llvm-svn: 82622
2009-09-23 11:48:57 +00:00
John McCall 0110327ae3 Make the type traits for a const pointer defer to those for a unqualified
pointer, instead of providing independent values modelled on the default
implementation.

llvm-svn: 82620
2009-09-23 06:53:51 +00:00
Evan Cheng 262f86ed90 Fix PR5024. LiveVariables physical register defs should *commit* only after all
of the defs are processed.
Also fix a implicit_def propagation bug: a implicit_def of a physical register
should be applied to uses of the sub-registers.

llvm-svn: 82616
2009-09-23 06:28:31 +00:00
Evan Cheng b2abe07457 Fix a obvious logic error.
llvm-svn: 82610
2009-09-23 05:23:19 +00:00
Gabor Greif 98dd936bc9 pretty mechanical changes to match coding guidelines (blessed by sabre on IRC)
llvm-svn: 82603
2009-09-23 02:46:12 +00:00
Chris Lattner 8bcc6445c7 errorstr can be null, don't unconditionally set it. Only report that
"the jit has not been linked in" if the interpreter failed.

This fixes a unit test failure.

llvm-svn: 82601
2009-09-23 02:03:49 +00:00
Chris Lattner 41fa2bd112 Make EngineBuilder return more error codes, by KS Sreeram.
llvm-svn: 82600
2009-09-23 01:46:04 +00:00
Dan Gohman c0353bfff5 Give MachineMemOperand an operator<<, factoring out code from
two different places for printing MachineMemOperands.

Drop the virtual from Value::dump and instead give Value a
protected virtual hook that can be overridden by subclasses
to implement custom printing. This lets printing be more
consistent, and simplifies printing of PseudoSourceValue
values.

llvm-svn: 82599
2009-09-23 01:33:16 +00:00
Dan Gohman 1439957928 Fix X86's unfoldMemoryOperand to properly handle MachineMemOperands.
llvm-svn: 82597
2009-09-23 01:29:41 +00:00
Mike Stump 8808063181 This is overly constraining with respect to clang.
llvm-svn: 82591
2009-09-23 00:13:30 +00:00
Erick Tryzelaar 21e83eab3f Add examples for Kaleidoscope chapters 2 through 6.
Conflicts:

	examples/Makefile

llvm-svn: 82574
2009-09-22 21:15:19 +00:00
Erick Tryzelaar 2d8813cfb0 Rename Kaleidoscope to show that it's for Chapter 7 of the tutorial.
llvm-svn: 82573
2009-09-22 21:15:00 +00:00
Erick Tryzelaar 6e2b34bc14 Sync c++ kaleidoscope tutorial with test.
llvm-svn: 82572
2009-09-22 21:14:49 +00:00
Devang Patel 320a1c4083 Add SetLocation() to allow IRBuilder user to set location info for an instruction already created.
llvm-svn: 82570
2009-09-22 20:56:31 +00:00
Devang Patel 276b02b325 Check exisiting dbg MDKind first.
llvm-svn: 82568
2009-09-22 20:54:13 +00:00
Victor Hernandez ddc2ce4fe2 No need to verify that malloc's return type is i8*.
llvm-svn: 82561
2009-09-22 18:50:03 +00:00
David Goodwin 74b79566f6 Use early returns.
llvm-svn: 82554
2009-09-22 16:47:52 +00:00
Daniel Dunbar 7e3aa3f68c Revert "Don't allow formatted_ostream to be unbuffered, even if its underlying
buffer", while we work out a solution.

Dan convinced me that making debugging annoying for him is worse than 10x being
slower for me. :)

llvm-svn: 82553
2009-09-22 16:33:42 +00:00
Daniel Dunbar b2942cb5cb ... missed hiding a variable for MSVC only.
llvm-svn: 82552
2009-09-22 16:10:35 +00:00
Daniel Dunbar 1bdedd3876 Hide MSVC specific CRT interaction behind _MSC_VER.
llvm-svn: 82551
2009-09-22 15:58:35 +00:00
Mikhail Glushenkov 88e98fec70 Remove the GetProcessId() call from Win32/Program.inc, take 2.
GetProcessId() was introduced only in Windows XP, and we want to support earlier
versions.

llvm-svn: 82548
2009-09-22 15:40:32 +00:00