oota-llvm.git
16 years agoRevert previous "fix" - the breakage was due to some
Duncan Sands [Wed, 28 Nov 2007 16:50:29 +0000 (16:50 +0000)]
Revert previous "fix" - the breakage was due to some
local changes, not the "not".

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

16 years agoThis test somehow got an extra "not" during the
Duncan Sands [Wed, 28 Nov 2007 15:36:27 +0000 (15:36 +0000)]
This test somehow got an extra "not" during the
recent stderr updates.

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

16 years agoMy compiler complains that "x always evaluates to true"
Duncan Sands [Wed, 28 Nov 2007 10:36:19 +0000 (10:36 +0000)]
My compiler complains that "x always evaluates to true"
in this call:

Result.IntVal = APInt(80, 2, x);

What is x?

uint16_t x[8];

I deduce that the APInt constructor being used is this one:

  APInt(uint32_t numBits, uint64_t val, bool isSigned = false);

rather than this one:

  APInt(uint32_t numBits, uint32_t numWords, const uint64_t bigVal[]);

That doesn't seem right!  This fix compiles but is otherwise completely
untested.

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

16 years agoAdd missing newlines at EOF.
Duncan Sands [Wed, 28 Nov 2007 10:13:38 +0000 (10:13 +0000)]
Add missing newlines at EOF.

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

16 years agoxfail a test
Chris Lattner [Wed, 28 Nov 2007 05:37:13 +0000 (05:37 +0000)]
xfail a test

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

16 years agoupdate this test after the fmrrd fix
Chris Lattner [Wed, 28 Nov 2007 05:27:07 +0000 (05:27 +0000)]
update this test after the fmrrd fix

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

16 years agoFix typo
Tanya Lattner [Wed, 28 Nov 2007 05:14:49 +0000 (05:14 +0000)]
Fix typo

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

16 years agoModified instructions to configure llvm-test by configure llvm with the Path --with...
Tanya Lattner [Wed, 28 Nov 2007 05:13:45 +0000 (05:13 +0000)]
Modified instructions to configure llvm-test by configure llvm with the Path --with-llvmgccdir set.

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

16 years agoFix bug in regression tests that ignored stderr output in RUN lines. Updated tests...
Tanya Lattner [Wed, 28 Nov 2007 04:57:00 +0000 (04:57 +0000)]
Fix bug in regression tests that ignored stderr output in RUN lines. Updated tests and fixed broken run lines.
XFAILed 3 arm regressions (will file bugs)

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

16 years agoRecover compile time regression.
Evan Cheng [Wed, 28 Nov 2007 01:28:46 +0000 (01:28 +0000)]
Recover compile time regression.

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

16 years agoAdd MachineLoopInfo. This is not yet tested.
Owen Anderson [Tue, 27 Nov 2007 22:47:08 +0000 (22:47 +0000)]
Add MachineLoopInfo.  This is not yet tested.

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

16 years agocommit testcase I forgot to svn add.
Chris Lattner [Tue, 27 Nov 2007 22:43:37 +0000 (22:43 +0000)]
commit testcase I forgot to svn add.

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

16 years agoseveral entries got significantly better, though they still aren't done.
Chris Lattner [Tue, 27 Nov 2007 22:41:52 +0000 (22:41 +0000)]
several entries got significantly better, though they still aren't done.

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

16 years agoimplement a trivial readme entry.
Chris Lattner [Tue, 27 Nov 2007 22:36:16 +0000 (22:36 +0000)]
implement a trivial readme entry.

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

16 years agoFix a crash on invalid code due to memcpy lowering.
Chris Lattner [Tue, 27 Nov 2007 22:14:42 +0000 (22:14 +0000)]
Fix a crash on invalid code due to memcpy lowering.

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

16 years agoMake this actually work on systems that support ppc long double.
Chris Lattner [Tue, 27 Nov 2007 20:45:25 +0000 (20:45 +0000)]
Make this actually work on systems that support ppc long double.

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

16 years agoUnbreak all of the darwin/ppc32 JIT failures having to do
Chris Lattner [Tue, 27 Nov 2007 20:41:32 +0000 (20:41 +0000)]
Unbreak all of the darwin/ppc32 JIT failures having to do
with not being able to find printf.

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

