Commit Graph

5683 Commits

Author SHA1 Message Date
Chris Lattner
259f88e3c9 Verify that the alignment argument to llvm.memcpy is a constant
integer, PR2318.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 05:31:10 +00:00
Chris Lattner
88e6dc8bf1 Fix PR2423 by checking all indices for out of range access, not only
indices that start with an array subscript.  x->field[10000] is just 
as bad as (*X)[14][10000].


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55226 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 05:21:06 +00:00
Dale Johannesen
169b5ed46e Test all currently supported atomic builtins on x86-{32,64}.
These just test that they go through the BE.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55208 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 22:39:21 +00:00
Dale Johannesen
7916fad6ef Comprehensive test of FE handling of __sync builtins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55206 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 21:47:03 +00:00
Dan Gohman
22bb31103d Factor out the predicate check code from DAGISelEmitter.cpp
and use it in FastISelEmitter.cpp, and make FastISel
subtarget aware. Among other things, this lets it work
properly on x86 targets that don't have SSE, where it
successfully selects x87 instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55156 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 00:20:26 +00:00
Bill Wendling
403483c200 Testcase for PR2585.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55151 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 23:04:49 +00:00
Dan Gohman
c67670b1ae Add -mattr=sse2 so this test doesn't fail on non-x86 hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55145 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 22:34:25 +00:00
Dale Johannesen
e2122a5e2e Make x86 and sse2 explicit for non-x86 hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55141 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 21:26:06 +00:00
Evan Cheng
1887c1c2f9 Fix a number of byval / memcpy / memset related codegen issues.
1. x86-64 byval alignment should be max of 8 and alignment of type. Previously the code was not doing what the commit message was saying.
2. Do not use byte repeat move and store operations. These are slow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55139 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 21:00:15 +00:00
Dan Gohman
5cc101ec89 getelementptr doesn't work on x86-64 yet, because it
has MOV64ri32 and no plain MOV64ri.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55126 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 17:28:42 +00:00
Dan Gohman
7a0e6593d0 MVT::getMVT uses iPTR for pointer types, while we need the actual
intptr_t type in this case. FastISel can now select simple
getelementptr instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55125 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 17:25:26 +00:00
Nick Lewycky
5d52c4501a Revert r54876 r54877 r54906 and r54907. Evan found that these caused a 20%
slowdown in bzip2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55113 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 05:56:10 +00:00
Dan Gohman
d5fe57d2f9 Basic fast-isel support for instructions with constant int operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55099 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 01:41:07 +00:00
Dan Gohman
5c6aea9714 Add a -march line for this test, and run it on x86-64 too for fun.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 00:56:07 +00:00
Chris Lattner
80b7bc865a ll printer prints each zeroinit on the same line now, update regex
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55025 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 00:33:57 +00:00
Dan Gohman
8014e86580 Add FastISel support for floating-point operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55021 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 00:23:20 +00:00
Dan Gohman
bdedd44773 Add FastISel support for several more binary operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55020 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 00:11:48 +00:00
Bill Wendling
108ecf3975 Add support for the __sync_sub_and_fetch atomics and friends for X86. The code
was already present, but not hooked up to anything.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55018 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 23:09:18 +00:00
Dan Gohman
d3aedf445c Fast-isel is now *minimally* functional. Add a testcase to
demonstrate the extent of its capabilities. Note that it
only attempts to operate on one of the blocks in this
testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55016 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 22:37:59 +00:00
Dale Johannesen
140be2dfb7 Add support for 8 and 16 bit forms of __sync
builtins on X86.

