Commit Graph

44001 Commits

Author SHA1 Message Date
Duncan Sands 230c35eda2 Get this building with gcc-4.4.
llvm-svn: 62322
2009-01-16 15:54:57 +00:00
Duncan Sands 35e43c12f1 Grammar fix.
llvm-svn: 62319
2009-01-16 09:29:46 +00:00
Mikhail Glushenkov 6e8d814d36 Registry.h should not depend on CommandLine.h.
Split Support/Registry.h into two files so that we have less to
recompile every time CommandLine.h is changed.

llvm-svn: 62312
2009-01-16 07:02:28 +00:00
Evan Cheng 2d9e40ed24 This is now passing.
llvm-svn: 62308
2009-01-16 06:59:14 +00:00
Mikhail Glushenkov b2f9a73029 Delete trailing whitespace.
llvm-svn: 62307
2009-01-16 06:53:46 +00:00
Sanjiv Gupta 3227928eeb Reverting back 62301.
llvm-svn: 62304
2009-01-16 05:06:35 +00:00
Sanjiv Gupta 30bd194504 Few targets do not have a single directive to emit global constants.
For example, PIC16 needs to break a long or int constant into mulitple parts and emit multiple directives. So Allow targets to overried EmitConstantValueOnly().

llvm-svn: 62301
2009-01-16 02:45:46 +00:00
Evan Cheng d243c0e3d9 ARMCompilationCallback should not save / restore vfp registers if vfp is not available.
llvm-svn: 62299
2009-01-16 02:16:37 +00:00
Devang Patel e067a7988c Validate debug info values only if DwarfDebug is initialized.
llvm-svn: 62298
2009-01-16 02:15:14 +00:00
Evan Cheng beac6f8b0c Clean up previous cast optimization a bit. Also make zext elimination a bit more aggressive: if it's not necessary to emit an AND (i.e. high bits are already zero), it's profitable to evaluate the operand at a different type.
llvm-svn: 62297
2009-01-16 02:11:43 +00:00
Dan Gohman 3e35fe8968 Add support for instructions with multiple ComplexPatterns, by
adding more information to the temporary variables names so that
they don't conflict.

llvm-svn: 62296
2009-01-16 02:05:52 +00:00
Devang Patel 32fed1c0ef Any debug info symbol is only valid if atleast one compile unit is seen.
llvm-svn: 62294
2009-01-16 01:49:46 +00:00
Dan Gohman ceac7c34f1 Initial hazard recognizer support in post-pass scheduling. This includes
a new toy hazard recognizier heuristic which attempts to direct the
scheduler to avoid clumping large groups of loads or stores too densely.

llvm-svn: 62291
2009-01-16 01:33:36 +00:00
Devang Patel fa1b408b3b Do not stumble over forward declared struct member.
llvm-svn: 62288
2009-01-16 00:50:53 +00:00
Devang Patel 76d190cf4a Validate dbg_* intrinsics before lowering them.
llvm-svn: 62286
2009-01-15 23:41:32 +00:00
Mon P Wang e248edff1b Added missing support to widen an operand from a bit convert.
llvm-svn: 62285
2009-01-15 22:43:38 +00:00
Dan Gohman 7e105f0b12 Generalize the HazardRecognizer interface so that it can be used
to support MachineInstr-based scheduling in addition to
SDNode-based scheduling.

llvm-svn: 62284
2009-01-15 22:18:12 +00:00
Dan Gohman 79618d1de8 Simplify the MachineLICM pass by having it only traverse outer
loops, hoisting instructions all the way out in one step rather
than hoisting them one nest level at a time. Also, make a few
other code simplifications. This speeds up MachineLICM
by several fold.

llvm-svn: 62283
2009-01-15 22:01:38 +00:00
Rafael Espindola f2831d6cd1 Fix Alpha test and support for private linkage.
llvm-svn: 62282
2009-01-15 21:51:46 +00:00
Mon P Wang ebfafee903 Expand insert/extract of a <4 x i32> with a variable index.
llvm-svn: 62281
2009-01-15 21:10:20 +00:00
Rafael Espindola 6de96a1b5d Add the private linkage.
llvm-svn: 62279
2009-01-15 20:18:42 +00:00
Devang Patel 851cdaf1fd Use lightweight DebugInfo objects directly.
llvm-svn: 62276
2009-01-15 19:26:23 +00:00
Dan Gohman 619ef48a52 Move a few containers out of ScheduleDAGInstrs::BuildSchedGraph
and into the ScheduleDAGInstrs class, so that they don't get
destructed and re-constructed for each block. This fixes a
compile-time hot spot in the post-pass scheduler.

To help facilitate this, tidy and do some minor reorganization
in the scheduler constructor functions.

llvm-svn: 62275
2009-01-15 19:20:50 +00:00
Nuno Lopes 04fe2f0a95 add comment to explain my previous commit, as asked by Chris
llvm-svn: 62272
2009-01-15 18:40:57 +00:00
Gabor Greif 5aa1922614 avoid using iterators when they get invalidated potentially
this fixes PR3332

llvm-svn: 62271
2009-01-15 18:40:09 +00:00
Devang Patel 8bdc698336 Use variable's context to identify respective DbgScope.
Use light weight DebugInfo object directly.

llvm-svn: 62269
2009-01-15 18:25:17 +00:00
Dan Gohman dbb22a4483 Add load-folding table entries for BT*ri8 instructions.
llvm-svn: 62267
2009-01-15 17:57:09 +00:00
Dan Gohman 307954ac69 Make getWidenVectorType const; this file was missed in the
previous commit.