16 years agoUpdated GenLibDeps.pl to employ "use strict" to help prevent uses of variables
Ted Kremenek [Tue, 27 Nov 2007 19:31:11 +0000 (19:31 +0000)]
Updated GenLibDeps.pl to employ "use strict" to help prevent uses of variables
that have not yet been defined.

Removed used of grep and sed when parsing the results of "nm". This was
originally motivated because if the user has specified options to grep using
the environment variable GREP_OPTIONS this could break the script. Piping
through grep/sed/sort/uniq is also (to my understanding) not necessary, and
the equivalent operations can be done much faster in the Perl script.

Using a crude benchmark, these changes resulted in a 3x speedup in the
execution of GenLibDeps.pl.

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

16 years agoSupport returning non-power-of-2 vectors to unblock some work
Nate Begeman [Tue, 27 Nov 2007 19:28:48 +0000 (19:28 +0000)]
Support returning non-power-of-2 vectors to unblock some work

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

16 years agosomething wrong with this opt
Andrew Lenharth [Tue, 27 Nov 2007 18:31:30 +0000 (18:31 +0000)]
something wrong with this opt

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

16 years agoAdd testcase for last llvm-gcc tweaks
Anton Korobeynikov [Tue, 27 Nov 2007 18:21:29 +0000 (18:21 +0000)]
Add testcase for last llvm-gcc tweaks

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

16 years agoAdded quotes around $(NM_PATH) argument to GenLibDeps.pl script so that
Ted Kremenek [Tue, 27 Nov 2007 17:53:54 +0000 (17:53 +0000)]
Added quotes around $(NM_PATH) argument to GenLibDeps.pl script so that
the "-p" option is actually seen by nm (it was being dropped as it was
considered as separate argument to the Perl script).

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

16 years agoUnbreak backwards compatibility with bytecode format. Regression
Chris Lattner [Tue, 27 Nov 2007 17:48:06 +0000 (17:48 +0000)]
Unbreak backwards compatibility with bytecode format.  Regression
introduced by this patch:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071126/055824.html

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

16 years agoFix PR1146: parameter attributes are longer part of
Duncan Sands [Tue, 27 Nov 2007 13:23:08 +0000 (13:23 +0000)]
Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls.  This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll).  Hopefully
a bitcode guru (who might that be? :) ) will fix it.

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

16 years agoMake this pass for CYGWIN.
Zhou Sheng [Tue, 27 Nov 2007 06:23:59 +0000 (06:23 +0000)]
Make this pass for CYGWIN.

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

16 years agoMake this testcase compatible with CYGWIN.
Zhou Sheng [Tue, 27 Nov 2007 06:17:01 +0000 (06:17 +0000)]
Make this testcase compatible with CYGWIN.

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

16 years agoerr, no really.
Chris Lattner [Tue, 27 Nov 2007 06:14:32 +0000 (06:14 +0000)]
err, no really.

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

16 years agodon't depend on ADL.
Chris Lattner [Tue, 27 Nov 2007 06:14:12 +0000 (06:14 +0000)]
don't depend on ADL.

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

16 years agoMake LoopInfoBase more generic, in preparation for having MachineLoopInfo. This...
Owen Anderson [Tue, 27 Nov 2007 03:43:35 +0000 (03:43 +0000)]
Make LoopInfoBase more generic, in preparation for having MachineLoopInfo.  This involves a small interface change.

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

16 years agoAdd accessor for getting the underlying templated type. This is necessary for templa...
Owen Anderson [Tue, 27 Nov 2007 03:33:40 +0000 (03:33 +0000)]
Add accessor for getting the underlying templated type.  This is necessary for templated LoopInfo.

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

16 years agoMoving TGLexer.h from source to header file tab in TableGen project file
Chuck Rose III [Tue, 27 Nov 2007 01:25:12 +0000 (01:25 +0000)]
Moving TGLexer.h from source to header file tab in TableGen project file

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

16 years agoChange &| to |&.
Dan Gohman [Tue, 27 Nov 2007 00:50:57 +0000 (00:50 +0000)]
Change &| to |&.

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

16 years agoChange grep '' to grep {}.
Dan Gohman [Tue, 27 Nov 2007 00:10:35 +0000 (00:10 +0000)]
Change grep '' to grep {}.
Change 2>&1 | to |&.

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

