Dan Gohman [Tue, 26 May 2009 17:41:16 +0000 (17:41 +0000)]
In cases where a pointer value is an operand of a multiplication or
division operation, don't attempt to use the operation's value as
the base of a getelementptr. This fixes PR4271.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72422
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Tue, 26 May 2009 08:55:52 +0000 (08:55 +0000)]
Delete a bunch of dead code from LegalizeDAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72414
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 26 May 2009 06:25:46 +0000 (06:25 +0000)]
Eliminate VarInfo::UsedBlocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72411
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 25 May 2009 21:28:56 +0000 (21:28 +0000)]
make memdep use the getModRefInfo method for stores instead of the
low-level alias() method, allowing it to reason more aggressively
about pointers into constant memory. PR4189
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72403
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 25 May 2009 21:28:11 +0000 (21:28 +0000)]
Audit the type constructors. Previously it was possible to create [0 x void]
or use labels as members of structures for example. Also included a couple of
whitespace fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72402
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 25 May 2009 20:28:19 +0000 (20:28 +0000)]
add some late optimizations that GCC does. It thinks these are a win
even on Core2, not just AMD processors which was a surprise to me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72396
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 25 May 2009 19:51:07 +0000 (19:51 +0000)]
fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72395
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 25 May 2009 16:34:44 +0000 (16:34 +0000)]
we should eventually add -march=atom and the new atom movbe instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72387
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 25 May 2009 06:29:56 +0000 (06:29 +0000)]
Fix the crash debugger to actually bisect globals once it's determined that it
can't just eliminate all global initializers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72378
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 25 May 2009 05:30:00 +0000 (05:30 +0000)]
Add a bisection step on the list of instructions before doing the linear
simplification. It's not clear to me whether this can replace the first of the
linear instruction simplification stages or not, so I left it in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72377
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 24 May 2009 23:45:28 +0000 (23:45 +0000)]
Various comment fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72376
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 24 May 2009 23:25:42 +0000 (23:25 +0000)]
Change ScalarEvolution::getSCEVAtScope to always return the original value
in the case where a loop exit value cannot be computed, instead of only in
some cases while using SCEVCouldNotCompute in others. This simplifies
getSCEVAtScope's callers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72375
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sun, 24 May 2009 20:32:10 +0000 (20:32 +0000)]
Add a comment which should hopefully make the purpose of this method a
bit clearer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72374
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sun, 24 May 2009 20:29:11 +0000 (20:29 +0000)]
Minor improvement to FCOPYSIGN to use BIT_CONVERT in cases where the
corresponding integer type is legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72373
91177308-0d34-0410-b5e6-
96231b3b80d8
Torok Edwin [Sun, 24 May 2009 20:08:21 +0000 (20:08 +0000)]
Move Rewriter.clear() earlier, to avoid triggerring the AssertingVH by
one of the RecursivelyDeleteTriviallyDeadInstructions.
Add a comment explaining why the cache needs to be cleared.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72372
91177308-0d34-0410-b5e6-
96231b3b80d8
Torok Edwin [Sun, 24 May 2009 19:36:09 +0000 (19:36 +0000)]
Instead of clearing the rewriter, don't attempt to rewrite dead phi nodes.
Also fix 80 column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72371
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 24 May 2009 19:11:38 +0000 (19:11 +0000)]
When rewriting the loop exit test with the canonical induction variable,
leave the original comparison in place if it has other uses, since the
other uses won't be dominated by the new comparison instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72369
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 24 May 2009 19:02:45 +0000 (19:02 +0000)]
Fix this code for hosts where std::vector doesn't have .data().
Use &Ops[0] instead, which is safe since Ops will never be empty here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72368
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 24 May 2009 18:09:01 +0000 (18:09 +0000)]
When replacing a floating-point comparison with an integer
comparison, use takeName to give the integer comparison a name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72367
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 24 May 2009 18:06:31 +0000 (18:06 +0000)]
Generalize SCEVExpander::visitAddRecExpr's GEP persuit, and avoid
sending SCEVUnknowns to expandAddToGEP. This avoids the need for
expandAddToGEP to bend the rules and peek into SCEVUnknown
expressions.
Factor out the code for testing whether a SCEV can be factored by
a constant for use in a GEP index. This allows it to handle
SCEVAddRecExprs, by recursing.
As a result, SCEVExpander can now put more things in GEP indices,
so it emits fewer explicit mul instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72366
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 24 May 2009 18:02:35 +0000 (18:02 +0000)]
When the low bits of one operand of an add are zero, that number
of low bits of the other operand are preserved in the output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72365
91177308-0d34-0410-b5e6-
96231b3b80d8
Torok Edwin [Sun, 24 May 2009 14:23:16 +0000 (14:23 +0000)]
The rewriter may hold references to instructions that are deleted because they are trivially dead.
Fix by clearing the rewriter cache before deleting the trivially dead
instructions.
Also make InsertedExpressions use an AssertingVH to catch these
bugs easier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72364
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sun, 24 May 2009 10:21:20 +0000 (10:21 +0000)]
Rewrite ISD::FCOPYSIGN lowering to never use i64. Not really ideal, but
it's late, and I don't have any better ideas at the moment. Fixes PR4257.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72363
91177308-0d34-0410-b5e6-
96231b3b80d8
Torok Edwin [Sun, 24 May 2009 09:40:47 +0000 (09:40 +0000)]
Make bugpoint emit a bugpoint-reduced-blocks.bc, because bugpoint itself
can crash during instruction simplification (for example if it creates a
broken module).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72362
91177308-0d34-0410-b5e6-
96231b3b80d8
Torok Edwin [Sun, 24 May 2009 09:31:04 +0000 (09:31 +0000)]
Add -disable-global-remove option to bugpoint.
Sometimes when bugpointing a crash the bugpoint-reduced-simplified.bc reproduces
a totally different bug than the original one ("GV doesn't have initializer").
Although its useful to report that bug too, I need a way to reduce the original
bug, hence I introduced -disable-global-remove.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72361
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sun, 24 May 2009 09:13:13 +0000 (09:13 +0000)]
Update for CMakeLists; untested, so tell me if there are issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72360
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sun, 24 May 2009 08:42:01 +0000 (08:42 +0000)]
Remove checks of getTypeAction from LegalizeOp; we already assert that
all results and all operands are legal, so this change shouldn't affect
behavior at all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72359
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sun, 24 May 2009 02:46:31 +0000 (02:46 +0000)]
Disable type legalization in LegalizeDAG.
This leaves around 4000 lines of dead code; I'll clean that up
in subsequent commits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72358
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sun, 24 May 2009 02:46:06 +0000 (02:46 +0000)]
Remove border around table used for layout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72357
91177308-0d34-0410-b5e6-
96231b3b80d8
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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