oota-llvm.git
15 years agoMake the PPC backend use a legal type for the operands to the BUILD_VECTOR
Eli Friedman [Sun, 24 May 2009 02:03:36 +0000 (02:03 +0000)]
Make the PPC backend use a legal type for the operands to the BUILD_VECTOR
nodes it generates.

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

15 years agoFix a bug in the expansion of EXTRACT_SUBVECTOR in
Eli Friedman [Sat, 23 May 2009 23:03:28 +0000 (23:03 +0000)]
Fix a bug in the expansion of EXTRACT_SUBVECTOR in
ExpandExtractFromVectorThroughStack.

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

15 years agoMake the X86 backend mark EXTRACT_SUBVECTOR as Expand, at least for the
Eli Friedman [Sat, 23 May 2009 22:44:52 +0000 (22:44 +0000)]
Make the X86 backend mark EXTRACT_SUBVECTOR as Expand, at least for the
moment.

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

15 years agoAdd a proper implementation of EXTRACT_SUBVECTOR legalization that
Eli Friedman [Sat, 23 May 2009 22:37:25 +0000 (22:37 +0000)]
Add a proper implementation of EXTRACT_SUBVECTOR legalization that
doesn't split legal vector operands.  This is necessary because the
type legalization (and therefore, vector splitting) code will be going
away soon.

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

15 years agoUse latin symbols. I was told not everybody has a UTF-8 capable editor.
Torok Edwin [Sat, 23 May 2009 20:40:47 +0000 (20:40 +0000)]
Use latin symbols. I was told not everybody has a UTF-8 capable editor.

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

15 years agoWrite family name last, as other entries in this file.
Torok Edwin [Sat, 23 May 2009 20:21:09 +0000 (20:21 +0000)]
Write family name last, as other entries in this file.

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

15 years agoAdd myself.
Torok Edwin [Sat, 23 May 2009 20:19:52 +0000 (20:19 +0000)]
Add myself.

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

15 years agoAdd ARMv7 architecture, Cortex processors and different FPU modes handling.
Anton Korobeynikov [Sat, 23 May 2009 19:51:43 +0000 (19:51 +0000)]
Add ARMv7 architecture, Cortex processors and different FPU modes handling.

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

15 years agoEmit ARM Build Attributes
Anton Korobeynikov [Sat, 23 May 2009 19:51:20 +0000 (19:51 +0000)]
Emit ARM Build Attributes

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

15 years agoPropagate CPU string out of SubtargetFeatures
Anton Korobeynikov [Sat, 23 May 2009 19:50:50 +0000 (19:50 +0000)]
Propagate CPU string out of SubtargetFeatures

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

15 years agoWork around a page size issue on Cygwin.
Jay Foad [Sat, 23 May 2009 17:57:59 +0000 (17:57 +0000)]
Work around a page size issue on Cygwin.

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

15 years agoFix PR4254.
Torok Edwin [Sat, 23 May 2009 17:29:48 +0000 (17:29 +0000)]
Fix PR4254.
The DAGCombiner created a negative shiftamount, stored in an
unsigned variable. Later the optimizer eliminated the shift entirely as being
undefined.
Example: (srl (shl X, 56) 48). ShiftAmt is 4294967288.
Fix it by checking that the shiftamount is positive, and storing in a signed
variable.

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

15 years agostat64/open64/lseek64 for the interpreter
Torok Edwin [Sat, 23 May 2009 16:23:59 +0000 (16:23 +0000)]
stat64/open64/lseek64 for the interpreter

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

15 years agoavailable_externall linkage is not local, this was confusing the codegenerator,
Torok Edwin [Sat, 23 May 2009 14:06:57 +0000 (14:06 +0000)]
available_externall linkage is not local, this was confusing the codegenerator,
and it wasn't generating calls through @PLT for these functions.
hasLocalLinkage() is now false for available_externally,
I attempted to fix the inliner and dce to handle available_externally properly.
It passed make check.

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