16 years agoDon't redirect llvm-as's stderr to llvm-dis.
Dan Gohman [Tue, 27 Nov 2007 00:07:33 +0000 (00:07 +0000)]
Don't redirect llvm-as's stderr to llvm-dis.
Change grep '' to grep {}.

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

16 years agoRemove unnecessary && from the RUN lines of this test.
Dan Gohman [Tue, 27 Nov 2007 00:03:38 +0000 (00:03 +0000)]
Remove unnecessary && from the RUN lines of this test.

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

16 years agoDon't lower srem/urem X%C to X-X/C*C unless the division is actually
Dan Gohman [Mon, 26 Nov 2007 23:46:11 +0000 (23:46 +0000)]
Don't lower srem/urem X%C to X-X/C*C unless the division is actually
optimized. This avoids creating illegal divisions when the combiner is
running after legalize; this fixes PR1815. Also, it produces better
code in the included testcase by avoiding the subtract and multiply
when the division isn't optimized.

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

16 years agoAdd TGParser files to VStudio project files. Removed generated files section from...
Chuck Rose III [Mon, 26 Nov 2007 23:19:59 +0000 (23:19 +0000)]
Add TGParser files to VStudio project files.  Removed generated files section from TableGen project file as it is no longer needed.  #Include <algorithm> directly from TGParser.cpp so it can see std::reverse.

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

16 years agoFix another bug that was causing siod to fail.
Owen Anderson [Mon, 26 Nov 2007 07:17:19 +0000 (07:17 +0000)]
Fix another bug that was causing siod to fail.

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

16 years agoFix a silly bug that Nicholas noticed.
Owen Anderson [Mon, 26 Nov 2007 03:27:38 +0000 (03:27 +0000)]
Fix a silly bug that Nicholas noticed.

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

16 years agoAllow GVN to eliminate read-only function calls when it can detect that they are...
Owen Anderson [Mon, 26 Nov 2007 02:26:36 +0000 (02:26 +0000)]
Allow GVN to eliminate read-only function calls when it can detect that they are redundant.

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

16 years agoRemove another leak. Due to some reason AliasSetTracker didn't had any dtor...
Anton Korobeynikov [Sun, 25 Nov 2007 23:52:02 +0000 (23:52 +0000)]
Remove another leak. Due to some reason AliasSetTracker didn't had any dtor...

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

16 years agoAdd new SCEV, SCEVSMax. This allows LLVM to analyze do-while loops.
Nick Lewycky [Sun, 25 Nov 2007 22:41:31 +0000 (22:41 +0000)]
Add new SCEV, SCEVSMax. This allows LLVM to analyze do-while loops.

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

16 years agoImplement PR1822
Chris Lattner [Sun, 25 Nov 2007 21:27:53 +0000 (21:27 +0000)]
Implement PR1822

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

16 years agoRemove a leak. Destroy LoopInfoBase object. releaseMemory() is actually called in...
Anton Korobeynikov [Sun, 25 Nov 2007 18:41:39 +0000 (18:41 +0000)]
Remove a leak. Destroy LoopInfoBase object. releaseMemory() is actually called in its dtor.

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

16 years agoFix PR1816. If a bitcast of a function only exists because of a
Duncan Sands [Sun, 25 Nov 2007 14:10:56 +0000 (14:10 +0000)]
Fix PR1816.  If a bitcast of a function only exists because of a
trivial difference in function attributes, allow calls to it to
be converted to direct calls.  Based on a patch by Török Edwin.
While there, move the various lists of mutually incompatible
parameters etc out of the verifier and into ParameterAttributes.h.

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

16 years agoDon't ignore files that are no longer in use.
Reid Spencer [Sun, 25 Nov 2007 07:05:05 +0000 (07:05 +0000)]
Don't ignore files that are no longer in use.

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

16 years agoFix a long standing deficiency in the X86 backend: we would
Chris Lattner [Sun, 25 Nov 2007 00:24:49 +0000 (00:24 +0000)]
Fix a long standing deficiency in the X86 backend: we would
sometimes emit "zero" and "all one" vectors multiple times,
for example:

_test2:
pcmpeqd %mm0, %mm0
movq %mm0, _M1
pcmpeqd %mm0, %mm0
movq %mm0, _M2
ret

