oota-llvm.git
16 years agoUpdate a comment to reflect recent changes.
Dan Gohman [Wed, 27 Aug 2008 16:18:22 +0000 (16:18 +0000)]
Update a comment to reflect recent changes.

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

16 years agoUnbreak PseudoSourceValue::print. This fixes -print-machine-instrs
Dan Gohman [Wed, 27 Aug 2008 15:24:43 +0000 (15:24 +0000)]
Unbreak PseudoSourceValue::print. This fixes -print-machine-instrs
and various other things.

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

16 years agoDiagnose uses of unsized types with the byval attribute in the
Dan Gohman [Wed, 27 Aug 2008 14:48:06 +0000 (14:48 +0000)]
Diagnose uses of unsized types with the byval attribute in the
verifier. See PR2711 for details.

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

16 years agoUpdate wording, as aggregates are now first-class.
Dan Gohman [Wed, 27 Aug 2008 14:44:57 +0000 (14:44 +0000)]
Update wording, as aggregates are now first-class.

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

16 years agoAdd DebugInfoBuilder. Patch by Talin!
Evan Cheng [Wed, 27 Aug 2008 06:51:14 +0000 (06:51 +0000)]
Add DebugInfoBuilder. Patch by Talin!

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

16 years agoBasic FastISel support for floating-point constants.
Dan Gohman [Wed, 27 Aug 2008 01:09:54 +0000 (01:09 +0000)]
Basic FastISel support for floating-point constants.

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

16 years agoFix handling of inttoptr and ptrtoint when unhandled operands are present.
Owen Anderson [Wed, 27 Aug 2008 00:35:37 +0000 (00:35 +0000)]
Fix handling of inttoptr and ptrtoint when unhandled operands are present.

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

16 years agoAdd support for fast isel of inttoptr and ptrtoint in the cases where truncation...
Owen Anderson [Wed, 27 Aug 2008 00:31:01 +0000 (00:31 +0000)]
Add support for fast isel of inttoptr and ptrtoint in the cases where truncation is not needed.

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

16 years agoFactor out a large amoutn of the cast handling code in fast isel into helper methods.
Owen Anderson [Tue, 26 Aug 2008 23:46:32 +0000 (23:46 +0000)]
Factor out a large amoutn of the cast handling code in fast isel into helper methods.
This simultaneously makes the code simpler and adds support for sext as well.

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

16 years agoAdd a MachineInstrBuilder method for adding floating-point
Dan Gohman [Tue, 26 Aug 2008 23:19:23 +0000 (23:19 +0000)]
Add a MachineInstrBuilder method for adding floating-point
immediate operands.

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

16 years agoAdd support for fast isel of zext.
Owen Anderson [Tue, 26 Aug 2008 23:14:49 +0000 (23:14 +0000)]
Add support for fast isel of zext.

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

16 years agodisallow direct access to SDValue::ResNo, provide a getter instead
Gabor Greif [Tue, 26 Aug 2008 22:36:50 +0000 (22:36 +0000)]
disallow direct access to SDValue::ResNo, provide a getter instead

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

16 years agoAdd support for fptosi of constants in fast isel.
Owen Anderson [Tue, 26 Aug 2008 22:34:28 +0000 (22:34 +0000)]
Add support for fptosi of constants in fast isel.

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

16 years agoPut a heuristic in place to prevent GVN from falling into bad cases with massively...
Owen Anderson [Tue, 26 Aug 2008 22:07:42 +0000 (22:07 +0000)]
Put a heuristic in place to prevent GVN from falling into bad cases with massively complicated CFGs.
This speeds up a particular testcase from 12+ hours to 5 seconds with little perceptible loss of quality.

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

16 years agoOptimize SelectionDAG's topological sort to use one pass instead
Dan Gohman [Tue, 26 Aug 2008 21:42:18 +0000 (21:42 +0000)]
Optimize SelectionDAG's topological sort to use one pass instead
of two, and to not need a scratch std::vector. Also, use the
SelectionDAG's topological sort in LegalizeDAG instead of having
a separate implementation.

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

