Commit Graph

14614 Commits

Author SHA1 Message Date
Evan Cheng
8d3af5e7d0 Instructions with variable operands (variable_ops) can have a number required
operands. e.g.
def CALL32r : I<0xFF, MRM2r, (ops GR32:$dst, variable_ops),
                "call {*}$dst", [(X86call GR32:$dst)]>;
TableGen should emit operand informations for the "required" operands.

Added a target instruction info flag M_VARIABLE_OPS to indicate the target
instruction may have more operands in addition to the minimum required
operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28791 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-15 07:22:16 +00:00
Evan Cheng
fae2994302 X86 call instructions can take variable number of operands. Parameters of
vector types are passed via XMM registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28789 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 22:24:55 +00:00
Chris Lattner
4b5a352f25 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28787 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 21:26:18 +00:00
Evan Cheng
b69d113201 Add argument registers to the end of call operand list (partial fix).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28783 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 18:17:40 +00:00
Jim Laskey
ed4e566dda Change versioning to per debug info descriptor (merged with tag.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28782 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 14:45:39 +00:00
Jim Laskey
014f98c7e5 Place dwarf headers at earliest possible point. Well behaved when skipping
functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28781 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 11:35:03 +00:00
Chris Lattner
f7a1212850 Fix Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll, a loop unswitch
bug exposed by the recent lcssa work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28779 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 04:46:17 +00:00
Owen Anderson
90245d4cbb When asked not to delete useless PHIs, really don't delete them, no matter how
redundant they are.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28777 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 04:43:14 +00:00
Chris Lattner
13a68e4257 Use the PotDoms map to memoize 'dominating value' lookup. With this patch,
LCSSA is still the slowest pass when gccas'ing 252.eon, but now it only takes
39s instead of 289s. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28776 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 01:13:57 +00:00
Owen Anderson
8b92d0cae1 Fix another instance where PHI nodes need special treatment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28774 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 20:50:09 +00:00
Owen Anderson
3cc86cc11f Update isLCSSAForm to handle PHI nodes specially for live-out detection. This
is the same as the recent patch to LCSSA.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28773 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 20:45:22 +00:00
Andrew Lenharth
c8aba85e1c I am sure I had commited this workaround before. Perhaps soon I should sort it all out
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28772 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 20:34:47 +00:00
Owen Anderson
7be3f1e078 Fix a bug that was causing major slowdowns in povray. This was due to LCSSA
not handling PHI nodes correctly when determining if a value was live-out.

This patch reduces the number of detected live-out variables in the testcase
from 6565 to 485.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28771 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 19:37:18 +00:00
Andrew Lenharth
0e4dd01ffc It really helps to be returning to the correct place
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28769 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 18:27:39 +00:00
Chris Lattner
c4fa603347 Port some bugfixes in shift handling from SimplifyDemandedBits over to
ComputeMaskedBits.  DemandedMasks and KnownZero/One masks should never have
bits set out of the range of the base datatype.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28768 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 16:52:37 +00:00
Jim Laskey
9bfa2dcff6 TargetLowering::ComputeMaskedBits was not clearing reciprocal bits on shifts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28765 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 13:08:58 +00:00
Evan Cheng
004fb92615 Cygwin support: use _alloca to allocate stack if > 4k. Patch by Anton Korobeynikov.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28764 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 05:14:44 +00:00
Chris Lattner
e67304fb78 Gaar! Don't use r11 for CR save/restore, use R0. R11 can be register
allocated, thus live across the save/reload.  This fixes

llc-beta /MultiSource/Applications/spiff/spiff
llc-beta /MultiSource/Benchmarks/sim/sim:
llc-beta /MultiSource/Benchmarks/Ptrdist/bc/bc
llc-beta /MultiSource/Benchmarks/McCat/12-IOtest/iotest:
llc-beta /MultiSource/Benchmarks/FreeBench/fourinarow/fourinarow
llc-beta /MultiSource/Benchmarks/Fhourstones-3.1/fhourstones3.1
llc-beta /MultiSource/Benchmarks/mediabench/adpcm/rawdaudio/rawdaudio
llc-beta /MultiSource/Benchmarks/mediabench/adpcm/rawcaudio/rawcaudio
llc-beta /MultiSource/Benchmarks/mediabench/g721/g721encode/encode
llc-beta /MultiSource/Benchmarks/mediabench/jpeg/jpeg-6a/cjpeg

and probably others, with -regalloc=local.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28761 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 23:59:16 +00:00
Chris Lattner
b47e0897a0 Fix spilling and reloading of CR regs to reload the right values. This fixes
Olden/power (and probably others) with -regalloc=local.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28760 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 21:50:57 +00:00
Owen Anderson
6edf399bb4 Reapply my 6/9 changes. The bug Evan saw no longer occurs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28759 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 21:49:21 +00:00
Chris Lattner
7f2e1dd5d4 Fix an infinite loop on Transforms/SimplifyCFG/2006-06-12-InfLoop.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28758 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 20:18:01 +00:00
Chris Lattner
a3bb86dd6b Make sure to update the CFG correctly if a switch only has a default dest.
This fixes CodeGen/Generic/2006-06-12-LowerSwitchCrash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28755 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 18:25:29 +00:00
Andrew Lenharth
f2b806a1aa Let the alpha breakage begin. First Formals and RET. next Calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28753 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 18:09:24 +00:00
Andrew Lenharth
232c910b8a Start on my todo list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28752 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 16:07:18 +00:00
Rafael Espindola
337c4ad6e7 lower more then 4 formal arguments. The offset is currently hard coded.
implement SelectFrameIndex


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28751 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 12:28:08 +00:00
Owen Anderson
3d2aa47bd3 Fix for 2006-06-26-MultipleExitsSingleBlock.
If a single exit block has multiple predecessors within the loop, it will
appear in the exit blocks list more than once.  LCSSA needs to take that into
account so that it doesn't double process that exit block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28750 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 07:10:16 +00:00
Owen Anderson
c2cc15cf9d Re-commit the safe parts of my 6/9 patch. Still working on fixing the unsafe parts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28748 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-11 19:22:28 +00:00
Evan Cheng
b9b2b309d3 Back out Owen's 6/9 changes. They broke MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28747 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-11 09:32:57 +00:00
Chris Lattner
31d1a2c51c Add a missing assertion that would have helped out Reid
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28746 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-10 04:16:23 +00:00
Chris Lattner
cf00631719 Work around a nasty tblgen bug where it doesn't add operands for varargs
nodes correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28745 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-10 01:15:02 +00:00
Chris Lattner
4a45abf66e Fix a problem exposed by the local allocator. CALL instructions are not marked
as using incoming argument registers, so the local allocator would clobber them
between their set and use.  To fix this, we give the call instructions a variable
number of uses in the CALL MachineInstr itself, so live variables understands
the live ranges of these register arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28744 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-10 01:14:28 +00:00
Evan Cheng
2fafaf1b01 Don't pull in environ, not always safe. Global variables are bad anyway.
Use execve when explicit environment variables ptr is available. Otherwise
just use execv.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28740 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 20:43:11 +00:00
Owen Anderson
fcaf345c88 Add LCSSA as a requirement for LoopUnswitch, and assert that LoopUnswitch preserves
LCSSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28739 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 18:40:32 +00:00
Owen Anderson
f25c19c6b5 Make Loop able to verify that it is in LCSSA-form, and have the LCSSA pass assert
on this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28738 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 18:33:30 +00:00
Evan Cheng
e5e228df19 Comments to appease sabre.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28737 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 06:25:10 +00:00
Evan Cheng
b12223e284 Minor compilation speed improvement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28736 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 06:24:42 +00:00
Evan Cheng
86c75d3113 RewriteExpr, either the new PHI node of induction variable or the
post-increment value, should be first cast to the appropriated type (to the
type of the common expr). Otherwise, the rewrite of a use based on (common +
iv) may end up with an incorrect type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28735 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 00:12:42 +00:00
Owen Anderson
a452932171 Update some comments, and expose LCSSAID in preparation for having other passes
require LCSSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28734 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 20:02:53 +00:00
Chris Lattner
0c48fd4610 Fix X86/inline-asm.ll:test2, a case where an input value was implicitly
truncated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28733 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 18:27:11 +00:00
Chris Lattner
cf752aa502 Fix Regression/CodeGen/X86/inline-asm.ll, a case where inline asm causes
implement extension of a register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28731 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 18:22:48 +00:00
Reid Spencer
ab4d9b0446 Squelch a warning about signed/unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28729 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 18:08:43 +00:00
Chris Lattner
c0bad5706e Add support for "m" inline asm constraints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28728 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 18:03:49 +00:00
Chris Lattner
fd561cded3 Fix an assert-on-inline-inline-asm bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28727 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 18:00:47 +00:00
Reid Spencer
393830a33a For PR804:
Change the file size field of StatusInfo to be uint64_t instead of size_t
so that we know it is always 64 bits. This prevents some overflow on
systems where size_t is 32 bits when it ought to be 64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28726 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 17:00:08 +00:00
Vladimir Prus
28962f353b Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28725 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 16:03:13 +00:00
Vladimir Prus
dd49dbfe44 New method BasicBlock::getFirstNonPHI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28724 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 15:46:18 +00:00
Reid Spencer
32f5553c03 For PR787:
Provide new llvm::sys::Program facilities for converting the stdout and
stdin to binary mode. There is no standard way to do this and the available
mechanisms are platform specific. Adjust the bytecode reader and writer to
use these methods when their input is stdin or output is stdout. THis avoids
the problem with \n writing CRLF to a bytecode file on windows.

Patch Contributed by Michael Smith.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28722 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 23:18:34 +00:00
Reid Spencer
af303d53e6 For PR780:
1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o
2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage
3. Make each of the tools with --load options include LinkAllVMCore.h
This should be the last set of changes for this bug and 800.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28719 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 23:03:13 +00:00
Chris Lattner
3bdac5171b Add a virtual dtor to the InlineAsm class so that the principle method of
the class can be defined in InlineAsm.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28718 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 22:47:44 +00:00
Chris Lattner
101cefa14a Fix a bug where the types for inlineasm nodes were not properly entered into
the compaction table for a function.  This broke compilation of hexxagon
on darwin/x86 with recent changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28717 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 22:20:03 +00:00
Reid Spencer
4f1bd9e996 For PR780:
1. Fix the macros in IncludeFile.h to put everything in the llvm namespace
2. Replace the previous explicit mechanism in all the .h and .cpp files
   with the macros in IncludeFile.h
This gets us a consistent mechanism throughout LLVM for ensuring linkage.
Next step is to make sure its used in enough places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28715 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 22:00:26 +00:00
Reid Spencer
6296b3cac5 Fix a spello in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28714 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 21:24:10 +00:00
Reid Spencer
6df60a9eff For PR780:
Break the "IncludeFile" mechanism into its own header file and adjust other
files accordingly. Use this facility for the IntrinsicInst problem which
was the subject of PR800.
More to follow on this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28709 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 20:00:19 +00:00
Evan Cheng
e8bd0a332a Added X86FunctionInfo subclass of MachineFunction to record whether the
function that is being lowered is forced to use FP. Currently this is only
true for main() / Cygwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28703 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 23:30:24 +00:00
Chris Lattner
fc790168a2 Move toolrunner out of libsupport into the bugpoint tool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28700 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 22:31:36 +00:00
Chris Lattner
18a4af2ba6 Fix a bug in a recent patch. This fixes UnitTests/Vector/Altivec/casts.c on
PPC/altivec


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28698 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 22:26:02 +00:00
Chris Lattner
475c55393a Now that PR633 is implemented, the CBE can know to emit _setjmp/_longjmp
when available.  This speeds up hexxagon from 18.61s to 16.61s with the CBE on
PPC Mac OS (for reference, LLC is 15.48s and GCC is 23.35s).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28697 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 21:45:47 +00:00
Chris Lattner
001db453f5 Add PowerPC intrinsics to support dcbz[l]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28696 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 21:29:23 +00:00
Owen Anderson
e9d93d5d70 Fix some formatting, and use inLoop() when appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28694 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 04:36:36 +00:00
Owen Anderson
92deacf2f7 Stop a memory leak, and update some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28693 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 04:28:30 +00:00
Reid Spencer
51ab5c8862 Add the -Xlinker option to bugpoint which allows an option to be passed
through to gcc when its being used as a linker. This allows -L and -l
(and any other) options to be added so that non-complete bytecode files
can be processed with bugpoint. The -Xlinker option can be added as many
times as needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28692 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 00:00:42 +00:00
Rafael Espindola
4b02367d54 add R0 to liveout
expand "ret null" (implements test/Regression/CodeGen/ARM/ret_void.ll)
note that a Flag link is missing between the copy and the branch


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28691 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-05 22:26:14 +00:00
Reid Spencer
fcadfbbdef For PR798:
Provide GraphViz support for MingW32. Patch provided by Anton Korobeynikov


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28688 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-05 16:26:06 +00:00
Reid Spencer
515b5b379f Make it possible to override the standard version printer. Not all tools
built with CommandLine.h will want the --version option to report that the
tool belongs to LLVM. To override simply pass a void func() to the
cl::SetVersionPrinter() function and that void func() will be called when
it is time to print the version information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28687 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-05 16:22:56 +00:00
Reid Spencer
3e0c154240 For PR798:
Add support for Graphviz. Patch contributed by Anton Korobeynikov.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28684 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-05 15:44:46 +00:00
Evan Cheng
c21051ff96 A few new entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28683 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-04 09:08:00 +00:00
Evan Cheng
f8614db52e Be consistent with gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28682 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-04 07:24:07 +00:00
Owen Anderson
c14c1d472a Some more clean-up, and squash an IDF-Phi related bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28680 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-04 00:55:19 +00:00
Andrew Lenharth
a5cc38bcbd ignore ordered/unordered for now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28679 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-04 00:25:51 +00:00
Owen Anderson
9e1c1ddd4b Various clean-ups suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28678 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-04 00:02:23 +00:00
Owen Anderson
30019c88f4 Fix a bug in Phi-noded insertion. Also, update some comments to reflect what's
actually going on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28677 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-03 23:22:50 +00:00
Evan Cheng
3649b0efa5 Cygwin support. Patch by Anton Korobeynikov!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28672 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 22:38:37 +00:00
Evan Cheng
aede9b9598 Use xor to clear a register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28667 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 21:20:34 +00:00
Evan Cheng
94b1453278 Incorrect AT&T opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28666 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 21:09:10 +00:00
Chris Lattner
0c1262c9f9 Remove unneeded hook. Patch by Anton K. Thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28664 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 19:11:46 +00:00
Chris Lattner
d9477607dc Add mingw support, patch contributed by Anton
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28661 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 18:54:01 +00:00
Chris Lattner
191b0ba97e Force anything that #includes llvm/Transforms/Utils/UnifyFunctionExitNodes.h
to link in the implementation.  Thanks to Anton Korobeynikov for figuring out
what was going on here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28660 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 18:40:06 +00:00
Chris Lattner
57de7a4542 Fix build on systems with bad bison's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28657 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 18:20:28 +00:00
Chris Lattner
ecf626fedf Remove dead #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28642 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 20:02:28 +00:00
Chris Lattner
35033efd08 Make the "pruning cloner" smarter. As it propagates constants through the
code (while cloning) it often gets the branch/switch instructions.  Since it
knows that edges of the CFG are dead, it need not clone (or even look) at
the obviously dead blocks.  This should speed up the inliner substantially on
code where there are lots of inlinable calls to functions with constant
arguments.  On C++ code in particular, this kicks in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28641 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 19:19:23 +00:00
Chris Lattner
620fd68b10 Fix linking of inline asm objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28640 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 19:14:22 +00:00
Reid Spencer
48fdf91d0f Provide configuration support and usage for MINGW32 platform
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28639 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 19:03:21 +00:00
Chris Lattner
870286aa33 Fix -pedantic warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28636 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 17:29:22 +00:00
Chris Lattner
26e6e109d5 Fix -pedantic warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28635 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 17:27:11 +00:00
Chris Lattner
080e25d884 Fix -pedantic warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28634 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 17:17:46 +00:00
Chris Lattner
08a9a985dc Silence -pedantic warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28633 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 17:17:06 +00:00
Chris Lattner
5180b29cb0 Silence a -pedantic warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28632 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 17:16:21 +00:00
Chris Lattner
078d1826d2 Silence -pedantic warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28630 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 17:13:10 +00:00
Chris Lattner
fea34a1f11 Silence some -pedantic warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28629 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 17:12:14 +00:00
Reid Spencer
192913e281 Change from using a stub function to a stub variable for passing to the
IncludeFile hack to ensure linkage of analysis passes. This works around
some -pedantic warnings about assigning an object to a function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28621 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 07:02:51 +00:00
Reid Spencer
177284ce89 Prevent the -pedantic option from causing Mac OS/X build problems:
LiveIntervalAnalysis.cpp:218: error: floating constant exceeds range of 'double'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28620 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 06:12:21 +00:00
Owen Anderson
ff99366919 Remove a FIXME that was fixed with my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28619 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 06:07:40 +00:00
Owen Anderson
2824da4738 More cleanups. Also, add a special case for updating PHI nodes, and
reimplement getValueDominatingFunction to walk the DominanceTree rather than
just searching blindly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28618 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 06:05:47 +00:00
Evan Cheng
2675534b7f Typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28617 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 05:53:27 +00:00
Reid Spencer
a2e05ea997 For PR786:
Don't warn about -pedantic errors. Add a note to the PR instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28616 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 05:49:51 +00:00
Reid Spencer
72f42bbc9b For PR786:
Turn -pedantic and -Wno-long-long compile flags on by default. In a few
places, avoid the warnings by removing these options in the local makefile.
One notable exception: lib/Target/CBackend/Writer.cpp. These warnings are
left on as a reminder to developers to clean them up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28614 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 01:55:21 +00:00
Reid Spencer
18c8b49e7d Use archive libraries instead of object files for VMCore, BCReader,
BCWriter, and bzip2 libraries. Adjust the various makefiles to accommodate
these changes. This was done to speed up link times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28610 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 01:30:27 +00:00
Evan Cheng
04b2562502 Remove a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28607 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 00:30:39 +00:00
Evan Cheng
cbe70e1c4b Rename ASM modifier trunc8, trunc16 to subreg8, subreg16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28606 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 22:34:26 +00:00
Reid Spencer
2bc320de0c Fix casting so there's no warning on Alpha.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28605 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 22:26:11 +00:00
Evan Cheng
f91c10153c Sign extender
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28603 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 22:05:11 +00:00
Reid Spencer
6dc6665e29 Squelch this warning:
/bzlib.c:126: warning: string length `1056' is greater than the length `509' ISO
C89 compilers are required to support


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28602 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 21:53:42 +00:00
Chris Lattner
13d4ab4009 Swap the order of operands created here. For +&|^, the order doesn't matter,
but for sub, it really does!  Fix fixes a miscompilation of fibheap_cut in
llvmgcc4.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28600 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 21:14:00 +00:00
Owen Anderson
408a4061d8 Extract a huge loop into a helper method. Fix a few iterator-invalidation bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28599 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 20:55:06 +00:00
Evan Cheng
190717d3cf Rename instructions for consistency sake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28594 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 19:00:07 +00:00
Evan Cheng
4c6f2f9e92 commuteInstruction() does not always create a new MI!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28592 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 18:03:39 +00:00
Reid Spencer
0b2375edfe Make the getNamedFunction and getNamedGlobal methods be const. They don't
change the module in any way and we should enforce that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28588 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 16:40:28 +00:00
Evan Cheng
16eee25c66 Eliminate a memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28585 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 07:13:03 +00:00
Evan Cheng
7b336a8746 visitVBinOp: Can't fold divide by zero!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28584 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 06:08:35 +00:00
Evan Cheng
9d09b89f39 Select vector_shuffle v1, undef <2, 3, ?, ?> to MOVHLPS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28582 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 00:51:37 +00:00
Evan Cheng
8f692e2457 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28581 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 00:50:42 +00:00
Evan Cheng
5a47282149 A new entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28579 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 23:56:31 +00:00
Evan Cheng
b5e406afc3 MAXP{D|S} and MINP{D|S} are commutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28578 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 23:47:30 +00:00
Evan Cheng
efeaed8fb4 Commute shufps / shufpd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28577 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 23:34:30 +00:00
Evan Cheng
a0eaf2d0c5 Somehow I lost a condition when I was shuffling some code around. Anyway,
only transform a shufps to pshufd when the first two operands are the same.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28575 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 22:13:36 +00:00
Evan Cheng
aa3c1410b4 Fix a build breaker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28574 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 21:45:53 +00:00
Evan Cheng
51da42c28f Oops. PSHUFD is only available with SSE2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28573 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 21:30:59 +00:00
Chris Lattner
9e18ef5262 Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28572 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 21:29:15 +00:00
Chris Lattner
7b05350906 Always reserve space for 8 spilled GPRs. GCC apparently assumes that this
space will be available, even if the callee isn't varargs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28571 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 21:21:04 +00:00
Evan Cheng
ccba76bb25 Allow shufps x, x, mask to be converted to pshufd x, mask to save a move.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28565 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 20:26:50 +00:00
Evan Cheng
eaf1e31775 Remove bogus comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28564 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 20:24:48 +00:00
Reid Spencer
461bed2b75 Provide a simpler interface for getting a ConstantArray from a character
string. Instead of specifying the length, just specify whether the user
wants a terminating null or not. The default is "true" to retain the same
behavior as previously provided by this function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28562 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 18:15:07 +00:00
Evan Cheng
6b8e5a9318 Make sure the register pressure reduction schedulers work for non-uniform
latency targets, e.g. PPC32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28561 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 18:05:39 +00:00
Evan Cheng
19564e3d83 When a priority_queue is empty, the behavior of top() operator is
non-deterministic. Returns NULL when it's empty!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28560 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 18:04:34 +00:00
Rafael Espindola
85ede37ca9 Expand ret into "CopyToReg;BRIND"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28559 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 17:33:19 +00:00
Reid Spencer
dd0f8df161 Undo a patch that breaks llvm-as because the warning message is written to
stdout when the output of llvm-as is also written to stdout. We'll have to
fix tcl some other way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28557 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 16:34:59 +00:00
Reid Spencer
c02af8538b Write the WARNING message to cout instead of cerr. Writing to cerr causes
Tcl to claim that the program had an error and thus produces errors in
the dejagnu testing when its really just a warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28556 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 16:05:59 +00:00
Reid Spencer
8949477ae4 Adjust the interface to ConstantArray::get. The previous
implementation always added a null byte to the end of the string. It turns
out that this is not always wanted. By adding a length parameter we preserve
this behavior when length==0 (default value) but also allow other lengths
(not null terminated) to be created.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28552 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 08:23:18 +00:00
Evan Cheng
5a622f2e06 Add a note about integer multiplication by constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28551 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 07:37:37 +00:00
Evan Cheng
e6ad27e917 A addressing mode folding enhancement:
Fold c2 in (x << c1) | c2 where (c2 < c1)
e.g.
int test(int x) {
  return (x << 3) + 7;
}

This can be codegen'd as:
leal 7(,%eax,8), %eax


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28550 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 06:59:36 +00:00
Evan Cheng
8c65fa564a Some new entries about truncate / anyext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28548 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 06:23:50 +00:00
Andrew Lenharth
40932272c7 move calltarget to dsa
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28546 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 23:39:48 +00:00
Andrew Lenharth
632cd52162 Since there was interest on the mailing list, this is a utility pass that
uses DSA to make find targets of calls.  It provides a very convinient
interface to DSA results to do things with indirect calls, such as
write a devirtualizer (which I have and may commit one of these days).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28545 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 22:58:38 +00:00
Vladimir Prus
cb29bd7fc9 Reset DEBUG_SYMBOL_TABLE back to 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28538 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 12:54:52 +00:00
Vladimir Prus
6ba568fabb Fix compile error when DEBUG_SYMBOL_TABLE is defined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28537 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 12:45:15 +00:00
Reid Spencer
fd20c0ab00 Fix grammar in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28534 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 02:34:34 +00:00
Owen Anderson
00ea74c27e Add Use replacement. Assuming there is nothing horribly wrong with this, LCSSA
is now theoretically feature-complete.  It has not, however, been thoroughly
test, and is still considered experimental.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28529 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 01:00:00 +00:00
Owen Anderson
bd82277cbb Major think-o. Iterate over all live out-of-loop values, and perform the
other calculations on each individually, rather than trying to delay it and do
them all at the end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28527 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-28 19:33:28 +00:00
Owen Anderson
2f21e07915 Make LCSSA insert proper Phi nodes throughout the rest of the CFG by computing
the iterated Dominance Frontier of the loop-closure Phi's.  This is the
second phase of the LCSSA pass.  The third phase (coming soon) will be to
update all uses of loop variables to use the loop-closure Phi's instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28524 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 18:47:11 +00:00
Chris Lattner
8d8d6530b1 Fix some regression from the inliner patch I committed last night. This fixes
ldecod, lencod, and SPASS.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28523 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 17:28:13 +00:00
Chris Lattner
5b5bc3032f Switch the inliner over to using CloneAndPruneFunctionInto. This effectively
makes it so that it constant folds instructions on the fly.  This is good
for several reasons:

0. Many instructions are constant foldable after inlining, particularly if
   inlining a call with constant arguments.
1. Without this, the inliner has to allocate memory for all of the instructions
   that can be constant folded, then a subsequent pass has to delete them.  This
   gets the job done without this extra work.
2. This makes the inliner *pass* a bit more aggressive: in particular, it
   partially solves a phase order issue where the inliner would inline lots
   of code that folds away to nothing, but think that the resultant function
   is big because of this code that will be gone.  Now the code never exists.

This is the first part of a 2-step process.  The second part will be smart
enough to see when this implicit constant folding propagates a constant into
a branch or switch instruction, making CFG edges dead.

This implements Transforms/Inline/inline_constprop.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28521 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 01:28:04 +00:00
Chris Lattner
a5135ba0c9 Ignore generated files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28520 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 01:23:30 +00:00
Chris Lattner
83f03bfc3f Implement a new method, CloneAndPruneFunctionInto, as documented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28519 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 01:22:24 +00:00
Chris Lattner
4b30fcb5f5 Refactor some code to expose an interface to constant fold and instruction given it's opcode, typeand operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28517 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 01:18:04 +00:00
Chris Lattner
729c6d1da8 Fix a nasty dag combiner bug that caused nondeterminstic crashes (MY FAVORITE!):
SimplifySelectOps would eliminate a Select, delete it, then return true.

The clients would see that it did something and return null.

The top level would see a null return, and decide that nothing happened,
proceeding to process the node in other ways: boom.

The fix is simple: clients of SimplifySelectOps should return the select
node itself.

In order to catch really obnoxious boogs like this in the future, add an
assert that nodes are not deleted.  We do this by checking for a sentry node
type that the SDNode dtor sets when a node is destroyed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28514 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 00:43:02 +00:00
Owen Anderson
a90b2c7240 A few small clean-ups, and the addition of an LCSSA statistic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28512 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 00:31:37 +00:00
Evan Cheng
d61c4820c9 Make CALL node consistent with RET node. Signness of value has type MVT::i32
instead of MVT::i1. Either is fine except MVT::i32 is probably a legal type
for most (if not all) platforms while MVT::i1 is not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28511 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 23:13:20 +00:00
Evan Cheng
6848be1a27 Change RET node to include signness information of the return values. i.e.
RET chain, value1, sign1, value2, sign2, ...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28510 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 23:10:12 +00:00
Evan Cheng
8e7d056bc5 Change RET node to include signness information of the return values. e.g.
RET chain, value1, sign1, value2, sign2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28509 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 23:09:09 +00:00
Owen Anderson
fc3a3bc64b Fix a copy-and-paste-o that would break some compilers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28507 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 21:19:17 +00:00
Owen Anderson
2480737211 Clean up and refactor LCSSA a bunch. It should also run faster now, though
there's still a lot of work to be done on it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28506 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 21:11:53 +00:00
Evan Cheng
3fddf241d8 Vector argument must be passed in memory location aligned on 16-byte boundary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28505 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 20:37:47 +00:00
Evan Cheng
1d6a9b3b6c Mac OS X ABI document lied. The first four XMM registers are used to pass
vector arguments, not three.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28504 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 19:22:06 +00:00
Chris Lattner
b4db97ffa7 Implement Transforms/InstCombine/store.ll:test2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28503 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 19:19:20 +00:00
Chris Lattner
a65371ea25 Fix a bug in the bc reader/writer: we were not correctly encoding varargs
nonccc calls (we were dropping the CC and tail flag).  This broke several
FORTRAN programs.

Testcase here: Regression/Assembler/2006-05-26-VarargsCallEncode.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28501 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:42:34 +00:00
Evan Cheng
052fb5110f Minor update to make the code more clear
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28499 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:39:59 +00:00
Evan Cheng
f9d62dc6e5 Update more comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28498 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:37:16 +00:00
Evan Cheng
f9ff7c54be Fix some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28497 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:25:43 +00:00
Evan Cheng
6f707999a1 No need to handle illegal types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28496 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:22:49 +00:00
Owen Anderson
11f510b577 Skeletal LCSSA pass. This is currently non-functional. Expect functionality
and documentation updates soo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28495 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 13:58:26 +00:00
Rafael Espindola
a1334cdfb2 On ARM, alignment is in bits
Add lr as a hard coded operand of bx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28494 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 10:56:17 +00:00
Evan Cheng
138a24e4d4 Remove a couple of bogus casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28493 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 08:04:31 +00:00
Evan Cheng
00aff7d977 Remove a bogus cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28492 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 08:00:14 +00:00
Evan Cheng
57c0788e02 Minor bug caught by Ashwin Chandra
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28491 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 06:22:34 +00:00
Chris Lattner
7b2e2792d6 Transform things like (splat(splat)) -> splat
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28490 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 00:29:06 +00:00
Chris Lattner
863bcff183 Introduce a helper function that simplifies interpretation of shuffle masks.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28489 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 23:48:38 +00:00
Evan Cheng
cc1fc220a0 Consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28488 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 23:31:23 +00:00
Chris Lattner
01575b7315 Turn (cast (shuffle (cast)) -> shuffle (cast) if it reduces the # casts in
the program.  This exposes more opportunities for the instcombiner, and implements
vec_shuffle.ll:test6


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28487 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 23:24:33 +00:00
Chris Lattner
73fa49d697 extract element from a shuffle vector can be trivially turned into an
extractelement from the SV's source.  This implement vec_shuffle.ll:test[45]


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28485 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 22:53:38 +00:00
Evan Cheng
25e71d10a0 Some clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28483 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 22:38:31 +00:00
Chris Lattner
8b5fbc5cd4 Add support for the missing FP condition codes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28482 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 22:26:02 +00:00
Evan Cheng
a9bb445db0 Remove some dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28481 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 22:25:52 +00:00
Evan Cheng
932ad51fea X86 / Cygwin asm / alignment fixes.
Patch contributed by Anton Korobeynikov!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28480 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 21:59:08 +00:00
Chris Lattner
99f2af2dee Revert a patch that is unsafe, due to out of range array accesses in inner
array scopes possibly accessing valid memory in outer subscripts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28478 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 21:25:12 +00:00
Evan Cheng
6b5783d0b1 Build breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28475 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 18:56:34 +00:00
Chris Lattner
8e2a04e21d Fix build failure of povray
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28473 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 18:06:16 +00:00
Chris Lattner
5d634ce466 Fix Benchmarks/MallocBench/cfrac
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28471 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 16:54:16 +00:00
Rafael Espindola
2f99b6bd96 implement initial version of ARMAsmPrinter::printOperand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28470 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 12:57:06 +00:00
Rafael Espindola
c3c1a86aa0 port the ARM backend to use ISD::CALL instead of LowerCallTo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28469 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 11:00:18 +00:00
Evan Cheng
3b78823868 Turn on -sched-commute-nodes by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28465 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 08:37:31 +00:00
Evan Cheng
32fe1035a7 Switch X86 over to a call-selection model where the lowering code creates
the copyto/fromregs instead of making the X86ISD::CALL selection code create
them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28463 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 00:59:30 +00:00
Evan Cheng
4360bdcf1f CALL node change (arg / sign pairs instead of just arguments).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28462 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 00:57:32 +00:00
Evan Cheng
f6d62c2e2a CALL node change: now including signness of every argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28461 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 00:55:32 +00:00
Evan Cheng
6a3d5a62f0 Assert if InflightSet is not cleared after instruction selecting a BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28459 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 00:24:28 +00:00
Evan Cheng
afe358e7d4 Clear HandleMap and ReplaceMap after instruction selection. Or it may cause
non-deterministic behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28454 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 20:46:25 +00:00
Reid Spencer
19b7e0e0ca For PR786:
Minor tweaks in public headers and a few .cpp files so that LLVM can build
successfully with -pedantic and projects using LLVM with -pedantic don't
get warnings from LLVM. There's still more -pedantic warnings to fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28453 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 19:21:13 +00:00
Reid Spencer
077b387207 For PR786:
Remove a spurious ;


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28452 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 19:05:21 +00:00
Chris Lattner
a04c0c417b Patch for a new instcombine xform, patch contributed by Nick Lewycky!
This implements Transforms/InstCombine/2006-05-10-InvalidIndexUndef.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28450 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 17:34:30 +00:00
Chris Lattner
d74ea2bbd8 Patches to make the LLVM sources more -pedantic clean. Patch provided
by Anton Korobeynikov!  This is a step towards closing PR786.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28447 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 17:04:05 +00:00
Chris Lattner
2ef5e89dc9 Fix CodeGen/Generic/vector.ll:test_div with altivec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28445 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 00:15:25 +00:00
Chris Lattner
5734012375 Handle SETO* like we handle SET*, restoring behavior after Evan's setcc
change.  This fixes PowerPC/fnegsel.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28443 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 00:06:44 +00:00
Chris Lattner
0c54d8964d Print struct return functions and calls as actually returning the hidden
argument struct pointer, enabling ABI compatibility for the CBE with
platforms with strange struct-return ABIs.  This fixes 252.eon and
CoyoteBench/fftbench on Darwin/X86 among other things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28442 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 23:39:48 +00:00
Chris Lattner
c6d0567324 Fix file header comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28441 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 23:20:42 +00:00
Evan Cheng
4db3af3511 Better way to check for vararg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28440 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 21:08:24 +00:00
Evan Cheng
25caf63cd2 Remove PreprocessCCCArguments and PreprocessFastCCArguments now that
FORMAL_ARGUMENTS nodes include a token operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28439 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 21:06:34 +00:00
Chris Lattner
2d2970905c Implement an annoying part of the Darwin/X86 abi: the callee of a struct
return argument pops the hidden struct pointer if present, not the caller.

For example, in this testcase:

struct X { int D, E, F, G; };
struct X bar() {
  struct X a;
  a.D = 0;
  a.E = 1;
  a.F = 2;
  a.G = 3;
  return a;
}
void foo(struct X *P) {
  *P = bar();
}

We used to emit:

_foo:
        subl $28, %esp
        movl 32(%esp), %eax
        movl %eax, (%esp)
        call _bar
        addl $28, %esp
        ret
_bar:
        movl 4(%esp), %eax
        movl $0, (%eax)
        movl $1, 4(%eax)
        movl $2, 8(%eax)
        movl $3, 12(%eax)
        ret

This is correct on Linux/X86 but not Darwin/X86.  With this patch, we now
emit:

_foo:
        subl $28, %esp
        movl 32(%esp), %eax
        movl %eax, (%esp)
        call _bar
***     addl $24, %esp
        ret
_bar:
        movl 4(%esp), %eax
        movl $0, (%eax)
        movl $1, 4(%eax)
        movl $2, 8(%eax)
        movl $3, 12(%eax)
***     ret $4

For the record, GCC emits (which is functionally equivalent to our new code):

_bar:
        movl    4(%esp), %eax
        movl    $3, 12(%eax)
        movl    $2, 8(%eax)
        movl    $1, 4(%eax)
        movl    $0, (%eax)
        ret     $4
_foo:
        pushl   %esi
        subl    $40, %esp
        movl    48(%esp), %esi
        leal    16(%esp), %eax
        movl    %eax, (%esp)
        call    _bar
        subl    $4, %esp
        movl    16(%esp), %eax
        movl    %eax, (%esi)
        movl    20(%esp), %eax
        movl    %eax, 4(%esi)
        movl    24(%esp), %eax
        movl    %eax, 8(%esi)
        movl    28(%esp), %eax
        movl    %eax, 12(%esi)
        addl    $40, %esp
        popl    %esi
        ret

This fixes SingleSource/Benchmarks/CoyoteBench/fftbench with LLC and the
JIT, and fixes the X86-backend portion of PR729.  The CBE still needs to
be updated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28438 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 18:50:38 +00:00
Evan Cheng
80235d508e -enable-unsafe-fp-math implies -enable-finite-only-fp-math
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28437 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 18:18:46 +00:00
Vladimir Prus
124729155d Fix missing include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28435 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 13:43:15 +00:00
Evan Cheng
f6f9581983 Incorrect SETCC CondCode used for FP comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28433 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 06:40:47 +00:00
Evan Cheng
95942d76f4 Added option -enable-finite-only-fp-math. When on, the codegen can assume that
FP arithmetic arguments and results are never NaNs or +=Infs. This includes
ignoring parity flag (PF) when checking for FP equality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28432 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 06:39:12 +00:00