llvm-svn: 62266
2009-01-15 17:39:39 +00:00
Dan Gohman 0ad43ca6e5 Make getWidenVectorType const.
llvm-svn: 62265
2009-01-15 17:34:08 +00:00
Evan Cheng ff716cb342 Eliminate a redundant check.
llvm-svn: 62264
2009-01-15 17:09:07 +00:00
Evan Cheng 60e19a46f2 - Teach CanEvaluateInDifferentType of this xform: sext (zext ty1), ty2 -> zext ty2
- Looking at the number of sign bits of the a sext instruction to determine  whether new trunc + sext pair should be added when its source is being evaluated in a different type.

llvm-svn: 62263
2009-01-15 17:01:23 +00:00
Dan Gohman 91febd1330 More consts on TargetLowering references.
llvm-svn: 62262
2009-01-15 16:58:17 +00:00
Dan Gohman 4bdf021e05 Use const with TargetLowering references in a few more places.
llvm-svn: 62260
2009-01-15 16:43:02 +00:00
Dan Gohman 02b93136e9 Const-qualify getPreIndexedAddressParts and friends.
llvm-svn: 62259
2009-01-15 16:29:45 +00:00
Richard Osborne 40119780a8 Don't fold address calculations which use negative offsets into
the ADDRspii addressing mode.

llvm-svn: 62258
2009-01-15 11:32:30 +00:00
Richard Osborne 502b91a35c Update the operands used when building LDAWSP instructions to match the .td
changes in the last commit.

llvm-svn: 62257
2009-01-15 11:18:53 +00:00
Gabor Greif 08a4c281cb minor refactoring: use a more specific API
llvm-svn: 62256
2009-01-15 11:10:44 +00:00
Scott Michel a292fc6d6b - Convert remaining i64 custom lowering into custom instruction emission
sequences in SPUDAGToDAGISel.cpp and SPU64InstrInfo.td, killing custom
  DAG node types as needed.
- i64 mul is now a legal instruction, but emits an instruction sequence
  that stretches tblgen and the imagination, as well as violating laws of
  several small countries and most southern US states (just kidding, but
  looking at a function with 80+ parameters is really weird and just plain
  wrong.)
- Update tests as needed.

llvm-svn: 62254
2009-01-15 04:41:47 +00:00
Mikhail Glushenkov bc39dff6e5 Some small documentation fixes.
llvm-svn: 62251
2009-01-15 02:42:40 +00:00
Mikhail Glushenkov bf78b20490 Clarify the documentation a bit.
llvm-svn: 62249
2009-01-15 02:04:54 +00:00
Chris Lattner 8fb9480ed2 Fix PR3325, a miscompilation of invokes by IPSCCP. Patch by Jay Foad!
llvm-svn: 62244
2009-01-14 21:01:16 +00:00
Devang Patel 08e5e62f98 xfail for now.
llvm-svn: 62243
2009-01-14 20:10:24 +00:00
Richard Osborne 4359325ba8 Add pseudo instructions to the XCore for (load|store|load address) of a
frame index. eliminateFrameIndex will replace these instructions with
(LDWSP|STWSP|LDAWSP) or (LDW|STW|LDAWF) if a frame pointer is in use.

This fixes PR 3324. Previously we used LDWSP, STWSP, LDAWSP before frame
pointer elimination. However since they were marked as implicitly using
SP they could not be rematerialised.

llvm-svn: 62238
2009-01-14 18:26:46 +00:00
Nuno Lopes 0971e77529 fix crash in the case when some arg is null
llvm-svn: 62236
2009-01-14 17:51:41 +00:00
Gabor Greif 191812fe08 minor simplification
llvm-svn: 62232
2009-01-14 17:09:04 +00:00
Dale Johannesen 1f0e0e7c9c Fix the time regression I introduced in 464.h264ref with
my earlier patch to this file.

The issue there was that all uses of an IV inside a loop
are actually references to Base[IV*2], and there was one
use outside that was the same but LSR didn't see the base
or the scaling because it didn't recurse into uses outside
the loop; thus, it used base+IV*scale mode inside the loop
instead of pulling base out of the loop.  This was extra bad
because register pressure later forced both base and IV into
memory.  Doing that recursion, at least enough
to figure out addressing modes, is a good idea in general;
the change in AddUsersIfInteresting does this.  However,
there were side effects....

It is also possible for recursing outside the loop to
introduce another IV where there was only 1 before (if
the refs inside are not scaled and the ref outside is).
I don't think this is a common case, but it's in the testsuite.
It is right to be very aggressive about getting rid of
such introduced IVs (CheckForIVReuse and the handling of
nonzero RewriteFactor in StrengthReduceStridedIVUsers).
In the testcase in question the new IV produced this way
has both a nonconstant stride and a nonzero base, neither
of which was handled before.  And when inserting 
new code that feeds into a PHI, it's right to put such 
code at the original location rather than in the PHI's 
immediate predecessor(s) when the original location is outside 
the loop (a case that couldn't happen before)
(RewriteInstructionToUseNewBase); better to avoid making
multiple copies of it in this case.

Also, the mechanism for keeping SCEV's corresponding to GEP's
no longer works, as the GEP might change after its SCEV
is remembered, invalidating the SCEV, and we might get a bad
SCEV value when looking up the GEP again for a later loop.  
This also couldn't happen before, as we weren't recursing
into GEP's outside the loop.

Also, when we build an expression that involves a (possibly
non-affine) IV from a different loop as well as an IV from
the one we're interested in (containsAddRecFromDifferentLoop),
don't recurse into that.  We can't do much with it and will
get in trouble if we try to create new non-affine IVs or something.

More testcases are coming.

llvm-svn: 62212
2009-01-14 02:35:31 +00:00
Mikhail Glushenkov 66068b3baf Make -o a prefix option.
Both 'llvmc -o file' and 'llvmc -ofile' should work.

llvm-svn: 62211
2009-01-14 02:02:16 +00:00
Devang Patel dedd3e1e14 Do not construct debug scope if RootScope *is* null.
llvm-svn: 62209
2009-01-14 01:34:32 +00:00
Ted Kremenek adeeb1af44 Add member template MallocAllocator::Allocate(Num) (to match the same function in BumpPtrAllocator).
llvm-svn: 62202
2009-01-14 00:38:21 +00:00
Chris Lattner 2538eb664c rewrite OptimizeAwayTrappingUsesOfLoads to 1) avoid a temporary
vector and extraneous loop over it, 2) not delete globals used by
phis/selects etc which could actually be useful.  This fixes PR3321.
Many thanks to Duncan for narrowing this down.