15 years agoFix test to account for legalization changes; I think this ends up
Eli Friedman [Sat, 23 May 2009 13:15:11 +0000 (13:15 +0000)]
Fix test to account for legalization changes; I think this ends up
running an extra DAGCombine pass which improves the code a bit.

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

15 years agoAdd a new step to legalization to legalize vector math operations. This
Eli Friedman [Sat, 23 May 2009 12:35:30 +0000 (12:35 +0000)]
Add a new step to legalization to legalize vector math operations.  This
will allow simplifying LegalizeDAG to eliminate type legalization.  (I
have a patch to do that, but it's not quite finished; I'll commit it
once it's finished and I've fixed any review comments for this patch.)
See the comment at the beginning of
lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp for more details on the
motivation for this patch.

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

15 years agoMake the x86 backend custom-lower UINT_TO_FP and FP_TO_UINT on 32-bit
Eli Friedman [Sat, 23 May 2009 09:59:16 +0000 (09:59 +0000)]
Make the x86 backend custom-lower UINT_TO_FP and FP_TO_UINT on 32-bit
systems instead of attempting to promote them to a 64-bit SINT_TO_FP or
FP_TO_SINT.  This is in preparation for removing the type legalization
code from LegalizeDAG: once type legalization is gone from LegalizeDAG,
it won't be able to handle the i64 operand/result correctly.

This isn't quite ideal, but I don't think any other operation for any
target ends up in this situation, so treating this case specially seems
reasonable.

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

15 years agoCMake: Use libdl only when available. Fixes build on FreeBSD.
Oscar Fuentes [Sat, 23 May 2009 02:37:24 +0000 (02:37 +0000)]
CMake: Use libdl only when available. Fixes build on FreeBSD.

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

15 years agoFix bug in FoldFCmp_IntToFP_Cst. If inttofp is a uintofp, use unsigned instead of...
Evan Cheng [Fri, 22 May 2009 23:10:53 +0000 (23:10 +0000)]
Fix bug in FoldFCmp_IntToFP_Cst. If inttofp is a uintofp, use unsigned instead of signed integer constant.

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

15 years agoAdd a note mentioning that uses of the return value of an invoke
Dan Gohman [Fri, 22 May 2009 21:47:08 +0000 (21:47 +0000)]
Add a note mentioning that uses of the return value of an invoke
must be dominated by the normal label.

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

15 years agoCMake: Use libpthread in tblgen when needed. Updated list of source
Oscar Fuentes [Fri, 22 May 2009 20:55:15 +0000 (20:55 +0000)]
CMake: Use libpthread in tblgen when needed. Updated list of source
files for PIC16 target.

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

15 years agoAdd a new codegen pass that normalizes dwarf exception handling
Duncan Sands [Fri, 22 May 2009 20:36:31 +0000 (20:36 +0000)]
Add a new codegen pass that normalizes dwarf exception handling
code in preparation for code generation.  The main thing it does
is handle the case when eh.exception calls (and, in a future
patch, eh.selector calls) are far away from landing pads.  Right
now in practice you only find eh.exception calls close to landing
pads: either in a landing pad (the common case) or in a landing
pad successor, due to loop passes shifting them about.  However
future exception handling improvements will result in calls far
from landing pads:
(1) Inlining of rewinds.  Consider the following case:
In function @f:
...
  invoke @g to label %normal unwind label %unwinds
...
unwinds:
  %ex = call i8* @llvm.eh.exception()
...

In function @g:
...
  invoke @something to label %continue unwind label %handler
...
handler:
  %ex = call i8* @llvm.eh.exception()
... perform cleanups ...
  "rethrow exception"

Now inline @g into @f.  Currently this is turned into:
In function @f:
...
  invoke @something to label %continue unwind label %handler
...
handler:
  %ex = call i8* @llvm.eh.exception()