Change "lock" instructions to be on a separate line.
This is needed to work around a bug in the Darwin
assembler.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54999 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 18:47:28 +00:00
Bill Wendling
2dcca3a6d8 XFAIL this test for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54929 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 18:29:54 +00:00
Nick Lewycky
91a0f78265 Consider the case where xor by -1 and xor by 128 have been combined already to
produce an xor by 127.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54906 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 19:58:24 +00:00
Evan Cheng
4e49c80289 Didn't mean to change this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54904 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 19:25:28 +00:00
Evan Cheng
0ac3fc2a61 Fix a (u)comiss intrinsic lowering bug. It was using anyext which can return junk in higher bits. Patch by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54903 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 19:22:34 +00:00
Gordon Henriksen
5eca075b74 Rename some GC classes so that their roll will hopefully be clearer.
In particular, Collector was confusing to implementors. Several
thought that this compile-time class was the place to implement
their runtime GC heap. Of course, it doesn't even exist at runtime.
Specifically, the renames are:

  Collector               -> GCStrategy
  CollectorMetadata       -> GCFunctionInfo
  CollectorModuleMetadata -> GCModuleInfo
  CollectorRegistry       -> GCRegistry
  Function::getCollector  -> getGC (setGC, hasGC, clearGC)

Several accessors and nested types have also been renamed to be
consistent. These changes should be obvious.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54899 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 18:44:35 +00:00
Nick Lewycky
1b344bc986 Xor'ing both sides of icmp by sign-bit is equivalent to swapping signedness of
the predicate.

Also, make this optz'n apply in more cases where it's safe to do so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54876 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 07:34:14 +00:00
Owen Anderson
7c856c09cd Remove GCSE and LoadVN from the testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54832 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 00:00:54 +00:00
Devang Patel
35115f92e4 Reapply 54786. Add overflow and number of mantissa bits checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54821 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-15 21:21:34 +00:00
Evan Cheng
21066541ae Revert 54786. It's not checking for overflows, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54813 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-15 08:12:11 +00:00
Bill Wendling
0d9deac485 Renaming LLVMC/dg.exp to LLVM/llvmc.exp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54809 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 23:37:58 +00:00
Devang Patel
488dc6732d The pass manager is not able to schedule -loop-deletion -loop-index-split.
The loop-deletion pass does not preserve dom frontier, which is required by
loop-index-split. When the PM checks dom frontier for loop-index-split, it has
already verified that lcssa is availalble. However, new dom frontier forces new
loop pass manager, which does not  have lcssa yet.

The PM should recheck availability of required analysis passes in such cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54805 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 23:07:48 +00:00
Devang Patel
79ceb4463e If IV is used in a int-to-float cast inside the loop then try to eliminate the cast opeation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54786 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 20:58:31 +00:00
Dan Gohman
7f8613e5b8 Improve support for vector casts in LLVM IR and CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54784 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 20:04:46 +00:00
Dan Gohman
a60832b018 Fix a bogus srem rule - a negative value srem'd by a power-of-2
can have a non-negative result; for example, -16%16 is 0. Also,
clarify the related comments. This fixes PR2670.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54767 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 23:12:35 +00:00
Dan Gohman
6ab6422f25 Allow SelectionDAG to create EXTRACT_VECTOR_ELT nodes with
non-constant indices. Only a few of the peephole checks require
a constant index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54764 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 21:51:37 +00:00
Dan Gohman
2edeb63ece Fix SCCP's handling of struct value loads and stores. SCCP doesn't
track individual leaf values in such cases, so it needs to treat
struct values as normal values in this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 21:22:48 +00:00
Duncan Sands
81b06be055 Teach constant folding that an inttoptr of a
ptrtoint can be turned into a bitcast if the
integer is at least as wide as a pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54752 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 20:20:35 +00:00
Devang Patel
d16aba22c9 Check sign to detect overflow before changing compare stride.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54710 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 02:05:14 +00:00
Dan Gohman
3837218ea0 Extend ScalarEvolution's executesAtLeastOnce logic to be able to
continue past the first conditional branch when looking for a
relevant test. This helps it avoid using MAX expressions in
loop trip counts in more cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54697 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 20:17:31 +00:00
Chris Lattner
b8cd4d3d49 Implement support for simplifying vector comparisons by 0.0 and 1.0 like we
do for scalars.  Patch contributed by Nicolas Capens