16 years agoRefactor the bitcast code into its own function.
Dan Gohman [Tue, 26 Aug 2008 21:28:54 +0000 (21:28 +0000)]
Refactor the bitcast code into its own function.

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

16 years agoRefactor a bunch of FastISelEmitter code into a helper class, and
Dan Gohman [Tue, 26 Aug 2008 21:21:20 +0000 (21:21 +0000)]
Refactor a bunch of FastISelEmitter code into a helper class, and
put each major step in a separate function. This makes the high
level sequence of events easier to follow.

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

16 years agoMake FastISel use the correct argument type when casting GEP indices.
Dan Gohman [Tue, 26 Aug 2008 20:57:08 +0000 (20:57 +0000)]
Make FastISel use the correct argument type when casting GEP indices.

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

16 years agoDon't select binary instructions with illegal types.
Dan Gohman [Tue, 26 Aug 2008 20:52:40 +0000 (20:52 +0000)]
Don't select binary instructions with illegal types.

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

16 years agoAdd support for fast isel of sitofp, and remove some unnecessary and imprecise legali...
Owen Anderson [Tue, 26 Aug 2008 20:37:00 +0000 (20:37 +0000)]
Add support for fast isel of sitofp, and remove some unnecessary and imprecise legality checks.

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

16 years ago- small bug corrected: incorrect iterator type.
Cedric Venet [Tue, 26 Aug 2008 19:49:04 +0000 (19:49 +0000)]
- small bug corrected: incorrect iterator type.
- fix to please VS: add a return after an assert.

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

16 years agoUse a combination of copyRegToReg and ISD::BIT_CONVERT when doing fast isel of bitcasts,
Owen Anderson [Tue, 26 Aug 2008 18:51:24 +0000 (18:51 +0000)]
Use a combination of copyRegToReg and ISD::BIT_CONVERT when doing fast isel of bitcasts,
allowing it to support the full range of conversions people might ask for in a correct manner.

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

16 years agoThese assertions should be return false's instead, allowing the client to detect...
Owen Anderson [Tue, 26 Aug 2008 18:50:40 +0000 (18:50 +0000)]
These assertions should be return false's instead, allowing the client to detect the failure.

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

16 years agoWe need to check that the return type is correct, even in cases where we don't
Owen Anderson [Tue, 26 Aug 2008 18:50:00 +0000 (18:50 +0000)]
We need to check that the return type is correct, even in cases where we don't
have a return type that differs from the operand types.

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

16 years agoMake TargetInstrInfo::copyRegToReg return a bool indicating whether the copy requested
Owen Anderson [Tue, 26 Aug 2008 18:03:31 +0000 (18:03 +0000)]
Make TargetInstrInfo::copyRegToReg return a bool indicating whether the copy requested
was inserted or not.  This allows bitcast in fast isel to properly handle the case
where an appropriate reg-to-reg copy is not available.

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

16 years agoIf IV is used in a int-to-float cast inside the loop then try to eliminate the cast...
Devang Patel [Tue, 26 Aug 2008 17:57:54 +0000 (17:57 +0000)]
If IV is used in a int-to-float cast inside the loop then try to eliminate the cast operation.

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

16 years agoAdd support for fast isel of non-constant fptosi instructions.
Owen Anderson [Tue, 26 Aug 2008 17:44:42 +0000 (17:44 +0000)]
Add support for fast isel of non-constant fptosi instructions.

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

16 years agofix doxygen comment
Gabor Greif [Tue, 26 Aug 2008 17:44:40 +0000 (17:44 +0000)]
fix doxygen comment

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

16 years agoGrammar fix.
Ted Kremenek [Tue, 26 Aug 2008 16:41:15 +0000 (16:41 +0000)]
Grammar fix.

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

16 years agoAdded "str()" method to raw_string_ostream.
Ted Kremenek [Tue, 26 Aug 2008 16:34:01 +0000 (16:34 +0000)]
Added "str()" method to raw_string_ostream.
str() mirrors the same method in std::ostringstream.
str() flushes the buffered stream contents to string and returns a reference to the string.

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