llvm-svn: 62201
2009-01-14 00:12:58 +00:00
Devang Patel 3c82aa0209 Removoe MachineModuleInfo methods (and related DebugInfoDesc class hierarchy) that were used to handle debug info.
llvm-svn: 62199
2009-01-13 23:54:55 +00:00
Nuno Lopes b0a78f8fa1 fix memleaks
llvm-svn: 62198
2009-01-13 23:35:49 +00:00
Dan Gohman a63bede3c6 BT appears to be available on all >= i386 chips.
llvm-svn: 62196
2009-01-13 23:27:15 +00:00
Dan Gohman d3942af5cb Don't use a BT instruction if the AND has multiple uses.
llvm-svn: 62195
2009-01-13 23:25:30 +00:00
Dan Gohman b8f5ba6781 Disable the register+memory forms of the bt instructions for now. Thanks
to Eli for pointing out that these forms don't ignore the high bits of
their index operands, and as such are not immediately suitable for use
by isel.

llvm-svn: 62194
2009-01-13 23:23:30 +00:00
Devang Patel 7b13aeedea Keep "has debug info" big in MachineModuleInfo to avoid circular dependency between AsmPrinter and CodeGen.
llvm-svn: 62191
2009-01-13 23:02:17 +00:00
Devang Patel fe9581f0cd Undo previous checkin.
llvm-svn: 62190
2009-01-13 22:54:57 +00:00
Dale Johannesen 0aeabdff57 Fix testsuite regressions from recursive inlining.
llvm-svn: 62189
2009-01-13 22:43:37 +00:00
Devang Patel dd25a9d0aa Use DwarfWriter to record dbg variables.
llvm-svn: 62185
2009-01-13 21:44:10 +00:00
Devang Patel ca997988c3 Use dwarf writer to decide whether the module has debug info or not.
llvm-svn: 62184
2009-01-13 21:25:00 +00:00
Dan Gohman 0fdf71cb9d Add bt instructions that take immediate operands.
llvm-svn: 62180
2009-01-13 20:33:23 +00:00
Dan Gohman eb2591bbdd Fix a few more JIT encoding issues in the BT instructions.
llvm-svn: 62179
2009-01-13 20:32:45 +00:00
Dan Gohman 5d4afb7bd9 Use assertions to check for conditions that should never happen.
llvm-svn: 62178
2009-01-13 20:25:24 +00:00
Dan Gohman 1407484178 The list-td and list-tdrr schedulers don't yet support physreg
scheduling dependencies. Add assertion checks to help catch
this.

It appears the Mips target defaults to list-td, and it has a
regression test that uses a physreg dependence. Such code was
liable to be miscompiled, and now evokes an assertion failure.

llvm-svn: 62177
2009-01-13 20:24:13 +00:00
Dan Gohman 59af77376c Make instcombine ensure that all allocas are explicitly aligned at at
least their preferred alignment.

llvm-svn: 62176
2009-01-13 20:18:38 +00:00
Sanjiv Gupta 45da8b779c Checking in conditionals, function call, arrays and libcalls implementation.
llvm-svn: 62174
2009-01-13 19:18:47 +00:00
Dan Gohman 13141d5538 Avoid referring to edge D after the Succs or Preds arrays have
been modified, to avoid trouble in the (unlikely) scenario that
D is a reference to an element in one of those arrays.

llvm-svn: 62173
2009-01-13 19:08:45 +00:00
Duncan Sands ffc6133318 When replacing uses and the same node is reached
via two paths, process it once not twice, d'oh!
Analysis, testcase and original patch thanks to
Mon Ping Wang.

llvm-svn: 62169
2009-01-13 15:17:14 +00:00
Duncan Sands ab2fd9e4b9 Mark this XFAIL for the moment.
llvm-svn: 62168
2009-01-13 15:15:46 +00:00
Duncan Sands 90d2a7bd72 Fix some typos. Also, the WidenedVectors map
was not being cleaned by ExpungeNode.

llvm-svn: 62167
2009-01-13 14:42:39 +00:00
Duncan Sands 013be76241 Correct a comment - this is not a sign extension.
llvm-svn: 62166
2009-01-13 14:04:14 +00:00
Duncan Sands 944ccc5d6a Correct a comment.
llvm-svn: 62165
2009-01-13 13:48:44 +00:00
Nick Lewycky 52348300a4 Wind SCEV back in time, to Nov 18th. This 'fixes' PR3275, PR3294, PR3295,
PR3296 and PR3302.