instead of:

_test2:
pcmpeqd %mm0, %mm0
movq %mm0, _M1
movq %mm0, _M2
ret

This patch fixes this by always arranging for zero/one vectors
to be defined as v4i32 or v2i32 (SSE/MMX) instead of letting them be
any random type.  This ensures they get trivially CSE'd on the dag.
This fix is also important for LegalizeDAGTypes, as it gets unhappy
when the x86 backend wants BUILD_VECTOR(i64 0) to be legal even when
'i64' isn't legal.

This patch makes the following changes:

1) X86TargetLowering::LowerBUILD_VECTOR now lowers 0/1 vectors into
   their canonical types.
2) The now-dead patterns are removed from the SSE/MMX .td files.
3) All the patterns in the .td file that referred to immAllOnesV or
   immAllZerosV in the wrong form now use *_bc to match them with a
   bitcast wrapped around them.
4) X86DAGToDAGISel::SelectScalarSSELoad is generalized to handle
   bitcast'd zero vectors, which simplifies the code actually.
5) getShuffleVectorZeroOrUndef is updated to generate a shuffle that
   is legal, instead of generating one that is illegal and expecting
   a later legalize pass to clean it up.
6) isZeroShuffle is generalized to handle bitcast of zeros.
7) several other minor tweaks.

This patch is definite goodness, but has the potential to cause random
code quality regressions.  Please be on the lookout for these and let
me know if they happen.

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

16 years agoImplement expand support for MERGE_VALUEs that only produces one result.
Chris Lattner [Sat, 24 Nov 2007 19:12:15 +0000 (19:12 +0000)]
Implement expand support for MERGE_VALUEs that only produces one result.

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

16 years agoadd a immAllZerosV_bc pattern fragment for consistency with others.
Chris Lattner [Sat, 24 Nov 2007 19:02:07 +0000 (19:02 +0000)]
add a immAllZerosV_bc pattern fragment for consistency with others.

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

16 years agoremove bogus assertion that broke CodeGen/Generic/cast-fp.ll on x86
Chris Lattner [Sat, 24 Nov 2007 18:37:20 +0000 (18:37 +0000)]
remove bogus assertion that broke CodeGen/Generic/cast-fp.ll on x86
among others.

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

16 years agoImplement support for custom legalization in DAGTypeLegalizer::ExpandOperand.
Chris Lattner [Sat, 24 Nov 2007 18:11:42 +0000 (18:11 +0000)]
Implement support for custom legalization in DAGTypeLegalizer::ExpandOperand.
Improve a comment.
Unbreak Duncan's carefully written path compression where I didn't realize
what was happening!

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

16 years agoSeveral changes:
Chris Lattner [Sat, 24 Nov 2007 07:07:01 +0000 (07:07 +0000)]
Several changes:
1) Change the interface to TargetLowering::ExpandOperationResult to
   take and return entire NODES that need a result expanded, not just
   the value.  This allows us to handle things like READCYCLECOUNTER,
   which returns two values.
2) Implement (extremely limited) support in LegalizeDAG::ExpandOp for MERGE_VALUES.
3) Reimplement custom lowering in LegalizeDAGTypes in terms of the new
   ExpandOperationResult.  This makes the result simpler and fully
   general.
4) Implement (fully general) expand support for MERGE_VALUES in LegalizeDAGTypes.
5) Implement ExpandOperationResult support for ARM f64->i64 bitconvert and ARM
   i64 shifts, allowing them to work with LegalizeDAGTypes.
6) Implement ExpandOperationResult support for X86 READCYCLECOUNTER and FP_TO_SINT,
   allowing them to work with LegalizeDAGTypes.

LegalizeDAGTypes now passes several more X86 codegen tests when enabled and when
type legalization in LegalizeDAG is ifdef'd out.

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

16 years agoadd a note
Chris Lattner [Sat, 24 Nov 2007 06:13:33 +0000 (06:13 +0000)]
add a note

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

16 years agoupgrade this test
Chris Lattner [Sat, 24 Nov 2007 05:39:29 +0000 (05:39 +0000)]
upgrade this test

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

16 years agoFix PR1816, by correcting the broken definition of APInt::countTrailingZeros.
Chris Lattner [Fri, 23 Nov 2007 22:42:31 +0000 (22:42 +0000)]
Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros.

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

