OSDN Git Service
Duncan Sands [Mon, 28 Jan 2008 10:35:11 +0000 (10:35 +0000)]
Make this more likely to be passed byval.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46451
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 28 Jan 2008 09:15:03 +0000 (09:15 +0000)]
If the function has no machine instructions, then emit a "nop" so that
the function label isn't associated with something it shouldn't be.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46449
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 28 Jan 2008 04:41:43 +0000 (04:41 +0000)]
Transform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46433
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 28 Jan 2008 04:18:41 +0000 (04:18 +0000)]
reduce duplicate -I flags passed to the compiler, cleaning up the VERBOSE
output. Patch contributed by Sam Bishop!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46432
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 28 Jan 2008 03:48:02 +0000 (03:48 +0000)]
Handle some more combinations of extend and icmp. Fixes PR1940.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46431
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 28 Jan 2008 00:58:18 +0000 (00:58 +0000)]
Fix PR1932 by disabling an xform invalid for fdiv.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46429
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 28 Jan 2008 00:36:27 +0000 (00:36 +0000)]
make handling of overflow and undefined results much more clear.
Patch by Eli Friedman, thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46428
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 28 Jan 2008 00:32:30 +0000 (00:32 +0000)]
Fix PR1938 by forcing the code that uses an undefined value to branch one
way or the other. Rewriting the code itself prevents subsequent analysis
passes from making contradictory conclusions about the code that could
cause an infeasible path to be made feasible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46427
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 27 Jan 2008 23:43:26 +0000 (23:43 +0000)]
Always for PACKAGEVERSION to 'mainline' for teh llvm web page.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46425
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 27 Jan 2008 23:32:17 +0000 (23:32 +0000)]
Fix PowerPC/./2007-10-18-PtrArithmetic.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46424
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 27 Jan 2008 23:26:37 +0000 (23:26 +0000)]
Update this test. Due to dag combiner improvements, we now compile
f7/f11 to:
_f7:
eor r0, r0, #2, 2 @ -
2147483648
bx lr
_f11:
bic r0, r0, #2, 2 @ -
2147483648
bx lr
instead of:
_f7:
fmsr s0, r0
fnegs s0, s0
fmrs r0, s0
bx lr
_f11:
fmsr s0, r0
fabss s0, s0
fmrs r0, s0
bx lr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46423
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 27 Jan 2008 23:21:58 +0000 (23:21 +0000)]
fix a crash on CodeGen/X86/vector-rem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46422
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 27 Jan 2008 22:58:59 +0000 (22:58 +0000)]
Add support for frameworks. Patch by Shantonu Sen!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46421
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Sun, 27 Jan 2008 22:00:00 +0000 (22:00 +0000)]
Reg alloc doesn't really need LiveVariables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46420
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Sun, 27 Jan 2008 19:51:03 +0000 (19:51 +0000)]
Fixes for BreakCriticalMachineCodeEdge by Fernando.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46419
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sun, 27 Jan 2008 18:35:00 +0000 (18:35 +0000)]
Be more careful modifying the use_list while also iterating through it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46417
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Sun, 27 Jan 2008 18:12:58 +0000 (18:12 +0000)]
Revert r46393: readonly/readnone functions are no
longer allowed to write through byval arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46416
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 27 Jan 2008 17:42:27 +0000 (17:42 +0000)]
Implement some dag combines that allow doing fneg/fabs/fcopysign in integer
registers if used by a bitconvert or using a bitconvert. This allows us to
avoid constant pool loads and use cheaper integer instructions when the
values come from or end up in integer regs anyway. For example, we now
compile CodeGen/X86/fp-in-intregs.ll to:
_test1:
movl $
2147483648, %eax
xorl 4(%esp), %eax
ret
_test2:
movl $
1065353216, %eax
orl 4(%esp), %eax
andl $
3212836864, %eax
ret
Instead of:
_test1:
movss 4(%esp), %xmm0
xorps LCPI2_0, %xmm0
movd %xmm0, %eax
ret
_test2:
movss 4(%esp), %xmm0
andps LCPI3_0, %xmm0
movss LCPI3_1, %xmm1
andps LCPI3_2, %xmm1
orps %xmm0, %xmm1
movd %xmm1, %eax
ret
bitconverts can happen due to various calling conventions that require
fp values to passed in integer regs in some cases, e.g. when returning
a complex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46414
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 27 Jan 2008 07:31:41 +0000 (07:31 +0000)]
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46413
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 27 Jan 2008 06:19:31 +0000 (06:19 +0000)]
Use fldz and fld1 for long double constants instead of a constant pool load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46411
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 27 Jan 2008 06:19:08 +0000 (06:19 +0000)]
make isExactlyValue work for long double.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46410
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 27 Jan 2008 06:13:32 +0000 (06:13 +0000)]
The CorrelatedExpressions pass is now no more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46409
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 27 Jan 2008 06:11:41 +0000 (06:11 +0000)]
The CorrelatedExpressionElimination pass is known to be buggy. Remove it.
This fixes PR1769.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46408
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 27 Jan 2008 06:09:28 +0000 (06:09 +0000)]
For long double constants, print an approximation of their value to the .s file to make it easier to read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46407
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 27 Jan 2008 05:29:54 +0000 (05:29 +0000)]
Fold fptrunc(add (fpextend x), (fpextend y)) -> add(x,y), as GCC does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46406
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 26 Jan 2008 20:12:07 +0000 (20:12 +0000)]
Add some notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46405
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 26 Jan 2008 20:07:42 +0000 (20:07 +0000)]
Remove some code for inferring alignment info from the x86 backend
now that the dag combiner does it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46404
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 26 Jan 2008 20:06:45 +0000 (20:06 +0000)]
New test to verify that "merging 4 loads into a vec load" continues to work and
continues to infer alignment info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46403
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 26 Jan 2008 19:50:30 +0000 (19:50 +0000)]
make this 64-bit safe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46402
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 26 Jan 2008 19:45:50 +0000 (19:45 +0000)]
Infer alignment of loads and increase their alignment when we can tell they are
from the stack. This allows us to compile stack-align.ll to:
_test:
movsd LCPI1_0, %xmm0
movapd %xmm0, %xmm1
*** andpd 4(%esp), %xmm1
andpd _G, %xmm0
addsd %xmm1, %xmm0
movl 20(%esp), %eax
movsd %xmm0, (%eax)
ret
instead of:
_test:
movsd LCPI1_0, %xmm0
** movsd 4(%esp), %xmm1
** andpd %xmm0, %xmm1
andpd _G, %xmm0
addsd %xmm1, %xmm0
movl 20(%esp), %eax
movsd %xmm0, (%eax)
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46401
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 26 Jan 2008 19:35:46 +0000 (19:35 +0000)]
remove a useless xfailed test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46400
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Sat, 26 Jan 2008 12:33:01 +0000 (12:33 +0000)]
Invert this test, because it is wrong if we allow
readonly functions to use byval parameters as local
storage (how much do we want this?).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46399
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 26 Jan 2008 09:03:52 +0000 (09:03 +0000)]
If there's no instructions being emitted on X86 for a function, emit a
nop. Emit the nop directly for PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46398
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 26 Jan 2008 06:56:08 +0000 (06:56 +0000)]
Need to convert to LLVM code and not C.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46397
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 26 Jan 2008 06:53:40 +0000 (06:53 +0000)]
Rename the .c to .ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46396
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 26 Jan 2008 06:53:06 +0000 (06:53 +0000)]
Move testcase to the code gen directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46395
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 26 Jan 2008 06:51:24 +0000 (06:51 +0000)]
If there are no machine instructions emitted for a function, then insert
a "nop" instruction so that we don't have the function's label associated
with something that it's not supposed to be associated with.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46394
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Sat, 26 Jan 2008 06:41:49 +0000 (06:41 +0000)]
Create an explicit copy for byval parameters even
when inlining a readonly function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46393
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 26 Jan 2008 01:43:44 +0000 (01:43 +0000)]
If we have a function like this:
void bork() {
int *address = 0;
*address = 0;
}
It's compiled into LLVM code that looks like this:
define void @bork() noreturn nounwind {
entry:
unreachable
}
This is bad on some platforms (like PPC) because it will generate the label for
the function but no body. The label could end up being associated with some
non-code related stuff, like a section. This places a "trap" instruction if the
SimplifyCFG pass removed all code from the function leaving only one
"unreachable" instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46387
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Sat, 26 Jan 2008 01:21:48 +0000 (01:21 +0000)]
Add another testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46385
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 26 Jan 2008 01:09:19 +0000 (01:09 +0000)]
Fix some bugs in SimplifyNodeWithTwoResults where it would call deletenode to
delete a node even if it was not dead in some cases. Instead, just add it to
the worklist. Also, make sure to use the CombineTo methods, as it was doing
things that were unsafe: the top level combine loop could touch dangling memory.
This fixes CodeGen/Generic/2008-01-25-dag-combine-mul.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46384
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 26 Jan 2008 01:05:42 +0000 (01:05 +0000)]
don't bother making x&-1 only to simplify it in dag combine. This commonly occurs expanding i64 ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46383
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sat, 26 Jan 2008 00:35:43 +0000 (00:35 +0000)]
New test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46382
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Jan 2008 23:34:24 +0000 (23:34 +0000)]
reduce indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46377
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Jan 2008 22:36:24 +0000 (22:36 +0000)]
add a testcase for a bug Duncan pointed out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46372
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 25 Jan 2008 22:06:51 +0000 (22:06 +0000)]
Do this more neatly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46369
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Jan 2008 17:49:41 +0000 (17:49 +0000)]
Reorder a field to reduce the size of StackObject. Note that this
may require a clean rebuild on leopard. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46360
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 25 Jan 2008 17:36:44 +0000 (17:36 +0000)]
Test for PR1942.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46357
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Jan 2008 17:24:52 +0000 (17:24 +0000)]
fix long lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46355
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Jan 2008 16:41:09 +0000 (16:41 +0000)]
JITEmitter.cpp was trying to sync the icache for function stubs, but
was actually passing a completely incorrect size to sys_icache_invalidate.
Instead of having the JITEmitter do this (which doesn't have the correct
size), just make the target sync its own stubs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46354
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 25 Jan 2008 10:20:53 +0000 (10:20 +0000)]
Add more assertions to catch accesses outside of
arrays. Also, as a convenience, don't barf, just
return false, if someone calls isTruncStoreLegal
or isLoadXLegal with an extended type for the in
memory type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46352
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 25 Jan 2008 10:10:33 +0000 (10:10 +0000)]
DeadStoreElimination can treat byval parameters as if there were alloca's for the purpose of removing end-of-function stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46351
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Jan 2008 07:29:34 +0000 (07:29 +0000)]
move this field back. Moving the field causes miscompilations (!) of voronoi and others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46350
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Jan 2008 07:20:16 +0000 (07:20 +0000)]
Add skeletal code to increase the alignment of loads and stores when
we can infer it. This will eventually help stuff, though it doesn't
do much right now because all fixed FI's have an alignment of 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46349
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Jan 2008 07:19:06 +0000 (07:19 +0000)]
move MachineFrameInfo::CreateFixedObject out of line, give MachineFrameInfo
a reference to TargetFrameInfo. Rearrange order of fields in StackObject to
save a word.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46348
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Jan 2008 06:40:45 +0000 (06:40 +0000)]
include alignment and volatility information in -view-*-dags output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46347
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Jan 2008 06:20:20 +0000 (06:20 +0000)]
add a fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46346
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Jan 2008 06:14:17 +0000 (06:14 +0000)]
optimize fxor like for
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46345
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Jan 2008 05:46:26 +0000 (05:46 +0000)]
Add target-specific dag combines for FAND(x,0) and FOR(x,0). This allows
us to compile:
double test(double X) {
return copysign(0.0, X);
}
into:
_test:
andpd LCPI1_0(%rip), %xmm0
ret
instead of:
_test:
pxor %xmm1, %xmm1
andpd LCPI1_0(%rip), %xmm1
movapd %xmm0, %xmm2
andpd LCPI1_1(%rip), %xmm2
movapd %xmm1, %xmm0
orpd %xmm2, %xmm0
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46344
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Fri, 25 Jan 2008 00:34:13 +0000 (00:34 +0000)]
Provide correct DWARF register numbering for debug information emission on x86-32/Darwin.
This should fix bunch of issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46337
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Thu, 24 Jan 2008 23:55:34 +0000 (23:55 +0000)]
New test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46333
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Jan 2008 19:28:11 +0000 (19:28 +0000)]
Don't dump the function!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46320
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Jan 2008 19:07:10 +0000 (19:07 +0000)]
getUnderlyingObject can return null, handle this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46318
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 24 Jan 2008 18:59:52 +0000 (18:59 +0000)]
Added additional overloaded operators for APSInt to match the operators of
APInt.
While some operators were already specifically overloaded for APSInt, others
resulted in using the overloaded operator methods in APInt, which would result
in the signedness bit being lost.
Modified the APSInt(APInt&) constructor to be "explicit" and to take an
extra (optional) flag to indicate the signedness. Making the ctor explicit
will catch any implicit conversations between APSInt -> APInt -> APSInt that
results in the signedness flag being lost.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46316
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Jan 2008 18:00:32 +0000 (18:00 +0000)]
Teach basicaa that 'byval' arguments define a new memory location that
can't be aliased to other known objects. This allows us to know that byval
pointer args don't alias globals, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46315
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Jan 2008 17:47:11 +0000 (17:47 +0000)]
Add hasByValAttr() and hasNoAliasAttr() methods to the Argument class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46314
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Jan 2008 17:10:01 +0000 (17:10 +0000)]
clarify a comment, thanks Duncan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46313
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Jan 2008 08:07:48 +0000 (08:07 +0000)]
Significantly simplify and improve handling of FP function results on x86-32.
This case returns the value in ST(0) and then has to convert it to an SSE
register. This causes significant codegen ugliness in some cases. For
example in the trivial fp-stack-direct-ret.ll testcase we used to generate:
_bar:
subl $28, %esp
call L_foo$stub
fstpl 16(%esp)
movsd 16(%esp), %xmm0
movsd %xmm0, 8(%esp)
fldl 8(%esp)
addl $28, %esp
ret
because we move the result of foo() into an XMM register, then have to
move it back for the return of bar.
Instead of hacking ever-more special cases into the call result lowering code
we take a much simpler approach: on x86-32, fp return is modeled as always
returning into an f80 register which is then truncated to f32 or f64 as needed.
Similarly for a result, we model it as an extension to f80 + return.
This exposes the truncate and extensions to the dag combiner, allowing target
independent code to hack on them, eliminating them in this case. This gives
us this code for the example above:
_bar:
subl $12, %esp
call L_foo$stub
addl $12, %esp
ret
The nasty aspect of this is that these conversions are not legal, but we want
the second pass of dag combiner (post-legalize) to be able to hack on them.
To handle this, we lie to legalize and say they are legal, then custom expand
them on entry to the isel pass (PreprocessForFPConvert). This is gross, but
less gross than the code it is replacing :)
This also allows us to generate better code in several other cases. For
example on fp-stack-ret-conv.ll, we now generate:
_test:
subl $12, %esp
call L_foo$stub
fstps 8(%esp)
movl 16(%esp), %eax
cvtss2sd 8(%esp), %xmm0
movsd %xmm0, (%eax)
addl $12, %esp
ret
where before we produced (incidentally, the old bad code is identical to what
gcc produces):
_test:
subl $12, %esp
call L_foo$stub
fstpl (%esp)
cvtsd2ss (%esp), %xmm0
cvtss2sd %xmm0, %xmm0
movl 16(%esp), %eax
movsd %xmm0, (%eax)
addl $12, %esp
ret
Note that we generate slightly worse code on pr1505b.ll due to a scheduling
deficiency that is unrelated to this patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46307
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Jan 2008 07:57:06 +0000 (07:57 +0000)]
Fix this buggy transformation. Two observations:
1. we already know the value is dead, so don't bother replacing
it with undef.
2. The very case the comment describes actually makes the load
live which asserts in deletenode. If we do the replacement
and the node becomes live, just treat it as new. This fixes
a failure on X86/2008-01-16-InvalidDAGCombineXform.ll with
some local changes in my tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46306
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Jan 2008 07:18:21 +0000 (07:18 +0000)]
The dag combiner is missing revisiting nodes that it really should, and thus leaving
dead stuff around. This gets fed into the isel pass and causes certain foldings from
happening because nodes have extraneous uses floating around. For example, if we turned
foo(bar(x)) -> baz(x), we sometimes left bar(x) around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46305
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Jan 2008 06:45:35 +0000 (06:45 +0000)]
fold fp_round(fp_round(x)) -> fp_round(x).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46304
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Jan 2008 06:35:44 +0000 (06:35 +0000)]
take these with a pr #
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46303
91177308-0d34-0410-b5e6-
96231b3b80d8
Gordon Henriksen [Thu, 24 Jan 2008 05:16:36 +0000 (05:16 +0000)]
Fixing the stack walker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46302
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Thu, 24 Jan 2008 01:20:48 +0000 (01:20 +0000)]
Fix potential buffer overflow
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46296
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 24 Jan 2008 01:10:07 +0000 (01:10 +0000)]
Move some functionality for adding flags to MachineInstr's into methods on MachineInstr rather than LiveVariables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46295
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 24 Jan 2008 00:22:01 +0000 (00:22 +0000)]
Forgot these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46292
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 23 Jan 2008 23:17:41 +0000 (23:17 +0000)]
Let each target decide byval alignment. For X86, it's 4-byte unless the aggregare contains SSE vector(s). For x86-64, it's max of 8 or alignment of the type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46286
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 23 Jan 2008 22:29:58 +0000 (22:29 +0000)]
Added special escape sequences "\{", "\}", and "\|" when processing
getNodeLabel(); these sequences allow the user to specify the characters '{',
'}', and '|' in the label, which facilitate breaking the label into multiple
record segments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46283
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Wed, 23 Jan 2008 20:39:46 +0000 (20:39 +0000)]
The last pieces needed for loading arbitrary
precision integers. This won't actually work
(and most of the code is dead) unless the new
legalization machinery is turned on. While
there, I rationalized the handling of i1, and
removed some bogus (and unused) sextload patterns.
For i1, this could result in microscopically
better code for some architectures (not X86).
It might also result in worse code if annotating
with AssertZExt nodes turns out to be more harmful
than helpful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46280
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 23 Jan 2008 19:57:33 +0000 (19:57 +0000)]
Added "getRoot()" to ImmutableSet.
Made ImmutableSet::ImmutableSet(ImutAVLTree* Root) public. (this allows handy
casting between trees and sets).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46277
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Wed, 23 Jan 2008 00:58:14 +0000 (00:58 +0000)]
Honor explicit section information on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46267
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 22 Jan 2008 23:58:54 +0000 (23:58 +0000)]
Fix an iterator invalidation issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46263
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 22 Jan 2008 23:26:53 +0000 (23:26 +0000)]
SSE varargs arguments are passed in memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46262
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Jan 2008 19:09:33 +0000 (19:09 +0000)]
Simplify SelectionDAG::getNode so that a big switch stmt is not #ifndef
NDEBUG. This is in response to a really nasty bug I introduced that
Dale tracked down, hopefully this won't happen in the future.
Many thanks Dale.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46254
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Tue, 22 Jan 2008 11:01:23 +0000 (11:01 +0000)]
Silence a warning. Should we turn this into configure-time check?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46251
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Tue, 22 Jan 2008 11:00:07 +0000 (11:00 +0000)]
Add interator interface to DAGInit also
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46250
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Tue, 22 Jan 2008 07:17:34 +0000 (07:17 +0000)]
The final piece needed for storing arbitrary precision
integers. Handle truncstore of a legal type to an unusual
number of bits. Most of this code is not reachable unless
the new legalize infrastructure is turned on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46249
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Tue, 22 Jan 2008 05:42:02 +0000 (05:42 +0000)]
Enable the fix I just checked in, silly me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46247
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Jan 2008 05:31:58 +0000 (05:31 +0000)]
update this test to pass with duncan's change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46246
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Jan 2008 05:19:26 +0000 (05:19 +0000)]
One too many )'s breaks 'make clean' with certain versions of make.
This fixes PR1927
This should be pulled into llvm 2.2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46245
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Tue, 22 Jan 2008 05:08:48 +0000 (05:08 +0000)]
Multiply can be evaluated in a different type, so long as the target type has
a smaller bitwidth.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46244
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Jan 2008 04:47:47 +0000 (04:47 +0000)]
Trivial patch to fix two warnings, please pull into llvm 2.2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46243
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 21 Jan 2008 22:54:46 +0000 (22:54 +0000)]
Fixed buggy caching of the hash value of an ImutAVLTree node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46229
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 21 Jan 2008 22:51:35 +0000 (22:51 +0000)]
Moved method call within a conditional branch because its effects will
be ignored on the false branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46228
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 21 Jan 2008 22:50:37 +0000 (22:50 +0000)]
Adjusted ImutAVLTree::ComputeHash to compute a hash value that is based on a
clearer sequence of hashing compositions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46227
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 21 Jan 2008 22:49:22 +0000 (22:49 +0000)]
Added "clear" method to FoldingSetNodeID to allow a FoldingSetNodeID object
to be reused to compute multiple object profiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46226
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 21 Jan 2008 22:33:30 +0000 (22:33 +0000)]
Replaced (FoldingSet) profiling of ImutAVLTree with a hashing based scheme. The
problem was that we previously hashed based on the pointers of the left and
right children, but this is bogus: we can easily have different trees that
represent the same set. Now we use a hashing based scheme that compares the
*contents* of the trees, but not without having to do a full scan of a tree. The
only caveat is that with hashing is that we may have collisions, which result in
two different trees being falsely labeled as equivalent. If this becomes a
problem, we can add extra data to the profile to hopefully resolve most
collisions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46224
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Mon, 21 Jan 2008 22:30:26 +0000 (22:30 +0000)]
Provide iterator access to ListInit contents
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46223
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 21 Jan 2008 22:27:27 +0000 (22:27 +0000)]
Fix the failures in the PPC JIT by marking relocation entries for
external symbols (e.g. 'fmod') as needing a stub. This regression
was introduced by Evan's jit patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20071231/056749.html
With this fixed, the two ExecutionEngine failures are passing on ppc,
and the ppc jit works on freebench and olden.
This should be pulled into the 2.2 release branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46222
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 21 Jan 2008 22:15:58 +0000 (22:15 +0000)]
New test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46220
91177308-0d34-0410-b5e6-
96231b3b80d8