llvm-svn: 62160
2009-01-13 09:18:58 +00:00
Chris Lattner 6e66d0a6a1 add a new insertAfter method, patch by Tom Jablin!
llvm-svn: 62158
2009-01-13 07:43:51 +00:00
Chris Lattner 1a579351d2 make -march=cpp handle the nocapture attribute, make it assert if it
sees attributes it doesn't know.

llvm-svn: 62155
2009-01-13 07:22:22 +00:00
Evan Cheng 4f9c47aab9 Un-tabify.
llvm-svn: 62151
2009-01-13 06:08:37 +00:00
Owen Anderson b282d1b6ff Fix fallout from r62144. Evan, please double check this.
llvm-svn: 62150
2009-01-13 06:05:10 +00:00
Evan Cheng f343168f1f FIX llvm-gcc bootstrap on x86_64 linux. If a virtual register is copied to a physical register, it's not necessarily defined by a copy. We have to watch out it doesn't clobber any sub-register that might be live during its live interval. If the live interval crosses a basic block, then it's not safe to check with the less conservative check (by scanning uses and defs) because it's possible a sub-register might be live out of the block.
llvm-svn: 62144
2009-01-13 03:57:45 +00:00
Devang Patel 5c6e1e3b7d Use DebugInfo interface to lower dbg_* intrinsics.
llvm-svn: 62127
2009-01-13 00:35:13 +00:00
Devang Patel 76007e009e Use DebugInfo interface to lower dbg_* intrinsics.
llvm-svn: 62126
2009-01-13 00:32:17 +00:00
Devang Patel f3456e8f07 Start using DebugInfo API to emit debug info.
llvm-svn: 62125
2009-01-13 00:20:51 +00:00
Dan Gohman 3065b6169f Document several current CodeGen limitations in LangRef.html.
Patches for any of these are welcome!

llvm-svn: 62120
2009-01-12 23:12:39 +00:00
Devang Patel 243b4add9a Emit debug info, only if at least one compile unit is seen.
llvm-svn: 62118
2009-01-12 23:09:42 +00:00
Devang Patel b71fbeb19f If multiple compile units are seen then emit them independently. In other words, do not force all DIEs into first, whatever it is, compile unit.
Note, multiple compile unit support is not well tested (it did not work correctly until now anyway.)

llvm-svn: 62116
2009-01-12 23:05:55 +00:00
Devang Patel 4aa4128ced Avoid cast<>, use light weith wrapper directly.
llvm-svn: 62115
2009-01-12 22:58:14 +00:00
Devang Patel 4223582f00 Use SrcLineInfo from DwarfWriter. The MachineModuleInfo copy will disappear soon.
llvm-svn: 62114
2009-01-12 22:54:42 +00:00
Dale Johannesen 433a9086c0 Enable recursive inlining. Reduce inlining threshold
back to 200; 400 seems to be too high, loses more than
it gains.

llvm-svn: 62107
2009-01-12 22:11:50 +00:00
Devang Patel 45d2cfd064 Add classof() methods to support isa<> and other related facilities.
llvm-svn: 62104
2009-01-12 21:38:43 +00:00
Dan Gohman 33a9cef204 The LLVM Assembly Language Reference incorrectly stated that the
prefix used for dll{import,export} is _imp__; it is actually __imp_.
Patch by Mahadevan R!

llvm-svn: 62103
2009-01-12 21:35:55 +00:00
Dan Gohman 87bc800384 Fix the instructions to work even when PATH does not contain ".".
Thanks to Martin Geisse for pointing this out!

llvm-svn: 62102
2009-01-12 21:29:24 +00:00
Duncan Sands dc020f9c3c Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.

llvm-svn: 62099
2009-01-12 20:38:59 +00:00
Devang Patel df31a7256d Add DwarfWriter interface to mainipulate source location info.
( May be this info should be directly handled by the dwarf writer ? )