... perform cleanups ...
  invoke "rethrow exception" to label %normal unwind label %unwinds
unwinds:
  %ex = call i8* @llvm.eh.exception()
...

However we would like to simplify invoke of "rethrow exception" into
a branch to the %unwinds label.  Then %unwinds is no longer a landing
pad, and the eh.exception call there is then far away from any landing
pads.

(2) Using the unwind instruction for cleanups.
It would be nice to have codegen handle the following case:
  invoke @something to label %continue unwind label %run_cleanups
...
handler:
... perform cleanups ...
  unwind

This requires turning "unwind" into a library call, which
necessarily takes a pointer to the exception as an argument
(this patch also does this unwind lowering).  But that means
you are using eh.exception again far from a landing pad.

(3) Bugpoint simplifications.  When bugpoint is simplifying
exception handling code it often generates eh.exception calls
far from a landing pad, which then causes codegen to assert.
Bugpoint then latches on to this assertion and loses sight
of the original problem.

Note that it is currently rare for this pass to actually do
anything.  And in fact it normally shouldn't do anything at
all given the code coming out of llvm-gcc!  But it does fire
a few times in the testsuite.  As far as I can see this is
almost always due to the LoopStrengthReduce codegen pass
introducing pointless loop preheader blocks which are landing
pads and only contain a branch to another block.  This other
block contains an eh.exception call.  So probably by tweaking
LoopStrengthReduce a bit this can be avoided.

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

15 years agoOnly 64-bit targets support TImode libcalls. Disable the TImode shift libcalls
Bob Wilson [Fri, 22 May 2009 17:38:41 +0000 (17:38 +0000)]
Only 64-bit targets support TImode libcalls.  Disable the TImode shift libcalls
for ARM.  This fixes rdar://6908807.

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

15 years agoTeach IndVarSimplify's FixUsesBeforeDefs to handle InvokeInsts by
Dan Gohman [Fri, 22 May 2009 16:47:11 +0000 (16:47 +0000)]
Teach IndVarSimplify's FixUsesBeforeDefs to handle InvokeInsts by
assuming that the use of the value is in a block dominated by the
"normal" destination. LangRef.html and other documentation sources
don't explicitly guarantee this, but it seems to be assumed in
other places in LLVM at least.

This fixes an assertion failure on the included testcase, which
is derived from the Ada testsuite.

FixUsesBeforeDefs is a temporary measure which I'm looking to
replace with a more capable solution.

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

