oota-llvm.git
15 years agoFix a typo.
Dan Gohman [Mon, 15 Jun 2009 18:22:49 +0000 (18:22 +0000)]
Fix a typo.

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

15 years agoglibc has two versions of strerror_r, a standards compliant one and a GNU
Dan Gohman [Mon, 15 Jun 2009 18:05:46 +0000 (18:05 +0000)]
glibc has two versions of strerror_r, a standards compliant one and a GNU
specific one. The GNU one is chosen when _GNU_SOURCE is defined. g++ always
defines _GNU_SOURCE on linux platforms because glibc's headers won't compile
in C++ mode without it. The GNU strerror_r doesn't always modify the buffer
which causes empty error messages on linux.

This patch changes MakeErrMsg to use the return value of strerror_r to get
the string instead of assuming the buffer will be modified, on GLIBC.

Patch by Benjamin Kramer!

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

15 years agoReword the description of the noredzone attribute.
Dan Gohman [Mon, 15 Jun 2009 17:37:09 +0000 (17:37 +0000)]
Reword the description of the noredzone attribute.

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

15 years agoCheckTailCallReturnConstraints is missing a check on the
Arnold Schwaighofer [Mon, 15 Jun 2009 14:43:36 +0000 (14:43 +0000)]
CheckTailCallReturnConstraints is missing a check on the
incomming chain of the RETURN node. The incomming chain must
be the outgoing chain of the CALL node. This causes the
backend to identify tail calls that are not tail calls. This
patch fixes this.

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

15 years agox86_64 was completely missing from the target triples supported by the X86 code
Torok Edwin [Mon, 15 Jun 2009 12:17:44 +0000 (12:17 +0000)]
x86_64 was completely missing from the target triples supported by the X86 code
generator!

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

15 years agoRemove the gcc= option. llvm-gcc uses only as=
Rafael Espindola [Mon, 15 Jun 2009 10:14:18 +0000 (10:14 +0000)]
Remove the gcc= option. llvm-gcc uses only as=

Look for as in the path. Doing it here instead
of llvm-gcc because llvm-gcc has nothing as
convenient as sys::Program::FindProgramByName.

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

15 years agoPart 1.
Evan Cheng [Mon, 15 Jun 2009 08:28:29 +0000 (08:28 +0000)]
Part 1.
- Change register allocation hint to a pair of unsigned integers. The hint type is zero (which means prefer the register specified as second part of the pair) or entirely target dependent.
- Allow targets to specify alternative register allocation orders based on allocation hint.

Part 2.
- Use the register allocation hint system to implement more aggressive load / store multiple formation.
- Aggressively form LDRD / STRD. These are formed *before* register allocation. It has to be done this way to shorten live interval of base and offset registers. e.g.
v1025 = LDR v1024, 0
v1026 = LDR v1024, 0
=>
v1025,v1026 = LDRD v1024, 0

If this transformation isn't done before allocation, v1024 will overlap v1025 which means it more difficult to allocate a register pair.

- Even with the register allocation hint, it may not be possible to get the desired allocation. In that case, the post-allocation load / store multiple pass must fix the ldrd / strd instructions. They can either become ldm / stm instructions or back to a pair of ldr / str instructions.

This is work in progress, not yet enabled.

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

15 years agofix testcase to properly check for the patch in r73195.
Chris Lattner [Mon, 15 Jun 2009 05:46:02 +0000 (05:46 +0000)]
fix testcase to properly check for the patch in r73195.

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

15 years ago"This patch implements the method with the GetModuleFileName function for windows."
Chris Lattner [Mon, 15 Jun 2009 05:38:04 +0000 (05:38 +0000)]
"This patch implements the method with the GetModuleFileName function for windows."

Patch by Benjamin Kramer!

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

15 years agoremove extraneous const qualifier
Chris Lattner [Mon, 15 Jun 2009 04:42:32 +0000 (04:42 +0000)]
remove extraneous const qualifier

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