llvm-svn: 62096
2009-01-12 19:17:34 +00:00
Chris Lattner ecbe933d6a remove some dead options.
llvm-svn: 62095
2009-01-12 19:02:50 +00:00
Devang Patel f033d53264 Clear debug info at the end of function processing.
llvm-svn: 62092
2009-01-12 18:48:36 +00:00
Devang Patel 5daa1abf25 There is no need to maintain separate labelid list in the dwarf writer. It is not a good idea.
llvm-svn: 62090
2009-01-12 18:41:00 +00:00
Rafael Espindola 6919ab4d05 Remove some dead code from the days llvm had type planes.
There might be more dead code, but with llvm-gcc bootstrap broken on linux x86-64 it is had to test :-(

llvm-svn: 62088
2009-01-12 15:53:25 +00:00
Evan Cheng 2adb5cfb48 Second test is only valid in 32-bit mode.
llvm-svn: 62084
2009-01-12 08:05:54 +00:00
Evan Cheng 0258874607 Test for r62076.
llvm-svn: 62077
2009-01-12 03:46:55 +00:00
Evan Cheng b2c42c648d Fix PR3241: Currently EmitCopyFromReg emits a copy from the physical register to a virtual register unless it requires an expensive cross class copy. That means we are only treating "expensive to copy" register dependency as physical register dependency.
Also future proof the scheduler to handle "normal" physical register dependencies. The code is not exercised yet.

llvm-svn: 62074
2009-01-12 03:19:55 +00:00
Owen Anderson 45cfef2cb6 More two-address fixes. This gets lua working with join-creation enabled.
llvm-svn: 62073
2009-01-12 03:10:40 +00:00
Chris Lattner 2089cd09ba make tblgen autogenerate the nocapture intrinsics for
llvm.memcpy/memset/memmove.  This allows removal of some 
hackish code from basicaa.

llvm-svn: 62071
2009-01-12 02:41:37 +00:00
Chris Lattner 9d0a8770bd add scaffolding to emit argument attributes. No functionality
change.

llvm-svn: 62067
2009-01-12 01:27:55 +00:00
Chris Lattner 49b7ee1b50 make tblgen emit the entire Intrinsic::getAttributes method,
not a random piece of it.  No functionality change.

llvm-svn: 62066
2009-01-12 01:18:58 +00:00
Chris Lattner 9a3113aeb8 add nocapture attribute to llvm.mem* intrinsics and have tblgen
parse them.  tblgen doesn't yet do anything with this info though.

llvm-svn: 62065
2009-01-12 01:12:03 +00:00
Dale Johannesen f84685290a Increase default inlining aggressiveness in partial
compensation for turning off gcc's inliner.  This gets
us closer to the amount of inlining we were getting before.
It is not a win on everything, of course, but seems to
gain overall.

llvm-svn: 62058
2009-01-11 23:11:00 +00:00
Gabor Greif 9722023df8 drats! remove tabs
llvm-svn: 62056
2009-01-11 22:39:04 +00:00
Gabor Greif 1b9921af34 simplify CallSite helper class to not consult the Instruction's
opcode on each delegation.
Instead the information is cached on construction and the cached flag used thereafter.
Introduced two predicates: isCall and isInvoke.

llvm-svn: 62055
2009-01-11 22:33:22 +00:00
Chris Lattner bc088218e6 Implement PR3313, and while I'm at it address a very FAQ.
llvm-svn: 62048
2009-01-11 20:53:49 +00:00
Chris Lattner bd3c7c8b52 Duncan is nervous about undefinedness of % with negatives. I'm
not thrilled about 64-bit % in general, so rewrite to use * instead.

llvm-svn: 62047
2009-01-11 20:41:36 +00:00
Chris Lattner b19151686f do not generated GEPs into vectors where they don't already exist.
We should treat vectors as atomic types, not like arrays.

llvm-svn: 62046
2009-01-11 20:23:52 +00:00
Chris Lattner 171d2d474f Make a couple of cleanups to the instcombine bitcast/gep
canonicalization transform based on duncan's comments:

1) improve the comment about %.
2) within our index loop make sure the offset stays 
   within the *type size*, instead of within the *abi size*.
   This allows us to reason explicitly about landing in tail
   padding and means that issues like non-zero offsets into
   [0 x foo] types don't occur anymore.

llvm-svn: 62045
2009-01-11 20:15:20 +00:00
Nick Lewycky 93787d1262 Use the spiffy new getAlignmentFromAttrs function.
llvm-svn: 62039
2009-01-11 17:02:06 +00:00
Evan Cheng e3108148e2 CheckForPhysRegDependency should not return copy cost. It's not used. No functionality change.
llvm-svn: 62036
2009-01-11 08:53:35 +00:00
Bill Wendling 8d069ef872 Fix naming of file.
llvm-svn: 62035
2009-01-11 01:25:51 +00:00
Dan Gohman aaa679b270 Fix the example syntax for named sections.
llvm-svn: 62033
2009-01-11 00:40:00 +00:00
Evan Cheng 8e7d88b916 This is a dup of pr2659.ll.
llvm-svn: 62029
2009-01-10 19:06:32 +00:00
Bill Wendling c56c37f039 Adding unittests for SmallVector. Test by Talin.
llvm-svn: 62025
2009-01-10 12:56:31 +00:00
Evan Cheng 5a272e79e5 80 col violation.
llvm-svn: 62024
2009-01-10 03:33:22 +00:00
Devang Patel af7d04207c Reduce initial small vector sizes.
llvm-svn: 62023
2009-01-10 02:42:49 +00:00
Devang Patel 5491f25810 Fix thinko. Create parent scope if parent descriptor is *not* null.
llvm-svn: 62022
2009-01-10 02:34:18 +00:00
Evan Cheng ed74d8ac2a Duplicated node may produce a non-physical register def.
llvm-svn: 62015
2009-01-09 22:44:02 +00:00
Evan Cheng c1f5a659de Add test case from PR2659.
llvm-svn: 62006
2009-01-09 21:01:31 +00:00
Evan Cheng 0c4fe2600a Minor debug output tweak.
llvm-svn: 62005
2009-01-09 20:42:34 +00:00
Misha Brukman b302377dc3 This has been replaced by llvm/utils/lint/cpp_lint.py, which is more
comprehensive and can support more complex style analysis.