16 years agocode simplification, no functionality change.
Chris Lattner [Tue, 26 Aug 2008 07:01:28 +0000 (07:01 +0000)]
code simplification, no functionality change.

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

16 years agostabilize more printing, this doesn't cause a problem
Chris Lattner [Tue, 26 Aug 2008 06:50:46 +0000 (06:50 +0000)]
stabilize more printing, this doesn't cause a problem
in the example attached to PR2590, but is a problem in general.

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

16 years agostablize SubRegsSet printing, part of PR2590
Chris Lattner [Tue, 26 Aug 2008 06:49:06 +0000 (06:49 +0000)]
stablize SubRegsSet printing, part of PR2590

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

16 years agoStabilize 'getDwarfRegNumFull' output to not depend on random memory
Chris Lattner [Tue, 26 Aug 2008 06:43:25 +0000 (06:43 +0000)]
Stabilize 'getDwarfRegNumFull' output to not depend on random memory
orders, part of PR2590

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

16 years agoIf an xmm register is referenced explicitly in an inline asm, make sure to
Chris Lattner [Tue, 26 Aug 2008 06:19:02 +0000 (06:19 +0000)]
If an xmm register is referenced explicitly in an inline asm, make sure to
assign it to a version of the xmm register with the regclass that matches its
type.  This fixes PR2715, a bug handling some crazy xpcom case in mozilla.

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

16 years agotypo fix.
Chris Lattner [Tue, 26 Aug 2008 06:07:47 +0000 (06:07 +0000)]
typo fix.

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

16 years agoActually recycle SDNode allocations. SelectionDAG is using
Dan Gohman [Tue, 26 Aug 2008 01:44:34 +0000 (01:44 +0000)]
Actually recycle SDNode allocations. SelectionDAG is using
RecyclingAllocator, but this change is needed for the nodes
to actually be recycled. This cuts SelectionDAG's memory
usage high-water-mark in half in some cases.

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

16 years agoAvoid a warning about isTargetNullPtr being unused in release builds.
Dan Gohman [Tue, 26 Aug 2008 01:38:29 +0000 (01:38 +0000)]
Avoid a warning about isTargetNullPtr being unused in release builds.

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

16 years agoThrow the switch to allow FastISel to emit instructions whose return types different...
Owen Anderson [Tue, 26 Aug 2008 01:22:59 +0000 (01:22 +0000)]
Throw the switch to allow FastISel to emit instructions whose return types different from their inputs.  Next step: adding lowering pattens in FastISel that actually use these newly available opcodes.

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

16 years agoThis is done.
Evan Cheng [Tue, 26 Aug 2008 01:13:44 +0000 (01:13 +0000)]
This is done.

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

16 years agoEnhance TableGen to emit code for FastISel of opcodes with variadic return types...
Owen Anderson [Tue, 26 Aug 2008 00:42:26 +0000 (00:42 +0000)]
Enhance TableGen to emit code for FastISel of opcodes with variadic return types without slowing down opcodes that are not variadic.  No such opcodes are currently generated, but in theory it should be a matter of just hitting the switch.

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

16 years agoAdd a RetVT parameter to emitted FastISel methods, so that we will be able to pass...
Owen Anderson [Mon, 25 Aug 2008 23:58:18 +0000 (23:58 +0000)]
Add a RetVT parameter to emitted FastISel methods, so that we will be able to pass the desired return
type down.  This is not currently used.

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

16 years agoDeepen the map structure tablegen uses to compute FastISel patterns, in preparation...
Owen Anderson [Mon, 25 Aug 2008 23:43:09 +0000 (23:43 +0000)]
Deepen the map structure tablegen uses to compute FastISel patterns, in preparation for having patterns
with return types that differ from their input types.  This is not yet used.

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

16 years agoImplement 32 & 64 bit versions of PPC atomic
Dale Johannesen [Mon, 25 Aug 2008 22:34:37 +0000 (22:34 +0000)]
Implement 32 & 64 bit versions of PPC atomic
binary primitives.

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

16 years agoUnbreak build.
Evan Cheng [Mon, 25 Aug 2008 22:20:39 +0000 (22:20 +0000)]
Unbreak build.

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