15 years agoI got J and K backward, many thanks to Eli for spotting this!
Chris Lattner [Mon, 15 Jun 2009 04:39:05 +0000 (04:39 +0000)]
I got J and K backward, many thanks to Eli for spotting this!

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

15 years agoremove some old CVS-specific arguments that don't work with SVN.
Chris Lattner [Mon, 15 Jun 2009 04:18:54 +0000 (04:18 +0000)]
remove some old CVS-specific arguments that don't work with SVN.

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

15 years agoadd a new static method to portably determine whether a patch is
Chris Lattner [Mon, 15 Jun 2009 04:17:07 +0000 (04:17 +0000)]
add a new static method to portably determine whether a patch is
absolute or not, based on a patch by Gregory Curfman!

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

15 years agoimplement support for the 'K' asm constraint, PR4347
Chris Lattner [Mon, 15 Jun 2009 04:01:39 +0000 (04:01 +0000)]
implement support for the 'K' asm constraint, PR4347

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

15 years agoFix old-style type names in comments.
Dan Gohman [Sun, 14 Jun 2009 23:30:43 +0000 (23:30 +0000)]
Fix old-style type names in comments.

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

15 years agoImplement more aggressive folding of add operand lists when
Dan Gohman [Sun, 14 Jun 2009 22:58:51 +0000 (22:58 +0000)]
Implement more aggressive folding of add operand lists when
they contain multiplications of constants with add operations.
This helps simplify several kinds of things; in particular it
helps simplify expressions like ((-1 * (%a + %b)) + %a) to %b,
as expressions like this often come up in loop trip count
computations.

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

15 years agoSpecialize DenseMapInfo for SCEVHandle, so that SCEVHandles can be
Dan Gohman [Sun, 14 Jun 2009 22:55:07 +0000 (22:55 +0000)]
Specialize DenseMapInfo for SCEVHandle, so that SCEVHandles can be
used as keys in DenseMaps.

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

15 years agoCheck for the short-circuiting condition before performing
Dan Gohman [Sun, 14 Jun 2009 22:53:57 +0000 (22:53 +0000)]
Check for the short-circuiting condition before performing
the potentially expensive erase.

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

15 years agoDo compare constant SCEV values in SCEVComplexityCompare, because
Dan Gohman [Sun, 14 Jun 2009 22:51:25 +0000 (22:51 +0000)]
Do compare constant SCEV values in SCEVComplexityCompare, because
even though the order doesn't matter at the top level of an expression,
it does matter when the constant is a subexpression of an n-ary
expression, because n-ary expressions are sorted lexicographically.

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

15 years agoConvert several parts of the ScalarEvolution framework to use
Dan Gohman [Sun, 14 Jun 2009 22:47:23 +0000 (22:47 +0000)]
Convert several parts of the ScalarEvolution framework to use
SmallVector instead of std::vector.

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

15 years agoAdd another item to the list of things that indvars does.
Dan Gohman [Sun, 14 Jun 2009 22:38:41 +0000 (22:38 +0000)]
Add another item to the list of things that indvars does.

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

15 years agoTestcase for PR4332.
Duncan Sands [Sun, 14 Jun 2009 22:22:42 +0000 (22:22 +0000)]
Testcase for PR4332.

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

15 years agoMove register allocation preference (or hint) from LiveInterval to MachineRegisterInf...
Evan Cheng [Sun, 14 Jun 2009 20:22:55 +0000 (20:22 +0000)]
Move register allocation preference (or hint) from LiveInterval to MachineRegisterInfo. This allows more passes to set them.

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

15 years agoFix CMake build. Patch from Ingmar Vanhassel.
Torok Edwin [Sun, 14 Jun 2009 13:39:56 +0000 (13:39 +0000)]
Fix CMake build. Patch from Ingmar Vanhassel.

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

15 years agoAdd an early implementation of a partial inlining pass. The idea behind this
Owen Anderson [Sun, 14 Jun 2009 08:26:32 +0000 (08:26 +0000)]
Add an early implementation of a partial inlining pass. The idea behind this
is that, for functions whose bodies are entirely guarded by an if-statement, it
can be profitable to pull the test out of the callee and into the caller.