This also generalizes the previous xforms to work on long double, now that 
isExactlyValue works for long double.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54653 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 22:06:05 +00:00
Dan Gohman
00f19b6542 Improve the grep commands for this test to be tolerant of ABI
differences, and to be more specific.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54648 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 20:10:41 +00:00
Dan Gohman
8cea8ff34c Take the FrameOffset into account when computing the alignment
of stack objects. This fixes PR2656.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54646 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 18:27:03 +00:00
Gordon Henriksen
21491edbf4 [PR-2610] Adding Ocaml bindings for Switch::addCase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54571 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 01:55:52 +00:00
Dan Gohman
d9ced09299 Add an EXTRACTPSmr pattern to match the pattern that
X86ISelLowering creates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54544 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 18:30:21 +00:00
Nick Lewycky
ffa45431c8 Testcase for r54520.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 07:00:26 +00:00
Evan Cheng
711b6dce24 It's not legal to output a GV in a coalesced section if it's used in an ARM PIC relative constantpool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54519 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 06:56:16 +00:00
Nick Lewycky
d6227385fc Don't crash printing the asm for a ConstantExpr PtrToInt just because the int
is narrower than the pointer. This testcase emits:

  .byte (((17) - 16) & 255)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54517 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 06:34:07 +00:00
Bruno Cardoso Lopes
65ad452536 Support added for ctlz intrinsic, test case added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54516 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 06:16:31 +00:00
Bruno Cardoso Lopes
ab243df91f [Last] Batch 7 of Mips CodeGen tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54512 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 04:12:42 +00:00
Bruno Cardoso Lopes
4230586091 Batch 6 of Mips CodeGen tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54511 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 04:11:30 +00:00
Bruno Cardoso Lopes
0b4e136c74 Batch 5 of Mips CodeGen tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54510 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 04:09:57 +00:00
Bruno Cardoso Lopes
29b4ff7c73 Batch 4 of Mips CodeGen tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54509 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 04:08:30 +00:00
Bruno Cardoso Lopes
ba3442fc24 Batch 3 of Mips CodeGen tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54508 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 04:05:51 +00:00
Bruno Cardoso Lopes
e5813b7aa8 Batch 2 of Mips CodeGen tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54507 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 04:03:25 +00:00
Bruno Cardoso Lopes
6d523c0fe3 Batch 1 of Mips CodeGen tests, more coming...
I had a lot of simple local codegen tests and they are now ready to be placed
in test/CodeGen. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54506 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 03:58:34 +00:00
Dale Johannesen
ea98fe2cd2 Testcases for 54503. One derived from PR 2533, the
other from Python.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54505 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 03:37:11 +00:00
Duncan Sands
c93346af8e Use correct compiler component names for objc
and objc++.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54474 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 17:59:54 +00:00
Duncan Sands
dbfccf64d9 Move tests of the ObjC++ front-end to their own
directory: some people (guess who!) may build llvm-gcc
with support for objc but not with support for objc++.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54471 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 17:48:08 +00:00
Matthijs Kooijman
1d63d92092 Add a basic test for the SRETPromotion pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54466 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 15:55:18 +00:00
Matthijs Kooijman
0d4ee1a7cd Move two tests from SRETPromotion to Inline, since they only call opt -inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 15:36:46 +00:00
Anton Korobeynikov
feac94b18d Print section flags ok on platforms, which use '@' as comment string. Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:55:06 +00:00
Dan Gohman
e3d920699c Re-enable elimination of unnecessary SUBREG_TO_REG instructions in
LowerSubregs, and fix an x86-64 isel bug that this exposed.