16 years ago80 col. violations.
Evan Cheng [Mon, 25 Aug 2008 21:58:43 +0000 (21:58 +0000)]
80 col. violations.

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

16 years agoExpand bitcast support in fast isel to support bitcasts of non-constant values by...
Owen Anderson [Mon, 25 Aug 2008 21:32:34 +0000 (21:32 +0000)]
Expand bitcast support in fast isel to support bitcasts of non-constant values by emitting reg-reg copies.

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

16 years agoTry approach to moving call address load inside of callseq_start. Now it's done durin...
Evan Cheng [Mon, 25 Aug 2008 21:27:18 +0000 (21:27 +0000)]
Try approach to moving call address load inside of callseq_start. Now it's done during the preprocess of x86 isel. callseq_start's chain is changed to load's chain node; while load's chain is the last of callseq_start or the loads or copytoreg nodes inserted to move arguments to the right spot.

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

16 years agoRemove PPC-specific lowering for atomics; the
Dale Johannesen [Mon, 25 Aug 2008 21:09:52 +0000 (21:09 +0000)]
Remove PPC-specific lowering for atomics; the
generic stuff works fine.

Mark rewritten cmp-and-swap as not using CR1.

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

16 years agoAdd support for fast isel of (integer) immediate materialization pattens, and use...
Owen Anderson [Mon, 25 Aug 2008 20:20:32 +0000 (20:20 +0000)]
Add support for fast isel of (integer) immediate materialization pattens, and use them to support
bitcast of constants in fast isel.

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

16 years agoAdjust grep's for new code sequence.
Dale Johannesen [Mon, 25 Aug 2008 18:53:58 +0000 (18:53 +0000)]
Adjust grep's for new code sequence.

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

16 years agoIt's important for the cmp-and-swap to balance
Dale Johannesen [Mon, 25 Aug 2008 18:53:26 +0000 (18:53 +0000)]
It's important for the cmp-and-swap to balance
loads and stores but it's even more important for
it to store the right value.:(

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

16 years agoNevermind. This broke the bootstrap (?!).
Bill Wendling [Mon, 25 Aug 2008 18:32:39 +0000 (18:32 +0000)]
Nevermind. This broke the bootstrap (?!).

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

16 years agoMOVQ2DQ and MOVQ2DQ use SSE2. We should conditionalize the use of these
Bill Wendling [Mon, 25 Aug 2008 18:20:52 +0000 (18:20 +0000)]
MOVQ2DQ and MOVQ2DQ use SSE2. We should conditionalize the use of these
instructions on having SSE2.

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

16 years agoFix pasto (values -> types) noticed by Josh Conner
Chris Lattner [Mon, 25 Aug 2008 17:03:15 +0000 (17:03 +0000)]
Fix pasto (values -> types) noticed by Josh Conner

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

16 years agoflush stream after dumping.
Chris Lattner [Mon, 25 Aug 2008 04:55:46 +0000 (04:55 +0000)]
flush stream after dumping.

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

16 years agoFix asm printing of MOVSDto64mr and MOV64toSDrm.
Evan Cheng [Mon, 25 Aug 2008 04:11:42 +0000 (04:11 +0000)]
Fix asm printing of MOVSDto64mr and MOV64toSDrm.

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

16 years agoFix this test. Don't null out the file, just XFAIL it until patch can be fixed.
Bill Wendling [Sun, 24 Aug 2008 21:48:46 +0000 (21:48 +0000)]
Fix this test. Don't null out the file, just XFAIL it until patch can be fixed.

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

16 years agoTemporarily reverting r55292. It's causing a bootstraping failure:
Bill Wendling [Sun, 24 Aug 2008 21:45:30 +0000 (21:45 +0000)]
Temporarily reverting r55292. It's causing a bootstraping failure:

/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/xgcc ... src/libiberty/make-temp-file.c -o make-temp-file.o
Assertion failed: (Node2Index[SU->NodeNum] > Node2Index[I->Dep->NodeNum] && "Wrong topological sorting"), function InitDAGTopologicalSorting, file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp, line 508.
../../../../llvm-gcc.src/libiberty/hashtab.c:955: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[4]: *** [hashtab.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [multi-do] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-target-libiberty] Error 2
make: *** [all] Error 2

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

16 years agoremove the type checking logic already done by tblgen, just keep the
Chris Lattner [Sun, 24 Aug 2008 20:46:13 +0000 (20:46 +0000)]
remove the type checking logic already done by tblgen, just keep the
parts tblgen doesn't do (checking for constant, alloca, enclosing
function has gc marker).  This passes dj! :)

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