15 years agoEmit debug information for globals (which include automatic variables as well because...
Sanjiv Gupta [Fri, 22 May 2009 13:58:45 +0000 (13:58 +0000)]
Emit debug information for globals (which include automatic variables as well because on PIC16 they are emitted as globals by the frontend).

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

15 years agoHopefully fix the build for people with ocaml.
Duncan Sands [Fri, 22 May 2009 09:22:17 +0000 (09:22 +0000)]
Hopefully fix the build for people with ocaml.

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

15 years agoAlways verify dominfo if expensive checking is enabled.
Duncan Sands [Fri, 22 May 2009 08:52:53 +0000 (08:52 +0000)]
Always verify dominfo if expensive checking is enabled.

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

15 years agoFix a thinko in the code that adapted SCEVMulExpr operands for
Dan Gohman [Fri, 22 May 2009 07:14:20 +0000 (07:14 +0000)]
Fix a thinko in the code that adapted SCEVMulExpr operands for
use in expanding SCEVAddExprs with GEPs. The operands of a
SCEVMulExpr need to be multiplied together, not added.

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

15 years agoRevert this. There's no way to verifiy indirect calls, and an optimizer can turn
Torok Edwin [Fri, 22 May 2009 07:12:05 +0000 (07:12 +0000)]
Revert this. There's no way to verifiy indirect calls, and an optimizer can turn
indirect call into direct call, thus the verifier would reject something it
previously accepted.

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

15 years agoVerify that calling conventions match function prototype.
Torok Edwin [Fri, 22 May 2009 06:41:43 +0000 (06:41 +0000)]
Verify that calling conventions match function prototype.
This only rejects mismatches between target specific calling convention
and C/LLVM specific calling convention.
There are too many fastcc/C, coldcc/cc42 mismatches in the testsuite, these are
not reject by the verifier.

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

15 years agoFix loop-index-split to correctly preserve dominance frontiers. Part of
Eli Friedman [Fri, 22 May 2009 03:22:46 +0000 (03:22 +0000)]
Fix loop-index-split to correctly preserve dominance frontiers.  Part of
PR4238.

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

15 years agoAdd llvm::triple constructor from arch, vendor, os strings, and recognize
Daniel Dunbar [Fri, 22 May 2009 02:24:11 +0000 (02:24 +0000)]
Add llvm::triple constructor from arch, vendor, os strings, and recognize
DragonFly OS type.

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

15 years agoUpdate an assertion string to new-style type names.
Dan Gohman [Fri, 22 May 2009 00:40:35 +0000 (00:40 +0000)]
Update an assertion string to new-style type names.

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

15 years ago80 column violation.
Evan Cheng [Thu, 21 May 2009 23:47:47 +0000 (23:47 +0000)]
80 column violation.

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

15 years agoTableGen for fast isel seems to assume an 'imm'
Dale Johannesen [Thu, 21 May 2009 22:25:49 +0000 (22:25 +0000)]
TableGen for fast isel seems to assume an 'imm'
operand is the last in a pattern.  There is no
reason this should be true (although apparently
it always is right now).

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

15 years agoFix broken logic in DominatorTreeBase::Split. Part of PR4238.
Eli Friedman [Thu, 21 May 2009 21:47:54 +0000 (21:47 +0000)]
Fix broken logic in DominatorTreeBase::Split.  Part of PR4238.

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

15 years agoFix indentation.
Eli Friedman [Thu, 21 May 2009 21:08:47 +0000 (21:08 +0000)]
Fix indentation.

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

15 years agoFix some incorrect logic in DominanceFrontier::splitBlock. Part of
Eli Friedman [Thu, 21 May 2009 20:40:30 +0000 (20:40 +0000)]
Fix some incorrect logic in DominanceFrontier::splitBlock.  Part of
PR4238.

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

15 years agoAdd some missing steps to the sacred testing ritual scriptures.
Stuart Hastings [Thu, 21 May 2009 20:23:59 +0000 (20:23 +0000)]
Add some missing steps to the sacred testing ritual scriptures.

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

15 years agoTighten up the asserts in SmallVector::operator[]().
Jay Foad [Thu, 21 May 2009 19:48:58 +0000 (19:48 +0000)]
Tighten up the asserts in SmallVector::operator[]().
If this causes any new assertion failures that I didn't catch in
testing, the fix is usually to change "&v[0]" to "v.data()" for some
SmallVector v.

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

15 years agoAdd a getAlignOf helper for getting the ABI alignment of a
Duncan Sands [Thu, 21 May 2009 15:52:21 +0000 (15:52 +0000)]
Add a getAlignOf helper for getting the ABI alignment of a
type as a target independent constant expression.  I confess
that I didn't check that this method works as intended (though
I did test the equivalent hand-written IR a little).  But what
could possibly go wrong!

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

15 years agoUse v.data() instead of &v[0] when SmallVector v might be empty.
Jay Foad [Thu, 21 May 2009 09:52:38 +0000 (09:52 +0000)]
Use v.data() instead of &v[0] when SmallVector v might be empty.

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

15 years agoImplement new SmallVector::data() methods.
Jay Foad [Thu, 21 May 2009 09:00:37 +0000 (09:00 +0000)]
Implement new SmallVector::data() methods.

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