This code has had some cursory testing, but still has a number of known issues
on the LLVM test suite.

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

15 years agoIntroduce new BinaryObject (blob) class, ELF Writer modified to use it. BinaryObject...
Bruno Cardoso Lopes [Sun, 14 Jun 2009 07:53:21 +0000 (07:53 +0000)]
Introduce new BinaryObject (blob) class, ELF Writer modified to use it. BinaryObject.h by Aaron Gray

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

15 years agoAdd output of the SFINAE bit for Clang's diagnostics
Douglas Gregor [Sun, 14 Jun 2009 07:24:49 +0000 (07:24 +0000)]
Add output of the SFINAE bit for Clang's diagnostics

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

15 years agoAdd myself, test commit
Shantonu Sen [Sun, 14 Jun 2009 02:03:17 +0000 (02:03 +0000)]
Add myself, test commit

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

15 years agoUnlike the other instructions, GEP really does need to look at the type of a
Nick Lewycky [Sat, 13 Jun 2009 19:09:52 +0000 (19:09 +0000)]
Unlike the other instructions, GEP really does need to look at the type of a
pointer. This fixes kimwitu++. Pointed out by Frits van Bommel on review!

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

15 years agoThe subprogram descriptor for a function may be missing (llvm-ld linking two static...
Sanjiv Gupta [Sat, 13 Jun 2009 17:35:54 +0000 (17:35 +0000)]
The subprogram descriptor for a function may be missing (llvm-ld linking two static functions with same name), so pick up the compilation unit for the function from the first valid debug loc of its instructions.
This patch also emits debug info for structure (aggregate types in
general) types.

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

15 years agoTeach SCEVExpander's visitAddRecExpr to reuse an existing canonical
Dan Gohman [Sat, 13 Jun 2009 16:25:49 +0000 (16:25 +0000)]
Teach SCEVExpander's visitAddRecExpr to reuse an existing canonical
induction variable when the addrec to be expanded does not require
a wider type. This eliminates the need for IndVarSimplify to
micro-manage SCEV expansions, because SCEVExpander now
automatically expands them in the form that IndVarSimplify considers
to be canonical. (LSR still micro-manages its SCEV expansions,
because it's optimizing for the target, rather than for
other optimizations.)

Also, this uses the new getAnyExtendExpr, which has more clever
expression simplification logic than the IndVarSimplify code it
replaces, and this cleans up some ugly expansions in code such as
the included masked-iv.ll testcase.

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

15 years agoAdd a ScalarEvolution::getAnyExtendExpr utility function for performing
Dan Gohman [Sat, 13 Jun 2009 15:56:47 +0000 (15:56 +0000)]
Add a ScalarEvolution::getAnyExtendExpr utility function for performing
extension with unspecified bits.

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

15 years agoAdd a ARM specific pre-allocation pass that re-schedule loads / stores from
Evan Cheng [Sat, 13 Jun 2009 09:12:55 +0000 (09:12 +0000)]
Add a ARM specific pre-allocation pass that re-schedule loads / stores from
consecutive addresses togther. This makes it easier for the post-allocation pass
to form ldm / stm.

This is step 1. We are still missing a lot of ldm / stm opportunities because
of register allocation are not done in the desired order. More enhancements
coming.

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

15 years agollvm.dbg.region.end() intrinsic is not required to be in _last_ basic block in a...
Devang Patel [Sat, 13 Jun 2009 02:16:18 +0000 (02:16 +0000)]
llvm.dbg.region.end() intrinsic is not required to be in _last_ basic block in a function.  If that happens then any basic block that follows (lexically) the block with regin.end will not have scope info available.  LexicalScopeStack relies on processing basic block in CFG order, but this processing order is not guaranteed. Things get complicated when the optimizer gets a chance to optimizer IR with dbg intrinsics.
Apply defensive patch to preserve at least one lexical scope till the end of function.

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

15 years agoType change cleanup on JCE and MCE. Patch by Aaron Gray
Bruno Cardoso Lopes [Fri, 12 Jun 2009 23:51:56 +0000 (23:51 +0000)]
Type change cleanup on JCE and MCE. Patch by Aaron Gray

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

15 years agoAdjust this test's regex strings so that they work regardless
Dan Gohman [Fri, 12 Jun 2009 23:31:14 +0000 (23:31 +0000)]
Adjust this test's regex strings so that they work regardless
of the target's pointer size. This avoids the need for -m32 on
the llvm-gcc command-line, which some targets may not support.

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

15 years agoAdd -m32 to llvm-gcc commands, so that this test behaves as expected
Dan Gohman [Fri, 12 Jun 2009 23:02:02 +0000 (23:02 +0000)]
Add -m32 to llvm-gcc commands, so that this test behaves as expected
on systems which default to a 64-bit target.

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

15 years agoImprove style.
Owen Anderson [Fri, 12 Jun 2009 22:07:19 +0000 (22:07 +0000)]
Improve style.

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

15 years agoThis is supposed to be a preorder numbering of the dominator tree, not the CFG.
Owen Anderson [Fri, 12 Jun 2009 21:50:22 +0000 (21:50 +0000)]
This is supposed to be a preorder numbering of the dominator tree, not the CFG.

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

15 years agoNow with less iterator invalidation, and other forms of crashing!
Owen Anderson [Fri, 12 Jun 2009 21:41:29 +0000 (21:41 +0000)]
Now with less iterator invalidation, and other forms of crashing!

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

15 years agoIf killed register is defined by implicit_def, do not clear it since it's live range...
Evan Cheng [Fri, 12 Jun 2009 21:34:26 +0000 (21:34 +0000)]
If killed register is defined by implicit_def, do not clear it since it's live range may overlap another def of same register.

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

15 years agosecond half of fix for PR4366: don't zap store to null of
Chris Lattner [Fri, 12 Jun 2009 21:01:07 +0000 (21:01 +0000)]
second half of fix for PR4366: don't zap store to null of
non-default addrspaces.

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

15 years agoMark some pattern-less instructions as neverHasSideEffects.
Evan Cheng [Fri, 12 Jun 2009 20:46:18 +0000 (20:46 +0000)]
Mark some pattern-less instructions as neverHasSideEffects.

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

15 years agoDocument noredzone and noimplicitfloat function attributes.
Devang Patel [Fri, 12 Jun 2009 19:45:19 +0000 (19:45 +0000)]
Document noredzone and noimplicitfloat function attributes.

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

15 years agoClear AbstractInstanceRootMap at the end of the function.
Devang Patel [Fri, 12 Jun 2009 19:24:05 +0000 (19:24 +0000)]
Clear AbstractInstanceRootMap at the end of the function.

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

15 years agoDon't do (x - (y - z)) --> (x + (z - y)) on floating-point types, because
Dan Gohman [Fri, 12 Jun 2009 19:23:25 +0000 (19:23 +0000)]
Don't do (x - (y - z)) --> (x + (z - y)) on floating-point types, because
it may round differently. This fixes PR4374.

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

15 years agoGive Instruction::isSameOperationAs a corresponding comment to note
Dan Gohman [Fri, 12 Jun 2009 19:03:05 +0000 (19:03 +0000)]
Give Instruction::isSameOperationAs a corresponding comment to note
the relationship with MergeFunctions.cpp's isEquivalentOperation,
and make a trivial code reordering so that the two functions are
easier to compare.

Fix the name of Instruction::isSameOperationAs in MergeFunction.cpp's
isEquivalentOperation's comment, and fix a nearby 80-column violation.

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

15 years agoTestcase for llvm-gcc patch 73238.
Dale Johannesen [Fri, 12 Jun 2009 18:41:53 +0000 (18:41 +0000)]
Testcase for llvm-gcc patch 73238.

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

15 years agoWaste time fixing something that should have been fixed before.
Bill Wendling [Fri, 12 Jun 2009 18:02:40 +0000 (18:02 +0000)]
Waste time fixing something that should have been fixed before.

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

15 years agoKeep callers of a weak function calling it, instead of the non-weak equivalent.
Nick Lewycky [Fri, 12 Jun 2009 17:16:48 +0000 (17:16 +0000)]
Keep callers of a weak function calling it, instead of the non-weak equivalent.

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

15 years agoFix Bug 4278: X86-64 with -tailcallopt calling convention
Arnold Schwaighofer [Fri, 12 Jun 2009 16:26:57 +0000 (16:26 +0000)]
Fix Bug 4278: X86-64 with -tailcallopt calling convention
out of sync with regular cc.

The only difference between the tail call cc and the normal
cc was that one parameter register - R9 - was reserved for
calling functions through a function pointer. After time the
tail call cc has gotten out of sync with the regular cc.

We can use R11 which is also caller saved but not used as
parameter register for potential function pointers and
remove the special tail call cc on x86-64.

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

15 years agoDon't forget to match the calling convention when producing a thunk.
Nick Lewycky [Fri, 12 Jun 2009 16:04:00 +0000 (16:04 +0000)]
Don't forget to match the calling convention when producing a thunk.

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

15 years agoGiven two identical weak functions, produce one internal function and two weak
Nick Lewycky [Fri, 12 Jun 2009 15:56:56 +0000 (15:56 +0000)]
Given two identical weak functions, produce one internal function and two weak
thunks.

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

15 years agoTweak GenLibDeps.pl so it works on solaris.
Duncan Sands [Fri, 12 Jun 2009 14:23:42 +0000 (14:23 +0000)]
Tweak GenLibDeps.pl so it works on solaris.
Patch by Edward O'Callaghan.

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

15 years agoAfter obtaining the lock, look if the function has been codegen'd by
Nicolas Geoffray [Fri, 12 Jun 2009 14:11:08 +0000 (14:11 +0000)]
After obtaining the lock, look if the function has been codegen'd by
another thread.

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

15 years agoThis test is wrong. If you have two weak functions F and G you can't make
Nick Lewycky [Fri, 12 Jun 2009 13:24:41 +0000 (13:24 +0000)]
This test is wrong. If you have two weak functions F and G you can't make
either one call the other since either one can be replaced at link time, and
they need to be independent.

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

15 years agoAdd clang support to the nightly test script.
Duncan Sands [Fri, 12 Jun 2009 13:02:52 +0000 (13:02 +0000)]
Add clang support to the nightly test script.
Patch by Edward O'Callaghan.

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

15 years agoCredits for Edward O'Callaghan.
Duncan Sands [Fri, 12 Jun 2009 12:52:24 +0000 (12:52 +0000)]
Credits for Edward O'Callaghan.

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

15 years agoAdd an "are types equivalent" operation that ignores the types that a pointer
Nick Lewycky [Fri, 12 Jun 2009 08:04:51 +0000 (08:04 +0000)]
Add an "are types equivalent" operation that ignores the types that a pointer
points to while analyzing all other fields.

Use FoldingSetNodeID to produce a good hash. This dramatically decreases run
times.

Emit thunks. This means that it can look at all functions regardless of what
the linkage is or if the address is taken, but unfortunately some small
functions can be even shorter than the thunk because our backend doesn't yet
realize it can just turn these into jumps. This means that this pass will
pessimize code on average.

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

15 years agoFix regular expression.
Nick Lewycky [Fri, 12 Jun 2009 05:39:02 +0000 (05:39 +0000)]
Fix regular expression.

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

15 years agoDon't remove aggregate-typed module level constants before encoding functions
Nick Lewycky [Fri, 12 Jun 2009 05:20:12 +0000 (05:20 +0000)]
Don't remove aggregate-typed module level constants before encoding functions
since functions may contain aggregate constants too.

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

15 years agoIn an XFAIL line, treat "XFAIL: foo*bar" as a regular expression to be matched
Nick Lewycky [Fri, 12 Jun 2009 05:18:32 +0000 (05:18 +0000)]
In an XFAIL line, treat "XFAIL: foo*bar" as a regular expression to be matched
against the target triple, instead of equivalent to "XFAIL: *".

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

15 years agoCMake: New variable LLVM_LIBDIR_SUFFIX.
Oscar Fuentes [Fri, 12 Jun 2009 02:49:53 +0000 (02:49 +0000)]
CMake: New variable LLVM_LIBDIR_SUFFIX.

Patch by Ingmar Vanhassel!

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

15 years agoUpdate script to tell the user where to get the CodeSourcery crosstool, if it's
Misha Brukman [Fri, 12 Jun 2009 02:04:47 +0000 (02:04 +0000)]
Update script to tell the user where to get the CodeSourcery crosstool, if it's
not found.

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

15 years agoAdded two scripts to aid with building Linux/x86 -> Linux/ARM crosstools, using
Misha Brukman [Fri, 12 Jun 2009 01:55:57 +0000 (01:55 +0000)]
Added two scripts to aid with building Linux/x86 -> Linux/ARM crosstools, using
CodeSourcery's provided GCC-based crosstools, from which we use binutils.

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

15 years agoXFAIL this on PPC Linux. This keeps showing up in the buildbot and isn't easy to...
Nick Lewycky [Thu, 11 Jun 2009 23:43:02 +0000 (23:43 +0000)]
XFAIL this on PPC Linux. This keeps showing up in the buildbot and isn't easy to fix, and I'd like it to stop masking
real failures.

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

15 years agoMisc x86 README updates: remove a couple of already-fixed issues,
Eli Friedman [Thu, 11 Jun 2009 23:07:04 +0000 (23:07 +0000)]
Misc x86 README updates: remove a couple of already-fixed issues,
add a few suggestions from looking at some assembly code.

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

15 years agoUse forward declarations and move TargetELFWriterInfo impl to a new file.
Bruno Cardoso Lopes [Thu, 11 Jun 2009 22:13:00 +0000 (22:13 +0000)]
Use forward declarations and move TargetELFWriterInfo impl to a new file.

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

15 years agoTest for rev 73205 (PR 4349)
Dale Johannesen [Thu, 11 Jun 2009 20:48:09 +0000 (20:48 +0000)]
Test for rev 73205 (PR 4349)

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

15 years agoAlphabetize.
Bill Wendling [Thu, 11 Jun 2009 20:13:35 +0000 (20:13 +0000)]
Alphabetize.

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

15 years agoRemove unused parameter warnings.
Bill Wendling [Thu, 11 Jun 2009 20:10:02 +0000 (20:10 +0000)]
Remove unused parameter warnings.

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

15 years agoSupport for ELF Visibility
Bruno Cardoso Lopes [Thu, 11 Jun 2009 19:16:03 +0000 (19:16 +0000)]
Support for ELF Visibility
Emission for globals, using the correct data sections
Function alignment can be computed for each target using TargetELFWriterInfo
Some small fixes

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

15 years agoFix 4366: store to null in non-default addr space should not be
Chris Lattner [Thu, 11 Jun 2009 17:54:56 +0000 (17:54 +0000)]
Fix 4366: store to null in non-default addr space should not be
turned into unreachable.

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

15 years agoGenerate libcalls for floating point arithmetic and casting operations.
Sanjiv Gupta [Thu, 11 Jun 2009 16:50:48 +0000 (16:50 +0000)]
Generate libcalls for floating point arithmetic and casting operations.

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

15 years agoCosmetic changes to parameter attribute verification.
Duncan Sands [Thu, 11 Jun 2009 08:11:03 +0000 (08:11 +0000)]
Cosmetic changes to parameter attribute verification.

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

15 years agoAvoid leaking memory in an error path. Noticed
Duncan Sands [Thu, 11 Jun 2009 08:09:49 +0000 (08:09 +0000)]
Avoid leaking memory in an error path.  Noticed
by cppcheck.

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

15 years agoMore formatting.
Sanjiv Gupta [Thu, 11 Jun 2009 06:55:48 +0000 (06:55 +0000)]
More formatting.

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

15 years agoFixed source comments. No functionality change.
Sanjiv Gupta [Thu, 11 Jun 2009 06:49:55 +0000 (06:49 +0000)]
Fixed source comments. No functionality change.

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

15 years agoCMake: Documented how to cross-compile with CMake.
Oscar Fuentes [Thu, 11 Jun 2009 04:45:08 +0000 (04:45 +0000)]
CMake: Documented how to cross-compile with CMake.

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

15 years agoCMake: Fixed parallel build problem related to native tblgen when
Oscar Fuentes [Thu, 11 Jun 2009 04:16:10 +0000 (04:16 +0000)]
CMake: Fixed parallel build problem related to native tblgen when
cross-compiling.

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

15 years agoCMake: Updated list of files on lib/CodeGen/CMakeLists.txt.
Oscar Fuentes [Wed, 10 Jun 2009 22:53:59 +0000 (22:53 +0000)]
CMake: Updated list of files on lib/CodeGen/CMakeLists.txt.

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

15 years agoImplement and use new method Function::hasAddressTaken().
Jay Foad [Wed, 10 Jun 2009 08:41:11 +0000 (08:41 +0000)]
Implement and use new method Function::hasAddressTaken().

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

15 years agoRemove warnings: no newline at end of file.
Sanjiv Gupta [Wed, 10 Jun 2009 03:42:13 +0000 (03:42 +0000)]
Remove warnings:  no newline at end of file.

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

15 years agoSilence a warning
Anton Korobeynikov [Tue, 9 Jun 2009 23:00:39 +0000 (23:00 +0000)]
Silence a warning

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

15 years agoReversed order of args in EXPECT_EQ() macros to be in the correct order:
Misha Brukman [Tue, 9 Jun 2009 21:48:57 +0000 (21:48 +0000)]
Reversed order of args in EXPECT_EQ() macros to be in the correct order:
EXPECT_EQ(expected, actual) .  This will make error messages understandable as
it uses terms such as "expected" and "actual" based on the order of arguments.

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

15 years agoRemove an unused function SafeToDestroyConstant(). Rename an almost
Jay Foad [Tue, 9 Jun 2009 21:37:11 +0000 (21:37 +0000)]
Remove an unused function SafeToDestroyConstant(). Rename an almost
identical function ConstantIsDead() to SafeToDestroyConstant(), to
emphasise the connection with Constant::destroyConstant().

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

15 years agoRemove empty test (my DejaGNU doesn't like this)
Daniel Dunbar [Tue, 9 Jun 2009 21:24:39 +0000 (21:24 +0000)]
Remove empty test (my DejaGNU doesn't like this)

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

15 years agoBug fix:
Rafael Espindola [Tue, 9 Jun 2009 21:14:25 +0000 (21:14 +0000)]
Bug fix:

string::find returns string::npos if the substring is not found.

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

15 years agoSimplified logic of this if-then statement to reduce nesting. No functionality
Bill Wendling [Tue, 9 Jun 2009 20:08:51 +0000 (20:08 +0000)]
Simplified logic of this if-then statement to reduce nesting. No functionality
change.

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

15 years agoAdd the beginnings of an implementatation of lazy liveness analysis, based on "Fast...
Owen Anderson [Tue, 9 Jun 2009 19:30:45 +0000 (19:30 +0000)]
Add the beginnings of an implementatation of lazy liveness analysis, based on "Fast Liveness Checking for SSA-form Programs" by Boissinot, et al.

This is still very early, hasn't been tested, and is not yet well documented.  More to come soon.

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

15 years agoRemove empty file.
Bill Wendling [Tue, 9 Jun 2009 18:55:39 +0000 (18:55 +0000)]
Remove empty file.

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

15 years agoI'm going to assume that this was meant to be an assignment instead of a
Bill Wendling [Tue, 9 Jun 2009 18:49:42 +0000 (18:49 +0000)]
I'm going to assume that this was meant to be an assignment instead of a
computation that isn't used. Please correct this if it's wrong!

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

15 years agoRevert 73074 and 73099 because Windows doesn't have POSIX
David Greene [Tue, 9 Jun 2009 18:31:17 +0000 (18:31 +0000)]
Revert 73074 and 73099 because Windows doesn't have POSIX
regular expressions.  We will add an OpenBSD implementation
and re-apply ASAP.

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

15 years agoUse expandCodeFor instead of expand when the result will be
Dan Gohman [Tue, 9 Jun 2009 17:18:38 +0000 (17:18 +0000)]
Use expandCodeFor instead of expand when the result will be
immediately casted. At present, this is just a minor code
simplification. In the future, the expansion code may be able
to make better choices if it knows what the desired result
type will be.

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

15 years agoPIC16 emits auto variables as globals. When optimizer removes a function entierly...
Sanjiv Gupta [Tue, 9 Jun 2009 15:31:19 +0000 (15:31 +0000)]
PIC16 emits auto variables as globals. When optimizer removes a function entierly by estimating its side effects on globals, those globals(autos) without a function were not being printed by the Asm printer.

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

15 years agoChange IndexedModeAction representation.
David Greene [Tue, 9 Jun 2009 00:19:10 +0000 (00:19 +0000)]
Change IndexedModeAction representation.

This changes the IndexedModeAction representation to remove the
limitation on the number of value types in MVT.  This limitation
prevents us from specifying AVX types.

Prior to this change IndexedModActions was represented as follows...

uint64_t IndexedModeActions[2][ISD::LAST_INDEXED_MODE];

the first dimension was used to represent loads, then stores.  This
imposed a limitation of 32 on the number of value types that could be
handled with this method.  The value type was used to shift the two bits
into and out of the approprate bits in the uint64_t.

With this change the array is now represented as ...

uint8_t IndexedModeActions[MVT::LAST_VALUETYPE][2][ISD::LAST_INDEXED_MODE];

Takes more space but removes the limitation on MVT::LAST_VALUETYPE.  The
first dimension is now the value_type for the reference.  The second
dimension is the load [0] vs. store[1].  The third dimension represents
the various modes for load store.  Accesses are now direct, no shifting
or masking.

There are other limitations that need to be removed, so that
MVT::LAST_VALUETYPE can be greater than 32.  This is merely the first
step towards that goal.

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

15 years agoOops, didn't mean to commit 73102 yet. Revert it.
David Greene [Mon, 8 Jun 2009 23:54:42 +0000 (23:54 +0000)]
Oops, didn't mean to commit 73102 yet.  Revert it.

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

15 years agoChange IndexedModeAction representation.
David Greene [Mon, 8 Jun 2009 23:53:19 +0000 (23:53 +0000)]
Change IndexedModeAction representation.

This changes the IndexedModeAction representation to remove the
limitation on the number of value types in MVT.  This limitation
prevents us from specifying AVX types.

Prior to this change IndexedModActions was represented as follows...

uint64_t IndexedModeActions[2][ISD::LAST_INDEXED_MODE];

the first dimension was used to represent loads, then stores.  This
imposed a limitation of 32 on the number of value types that could be
handled with this method.  The value type was used to shift the two bits
into and out of the approprate bits in the uint64_t.

With this change the array is now represented as ...

uint8_t IndexedModeActions[MVT::LAST_VALUETYPE][2][ISD::LAST_INDEXED_MODE];

Takes more space but removes the limitation on MVT::LAST_VALUETYPE.  The
first dimension is now the value_type for the reference.  The second
dimension is the load [0] vs. store[1].  The third dimension represents
the various modes for load store.  Accesses are now direct, no shifting
or masking.

There are other limitations that need to be removed, so that
MVT::LAST_VALUETYPE can be greater than 32.  This is merely the first
step towards that goal.

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

15 years agoAdd a !patsubst operator. Use on string types.
David Greene [Mon, 8 Jun 2009 23:05:37 +0000 (23:05 +0000)]
Add a !patsubst operator.  Use on string types.

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

15 years agoTypo
Anton Korobeynikov [Mon, 8 Jun 2009 22:59:50 +0000 (22:59 +0000)]
Typo

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