Commit Graph

26096 Commits

Author SHA1 Message Date
Dan Gohman
fc626b62b8 Update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 19:16:58 +00:00
Dan Gohman
3ebd0eeaeb Update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 19:10:41 +00:00
Chris Lattner
824b958e6f reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an
arbitrary integer width for the count.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 16:42:48 +00:00
Bill Wendling
dc770929cb Revert r59802. It was breaking the build of llvm-gcc:
g++ -m32 -c -g -DIN_GCC -W -Wall -Wwrite-strings -Wmissing-format-attribute -fno-common -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"i386-apple-darwin9.5.0\" -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include  -D_DEBUG  -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS   -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include ../../llvm-gcc.src/gcc/llvm-types.cpp -o llvm-types.o
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemCpy(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemMove(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemSet(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i64' is not a member of 'llvm::Intrinsic'
make[3]: *** [llvm-convert.o] Error 1
make[3]: *** Waiting for unfinished jobs....
rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59809 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 09:09:41 +00:00
Sanjiv Gupta
219ab405e6 Make mem[cpy,move,set] intrinsics overloaded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59802 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 07:49:09 +00:00
Bill Wendling
137dccd5d8 Default to converting UADDO to the generic form that SADDO is converted to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59801 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 07:44:30 +00:00
Nick Lewycky
0c73079855 Optimize (x/y)*y into x-(x%y) in general. Div and rem are about the same, and
a subtract is cheaper than a multiply. This generalizes an existing transform.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59800 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 07:33:58 +00:00
Mon P Wang
230e4faa19 Clean up normalization of shuffles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59792 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 04:25:21 +00:00
Scott Michel
9c0c6b2e4a CellSPU:
(a) Fix bgs 3052, 3057
(b) Incorporate Duncan's suggestions re: i1 promotion
(c) Indentation updates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59790 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:56:16 +00:00
Bill Wendling
ef37546f68 Combine the two add with overflow intrinsics lowerings. They differ only in DAG node type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59788 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:38:44 +00:00
Dan Gohman
f6b7a47d5d Set the isAntiDep flag in the MachineInstr scheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59787 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:38:21 +00:00
Bill Wendling
da4948ac8c Generate code for llvm.uadd.with.overflow intrinsic. No conversion support yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59786 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:33:36 +00:00
Dan Gohman
cddd428459 Add a flag to SDep for tracking which edges are anti-dependence edges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59785 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:27:52 +00:00
Bill Wendling
6c63f62729 Remove chains. Unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59783 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:22:59 +00:00
Dan Gohman
98adea1149 Rename SDep's isSpecial to isArtificial, to make this field a little
less mysterious.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:18:56 +00:00
Bill Wendling
1c55a9c0cc Rename "ADDO" to "SADDO" and "UADDO". The "UADDO" isn't equivalent to "ADDC"
because the boolean it returns to indicate an overflow may not be treated like
as a flag. It could be stored to memory, for instance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59780 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:12:42 +00:00
Bill Wendling
7cdc3c8ad2 Implement the sadd_with_overflow intrinsic. This is converted into
"ISD::ADDO". ISD::ADDO is lowered into a target-independent form that does the
addition and then checks if the result is less than one of the operands. (If it
is, then there was an overflow.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59779 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:03:52 +00:00
Devang Patel
cb9a354d13 Fix unused variable warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59778 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 01:52:59 +00:00
Dan Gohman
787782f4ca Use ComputeLatency in the MachineInstr scheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59777 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 01:44:51 +00:00
Dan Gohman
f209c2cc30 Remove the CycleBound computation code from the ScheduleDAGRRList
schedulers. This doesn't have much immediate impact because
targets that use these schedulers by default don't yet provide
pipeline information.

This code also didn't have the benefit of register pressure
information. Also, removing it will avoid problems with list-burr
suddenly starting to do latency-oriented scheduling on x86 when we
start providing pipeline data, which would increase spilling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59775 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 01:30:54 +00:00
Dan Gohman
c8c2827993 Implement ComputeLatency for MachineInstr ScheduleDAGs. Factor
some of the latency computation logic out of the SDNode
ScheduleDAG code into a TargetInstrItineraries helper method
to help with this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59761 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 00:12:10 +00:00
Bill Wendling
ea7b527aa5 Add UADDO and SADDO nodes. These will be used for determining an overflow
condition in an addition operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 00:11:16 +00:00
Dan Gohman
47d1a214a7 Change these schedulers to not emit no-ops. It turns out that
the RR scheduler actually does look at latency values, but it
doesn't use a hazard recognizer so it has no way to know when
a no-op is needed, as opposed to just stalling and incrementing
the cycle count.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59759 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 00:10:42 +00:00
Bill Wendling
66c75aaa02 Fix error where it wasn't getting the correct caller function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59758 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 00:09:21 +00:00
Bill Wendling
8c1604e7d6 If the function being inlined has a higher stack protection level than the
inlining function, then increase the stack protection level on the inlining
function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59757 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 00:06:32 +00:00
Dan Gohman
8eaf41de8a Treat mid-block labels the same as terminators when building the
MachineInstr scheduling DAG, meaning they implicitly depend on all
preceding defs. This fixes Benchmarks/Shootout-C++/except and
Regression/C++/EH/simple_rethrow in
  -relocation-model=pic -disable-post-RA-scheduler=false
mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59747 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 19:58:35 +00:00
Dan Gohman
5ce0973f7f Add another machine-code printing pass when post-pass scheduling is run.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59746 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 19:54:21 +00:00
Devang Patel
e0de705eb7 Don't forget arguments!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59745 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 19:50:17 +00:00
Scott Michel
dc91bea479 CellSPU:
(a) Remove moved file (SPUAsmPrinter.cpp) to make svn happy.
(b) Remove truncated stores that will never be used.
(c) Add initial support for __muldi3 as a libcall.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59734 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 16:36:33 +00:00
Duncan Sands
810260bf6b Add some documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59727 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 10:34:43 +00:00
Mon P Wang
07239f13cd Allow XMM2 and XMM3 to be used for non ABI compliant code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59720 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 07:48:19 +00:00
Bill Wendling
f0a2d0cb8f 80-column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59718 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 07:24:30 +00:00
Scott Michel
4379efced7 CellSPU: Custom lower truncating stores of i8 to i1 (should not have been
promote), fix signed conversion of indexed offsets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59707 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 05:01:09 +00:00
Nick Lewycky
d433904982 undef beats zero. Fix this missed optimization opportunity. Patch by Matt Elder!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59705 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 04:36:13 +00:00
Scott Michel
a0e5769166 CellSPU: Adjust spacing/tabulation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59703 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 04:26:21 +00:00
Dan Gohman
57bebbbd12 Remove a remnant of list-burr's fast mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59702 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 03:32:45 +00:00
Dan Gohman
117f3e9ee4 Factor out the SethiUllman numbering logic from the list-burr and
list-tdrr schedulers into a common base class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59701 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 03:30:37 +00:00
Dan Gohman
9e76fea3ab Remove the "fast" form of the list-burr scheduler, and use the
dedicated "fast" scheduler in -fast mode instead, which is
faster. This speeds up llc -fast by a few percent on some
testcases -- the speedup only happens for code not handled by
fast-isel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59700 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 03:11:19 +00:00
Dan Gohman
6be2ee431f Facter AddPseudoTwoAddrDeps and associated infrasructure out of
the list-burr scheduler so that it can be used by the list-tdrr
scheduler too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59698 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 02:45:51 +00:00
Evan Cheng
d37c13cfd1 - Register scavenger should use MachineRegisterInfo and internal map to find the first use of a register after a given machine instruction.
- When scavenging a register, in addition to the spill, insert a restore before the first use.
- Abort if client is looking to scavenge a register even when a previously scavenged register is still live.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59697 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 02:32:35 +00:00
Evan Cheng
97c573d5de Fix a thinko. MO is getOperand(i-1) so we don't have to adjust e.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59696 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 02:25:51 +00:00
Dan Gohman
40362067de Add #include <climits> to get the definition of INT_MAX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59692 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 01:41:34 +00:00
Dan Gohman
a1e6d363e5 Factor out the code for verifying the work of the scheduler,
extend it a bit, and make use of it in all schedulers, to
ensure consistent checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59689 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 01:26:25 +00:00
Devang Patel
f23de86fa3 Do not forget llvm.dbg.declare's first argument while removing debugging information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59688 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 01:20:42 +00:00
Dan Gohman
cdb260de83 Simplify this code a little. In the fast scheduler, CreateNewSUnit
and CreateClone don't add any extra value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59679 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 23:39:02 +00:00
Evan Cheng
e3066abfcf Eliminate a compile time warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59678 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 23:21:33 +00:00
Evan Cheng
eda60a8364 Eliminate a compile time warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59677 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 23:21:11 +00:00
Dan Gohman
343f0c0467 Experimental post-pass scheduling support. Post-pass scheduling
is currently off by default, and can be enabled with
-disable-post-RA-scheduler=false.

This doesn't have a significant impact on most code yet because it doesn't
yet do anything to address anti-dependencies and it doesn't attempt to
disambiguate memory references. Also, several popular targets
don't have pipeline descriptions yet.

The majority of the changes here are splitting the SelectionDAG-specific
code out of ScheduleDAG, so that ScheduleDAG can be moved to
libLLVMCodeGen.a. The interface between ScheduleDAG-using code and
the rest of the scheduling code is somewhat rough and will evolve.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59676 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 23:18:57 +00:00
Dan Gohman
7d1cd3f21d Move the code for printing a graph node label for an SUnit into
a virtual method of SelectionDAG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59667 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 22:09:45 +00:00
Dan Gohman
252ae9e8ae Convert SUnit's dump method into a print method and implement
dump in terms of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59665 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 21:32:03 +00:00
Oscar Fuentes
eb22065a35 CMake: Removed source file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59662 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 19:32:19 +00:00
Devang Patel
dfca407c79 Do not use separate utility to walk all instructions and remove dead dbg intrinsics. Let instcombiner do this job.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 19:01:37 +00:00
Devang Patel
b8f69c65df Let instcombiner remove redundant dbg intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59658 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 18:59:41 +00:00
Devang Patel
7fe1decf3a If there are two consecutive llvm.dbg.stoppoint calls then
it is likely that the optimizer deleted code in between these
two intrinsics. Keep only the last llvm.dbg.stoppoint in this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59657 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 18:56:50 +00:00
Oscar Fuentes
57cbd99d5d CMake: Removed source file from lib/Target/PIC16/CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59655 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 18:42:25 +00:00
Scott Michel
719b0e17ae CellSPU: Do not custom lower i1 stores, rely on type legalization to do the
right thing and promote the store to i8.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59648 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 17:45:08 +00:00
Stuart Hastings
be362abe9c <rdar://problem/6351057>
Discourage (allocate last) use of x86_64 R12 and R13 due to their
longer instruction encodings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59644 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 17:19:35 +00:00
Scott Michel
430a555cdd Temporary check-in for Duncan to demonstrate CellSPU store problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59637 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 15:24:16 +00:00
Argyrios Kyrtzidis
3713c0ba62 Fix compilation error on MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 12:56:21 +00:00
Sanjiv Gupta
928df6ca4e Forgot to add this in the previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59623 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 12:12:49 +00:00
Sanjiv Gupta
863d3e9328 Fixed build warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59621 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 11:27:59 +00:00
Sanjiv Gupta
b1b5ffd827 Added a more function PIC16 backend. However to get this working a patch in
ExpandIntegerOperand (LegalizeIntegerTypes.cpp) is needed which is yet to be reworked and submitted. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59617 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 11:00:54 +00:00
Bill Wendling
2f45f9762d Use stripPointerCasts when checking for AllocaInsts for the stackprotector intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59614 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 09:17:16 +00:00
Owen Anderson
75fa96bb71 Add support for rematerialization in pre-alloc-splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59587 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 04:28:29 +00:00
Dan Gohman
c2f9062ea4 Rearrange code to reduce the nesting level. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59580 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 02:00:32 +00:00
Bill Wendling
9173383e4e Use dyn_cast instead of cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59577 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 01:25:41 +00:00
Bill Wendling
bccdcca7d1 Match an element of the return type if it returns a structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59576 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 01:15:05 +00:00
Devang Patel
fb5fd5a0bb Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59570 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 00:22:02 +00:00
Devang Patel
b876cc193c Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59569 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 00:19:18 +00:00
Dan Gohman
06da2bc19f Fix debug printing of flagged SDNodes in SUnits so that they
print in the correct order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 00:04:44 +00:00
Evan Cheng
3a5b020292 Make the same change to RegScavenger::backward.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59566 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 23:54:01 +00:00
Bill Wendling
c5b795e8ce Verify that the second parameter of the stacprotector intrinsic is an alloca
instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59563 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 23:09:31 +00:00
Evan Cheng
63a431c670 We also need to keep the operand index for two address check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59562 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 22:56:19 +00:00
Evan Cheng
9c64bf3905 Register scavenger should process early clobber defs first. A dead early clobber def should not interfere with a normal def which happens one slot later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59559 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 22:28:38 +00:00
Devang Patel
f17fc461d1 Add new helper pass that strips all symbol names except debugging information.
This pass makes it easier to test wheter debugging info. influences optimization passes or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59552 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 21:34:39 +00:00
Dan Gohman
c99da1348d Don't set neverHasSideEffects on x86's divide instructions, since
they trap on divide-by-zero, and this side effect is otherwise
unmodeled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59551 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 21:29:14 +00:00
Dan Gohman
1256f5fe76 Tidy up ScheduleNodeBottomUp methods, and make them more
consistent with ScheduleNodeTopDown methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59550 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 21:22:20 +00:00
Dan Gohman
0454e8685f Update a comment to reflect the current code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59549 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 21:14:44 +00:00
Duncan Sands
9a6b92de4c Remove integer promotion support for FP_EXTEND
and FP_ROUND.  Not sure what these were doing
here - probably they were sometimes (wrongly)
created with integer operands somewhere that
has since been fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59548 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 21:13:59 +00:00
Devang Patel
4460a7e90c Remove even more llvm.dbg variables.
Remove all dead globals from llvm.metadata.
Ignore linkonce linkage for selected llvm.dbg values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59547 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 21:13:41 +00:00
Duncan Sands
c08468774b Simplify code using helper routines. There is not
supposed to be any functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59545 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 20:56:22 +00:00
Owen Anderson
5a92d4e657 Fix a bug introduced by my previous patch. With this change, SPEC is now clean with prealloc splitting enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59544 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 20:53:59 +00:00
Dan Gohman
cbad42cfd1 Add more const qualifiers. This fixes build breakage from r59540.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59542 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 19:49:32 +00:00
Dan Gohman
b3b930a011 Make some methods const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59540 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 19:04:29 +00:00
Devang Patel
4f3096b6af Initialize MallocFunc and FreeFunc properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 18:43:07 +00:00
Dan Gohman
3dbc4e3502 Whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59532 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 17:05:42 +00:00
Duncan Sands
331a746101 LegalizeTypes support for splitting and scalarizing
SCALAR_TO_VECTOR.  I didn't add the testcase, because
once llc gets past scalar-to-vector it hits a SPU target
lowering bug and explodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59530 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 16:40:48 +00:00
Nick Lewycky
dd643f26c4 Add a utility function that detects whether a loop is guaranteed to be finite.
Use it to safely handle less-than-or-equals-to exit conditions in loops. These
also occur when the loop exit branch is exit on true because SCEV inverses the
icmp predicate.

Use it again to handle non-zero strides, but only with an unsigned comparison
in the exit condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59528 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 15:10:54 +00:00
Bill Wendling
5734450d40 Rename stackprotector_create intrinsic to stackprotector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59519 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 11:01:33 +00:00
Bill Wendling
9bef70609c Cast to remove warning about comparing signed and unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59518 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 10:57:27 +00:00
Nicolas Geoffray
67c8c4caba Implement support for JIT exceptions on X86_64. Relative offsets are
encoded on 32 bytes, and the personality function is not encoded as
relative.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59516 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 10:44:46 +00:00
Duncan Sands
130fea2ca0 Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 10:39:04 +00:00
Duncan Sands
51d83fdd89 Reapply r59464, this time using the correct type
when softening FNEG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 09:15:03 +00:00
Bill Wendling
733bbc5320 Remove the stackprotector_check intrinsic. Use a volatile load instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59504 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 07:30:57 +00:00
Bill Wendling
c3348a77f7 - Use "moveAfter" instead of "remove/insert" of a basic block.
- Use less indentation in coding.
- Shorten description.
- Update comments.
- Move code around


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59496 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 05:32:11 +00:00
Dan Gohman
6c2fe2237b Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59489 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 02:50:01 +00:00
Dan Gohman
3cc6243ddf Change SUnit's dump method to take a ScheduleDAG* instead of
a SelectionDAG*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59488 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 02:06:40 +00:00
Bill Wendling
8f55b3d67d Revert r59464. It was causing this failure:
Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/XCore/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/XCore/fneg.ll
Failed with signal(SIGABRT) at line 1
while running:  llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/XCore/fneg.ll |  llc -march=xcore > fneg.ll.tmp1.s
Assertion failed: (VT.isFloatingPoint() && "Cannot create integer FP constant!"), function getConstantFP, file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/lib/CodeGen/SelectionDAG/SelectionDAG.cpp, line 913.
0   llc                                 0x0092115c _ZN4llvm3sys18RemoveFileOnSignalERKNS0_4PathEPSs + 844
1   libSystem.B.dylib                   0x9217809b _sigtramp + 43
2   ???                                 0xffffffff 0x0 + 4294967295
3   libSystem.B.dylib                   0x921f0ec2 raise + 26
4   libSystem.B.dylib                   0x9220047f abort + 73
5   libSystem.B.dylib                   0x921f2063 __assert_rtn + 101
6   llc                                 0x005a5b0a _ZN4llvm12SelectionDAG13getConmake[1]: *** [check-local] Error 1
make: *** [check] Error 2



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59487 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 01:49:24 +00:00
Devang Patel
13877bf6c2 Give SIToFPInst preference over UIToFPInst because it is faster on platforms that are widely used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59476 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 00:40:02 +00:00
Dan Gohman
2d093f3560 Avoid using a loop in ReleasePred and ReleaseSucc methods to compute the
new CycleBound value. Instead, just update CycleBound on each call.
Also, make ReleasePred and ReleaseSucc methods more consistent accross
the various schedulers.

This also happens to make ScheduleDAGRRList's CycleBound computation
somewhat more interesting, though it still doesn't have any noticeable
effect, because no current targets that use the register-pressure
reduction scheduler provide pipeline models.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59475 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 00:38:59 +00:00
Devang Patel
cd40233429 While handling floating point IVs lift restrictions on initial value and increment value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59471 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 23:27:13 +00:00
Devang Patel
84e3515974 Handle floating point ivs during doInitialization().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59466 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 21:32:02 +00:00
Dan Gohman
8123419f2b Eliminate some trivial differences between the ScheduleNodeTopDown
functions in these two schedulers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 21:31:02 +00:00
Duncan Sands
7fed65a68d Add soft float support for a bunch more operations. Original
patch by Richard Osborne, tweaked and extended by your humble
servant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 20:52:38 +00:00
Dan Gohman
e93483d855 Don't bother doing latency calculations in the "fast" scheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 19:52:36 +00:00
Dan Gohman
2dcca9d53e Use SUnit's CycleBound field instead of duplicating it in
a side-car datastructure


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59458 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 19:45:19 +00:00
Dale Johannesen
a7647e68a4 Move some former testcases (low-probability codegen
optimizations) into this wishlist.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59455 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 18:56:34 +00:00
Devang Patel
b8c564f72e Let AnalyzeAlloca() remove debug intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59454 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 18:37:53 +00:00
Richard Osborne
104de6cf7b Don't produce ADDC/ADDE when expanding SHL unless they are legal
for the target. This fixes PR3080.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59450 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 17:34:31 +00:00
Dan Gohman
6560c000a1 Don't use the isPending flag to mean what the isAvailable flag means.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59445 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 16:37:30 +00:00
Mon P Wang
28088d3c04 Fixed legalization of CONVERT_RNDSAT for integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 00:41:12 +00:00
Torok Edwin
b079a391c8 If SI->size() is 0, we are not allowed to dereference ->begin().
This fixed PR3078.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59416 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 17:21:25 +00:00
Lang Hames
27601ef832 Big PBQP allocator update. Adds coalescing support, stack slot coloring, several bug-fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59414 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 12:12:54 +00:00
Chris Lattner
1a6111f32d eliminate some std::set's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 07:17:51 +00:00
Chris Lattner
3f914f0138 simplify loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 06:35:18 +00:00
Chris Lattner
cb504b95c5 simplify a bunch more instcombines to use m_Specific etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59403 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 05:38:51 +00:00
Chris Lattner
69d4ced68d factor the code for simplifying (icmp)|(icmp) into its own function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 05:20:07 +00:00
Chris Lattner
aa3e157845 do some computation with apints instead of ConstantInts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59401 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 05:14:43 +00:00
Chris Lattner
ea065fbdd8 merge a check into a place where it is simpler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59400 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 05:10:52 +00:00
Mon P Wang
c7849c22f4 Improved shuffle normalization to avoid using extract/build when we
can extract using different indexes for two vectors. Added a few tests
for vector shuffles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59399 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 05:06:27 +00:00
Chris Lattner
29cd5ba621 factor a whole bunch of code out into a helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59398 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 05:06:21 +00:00
Chris Lattner
b9553d693b simplify the conditions on two gigantic if's, decreasing indentation
a bit.  Next step is to factor out into their own helper functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59397 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:55:20 +00:00
Chris Lattner
6046fb7bef simplify some instcombine matches by using m_Specific
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59395 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:46:19 +00:00
Chris Lattner
321e6a6e82 Use new m_SelectCst template to eliminate macros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59392 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:33:38 +00:00
Chris Lattner
a6a474dca9 simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:26:55 +00:00
Chris Lattner
a74cefa6d3 Handle the case where there is no "not". It is possible it got
folded into the select.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:25:26 +00:00
Chris Lattner
faaf951fab factor a bunch of copy/paste code out into a helper function.
Eliminate the cases checking for cond?0:-1, since that is already
handled by commutative checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59388 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:24:12 +00:00
Nick Lewycky
d72a81ee64 Don't brute-force analyze cubic or higher polynomials.
If this patch causes a performance regression for anyone, please let me know,
and it can be fixed in a different way with much more effort.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:14:25 +00:00
Chris Lattner
1ca0c9922b rearrange some code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59381 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 03:56:24 +00:00
Chris Lattner
7d3b4e92ab if we're going to use a macro, use it maximally. no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59380 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 03:54:57 +00:00
Oscar Fuentes
92adc19be9 Adds extern "C" ints to the .cpp files that use RegisterTarget, as
well as 2 files that use "Registrator"s. These are to be used by the
MSVC builds, as the Win32 linker does not include libs that are
otherwise unreferenced, even if global constructors in the lib have
side-effects.

Patch by Scott Graham!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59378 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 21:36:30 +00:00
Nick Lewycky
70c44f0cce Correct this error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59370 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 17:50:47 +00:00
Duncan Sands
c529168f29 When splitting a SHUFFLE_VECTOR, try to have the result
use SHUFFLE_VECTOR instead.  If not practical, fall back
to the old scheme of building the split result by hand
using a BUILD_VECTOR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59361 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 09:25:38 +00:00
Mon P Wang
49292f1651 Add missing widen operations, fixed widening for extracting a subvector,
and when loading/storing a widen vector, make sure that they are loaded
and stored in consecutive order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59357 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 06:05:52 +00:00
Evan Cheng
7e2cc91d2d Fix fuitos encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59344 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 00:40:57 +00:00
Dan Gohman
14ad6fce43 Correct a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59341 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 00:24:23 +00:00
Dan Gohman
ade9f18934 Move ScheduleDAGList's LatencyPriorityQueue class out to a separate file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59340 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 00:23:40 +00:00
Devang Patel
229de95eab Refactor code.
Strip debug information before stripping symbol names. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 22:49:37 +00:00
Dan Gohman
7e6a1bc0fa Add support for building a ScheduleDAG from MachineInstrs. This is currently
fairly conservative; it doesn't do alias-analysis queries and it doesn't
attempt to break anti-dependencies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59324 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 21:47:58 +00:00
Evan Cheng
a956255ebf Fix MOVrx, MOVsrl_flag, and MOVsra_flag encodings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59314 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 20:09:11 +00:00
Dale Johannesen
fb88f1f9a7 Remove unneeded stuff from GRAD register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59311 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 18:10:48 +00:00
Richard Osborne
30aa75c96a [XCore] Remove whitespace in the description used when
registering XCoreTargetMachine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59308 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 16:19:56 +00:00
Richard Osborne
223fd6efc8 [XCore] Fix expansion of 64 bit add/sub. Don't custom expand
these operations if ladd/lsub are not available on the current
subtarget.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59305 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 15:59:19 +00:00
Richard Osborne
1d8f975890 Add XCore intrinsics for getid (returns thread id) and bitrev (reverses
bits in a word).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 10:12:16 +00:00
Lang Hames
56c523c63b Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59293 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 06:51:35 +00:00
Evan Cheng
c663beecdb ARM / Mac OS X also wants to invalidate icache after jitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59291 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 02:33:17 +00:00
Dan Gohman
8f6c6d4c5f For post-regalloc scheduling, remove the instructions from the block
before re-inserting them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59281 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 00:33:17 +00:00
Dan Gohman
90c5201dd1 Check in the correct version of the patch in r59279.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59280 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 00:32:34 +00:00
Dan Gohman
505a551dab Debug printing for SUnits that carry MachineInstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59279 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 00:28:56 +00:00
Dan Gohman
f449bf36ef Initial support for carrying MachineInstrs in SUnits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59278 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 00:06:09 +00:00
Dan Gohman
c3c129fd8b Change DOTGraphTraits<ScheduleDAG*>::getGraphName how to find the name of
the current function on its own, rather than relying on the SelectionDAG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 23:45:55 +00:00
Evan Cheng
ffa6d962a7 Handle the rest of pseudo instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59275 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 23:36:57 +00:00
Evan Cheng
28f312949e Lazy compilation callback save / restore VFP registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59274 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 23:28:54 +00:00
Dan Gohman
d23e0f81bc Remove the FlaggedNodes member from SUnit. Instead of requiring each SUnit
to carry a SmallVector of flagged nodes, just calculate the flagged nodes
dynamically when they are needed.

The local-liveness change is due to a trivial scheduling change where
the scheduler arbitrary decision differently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59273 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 23:24:17 +00:00
Owen Anderson
711fd3db2d Don't allow the restore point to be placed after terminators. With this change,
MultiSource/Applications is clean with the prealloc splitter.  Some failures
remain in SPEC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59267 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:53:14 +00:00
Dale Johannesen
330169fa3e Extend InlineAsm::C_Register to allow multiple specific registers
(actually, code already all worked, only the comment
changed).  Use this to implement 'A' constraint on x86.
Fixes PR 1779.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59266 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:52:36 +00:00
Evan Cheng
704bff9e6c Always emit a function pointer as a pointer to the function stub (if there is one). This makes it possible to compare function pointer values in lazy compilation mode. This fixes PR3043.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59265 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:50:50 +00:00
Dan Gohman
550f5afb68 Make the Node member of SUnit private, and add accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59264 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:36:12 +00:00
Dan Gohman
a23b3b803e Change ScheduleDAG's DAG member from a reference to a pointer, to prepare
for the possibility of scheduling without a SelectionDAG being present.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 21:21:28 +00:00
Evan Cheng
35b0bfd06d Don't forget to emit stubs for function GV's emitted in CONSTPOOL_ENTRY's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59258 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 19:22:28 +00:00
Dan Gohman
4a829ecc54 Use find_first/find_next to iterate through all the set bits in a
BitVector, instead of manually testing each bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59246 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 16:31:27 +00:00
Bill Wendling
cdcc3e6e12 Modify the intrinsics pattern to separate out the "return" types from the
"parameter" types. An intrinsic can now return a multiple return values like
this:

  def add_with_overflow : Intrinsic<[llvm_i32_ty, llvm_i1_ty],
                                    [LLVMMatchType<0>, LLVMMatchType<0>]>;



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 09:08:33 +00:00
Evan Cheng
3c902e81fa fsub{d|s} encoding bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59234 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 07:59:48 +00:00
Evan Cheng
67fd91f3df Missed a break statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59231 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 07:46:59 +00:00
Evan Cheng
148cad8b30 Fix pre- and post-indexed load / store encoding bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59230 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 07:34:59 +00:00
Bill Wendling
a6ce05f82a Refactor the code that does the type checking for intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 07:11:27 +00:00
Daniel Dunbar
0d9eb9b491 Add Binary flag to raw_fd_ostream constructor.
Document raw_fd_ostream's treatment of "-".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59219 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 05:01:07 +00:00
Devang Patel
bf5db817f4 Really remove all debug information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59208 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 01:28:40 +00:00
Bill Wendling
6ff4bfee3a Regenerated
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59204 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 01:03:00 +00:00
Bill Wendling
e9e6bdf27f Implement stack protectors as function attributes: "ssp" and "sspreq".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59202 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 01:02:14 +00:00
Dan Gohman
bc5cbb8be9 Move the code that inserts X87 FP_REG_KILL instructions from a
special-purpose hook to a new pass. Also, add check to see if any
x87 virtual registers are used, to avoid doing any work in the
common case that no x87 code is needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59190 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 22:55:05 +00:00
Evan Cheng
cb5798285a Remove the incorrect assertion. We don't have enough information before relocation to set U bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59170 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 21:37:59 +00:00
Oscar Fuentes
bc8dda83ef CMake: when bulding shared libraries on non-WIN32 systems, link dl to
LLVMSystem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59159 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 20:40:56 +00:00
Dale Johannesen
7e298ed379 Fix unsigned char->ppcf128 conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 18:38:44 +00:00
Dan Gohman
2d9716f7bf Do the LiveVariables update before printing the instruction in
the debug output, so that the updated liveness flags are
reflected in the debug output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59147 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 17:15:19 +00:00
Dan Gohman
4cbb3ca67d Remove some debugging code made redundant by the change to do
coalescing as a separate pass rather than inside of
LiveIntervalAnalysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 17:09:23 +00:00
Duncan Sands
1e465a35c8 Simplify SplitVecRes_EXTRACT_SUBVECTOR. This means
that it no longer handles non-power-of-two vectors.
However it previously only handled them sometimes,
depending on obscure numerical relationships between
the index and vector type.  For example, for a vector
of length 6, it would succeed if and only if the
index was an even multiple of 6.  I consider this
more confusing than useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59122 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 08:37:57 +00:00
Duncan Sands
245146b58a Correct some thinkos in the expansion of ADD/SUB
when the target does not support ADDC/SUBC.  This
fixes PR3044.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59120 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 08:23:26 +00:00
Evan Cheng
e7c3551e6f Change binary dump format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59119 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 08:22:43 +00:00
Evan Cheng
607f1b41a2 Address mode immediate offset has already been divided by 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59117 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 08:21:12 +00:00
Evan Cheng
3f4924efff Fix a VFP binary arithmetic instruction encoding bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59116 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 08:14:21 +00:00
Evan Cheng
706329143d Fix address mode 3 immediate offset mode encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59109 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 07:34:37 +00:00
Evan Cheng
3c4a4ffa3d Consolidate formats; fix FCMPED etc. encodings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59107 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 07:18:38 +00:00
Evan Cheng
80a119842d Fix VFP conversion instruction encodings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59104 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 06:41:41 +00:00
Evan Cheng
d06d48d2b5 Fix encoding of single-precision VFP registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59102 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 02:19:38 +00:00
Dale Johannesen
cbf7cf50ec Fix the testb optimization so x86 also bootstraps.
Reenable test.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 02:00:35 +00:00
Evan Cheng
580c0dfaed VFP fld / fst immediate field is multiplied by 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59100 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 01:02:24 +00:00
Oscar Fuentes
4e506abedd CMake: Remove removed source file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59098 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 00:14:12 +00:00
Devang Patel
19ab6b0940 Remove
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59093 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 23:58:15 +00:00
Devang Patel
94b29c3eac Undo previous check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 23:57:33 +00:00
Andrew Lenharth
068d1c51cc This shouldn't be necessary
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59090 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 23:19:51 +00:00
Evan Cheng
0a0ab1387a Fix FMDRR encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59088 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 22:46:12 +00:00
Evan Cheng
cb5201f3b2 Handle floating point constpool_entry's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59087 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 22:19:31 +00:00
Owen Anderson
80fe8737eb Don't walk into predecessors in which the vreg is not live when doing shrinkwrapping.
This lets several failing tests get farther along, but doesn't completely fix any of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59086 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 22:11:27 +00:00
Evan Cheng
cd8e66a1ef Encode VFP load / store instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59084 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 21:48:44 +00:00
Dan Gohman
b13af2f2ec In ScheduleDAGRRList::CopyAndMoveSuccessors, create the SUnit for the load
before creating the SUnit for the operation that it was unfolded from. This
allows each SUnit to have all of its predecessor SUnits available at the time
it is created. I don't know yet if this will be absolutely required, but it
is a little tidier to do it this way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59083 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 21:34:44 +00:00
Dan Gohman
eb9dbf117f Avoid relying on the SelectionDAG for initializing the MachineFunction and
TargetLoweringInfo variables for the scheduler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59082 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 21:31:56 +00:00
Oscar Fuentes
7d013e4bbd CMake: Updated list of source files for lib/Transforms/Utils.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59077 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 19:51:36 +00:00
Evan Cheng
78be83d7c2 Encode VFP conversion instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59074 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 19:40:26 +00:00
Devang Patel
90d45b8a4a Add utility pass to remove dbg info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59068 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 19:33:39 +00:00
Devang Patel
89d0a4dd84 Silence unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59064 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 19:17:41 +00:00
Devang Patel
772777e105 Use actual function name in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59063 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 19:16:41 +00:00
Dan Gohman
9b75b37375 Change the scheduler accessor methods to accept an explicit TargetMachine
argument instead of taking the SelectionDAG's TargetMachine. This is
needed for some upcoming scheduler changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59055 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 17:50:47 +00:00
Evan Cheng
86d77337fc Add a README entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59052 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 17:35:52 +00:00
Oscar Fuentes
2ae80d8ab1 CMake: corrected split of Alpha and Sparc AsmPrinters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59050 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 17:10:13 +00:00
Anton Korobeynikov
3bd86aac99 Separate sparc asmprinter. This should unbreak the native build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59047 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 16:42:57 +00:00
Anton Korobeynikov
bfac4260d8 Separate alpha asmprinter. This should unbreak native build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59046 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 16:42:17 +00:00
Dan Gohman
27cae7b01b The 32-bit displacement field in an x86 address is signed. Arrange for it
to be sign-extended when it is promoted to 64 bits for intermediate
offset calculations. The offset calculations are done as uint64_t so that
overflow conditions are well defined.

This fixes a problem which is currently hidden by the x86 AsmPrinter but
which was exposed by r58917 (which is temporarily reverted).  See PR3027
for details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59044 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 15:52:29 +00:00
Cedric Venet
24d3b38a0a Update CMakeLists.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59039 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 09:55:48 +00:00
Bill Wendling
ae89bb1443 Fix for PR3040:
The CC was changed, but wasn't checked to see if it was legal if the DAG
combiner was being run after legalization. Threw in a couple of checks just to
make sure that it's okay. As far as the PR is concerned, no back-end target
actually exhibited this problem, so there isn't an associated testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59035 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 08:25:46 +00:00
Andrew Lenharth
683a922653 fix another libgcc blocker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59026 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 06:06:07 +00:00
Mon P Wang
00ec49b6ba Cleaned up and fix bugs in convert_rndsat node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59025 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 05:40:06 +00:00
Scott Michel
19fd42a207 Unbreak the buildbot and back out (inadvertant) casting edits in CellSPU
backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59018 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 03:06:06 +00:00
Evan Cheng
96581d3633 Encode VFP arithmetic instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59016 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 02:11:05 +00:00
Devang Patel
35275f499a Cleanup debug info. assocated with deleted instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59012 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 00:54:10 +00:00
Devang Patel
780c38d84f Add utility routines to remove dead debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59011 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 00:53:02 +00:00
Scott Michel
73ce1c513f CellSPU: Fix bug 3606, as well as some ongoing work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59009 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 23:43:06 +00:00
Bill Wendling
22511ed2fe Small simplification. Use the iterator already present as the insertion point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59008 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 23:38:59 +00:00
Evan Cheng
e4d783d584 Comments and indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59007 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 23:26:16 +00:00
Evan Cheng
588920b9a5 Correct PIC function stub codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59006 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 23:14:47 +00:00
Dan Gohman
f4b24e2b66 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59004 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 22:09:58 +00:00
Bill Wendling
d0ab34bf8f Temporarily revert r58979 and related patch. It's causing a failure in X86 bootstrap:
Comparing stages 2 and 3
warning: ./cc1-checksum.o differs
warning: ./cc1obj-checksum.o differs
warning: ./cc1objplus-checksum.o differs
warning: ./cc1plus-checksum.o differs
Bootstrap comparison failure!
./alias.o differs
./alloc-pool.o differs
./attribs.o differs
./bb-reorder.o differs
./bitmap.o differs
./build/errors.o differs
./build/genattrtab.o differs
./build/genautomata.o differs
./build/genemit.o differs
./build/genextract.o differs
...

-bw


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59003 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 21:22:06 +00:00
Bill Wendling
7205677a46 - Make sure that we don't over-increment the iterator when going through the
basic blocks.
- Minor code clean-up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59002 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 21:13:10 +00:00
Mon P Wang
77cdf30742 Added CONVERT_RNDSAT (conversion with rounding and saturation) SDNode to
support targets that support these conversions. Users should avoid using
this node as the current targets don't generating code for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 20:54:11 +00:00
Devang Patel
d4e7f44319 If the sign of exit condition and split condition does not match
then do not split loop index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58995 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 19:48:34 +00:00
Duncan Sands
f509224510 Fix PR2667: add soft float support for sint_to_fp/uint_to_fp
where the argument is an apint, or smaller than the minimum
size for which there is a libcall (i32). 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58994 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 17:36:26 +00:00
Duncan Sands
cff50d9e20 Tweak some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58993 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 17:31:56 +00:00
Duncan Sands
6959b2bb65 Small cleanups. No functionality change intended!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58992 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 17:29:56 +00:00
Duncan Sands
a29c13086a When promoting the result of fp_to_uint/fp_to_sint,
inform the optimizers that the result must be zero/
sign extended from the smaller type.  For example,
if a fp to unsigned i16 is promoted to fp to i32,
then we are allowed to assume that the extra 16 bits
are zero (because the result of fp to i16 is undefined
if the result does not fit in an i16).  This is
quite aggressive, but should help the optimizers
produce better code.  This requires correcting a
test which thought that fp_to_uint is some kind
of truncation, which it is not: in the testcase
(which does fp to i1), either the fp value converts
to 0 or 1 or the result is undefined, which is
quite different to truncation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58991 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 17:28:30 +00:00
Dale Johannesen
baf26b2d3e Really fix testb optimization on big-endian.
Fixes ppc32 bootstrap.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58979 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 07:16:42 +00:00
Bill Wendling
11bb6c6d2c Third time's a charm.
The previous patches didn't match correctly. Also, we need to make sure that
the conditional is the same before doing the transformation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58978 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 06:59:06 +00:00
Mon P Wang
aeb06d2462 Added support for the following definition of shufflevector
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58964 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 04:46:22 +00:00
Chris Lattner
a64f463fb9 eliminate a couple more uses of utohexstr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58963 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 04:35:24 +00:00
Chris Lattner
c6a1346d7c Use utohex_buffer instead of utohexstr to avoid creating a temporary
string in the .ll and .s printers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58962 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 04:30:26 +00:00
Chris Lattner
497a7a81a8 Move getCastToEmpty out of DIDescriptor into DIFactory. It is an
implementation detail of DIFactory anyway, and this allows it to avoid
recomputing the same type over and over.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58960 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 04:10:34 +00:00
Chris Lattner
4d557e4872 Fix an over aggressive assumption that struct decls will have a pointer to
an array that is empty.  Instead of requiring this array, allow a null pointer.
This shrinks all forward references of structs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58959 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 03:48:55 +00:00
Chris Lattner
903361e509 add new file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58955 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 02:58:28 +00:00
Chris Lattner
a45664f709 Add a new set of helper classes for creating and reading debug
information.  This logically replaces the "Desc" classes in
MachineModuleInfo.  Nice features of these classes are that they:

1. Are much more efficient than MMI because they don't create a 
   temporary parallel data structure for debug info that has to be
   'serialized' and 'deserialized' into/out of the module.
2. These provide a much cleaner abstraction for debug info than 
   MMI, which will make it easier to change the implementation in 
   the future (to be MDNode-based).
3. These are much easier to use than the MMI interfaces, requiring
   a lot less code in the front-ends.
4. These can be used to both create (for frontends) and read (for
   codegen) debug information.  DebugInfoBuilder can only be used
   to create the nodes.

So far, this is implemented just enough to support the debug info
generation needs of clang.  This can and should be extended to 
support the full set of debug info constructs, and we should switch
llvm-gcc and llc over to using this in the near future.

This code also has a ton of FIXMEs in it, because the way we 
currently represent debug info in LLVM IR is basically insane in a
variety of details.  This sort of issue should be fixed when we
eventually reimplement debug info on top of MDNodes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58954 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 02:56:27 +00:00
Evan Cheng
5594f120b8 Forgot these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58952 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 01:52:24 +00:00
Evan Cheng
9ed2f80910 Rename isGVNonLazyPtr to isIndirectSym to reflect how it will be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58949 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 01:08:07 +00:00
Bill Wendling
8f24cc237f Correction for the last patch. Should match the conditional in the first part
of the select match, not the select instruction itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58947 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-09 23:37:53 +00:00
Bill Wendling
1fb43c32ed The method of doing the matching with a 'select' instruction was wrong. The
original code was matching like this:

	if (match(A, m_Not(m_Value(B))))

B was already matched as a 'select' instruction. However, this isn't matching
what we think it's matching. It would match B as a 'Value', so basically
anything would match to it. In this case, a Constant matched. B was replaced
with a constant representation. And then the wrong value would be used in the
SelectInst::Create statement, causing a crash.

After thinking on this for a moment, and after Nick L. told me how the pattern
matching stuff was supposed to work, the solution was to match NOT an m_Value,
but an m_Select.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58946 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-09 23:17:42 +00:00
Nuno Lopes
ea736cee2b fix leakage of ValueNumbering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58933 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-09 12:45:23 +00:00
Dale Johannesen
ced4900578 Temporarily revert 58825, which breaks PPC bootstrap.
xs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-09 06:48:10 +00:00
Bill Wendling
c143bcf9ac If the LHS of the FCMP is coming from a UIToFP instruction, then we don't want
to generate signed ICMP instructions to replace the FCMP. This would violate
the following:

define i1 @test1(i32 %val) {
  %1 = uitofp i32 %val to double
  %2 = fcmp ole double %1, 0.000000e+00
  ret i1 %2
}

would be transformed into:

define i1 @test1(i32 %val) {
  %1 = icmp slt i33 %val, 1
  ret i1 %1
}

which is obviously wrong. This patch modifes InstCombiner::FoldFCmp_IntToFP_Cst
to handle when the LHS comes from UIToFP.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58929 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-09 04:26:50 +00:00
Anton Korobeynikov
b0714dbc0d Typo fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58928 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-09 02:54:13 +00:00
Anton Korobeynikov
0b45c9957f Temporary revert my last commit: it seems it's triggering some subtle bug in backend
and breaks llvm-gcc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58926 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 23:05:05 +00:00
Oscar Fuentes
b5b9252a17 CMake: corrected library target name for dependency: LLVMCellSPU ->
LLVMCellSPUCodeGen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58925 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 21:23:15 +00:00
Oscar Fuentes
a4dd926011 CMake: Reflected changes on the CellSPU target build. May require a
clean start.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58924 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 20:37:19 +00:00
Oscar Fuentes
eed0ec73b9 Fixed a pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58923 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 20:34:18 +00:00