llvm-svn: 62002
2009-01-09 19:46:41 +00:00
Misha Brukman 06b9ee567b Removed trailing whitespace.
llvm-svn: 62000
2009-01-09 19:25:42 +00:00
Devang Patel 235acaa131 Request DwarfWriter. This will be used to handle dbg_* intrinsics.
llvm-svn: 61999
2009-01-09 19:11:50 +00:00
Chris Lattner 5f54d50917 fix typo Duncan noticed.
llvm-svn: 61997
2009-01-09 18:31:39 +00:00
Chris Lattner ae0e857b98 Fix PR3304
llvm-svn: 61995
2009-01-09 18:18:43 +00:00
Misha Brukman 5cbf223916 Removed trailing whitespace from Makefiles.
llvm-svn: 61991
2009-01-09 16:44:42 +00:00
Mikhail Glushenkov 726440dbc9 Support llvmc plugins in out-of-tree projects.
llvm-svn: 61990
2009-01-09 16:31:01 +00:00
Mikhail Glushenkov 0f88cfa2ac Add a --check-graph option to llvmc.
llvm-svn: 61989
2009-01-09 16:16:27 +00:00
Dan Gohman ea1086b7f2 PR2659 was fixed by r61847. Add the testcase as a regression test.
llvm-svn: 61986
2009-01-09 08:16:12 +00:00
Chris Lattner f50aa6ae5c Implement rdar://6480391, extending of equality icmp's to avoid a truncation.
I noticed this in the code compiled for a routine using std::map, which produced
this code:
	%25 = tail call i32 @memcmp(i8* %24, i8* %23, i32 6) nounwind readonly
	%.lobit.i = lshr i32 %25, 31		; <i32> [#uses=1]
	%tmp.i = trunc i32 %.lobit.i to i8		; <i8> [#uses=1]
	%toBool = icmp eq i8 %tmp.i, 0		; <i1> [#uses=1]
	br i1 %toBool, label %bb3, label %bb4
which compiled to:

	call	L_memcmp$stub
	shrl	$31, %eax
	testb	%al, %al
	jne	LBB1_11	## 

with this change, we compile it to:

	call	L_memcmp$stub
	testl	%eax, %eax
	js	LBB1_11

This triggers all the time in common code, with patters like this:

	%169 = and i32 %ply, 1		; <i32> [#uses=1]
	%170 = trunc i32 %169 to i8		; <i8> [#uses=1]
	%toBool = icmp ne i8 %170, 0		; <i1> [#uses=1]

 	%7 = lshr i32 %6, 24		; <i32> [#uses=1]
	%9 = trunc i32 %7 to i8		; <i8> [#uses=1]
	%10 = icmp ne i8 %9, 0		; <i1> [#uses=1]

etc

llvm-svn: 61985
2009-01-09 07:47:06 +00:00
Chris Lattner 0f7cf1d7e1 Remove some old code that looks like a remanant from signed-types days.
llvm-svn: 61984
2009-01-09 07:10:58 +00:00
Chris Lattner 482eb70a10 Fix PR3298, a crash in Jump Threading. Apparently even
jump threading can have bugs, who knew? ;-)

llvm-svn: 61983
2009-01-09 06:08:12 +00:00
Chris Lattner d48d1ec320 this doesn't depend on the gcc early inliner anymore.
llvm-svn: 61982
2009-01-09 05:49:27 +00:00
Chris Lattner 7f88a1b512 PR3290 is now fixed.
llvm-svn: 61981
2009-01-09 05:46:19 +00:00
Chris Lattner fef138b140 Fix part 3/2 of PR3290, making instcombine zap (gep(bitcast)) when possible.
llvm-svn: 61980
2009-01-09 05:44:56 +00:00
Chris Lattner 9170731cb7 this test should not run opt -std-compile-opts, it should run
just llc.

llvm-svn: 61979
2009-01-09 05:32:00 +00:00
Chris Lattner 8b80ed7bf7 add a helper method.
llvm-svn: 61978
2009-01-09 05:27:40 +00:00
Chris Lattner 729a21f947 fit in 80 cols
llvm-svn: 61977
2009-01-09 04:58:01 +00:00
Chris Lattner a784a2ce01 move some code, check to see if the input to the GEP is a bitcast
(which is constant time and cheap) before checking hasAllZeroIndices.

llvm-svn: 61976
2009-01-09 04:53:57 +00:00
Dan Gohman bdc0f8b627 Add load-folding table entries for MOVDQA.
llvm-svn: 61972
2009-01-09 02:40:34 +00:00
Dan Gohman e907a0a527 Whitespace and other minor adjustments to make SSE instructions have
the same formatting as their corresponding SSE2 instructions, for
consistency.

llvm-svn: 61971
2009-01-09 02:27:34 +00:00
Dale Johannesen 4755d9df78 Adjustments to last patch based on review.
llvm-svn: 61969
2009-01-09 01:30:11 +00:00
Dan Gohman 68b135cc9c 61949 accidentally introduced an escaped newline. Fix this by making
the comment a little more verbose.

llvm-svn: 61959
2009-01-08 23:51:48 +00:00
Devang Patel f646668799 Convert DwarfWriter into a pass.
Now Users request DwarfWriter through getAnalysisUsage() instead of creating an instance of DwarfWriter object directly.

llvm-svn: 61955
2009-01-08 23:40:34 +00:00
Dan Gohman f87dc9264a Delete unnecessary parens around return values.
llvm-svn: 61950
2009-01-08 22:19:34 +00:00
Dan Gohman 138436f158 Fix the comment for lltok::backslash.
llvm-svn: 61949
2009-01-08 22:18:13 +00:00
Dan Gohman 6031a4353b Fix the path to llvm/Assembly/Parser.h in a comment.
llvm-svn: 61948
2009-01-08 22:17:05 +00:00
Dan Gohman 385d246e0d Correct the form of the atomic opcode names in a comment.
llvm-svn: 61947
2009-01-08 22:14:50 +00:00
Dale Johannesen b48fc71fc6 Do not inline functions with (dynamic) alloca into
functions that don't already have a (dynamic) alloca.
Dynamic allocas cause inefficient codegen and we shouldn't
propagate this (behavior follows gcc).  Two existing tests
assumed such inlining would be done; they are hacked by
adding an alloca in the caller, preserving the point of
the tests.

llvm-svn: 61946
2009-01-08 21:45:23 +00:00
Duncan Sands 715b2897d8 Use mayBeOverridden here, in anticipation of the
day when more linkage types will be handled.

llvm-svn: 61944
2009-01-08 20:55:49 +00:00
Chris Lattner f3e696bc5a ValueTracker can't assume that an alloca with no specified alignment
will get its preferred alignment.  It has to be careful and cautiously assume
it will just get the ABI alignment.  This prevents instcombine from rounding
up the alignment of a load/store without adjusting the alignment of the alloca.

llvm-svn: 61934
2009-01-08 19:28:38 +00:00
Chris Lattner 8c1cc34d6a one more crash from PR3281, we now diagnose:
llvm-as: t.ll:2:39: function may not return opaque type
  %"bwmoyl" = tail call coldcc opaque @g()
                                      ^
llvm-svn: 61933
2009-01-08 19:05:36 +00:00
Chris Lattner 4f6a38e68c remove some exclusions that don't exist anymore.
llvm-svn: 61932
2009-01-08 19:02:03 +00:00
Chris Lattner a2ed32eb4f this testcase is huge and hasn't regressed ever, I don't think it is worth keeping.
llvm-svn: 61931
2009-01-08 19:01:45 +00:00
Devang Patel 65143c537c Add DebugInfo based APIs to record source line info.
llvm-svn: 61928
2009-01-08 17:19:22 +00:00
Misha Brukman 572f2646c2 * Moved author attribution to CREDITS.TXT
* Removed trailing whitespace

llvm-svn: 61927
2009-01-08 16:40:25 +00:00
Misha Brukman da46748ad2 * Alphabetized #includes
* Removed trailing whitespace

llvm-svn: 61926
2009-01-08 15:50:22 +00:00
Bill Wendling 2a6dad5f0f Some generic clean-ups. Also make the StringMapEntryInitializer specialization apply only to the tests that are actually testing it.
llvm-svn: 61923
2009-01-08 09:31:36 +00:00
Bill Wendling 691c20d8fb * Don't explicitly cast "0" to "void*". This doesn't work well with specialized
StringMapEntryInitializer classes. Leave it for the compiler to figure out what
 the type is and what "0" should be transformed into.

* Un-disable the unit tests which test the StringMapEntryInitializer class.

llvm-svn: 61922
2009-01-08 08:26:46 +00:00
Chris Lattner 55927bdccd the new scalarrepl changes are optimizing away a temporary alloca in
check242, which invalidates this test.  This test is an x86-32 ABI test 
that is trying to be run in a target-independent way, which is not going
to work very well.  Just remove the test.

llvm-svn: 61921
2009-01-08 07:58:23 +00:00
Bill Wendling 453b4d5204 80-column violation fix.
llvm-svn: 61919
2009-01-08 07:35:39 +00:00
Chris Lattner 6c2ee50e28 add some more crazy strlen and memcpy stuff I noticed in spec.
llvm-svn: 61918
2009-01-08 07:34:55 +00:00
Chris Lattner 7cb3ae0505 add some notes about strlen craziness in eon.
llvm-svn: 61917
2009-01-08 06:52:57 +00:00
Misha Brukman 669b938d25 Remove extra blank line and space.
llvm-svn: 61916
2009-01-08 06:11:51 +00:00
Chris Lattner c518dfd11b This implements the second half of the fix for PR3290, handling
loads from allocas that cover the entire aggregate.  This handles
some memcpy/byval cases that are produced by llvm-gcc.  This triggers
a few times in kc++ (with std::pair<std::_Rb_tree_const_iterator
<kc::impl_abstract_phylum*>,bool>) and once in 176.gcc (with %struct..0anon).

llvm-svn: 61915
2009-01-08 05:42:05 +00:00
Misha Brukman 017e49897e * Added unittests for StringMap
* Fixed but in StringMap::clear()
* Removed trailing whitespace

Original patch by Talin.

llvm-svn: 61914
2009-01-08 04:48:20 +00:00
Devang Patel 145a7cfa85 Add APIs to record regions and variables.
Again, shamelessly copied from MMI.

llvm-svn: 61912
2009-01-08 02:49:34 +00:00
Devang Patel fbbe93bf68 Add APIs to manage scope using DebugInfo interface.
This is a shameless copy of similar APIs from MachineModuleInfo. The copy from MMI will be deleted in near future.

llvm-svn: 61908
2009-01-08 02:33:41 +00:00
Misha Brukman 44f27da773 * Fixed spelling of "sentinel"
* Removed trailing whitespace

llvm-svn: 61907
2009-01-08 02:21:23 +00:00
Misha Brukman 93bd1ca55e Use VIM's built-in shorthand for whitespace in regex.
llvm-svn: 61906
2009-01-08 02:17:30 +00:00
Misha Brukman 687501fdd4 Be sure to ignore the end-of-line character when considering trailing
whitespace.

llvm-svn: 61905
2009-01-08 02:16:13 +00:00
Misha Brukman 2879c29274 Removed trailing whitespace.
llvm-svn: 61904
2009-01-08 02:11:55 +00:00
Bob Wilson bf43619131 Fix failure messages in Verifier::PerformTypeCheck. The argument numbers
passed in to this function changed to support multiple return values,
leading to some incorrect argument numbers in the failure messages.
With this change, the ArgNo values used for return values and parameters are
disjoint, and the new IntrinsicParam function translates those ArgNo values
to strings that can be used in the messages.  This also fixes a few places
where PerformTypeCheck did not return false following calls to CheckFailed.

llvm-svn: 61903
2009-01-08 01:56:06 +00:00
Oscar Fuentes e0a2cf332c CMake: removed lib/VMCore/DebugInfoBuilder.cpp.
llvm-svn: 61900
2009-01-08 00:18:52 +00:00
Bob Wilson e8a299e90e Assert that VectorType::getTruncatedElementVectorType is not used with
odd bit-width vector elements.  Add a check in the verifier for this also.

llvm-svn: 61899
2009-01-07 23:44:27 +00:00
Chris Lattner 8157cb9ef6 remove DebugInfoBuilder, it has been subsumed by Analysis/DebugInfo.h
llvm-svn: 61898
2009-01-07 23:25:06 +00:00
Misha Brukman b51cdfadda Fix off-by-one error in traversing an array; this fixes a test.
The error was reported by gcc-4.3.0 during compilation.

llvm-svn: 61896
2009-01-07 23:07:29 +00:00
Gabor Greif 6aa83bd459 revert to functionally equivalent formulation
llvm-svn: 61895
2009-01-07 23:07:22 +00:00
Gabor Greif 6ecd6f43b0 use the obvious getters
llvm-svn: 61893
2009-01-07 22:39:29 +00:00
Dan Gohman 261ee6be57 Remove redundant 'else's. No functionality change.
llvm-svn: 61891
2009-01-07 22:30:55 +00:00
Dan Gohman 9157721904 Add empty() methods for register def lists.
llvm-svn: 61890
2009-01-07 22:28:56 +00:00
Misha Brukman 204b1d2268 Minor cleanup for unittest:
* Fixed {copy,assignment} constructor test names
* s/EXPECT_EQ(true, ...)/ASSERT_TRUE(...)/

Patch by Talin.

llvm-svn: 61883
2009-01-07 21:13:53 +00:00
Duncan Sands 0bcf085845 Whitespace - correct formatting.
llvm-svn: 61879
2009-01-07 20:01:06 +00:00
Duncan Sands 289f59f233 Remove alloca tracking from nocapture analysis. Not only
was it not very helpful, it was also wrong!  The problem
is shown in the testcase: the alloca might be passed to
a nocapture callee which dereferences it and returns the
original pointer.  But because it was a nocapture call we
think we don't need to track its uses, but we do.

llvm-svn: 61876
2009-01-07 19:39:06 +00:00
Oscar Fuentes b97e96350f CMake: replace `rm' with portable invocations of cmake.
Based on a bug report by Yonggang Luo.

llvm-svn: 61875
2009-01-07 19:24:44 +00:00
Duncan Sands 94bcbbab74 Reorder these.
llvm-svn: 61873
2009-01-07 19:17:02 +00:00
Duncan Sands 02599850b4 Use a switch rather than a sequence of "isa" tests.
llvm-svn: 61872
2009-01-07 19:10:21 +00:00
Duncan Sands 187c5716b6 The verifier checks that the aliasee is not null.
llvm-svn: 61870
2009-01-07 18:45:53 +00:00
Chris Lattner f2b8c82ad1 Implement the first half of PR3290: if there is a store of an
integer to a (transitive) bitcast the alloca and if that integer
has the full size of the alloca, then it clobbers the whole thing.
Handle this by extracting pieces out of the stored integer and 
filing them away in the SROA'd elements.

This triggers fairly frequently because the CFE uses integers to
pass small structs by value and the inliner exposes these.  For 
example, in kimwitu++, I see a bunch of these with i64 stores to
"%struct.std::pair<std::_Rb_tree_const_iterator<kc::impl_abstract_phylum*>,bool>"

In 176.gcc I see a few i32 stores to "%struct..0anon".

In the testcase, this is a difference between compiling test1 to:

_test1:
	subl	$12, %esp
	movl	20(%esp), %eax
	movl	%eax, 4(%esp)
	movl	16(%esp), %eax
	movl	%eax, (%esp)
	movl	(%esp), %eax
	addl	4(%esp), %eax
	addl	$12, %esp
	ret

vs:

_test1:
	movl	8(%esp), %eax
	addl	4(%esp), %eax
	ret

The second half of this will be to handle loads of the same form.

llvm-svn: 61853
2009-01-07 08:11:13 +00:00
Chris Lattner 9a2de65fd6 Factor a bunch of code out into a helper method.
llvm-svn: 61852
2009-01-07 07:18:45 +00:00
Chris Lattner db561146aa use continue to simplify code and reduce nesting, no functionality
change.

llvm-svn: 61851
2009-01-07 06:39:58 +00:00
Chris Lattner 938b54f383 Get TargetData once up front and cache as an ivar instead of
requerying it all over the place.

llvm-svn: 61850
2009-01-07 06:34:28 +00:00
Chris Lattner a63dba9e6c Use the hasAllZeroIndices predicate to simplify some
code, no functionality change.

llvm-svn: 61849
2009-01-07 06:25:07 +00:00
Evan Cheng f6768bd9cb The coalescer does not coalesce a virtual register to a physical register if any of the physical register's sub-register live intervals overlaps with the virtual register. This is overly conservative. It prevents a extract_subreg from being coalesced away:
v1024 = EDI  // not killed
      =
      = EDI

One possible solution is for the coalescer to examine the sub-register live intervals in the same manner as the physical register. Another possibility is to examine defs and uses (when needed) of sub-registers. Both solutions are too expensive. For now, look for "short virtual intervals" and scan instructions to look for conflict instead.

This is a small win on x86-64. e.g. It shaves 403.gcc by ~80 instructions.

llvm-svn: 61847
2009-01-07 02:08:57 +00:00
Chris Lattner 4687432d03 add a testcase.
llvm-svn: 61845
2009-01-07 01:48:08 +00:00
Dan Gohman 8e8d1da35a Add patterns to match conditional moves with loads folded
into their left operand, rather than their right. Do this
by commuting the operands and inverting the condition.

llvm-svn: 61842
2009-01-07 01:00:24 +00:00
Dan Gohman 1e6e9a8b9b Add load-folding table entries for cmovno too.
llvm-svn: 61841
2009-01-07 00:44:53 +00:00