15 years agoTeach ValueTracking a new way to analyze PHI nodes, and and teach
Dan Gohman [Thu, 21 May 2009 02:28:33 +0000 (02:28 +0000)]
Teach ValueTracking a new way to analyze PHI nodes, and and teach
Instcombine to be more aggressive about using SimplifyDemandedBits
on shift nodes. This allows a shift to be simplified to zero in the
included test case.

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

15 years agoAdd Atomic.cpp to the CMake build system.
Owen Anderson [Thu, 21 May 2009 00:48:56 +0000 (00:48 +0000)]
Add Atomic.cpp to the CMake build system.

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

15 years agoUse DataTypes.h instead of stdint.h.
Owen Anderson [Thu, 21 May 2009 00:48:13 +0000 (00:48 +0000)]
Use DataTypes.h instead of stdint.h.

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

15 years agoTemporarily revert r72191. It was causing an assert during llvm-gcc
Bill Wendling [Thu, 21 May 2009 00:04:55 +0000 (00:04 +0000)]
Temporarily revert r72191. It was causing an assert during llvm-gcc
bootstrapping.

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

15 years agoMinor code cleanup. No functionality change.
Bill Wendling [Wed, 20 May 2009 23:31:45 +0000 (23:31 +0000)]
Minor code cleanup. No functionality change.

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

15 years agoMerge 'ConstructFunctionDbgScope' and 'ConstructAbstractDbgScope'.
Bill Wendling [Wed, 20 May 2009 23:28:48 +0000 (23:28 +0000)]
Merge 'ConstructFunctionDbgScope' and 'ConstructAbstractDbgScope'.

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

15 years agoRename 'New*' methods to 'Create*' to be consistent. 'NewString' isn't used.
Bill Wendling [Wed, 20 May 2009 23:24:48 +0000 (23:24 +0000)]
Rename 'New*' methods to 'Create*' to be consistent. 'NewString' isn't used.

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

15 years agoAdd comment for emit section.
Bill Wendling [Wed, 20 May 2009 23:22:40 +0000 (23:22 +0000)]
Add comment for emit section.

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

15 years agoMove 'Emit' methods down to their own place.
Bill Wendling [Wed, 20 May 2009 23:21:38 +0000 (23:21 +0000)]
Move 'Emit' methods down to their own place.

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

15 years agoRevert r72192. It was causing a build failure.
Bill Wendling [Wed, 20 May 2009 23:19:06 +0000 (23:19 +0000)]
Revert r72192. It was causing a build failure.

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

15 years agoDo some mechanical changes. Combine the 'construct abastract dbg thingy' in with
Bill Wendling [Wed, 20 May 2009 23:04:56 +0000 (23:04 +0000)]
Do some mechanical changes. Combine the 'construct abastract dbg thingy' in with
the 'constract function dbg thingy'. Rename some methods to make them consistent
with the rest of the methods. Move the 'Emit' methods to the end of the file.

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

15 years agoIntroduce DebugScope which gets embedded into the machine instructions' DebugLoc.
Argyrios Kyrtzidis [Wed, 20 May 2009 22:57:17 +0000 (22:57 +0000)]
Introduce DebugScope which gets embedded into the machine instructions' DebugLoc.
DebugScope refers to a debug region, function or block.

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

15 years agoAdd an accessor method to return the insertion point.
Dan Gohman [Wed, 20 May 2009 21:45:41 +0000 (21:45 +0000)]
Add an accessor method to return the insertion point.

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

15 years agoHave llvm_start_multithreaded return a bool indicating whether multithreaded
Owen Anderson [Wed, 20 May 2009 21:03:06 +0000 (21:03 +0000)]
Have llvm_start_multithreaded return a bool indicating whether multithreaded
initialization succeeded or not, rather than just asserting.

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

15 years agoTabs, be gone!
Owen Anderson [Wed, 20 May 2009 19:06:49 +0000 (19:06 +0000)]
Tabs, be gone!

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