SUBREG_TO_REG for x86-64 implicit zero extension is only safe for
isel to generate when the source is known to always have zeros in
the high 32 bits. The EXTRACT_SUBREG instruction does not clear
the high 32 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54444 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 02:54:50 +00:00
Dan Gohman
865db4566e Add an extra example that shouldn't get an and instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54443 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 02:23:06 +00:00
Dan Gohman
8a1510d192 Re-introduce the 8-bit subreg zext-inreg patterns for x86-32,
this time using MOV32to32_ and MOV16to16_. Thanks to Evan for
suggesting this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54418 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 18:27:21 +00:00
Dan Gohman
4ce9627e97 Fix a shufflevector instcombine that was emitting invalid masks indices
when it meant to be emitting undef indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54417 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 18:17:32 +00:00
Evan Cheng
d756f8820a PR2535, not PR2355.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54416 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 18:06:48 +00:00
Evan Cheng
f5e25f32c7 Fix PR2355: bug in ChangeCompareStride. When the loop termination compare is the only use of its iv stride, the stride can be eliminated by moving it to another stride. If the scale is negative, swap the predicate instead of using a inverse predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54415 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 18:04:43 +00:00
Chris Lattner
46bbad217b optimize a common idiom generated by clang for bitfield access, PR2638.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54408 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 07:35:52 +00:00
Chris Lattner
5af5f463e1 Zap sitofp/fptoui pairs. In all cases when the sign difference
matters, the result is undefined anyway.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54396 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 05:13:06 +00:00
Nick Lewycky
b30591ec64 Reinstate this optimization, but without the miscompile. Thanks to Bill for
tracking down that this was breaking llvm-gcc bootstrap on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 04:54:03 +00:00
Bill Wendling
5226698f67 Just grep for through the LL code instead of the ASM code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 00:10:32 +00:00
Bill Wendling
201bf25f83 Add default architecture.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 23:36:00 +00:00
Bill Wendling
0b101b0399 Testcase for PR2629.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54377 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 22:23:59 +00:00
Evan Cheng
e9d5035838 Fix PR2620: Fix X86cmppd selection code so it expects operands to be v2f64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54376 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 22:19:15 +00:00
Evan Cheng
e3b8a48d32 Fix PR2596: out of bound reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54375 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 21:51:46 +00:00
Bill Wendling
021507be82 Revert r53282. This was causing a miscompile on Linux. Also, the transformation
looks bogus. Please see PR2629 for details on why this is breaking things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54372 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 21:23:45 +00:00
Owen Anderson
b6634e9e27 Update the remaining tests not to use -disable-correct-folding, and remove two
that couldn't be updated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 18:19:14 +00:00
Owen Anderson
551ddf718c One more -disable-correct-folding case removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54358 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 18:08:56 +00:00
Owen Anderson
2a1f07ea6a Remove another -disable-correct-folding use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54357 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 18:05:58 +00:00
Owen Anderson
d6db225800 Eliminate another use of -disable-correct-folding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54356 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 18:03:01 +00:00
Owen Anderson
287b7b7ed7 This check is unnecessary, and getting rid of it removes a use of -disable-correct-folding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54355 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 17:52:54 +00:00
Owen Anderson
3888aa0b7d Remove the need for -disable-correct-folding from this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54354 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 17:49:52 +00:00
Dan Gohman
c3be0fd8c3 Fix the AsmWriter to not print extra spaces after parameter attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54351 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 15:51:44 +00:00
Evan Cheng
068b4ff553 Fix PR2568: Fix bug that cause redudant kill marker after its live interval has been extended due to coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54346 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 07:10:38 +00:00
Owen Anderson
2b85dc3544 Update these tests to work by disabling the new correct CFG generation. This flag should ONLY be used to for tests like these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-04 23:55:29 +00:00
Eli Friedman
b42a626122 PR2621: Improvements to the SCEV AddRec binomial expansion. This
version uses a new algorithm for evaluating the binomial coefficients 
which is significantly more efficient for AddRecs of more than 2 terms 
(see the comments in the code for details on how the algorithm works).  
It also fixes some bugs: it removes the arbitrary length restriction for 
AddRecs, it fixes the silent generation of incorrect code for AddRecs 
which require a wide calculation width, and it fixes an issue where we 
were incorrectly truncating the iteration count too far when evaluating 
an AddRec expression narrower than the induction variable.