16 years agosimplify some code.
Chris Lattner [Fri, 23 Nov 2007 22:36:49 +0000 (22:36 +0000)]
simplify some code.

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

16 years agoFix APInt::countTrailingZeros to return BitWidth if the input is zero instead of...
Chris Lattner [Fri, 23 Nov 2007 22:36:25 +0000 (22:36 +0000)]
Fix APInt::countTrailingZeros to return BitWidth if the input is zero instead of returning some random large number.

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

16 years agoadd a comment.
Chris Lattner [Fri, 23 Nov 2007 22:35:18 +0000 (22:35 +0000)]
add a comment.

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

16 years agosplice some lines together, no functionality change.
Chris Lattner [Fri, 23 Nov 2007 22:34:59 +0000 (22:34 +0000)]
splice some lines together, no functionality change.

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

16 years ago!< is >=, not >. Thanks to Max Hailperin for pointing this out!
Chris Lattner [Fri, 23 Nov 2007 22:19:33 +0000 (22:19 +0000)]
!< is >=, not >.  Thanks to Max Hailperin for pointing this out!

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

16 years agoDing dong, the DoesntAccessMemoryFns and
Duncan Sands [Fri, 23 Nov 2007 19:30:27 +0000 (19:30 +0000)]
Ding dong, the DoesntAccessMemoryFns and
OnlyReadsMemoryFns tables are dead!  We
get more, and more accurate, information
from gcc via the readnone and readonly
function attributes.

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

16 years agoRemove some logic I thoughtlessly copied over
Duncan Sands [Fri, 23 Nov 2007 09:10:17 +0000 (09:10 +0000)]
Remove some logic I thoughtlessly copied over
from the old ADCE implementation (there it was
correct because the transform was being done
for read-only functions).

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

16 years agoFix a bug where we'd try to find a scev value for a bitcast operand,
Chris Lattner [Fri, 23 Nov 2007 08:46:22 +0000 (08:46 +0000)]
Fix a bug where we'd try to find a scev value for a bitcast operand,
even though the bitcast operand did not have integer type.  This fixes
PR1814.

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

16 years agoFix PR1817.
Chris Lattner [Thu, 22 Nov 2007 23:47:13 +0000 (23:47 +0000)]
Fix PR1817.

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

16 years agoadd some static icmpinst predicates.
Chris Lattner [Thu, 22 Nov 2007 23:43:29 +0000 (23:43 +0000)]
add some static icmpinst predicates.

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

16 years agoadd missing #include
Chris Lattner [Thu, 22 Nov 2007 23:19:05 +0000 (23:19 +0000)]
add missing #include

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

16 years agoDon't crash on bogus llvm.noinline. This is first part of PR1817 (preventing reduction)
Anton Korobeynikov [Thu, 22 Nov 2007 22:30:10 +0000 (22:30 +0000)]
Don't crash on bogus llvm.noinline. This is first part of PR1817 (preventing reduction)

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

16 years agoTurn invokes of nounwind functions into ordinary calls.
Duncan Sands [Thu, 22 Nov 2007 22:24:59 +0000 (22:24 +0000)]
Turn invokes of nounwind functions into ordinary calls.

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

16 years agoTeach alias analysis about readnone/readonly functions.
Duncan Sands [Thu, 22 Nov 2007 21:43:27 +0000 (21:43 +0000)]
Teach alias analysis about readnone/readonly functions.
Based on a patch by Török Edwin.

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

16 years agoReadonly/readnone functions are allowed to throw
Duncan Sands [Thu, 22 Nov 2007 21:40:06 +0000 (21:40 +0000)]
Readonly/readnone functions are allowed to throw
exceptions, so don't turn invokes of them into
calls.

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

16 years agoresolve the last fixme's in the new tblgen parser.
Chris Lattner [Thu, 22 Nov 2007 21:06:59 +0000 (21:06 +0000)]
resolve the last fixme's in the new tblgen parser.

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

16 years agochange the Init print methods to return strings, and implement
Chris Lattner [Thu, 22 Nov 2007 21:05:25 +0000 (21:05 +0000)]
change the Init print methods to return strings, and implement
print in terms of that.

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