16 years agosimplify PseudoSourceValue printing a bit. Unnest all of PseudoSourceValue.cpp from...
Chris Lattner [Sun, 24 Aug 2008 20:37:32 +0000 (20:37 +0000)]
simplify PseudoSourceValue printing a bit.  Unnest all of PseudoSourceValue.cpp from the llvm namespace.

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

16 years agoMove callseq_start above the call address load to allow load to be folded into the...
Evan Cheng [Sun, 24 Aug 2008 19:19:55 +0000 (19:19 +0000)]
Move callseq_start above the call address load to allow load to be folded into the call node.

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

16 years agoPrint PseudoSourceValue.
Evan Cheng [Sun, 24 Aug 2008 18:51:20 +0000 (18:51 +0000)]
Print PseudoSourceValue.

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

16 years agowe should use 'class' for non-pod types instead of 'struct' to
Chris Lattner [Sun, 24 Aug 2008 18:38:56 +0000 (18:38 +0000)]
we should use 'class' for non-pod types instead of 'struct' to
make it easier to deal with the VC++ struct/class bug.

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

16 years agoadd a hack to temporarily allow pseudo source values.
Chris Lattner [Sun, 24 Aug 2008 18:33:17 +0000 (18:33 +0000)]
add a hack to temporarily allow pseudo source  values.

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

16 years agomake sure to flush the stream after dumping, to make sure it goes out immediately.
Chris Lattner [Sun, 24 Aug 2008 18:28:30 +0000 (18:28 +0000)]
make sure to flush the stream after dumping, to make sure it goes out immediately.

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

16 years agoUse additionnal include directory instead of ../ in #include.
Cedric Venet [Sun, 24 Aug 2008 12:30:46 +0000 (12:30 +0000)]
Use additionnal include directory instead of ../ in #include.
Suggested by aKor.

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

16 years agoUpdating VC++ project.
Cedric Venet [Sun, 24 Aug 2008 11:56:40 +0000 (11:56 +0000)]
Updating VC++ project.
Adding one include file and correct one declaration from class to struct in order to make llvm compile on VC2005.

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

16 years agoUpdate GC docs for clarified naming and AsmWriter refactoring.
Gordon Henriksen [Sun, 24 Aug 2008 03:18:23 +0000 (03:18 +0000)]
Update GC docs for clarified naming and AsmWriter refactoring.

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

16 years agoimprove encapsulation of the BBExecutable set.
Chris Lattner [Sat, 23 Aug 2008 23:39:31 +0000 (23:39 +0000)]
improve encapsulation of the BBExecutable set.

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

16 years agoSwitch an assortment of maps, sets and vectors to more efficient versions,
Chris Lattner [Sat, 23 Aug 2008 23:36:38 +0000 (23:36 +0000)]
Switch an assortment of maps, sets and vectors to more efficient versions,
patch contributed by m-s!

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

16 years agoget MachineConstantPool off std::ostream, onto raw_ostream. It would be
Chris Lattner [Sat, 23 Aug 2008 22:53:13 +0000 (22:53 +0000)]
get MachineConstantPool off std::ostream, onto raw_ostream.  It would be
really nice if someone converted MachineFunction::print to raw_ostream.

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

16 years agominor cleanups.
Chris Lattner [Sat, 23 Aug 2008 22:52:27 +0000 (22:52 +0000)]
minor cleanups.

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

16 years agoremove dead method.
Chris Lattner [Sat, 23 Aug 2008 22:43:21 +0000 (22:43 +0000)]
remove dead method.

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