15 years agoI just fail today.
Owen Anderson [Wed, 20 May 2009 19:01:50 +0000 (19:01 +0000)]
I just fail today.

Hopefully this fixes the last build errors on systems with GCC < 4.1.

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

15 years agoCopy-and-paste-o.
Owen Anderson [Wed, 20 May 2009 18:47:53 +0000 (18:47 +0000)]
Copy-and-paste-o.

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

15 years agoMove atomic operations' definitions out of line. While this seems kind of silly,
Owen Anderson [Wed, 20 May 2009 18:26:15 +0000 (18:26 +0000)]
Move atomic operations' definitions out of line.  While this seems kind of silly,
all kinds of problems caused by including windows.h and/or config.h in an LLVM header.

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

15 years agoMinor formatting fixes.
Bob Wilson [Wed, 20 May 2009 16:30:25 +0000 (16:30 +0000)]
Minor formatting fixes.

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

15 years agoWhen comparing DominanceFrontier's, advance iterators
Duncan Sands [Wed, 20 May 2009 15:12:01 +0000 (15:12 +0000)]
When comparing DominanceFrontier's, advance iterators
before erasing nodes, not after.  Otherwise dom frontier
checking reads from freed memory.

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

15 years agoCompile fix for MSVC.
Owen Anderson [Wed, 20 May 2009 09:34:13 +0000 (09:34 +0000)]
Compile fix for MSVC.

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

15 years agoFix for PR4235: to build a floating-point value from integer parts,
Eli Friedman [Wed, 20 May 2009 06:02:09 +0000 (06:02 +0000)]
Fix for PR4235: to build a floating-point value from integer parts,
build an integer and cast that to a float.  This fixes a crash
caused by trying to split an f32 into two f16's.

This changes the behavior in test/CodeGen/XCore/fneg.ll because that
testcase now triggers a DAGCombine which converts the fneg into an integer
operation.  If someone is interested, it's probably possible to tweak
the test to generate an actual fneg.

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

15 years agoFix test on non-darwin hosts.
Evan Cheng [Wed, 20 May 2009 05:45:36 +0000 (05:45 +0000)]
Fix test on non-darwin hosts.

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

15 years agoTry again. Allow call to immediate address for ELF or when in static relocation mode.
Evan Cheng [Wed, 20 May 2009 04:53:57 +0000 (04:53 +0000)]
Try again. Allow call to immediate address for ELF or when in static relocation mode.

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

15 years agoCannot use immediate as call absolute target in PIC mode.
Evan Cheng [Wed, 20 May 2009 01:11:00 +0000 (01:11 +0000)]
Cannot use immediate as call absolute target in PIC mode.

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

15 years agoTeach SCEV::isLoopInvariant and SCEV::hasComputableLoopEvolution
Dan Gohman [Wed, 20 May 2009 01:01:24 +0000 (01:01 +0000)]
Teach SCEV::isLoopInvariant and SCEV::hasComputableLoopEvolution
about the convention from LoopInfo that a null Loop* means the entire
function body.

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

15 years agoAdd llvm_start_multithreaded(), which starts up the LLVM internals in thread-safe...
Owen Anderson [Wed, 20 May 2009 00:39:20 +0000 (00:39 +0000)]
Add llvm_start_multithreaded(), which starts up the LLVM internals in thread-safe mode.  Provide double-check locking
initialization of ManagedStatic's when running in thread-safe mode.

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

15 years agoSuppress the IV reversal transformation in the case that the RHS
Dan Gohman [Wed, 20 May 2009 00:34:08 +0000 (00:34 +0000)]
Suppress the IV reversal transformation in the case that the RHS
of the comparison is defined inside the loop. This fixes a
use-before-def problem, because the transformation puts a use
of the RHS outside the loop.

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