16 years agoeliminate a bunch of print methods that are duplicate with the getAsString() method.
Chris Lattner [Thu, 22 Nov 2007 20:51:34 +0000 (20:51 +0000)]
eliminate a bunch of print methods that are duplicate with the getAsString() method.

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

16 years agoRewrite the tblgen parser in a recursive descent style, eliminating the bison parser.
Chris Lattner [Thu, 22 Nov 2007 20:49:04 +0000 (20:49 +0000)]
Rewrite the tblgen parser in a recursive descent style, eliminating the bison parser.

This makes the parser much easier to understand, eliminates a ton of global variables,
and gives tblgen nice caret diagnostics.  It is also faster, but tblgen probably doesn't
care about performance.

There are a couple of FIXMEs which I will take care of next.

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

16 years agoRename the 'const' parameter attribute to 'readnone',
Duncan Sands [Thu, 22 Nov 2007 20:23:04 +0000 (20:23 +0000)]
Rename the 'const' parameter attribute to 'readnone',
and the 'pure' parameter attribute to 'readonly'.
Names suggested by DannyB.

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

16 years agoInstead of calculating constant factors, calculate the number of trailing
Nick Lewycky [Thu, 22 Nov 2007 07:59:40 +0000 (07:59 +0000)]
Instead of calculating constant factors, calculate the number of trailing
bits. Patch from Wojciech Matyjewicz.

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

16 years agoCreate nodes for inline asm so that we don't crash looking for the node later.
Nick Lewycky [Thu, 22 Nov 2007 03:07:37 +0000 (03:07 +0000)]
Create nodes for inline asm so that we don't crash looking for the node later.

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

16 years agoSwitching back to strtoll. Including config.h. On VStudio builds, this overrides...
Chuck Rose III [Wed, 21 Nov 2007 19:36:25 +0000 (19:36 +0000)]
Switching back to strtoll. Including config.h.  On VStudio builds, this overrides strtoll.

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

16 years agoFix a bug in which node A is replaced by node B, but later
Duncan Sands [Wed, 21 Nov 2007 16:43:19 +0000 (16:43 +0000)]
Fix a bug in which node A is replaced by node B, but later
node A gets back into the DAG again because it was hiding in
one of the node maps: make sure that node replacement happens
in those maps too.

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

16 years agotypo
Nick Lewycky [Wed, 21 Nov 2007 05:21:54 +0000 (05:21 +0000)]
typo

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

16 years agoFix compiler warning.
Dale Johannesen [Wed, 21 Nov 2007 00:45:00 +0000 (00:45 +0000)]
Fix compiler warning.

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

16 years agoThis change does a couple of things. First it gets the Visual Studio builds working.
Chuck Rose III [Wed, 21 Nov 2007 00:37:56 +0000 (00:37 +0000)]
This change does a couple of things.  First it gets the Visual Studio builds working.
I added the lexing files to the VStudio projects and removed the .l files from the
VStudio projects.  There was a problem with use of strtoll in TGLexer.cpp and Chris
suggested switching to strtol, so that's included here.

Additionally, this checkin adds minimal x64 builds to the VStudio builds.  Build issues
related to x64 in the windows specific files for DynamicLibrary.inc and Singals.inc
are worked around, but not ultimately solved.  Binaries used to be stored in

...\win32\{Debug|Release}

but are now kept in

...\win32\bin\{win32|x64}\{Debug|Release}

intermediate files will continue to be stored in the individual project directories under
win32.

Some names will likely change in the future to reflect that the vstudio projects
are no longer 32-bit only, but I wanted to get things up and running today so kept away
from bigger restructuring.

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

16 years agoFile missing from previous patch.
Dale Johannesen [Tue, 20 Nov 2007 23:25:17 +0000 (23:25 +0000)]
File missing from previous patch.

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

16 years agoFix .eh table linkage issues on Darwin. Some EH support
Dale Johannesen [Tue, 20 Nov 2007 23:24:42 +0000 (23:24 +0000)]
Fix .eh table linkage issues on Darwin.  Some EH support
for Darwin PPC, but it's not fully working yet.

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

16 years agoAdd the ability to convert a tblgen type to a string.
Chris Lattner [Tue, 20 Nov 2007 22:25:16 +0000 (22:25 +0000)]
Add the ability to convert a tblgen type to a string.

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