16 years agoAdd raw_stream adaptors that write into an std::string and SmallVector/SmallString.
Chris Lattner [Sat, 23 Aug 2008 22:43:04 +0000 (22:43 +0000)]
Add raw_stream adaptors that write into an std::string and SmallVector/SmallString.

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

16 years agoSwitch the asmprinter (.ll) and all the stuff it requires over to
Chris Lattner [Sat, 23 Aug 2008 22:23:09 +0000 (22:23 +0000)]
Switch the asmprinter (.ll) and all the stuff it requires over to
use raw_ostream instead of std::ostream.  Among other goodness,
this speeds up llvm-dis of kc++ with a release build from 0.85s
to 0.49s (88% faster).

Other interesting changes:
 1) This makes Value::print be non-virtual.
 2) AP[S]Int and ConstantRange can no longer print to ostream directly,
    use raw_ostream instead.
 3) This fixes a bug in raw_os_ostream where it didn't flush itself
    when destroyed.
 4) This adds a new SDNode::print method, instead of only allowing "dump".

A lot of APIs have both std::ostream and raw_ostream versions, it would
be useful to go through and systematically anihilate the std::ostream
versions.

This passes dejagnu, but there may be minor fallout, plz let me know if
so and I'll fix it.

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

16 years agouse proper namespace qualifications
Chris Lattner [Sat, 23 Aug 2008 22:00:15 +0000 (22:00 +0000)]
use proper namespace qualifications

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

16 years agoAdd #include
Chris Lattner [Sat, 23 Aug 2008 21:34:34 +0000 (21:34 +0000)]
Add #include

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

16 years agoadd #include
Chris Lattner [Sat, 23 Aug 2008 21:33:24 +0000 (21:33 +0000)]
add #include

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

16 years agoadd #include
Chris Lattner [Sat, 23 Aug 2008 20:34:06 +0000 (20:34 +0000)]
add #include

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

16 years agoSplit format() out to its own file, add support for formatting
Chris Lattner [Sat, 23 Aug 2008 19:48:00 +0000 (19:48 +0000)]
Split format() out to its own file, add support for formatting
up to three values in one call.

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

16 years agoconditionalize this to work on windows, untested but it should work
Chris Lattner [Sat, 23 Aug 2008 19:27:03 +0000 (19:27 +0000)]
conditionalize this to work on windows, untested but it should work
according to the intarnetz

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

16 years agoadd a simple mechanism for formatted output. This gives raw_ostream's
Chris Lattner [Sat, 23 Aug 2008 19:23:10 +0000 (19:23 +0000)]
add a simple mechanism for formatted output.  This gives raw_ostream's
all the power and risk of fprintf format strings.  Use them like this:

  OS << format("%10.4f", 42.0) << "\n" << format("%x", 42) << '\n';

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

16 years agoTestcase for 64bit maskmovq
Anton Korobeynikov [Sat, 23 Aug 2008 15:53:47 +0000 (15:53 +0000)]
Testcase for 64bit maskmovq

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

16 years agoProvide a 64 bit variant of mmx.maskmovq intrinsic lowering.
Anton Korobeynikov [Sat, 23 Aug 2008 15:53:19 +0000 (15:53 +0000)]
Provide a 64 bit variant of mmx.maskmovq intrinsic lowering.
Is there way to avoid explicit target check?

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

16 years agoReverting r55227. This was causing the following failures in the regression
Bill Wendling [Sat, 23 Aug 2008 09:46:46 +0000 (09:46 +0000)]
Reverting r55227. This was causing the following failures in the regression
tests:

Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcread-ptrptr.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcread-ptrptr.ll >& /dev/null
child process exited abnormally
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-alloca.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-alloca.ll >& /dev/null
child process exited abnormally
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-meta.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-meta.ll >& /dev/null
child process exited abnormally
FAIL: ndbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-ptrptr.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-ptrptr.ll >& /dev/null
child process exited abnormally
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcwrite-ptrptr.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcwrite-ptrptr.ll >& /dev/null
child process exited abnormally

===  Summary ===

# of expected passes 3021
# of unexpected failures 6
# of expected failures 16
make[1]: *** [check-local] Error 1
make: *** [check] Error 2

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