There are still a few related issues I know of: I think there's 
still an issue with the SCEVExpander expansion of AddRec in terms of
the width of the induction variable used.  The hack to avoid generating 
too-wide integers shouldn't be necessary; instead, the callers should be 
considering the cost of the expansion before expanding it (in addition 
to not expanding too-wide integers, we might not want to expand 
expressions that are really expensive, especially when optimizing for 
size; calculating an length-17 32-bit AddRec currently generates about 250 
instructions of straight-line code on X86).  Also, for long 32-bit 
AddRecs on X86, CodeGen really sucks at scheduling the code.  I'm planning on 
filing follow-up PRs for these issues.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54332 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-04 23:49:06 +00:00
Dan Gohman
6f498b0a8e Fix SDISel lowering of PHI nodes to use ComputeValueVTs.
This allows it to work correctly on aggregate values.
This fixes PR2623.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54331 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-04 23:42:46 +00:00
Dan Gohman
1f565bcff6 Fix SDISel lowering of zeroinitializer and undef to use ComputeValueVTs.
This allows it to work correctly on nested aggregate values.
This fixes PR2625.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54330 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-04 23:30:41 +00:00
Dale Johannesen
3b4c45203e Make sse2 explicit, for non-x86 hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54251 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-31 20:16:33 +00:00
Dan Gohman
75dcf08243 Improve dagcombining for sext-loads and sext-in-reg nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54239 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-31 00:50:31 +00:00
Dan Gohman
90d33ee746 Don't look for leaf values to store when lowering stores of
empty structs. This fixes PR2612.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54226 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-30 18:36:51 +00:00
Dan Gohman
1053502486 I missed this file in r54223. movzbl is now used instead
of movzbw here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54224 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-30 18:23:34 +00:00
Dan Gohman
11ba3b1af6 Reapply r54147 with a constraint to only use the 8-bit
subreg form on x86-64, to avoid the problem with x86-32
having GPRs that don't have 8-bit subregs.

Also, change several 16-bit instructions to use 
equivalent 32-bit instructions. These have a smaller
encoding and avoid partial-register updates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54223 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-30 18:09:17 +00:00
Mon P Wang
e3b3a7241c Added support for overloading intrinsics (atomics) based on pointers
to different address spaces.  This alters the naming scheme for those
intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54195 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-30 04:36:53 +00:00
Eli Friedman
1fbffe0cef Another SCEV issue from PR2607; essentially the same issue, but this
time applying to the implicit comparison in smin expressions. The 
correct way to transform an inequality into the opposite 
inequality, either signed or unsigned, is with a not expression.

I looked through the SCEV code, and I don't think there are any more 
occurrences of this issue.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54194 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-30 04:36:32 +00:00
Eli Friedman
068acc3caa Fix for PR2607: SCEV miscomputing the loop count for loops with an
SGT exit condition.  Essentially, the correct way to flip an inequality 
in 2's complement is the not operator, not the negation operator.  
That said, the difference only affects cases involving INT_MIN.

Also, enhance the pre-test search logic to be a bit smarter about 
inequalities flipped with a not operator, so it can eliminate the smax 
from the iteration count for simple loops.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54184 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-30 00:04:08 +00:00
Duncan Sands
68d4d1d49c Fix PR2609. If a label is deleted, then it needs
to be marked invalid regardless of whether it is
a debug, an exception handling or (hopefully) a
GC label.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54172 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-29 20:56:02 +00:00
Nate Begeman
5bc1ea0736 Add vector shifts to the IR, patch by Eli Friedman.
CodeGen & Clang work coming next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54161 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-29 15:49:41 +00:00
Matthijs Kooijman
75cf9cc527 Add -unroll-allow-partial command line option that enabled the loop unroller to
partially unroll a loop when fully unrolling would not fit under the threshold.

Patch by Mikael Lepistö.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54160 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-29 13:21:23 +00:00
Matthijs Kooijman
477f5a2f11 Restructure ArgumentPromotion a bit. Instead of just having a single boolean
that says "unconditional loads from this argument are safe", we now keep track
of the safety per set of indices from which loads happen. This prevents
ArgPromotion from promoting loads that aren't really valid. As an added effect,
this will now disregard the the type of the indices passed to a GEP, so
"load GEP %A, i32 1" and "load GEP %A, i64 1" will result in a single argument,
not two.

This fixes PR2598, for which a testcase has been added as well.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54159 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-29 10:00:13 +00:00