16 years agoIn order for parameter attribute uniquing to make
Duncan Sands [Tue, 20 Nov 2007 14:09:29 +0000 (14:09 +0000)]
In order for parameter attribute uniquing to make
any sense it is important that ParamAttr::None gets
treated the same as not supplying an attribute at
all.  Rather than stripping ParamAttr::None out of
the list of attributes, assert if ParamAttr::None
is seen.  Fix up the bitcode reader which liked to
insert ParamAttr::None all over the place.  Patch
based on one by Török Edwin.

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

16 years agoSmall cleanup. Use APInt::getHighBitsSet method instead of shift left.
Nick Lewycky [Tue, 20 Nov 2007 08:44:50 +0000 (08:44 +0000)]
Small cleanup. Use APInt::getHighBitsSet method instead of shift left.
"setcc" -> "icmp op" in comments. No functionality change.

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

16 years agoBe more careful when transforming | to +. Patch from Wojciech Matyjewicz.
Nick Lewycky [Tue, 20 Nov 2007 08:24:44 +0000 (08:24 +0000)]
Be more careful when transforming | to +. Patch from Wojciech Matyjewicz.

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

16 years agoTestcase for PR1811
Chris Lattner [Mon, 19 Nov 2007 21:43:22 +0000 (21:43 +0000)]
Testcase for PR1811

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

16 years agoExpandUnalignedLoad doesn't handle vectors right at all apparently.
Chris Lattner [Mon, 19 Nov 2007 21:38:03 +0000 (21:38 +0000)]
ExpandUnalignedLoad doesn't handle vectors right at all apparently.
Fix a couple of problems:
1. Don't assume the VT-1 is a VT that is half the size.
2. Treat vectors of FP in the vector path, not the FP path.

This has a couple of remaining problems before it will work with
the code in PR1811: the code below this change assumes that it can
use extload/shift/or to construct the result, which isn't right for
vectors.

This also doesn't handle vectors of 1 or vectors that aren't pow-2.

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

16 years agoImplement vector expand support for shuffle_vector. This fixes PR1811.
Chris Lattner [Mon, 19 Nov 2007 21:16:54 +0000 (21:16 +0000)]
Implement vector expand support for shuffle_vector.  This fixes PR1811.

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

16 years agoRemove meaningless qualifiers from return types, avoiding compiler warnings.
Dan Gohman [Mon, 19 Nov 2007 20:46:23 +0000 (20:46 +0000)]
Remove meaningless qualifiers from return types, avoiding compiler warnings.

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

16 years agoImplement splitting of UNDEF nodes. This is the first step towards fixing PR1811
Chris Lattner [Mon, 19 Nov 2007 20:21:32 +0000 (20:21 +0000)]
Implement splitting of UNDEF nodes. This is the first step towards fixing PR1811

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

16 years agoTeach me to do stuff late at night.
Owen Anderson [Mon, 19 Nov 2007 16:10:59 +0000 (16:10 +0000)]
Teach me to do stuff late at night.

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

16 years agoFix a typo in a comment.
Dan Gohman [Mon, 19 Nov 2007 15:36:19 +0000 (15:36 +0000)]
Fix a typo in a comment.

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

16 years agoAdd explicit keywords.
Dan Gohman [Mon, 19 Nov 2007 15:30:20 +0000 (15:30 +0000)]
Add explicit keywords.

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

16 years agoAdd support in SplitVectorOp for remainder operators.
Dan Gohman [Mon, 19 Nov 2007 15:15:03 +0000 (15:15 +0000)]
Add support in SplitVectorOp for remainder operators.

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

16 years agoFix a factually incorrect statement pointed out by Max Hailperin.
Owen Anderson [Mon, 19 Nov 2007 07:44:43 +0000 (07:44 +0000)]
Fix a factually incorrect statement pointed out by Max Hailperin.

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

16 years agoRecord the start of the current token, for use in error reporting.
Chris Lattner [Mon, 19 Nov 2007 07:43:52 +0000 (07:43 +0000)]
Record the start of the current token, for use in error reporting.

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

16 years agoAdd carat diagnostics to tblgen lexer errors.
Chris Lattner [Mon, 19 Nov 2007 07:38:58 +0000 (07:38 +0000)]
Add carat diagnostics to tblgen lexer errors.

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