16 years agoAdd a new trivial -inst-namer pass which makes it possible to diff the
Chris Lattner [Sat, 23 Aug 2008 06:07:02 +0000 (06:07 +0000)]
Add a new trivial -inst-namer pass which makes it possible to diff the
before/after effects of a pass, crazy!

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

16 years agoVerify that the alignment argument to llvm.memcpy is a constant
Chris Lattner [Sat, 23 Aug 2008 05:31:10 +0000 (05:31 +0000)]
Verify that the alignment argument to llvm.memcpy is a constant
integer, PR2318.

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

16 years agoremove verification for gc intrinsic argument types. it was indented wrong
Chris Lattner [Sat, 23 Aug 2008 05:26:35 +0000 (05:26 +0000)]
remove verification for gc intrinsic argument types.  it was indented wrong
and tblgen now knows intrinsic prototypes.

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

16 years agoFix PR2423 by checking all indices for out of range access, not only
Chris Lattner [Sat, 23 Aug 2008 05:21:06 +0000 (05:21 +0000)]
Fix PR2423 by checking all indices for out of range access, not only
indices that start with an array subscript.  x->field[10000] is just
as bad as (*X)[14][10000].

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

16 years agothe bug was apparently fixed long ago, reenable the assertion
Chris Lattner [Sat, 23 Aug 2008 03:48:35 +0000 (03:48 +0000)]
the bug was apparently fixed long ago, reenable the assertion

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

16 years agoMake MBBMap a DenseMap instead of a std::map.
Dan Gohman [Sat, 23 Aug 2008 02:44:46 +0000 (02:44 +0000)]
Make MBBMap a DenseMap instead of a std::map.

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

16 years agoMove the point at which FastISel taps into the SelectionDAGISel
Dan Gohman [Sat, 23 Aug 2008 02:25:05 +0000 (02:25 +0000)]
Move the point at which FastISel taps into the SelectionDAGISel
process up to a higher level. This allows FastISel to leverage
more of SelectionDAGISel's infastructure, such as updating Machine
PHI nodes.

Also, implement transitioning from SDISel back to FastISel in
the middle of a block, so it's now possible to go back and
forth. This allows FastISel to hand individual CallInsts and other
complicated things off to SDISel to handle, while handling the rest
of the block itself.

To help support this, reorganize the SelectionDAG class so that it
is allocated once and reused throughout a function, instead of
being completely reallocated for each block.

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

16 years agoAvoid creating shift-by-zero SDNodes in the common case of
Dan Gohman [Sat, 23 Aug 2008 01:06:51 +0000 (01:06 +0000)]
Avoid creating shift-by-zero SDNodes in the common case of
i8* getelementptr. DAGCombine eliminates these, but this is
a fairly common case.

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

16 years agoMove SelectionDAG's constructor out of line.
Dan Gohman [Sat, 23 Aug 2008 00:50:30 +0000 (00:50 +0000)]
Move SelectionDAG's constructor out of line.

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

16 years agoAdd a clear() method to FoldingSet.
Dan Gohman [Sat, 23 Aug 2008 00:42:16 +0000 (00:42 +0000)]
Add a clear() method to FoldingSet.

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

16 years agoTest all currently supported atomic builtins on x86-{32,64}.
Dale Johannesen [Fri, 22 Aug 2008 22:39:21 +0000 (22:39 +0000)]
Test all currently supported atomic builtins on x86-{32,64}.
These just test that they go through the BE.

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

16 years agoComprehensive test of FE handling of __sync builtins.
Dale Johannesen [Fri, 22 Aug 2008 21:47:03 +0000 (21:47 +0000)]
Comprehensive test of FE handling of __sync builtins.

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

16 years agoReapply r55191 and r55192.
Dan Gohman [Fri, 22 Aug 2008 21:28:19 +0000 (21:28 +0000)]
Reapply r55191 and r55192.

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

16 years agoMake option variables static, so they won't cause nameclash
Anton Korobeynikov [Fri, 22 Aug 2008 21:27:49 +0000 (21:27 +0000)]
Make option variables static, so they won't cause nameclash

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