15 years agoWe need to include config.h here so that the #defines are set properly.
Owen Anderson [Wed, 20 May 2009 00:31:29 +0000 (00:31 +0000)]
We need to include config.h here so that the #defines are set properly.

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

15 years agoForgot this file in my last commit.
Owen Anderson [Tue, 19 May 2009 22:25:55 +0000 (22:25 +0000)]
Forgot this file in my last commit.

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

15 years agoSplit the ENABLE_THREADS #define in two. Now ENABLE_THREADS indicates the ability...
Owen Anderson [Tue, 19 May 2009 22:18:56 +0000 (22:18 +0000)]
Split the ENABLE_THREADS #define in two.  Now ENABLE_THREADS indicates the ability to run multiple threads at once in the JIT, and requires only
mutex support.  LLVM_MULTITHREADED indicates (or will indicate) the ability to run LLVM itself across multiple threads, and requires atomics support.

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

15 years agoFix pr4227: Handle large immediate values in inline assembly.
Bob Wilson [Tue, 19 May 2009 21:27:57 +0000 (21:27 +0000)]
Fix pr4227: Handle large immediate values in inline assembly.

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

15 years agoRemove an irrelevant comment.
Dan Gohman [Tue, 19 May 2009 20:38:47 +0000 (20:38 +0000)]
Remove an irrelevant comment.

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

15 years agoAdd some more comments to the top of this file.
Dan Gohman [Tue, 19 May 2009 20:37:36 +0000 (20:37 +0000)]
Add some more comments to the top of this file.

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

15 years agoTrim unneeded #includes.
Dan Gohman [Tue, 19 May 2009 20:35:26 +0000 (20:35 +0000)]
Trim unneeded #includes.

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

15 years agoMake SCEVCallbackVH a private nested class inside ScalarEvolution, as
Dan Gohman [Tue, 19 May 2009 19:22:47 +0000 (19:22 +0000)]
Make SCEVCallbackVH a private nested class inside ScalarEvolution, as
it's an implementation detail.

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

15 years agoCreate ConstantExpr GEPs the correct way. This fixes
Dan Gohman [Tue, 19 May 2009 19:18:01 +0000 (19:18 +0000)]
Create ConstantExpr GEPs the correct way. This fixes
MultiSource/Benchmarks/Prolangs-C/football and a variety of other
failures.

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

15 years agoFollow up on new support for memory operands in ARM inline assembly.
Bob Wilson [Tue, 19 May 2009 18:33:02 +0000 (18:33 +0000)]
Follow up on new support for memory operands in ARM inline assembly.
This fixes pr4233.

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

15 years agoForward decls.
Bill Wendling [Tue, 19 May 2009 17:52:31 +0000 (17:52 +0000)]
Forward decls.

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

15 years agoRemove 'class' specifier.
Bill Wendling [Tue, 19 May 2009 17:51:26 +0000 (17:51 +0000)]
Remove 'class' specifier.

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

15 years agoFix to compile on VS2008.
Bill Wendling [Tue, 19 May 2009 17:50:18 +0000 (17:50 +0000)]
Fix to compile on VS2008.

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

15 years agoFix pr4058 and pr4059. Do not split i64 or double arguments between r3 and
Bob Wilson [Tue, 19 May 2009 10:02:36 +0000 (10:02 +0000)]
Fix pr4058 and pr4059.  Do not split i64 or double arguments between r3 and
the stack.  Patch by Sandeep Patel.

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

15 years agoFix pr4091: Add support for "m" constraint in ARM inline assembly.
Bob Wilson [Tue, 19 May 2009 05:53:42 +0000 (05:53 +0000)]
Fix pr4091: Add support for "m" constraint in ARM inline assembly.

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

15 years agoRemove the #ifndef NDEBUG from the FastISel debugging options. This
Dan Gohman [Tue, 19 May 2009 02:19:57 +0000 (02:19 +0000)]
Remove the #ifndef NDEBUG from the FastISel debugging options. This
fixes dejagnu tests that use these options.

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

15 years agoTeach SCEVExpander to expand arithmetic involving pointers into GEP
Dan Gohman [Tue, 19 May 2009 02:15:55 +0000 (02:15 +0000)]
Teach SCEVExpander to expand arithmetic involving pointers into GEP
instructions. It attempts to create high-level multi-operand GEPs,
though in cases where this isn't possible it falls back to casting
the pointer to i8* and emitting a GEP with that. Using GEP instructions
instead of ptrtoint+arithmetic+inttoptr helps pointer analyses that
don't use ScalarEvolution, such as BasicAliasAnalysis.

Also, make the AddrModeMatcher more aggressive in handling GEPs.
Previously it assumed that operand 0 of a GEP would require a register
in almost all cases. It now does extra checking and can do more
matching if operand 0 of the GEP is foldable. This fixes a problem
that was exposed by SCEVExpander using GEPs.

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

15 years agoTest commit.
Cristian Cadar [Tue, 19 May 2009 01:56:08 +0000 (01:56 +0000)]
Test commit.

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

15 years agoAdd some comments noting how IndVarSimplify facilitates
Dan Gohman [Tue, 19 May 2009 01:52:46 +0000 (01:52 +0000)]
Add some comments noting how IndVarSimplify facilitates
LoopInfo functionality.

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

15 years agoMake using an unsupported CAS size a hard error on Windows.
Owen Anderson [Tue, 19 May 2009 01:08:36 +0000 (01:08 +0000)]
Make using an unsupported CAS size a hard error on Windows.

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

15 years agoFix up the Windows portion of Atomic.h. This is untested, but it is my best understa...
Owen Anderson [Tue, 19 May 2009 01:07:40 +0000 (01:07 +0000)]
Fix up the Windows portion of Atomic.h.  This is untested, but it is my best understanding of what should work.
I'd be much obliged if someone on MSVC++ could try this out and let me know if it works.

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

15 years agoTemplate CompareAndSwap function.
Owen Anderson [Tue, 19 May 2009 01:02:27 +0000 (01:02 +0000)]
Template CompareAndSwap function.

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

15 years agoSpacing fix.
Dale Johannesen [Tue, 19 May 2009 00:46:42 +0000 (00:46 +0000)]
Spacing fix.

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

15 years agoFix cmake builds.
Mike Stump [Tue, 19 May 2009 00:18:14 +0000 (00:18 +0000)]
Fix cmake builds.

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

15 years agoNow that we have atomics support properly detected by configure,
Owen Anderson [Tue, 19 May 2009 00:08:29 +0000 (00:08 +0000)]
Now that we have atomics support properly detected by configure,
use it to implement Atomic.h.

This expunges the code previously imported from libatomic_ops.

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

15 years agoTest for the presence of GCC atomic builtins at configure time. If not found,
Owen Anderson [Mon, 18 May 2009 23:58:51 +0000 (23:58 +0000)]
Test for the presence of GCC atomic builtins at configure time.  If not found,
disable building LLVM in thread-safe mode and print a nice warning.

Regenerate configure for these changes.

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

15 years agoAdd -submit-aux option to NewNightlyTest.pl
Daniel Dunbar [Mon, 18 May 2009 23:24:26 +0000 (23:24 +0000)]
Add -submit-aux option to NewNightlyTest.pl
 - If given, the argument will be run using system with the path to the sent
   data. Useful for testing nightlytest server replacements.

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

15 years agoDon't set the "location" information for inlined functions' variables.
Bill Wendling [Mon, 18 May 2009 23:08:55 +0000 (23:08 +0000)]
Don't set the "location" information for inlined functions' variables.

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

15 years agoSmall code cleanup.
Bill Wendling [Mon, 18 May 2009 22:33:01 +0000 (22:33 +0000)]
Small code cleanup.

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