Dan Gohman
cd0b1bf0a0
Fix SelectionDAG::ReplaceAllUsesWith to behave correctly when
...
uses are added to the From node while it is processing From's
use list, because of automatic local CSE. The fix is to avoid
visiting any new uses.
Fix a few places in the DAGCombiner that assumed that after
a RAUW call, the From node has no users and may be deleted.
This fixes PR3018.
llvm-svn: 62533
2009-01-19 21:44:21 +00:00
Chris Lattner
6f34e317e9
Fix PR3353, infinitely jump threading an infinite loop make from switches.
...
llvm-svn: 62529
2009-01-19 21:20:34 +00:00
Dale Johannesen
740e98704d
compile-time fmod was done incorrectly. PR 3316.
...
llvm-svn: 62528
2009-01-19 21:17:05 +00:00
Devang Patel
8c8aa2ac29
Verify Intrinsic::dbg_declare.
...
llvm-svn: 62526
2009-01-19 21:00:48 +00:00
Evan Cheng
44cc554311
DIVREM isel deficiency: If sign bit is known zero, zero out DX/EDX/RDX instead of sign extending the low part (in AX/EAX/RAX) into it.
...
llvm-svn: 62519
2009-01-19 19:06:11 +00:00
Evan Cheng
0346c04f39
Fix 80 col violations.
...
llvm-svn: 62518
2009-01-19 18:57:29 +00:00
Evan Cheng
6c02498215
Handle ISD::DECLARE with PIC relocation model.
...
llvm-svn: 62516
2009-01-19 18:31:51 +00:00
Nick Lewycky
030c450fdc
Fix typo, sentence fragment.
...
llvm-svn: 62512
2009-01-19 17:42:33 +00:00
Bill Wendling
534d2e0bae
Temporarily revert r62487. It's causing this error during a release bootstrap of
...
llvm-gcc. Most likely, it's miscompiling one of the "gen*" programs:
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./prev-gcc/xgcc -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./prev-gcc/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.6.0/bin/ -c -g -O2 -mdynamic-no-pic -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -mdynamic-no-pic -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/build -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 -o build/gencondmd.o build/gencondmd.c
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: error: expected '}' before ')' token
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: warning: excess elements in struct initializer
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: warning: (near initialization for 'insn_conditions[4]')
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: error: expected '}' before ')' token
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: error: expected ',' or ';' before ')' token
../../llvm-gcc.src/gcc/config/i386/mmx.md:927: error: expected identifier or '(' before ',' token
../../llvm-gcc.src/gcc/config/i386/sse.md:3458: error: expected identifier or '(' before ',' token
...
llvm-svn: 62506
2009-01-19 08:46:20 +00:00
Evan Cheng
8f367e53c7
Minor tweak to LowerUINT_TO_FP_i32. Bias (after scalar_to_vector) has two uses so we should make it the second source operand of ISD::OR so 2-address pass won't have to be smart about commuting.
...
%reg1024<def> = MOVSDrm %reg0, 1, %reg0, <cp#0>, Mem:LD(8,8) [ConstantPool + 0]
%reg1025<def> = MOVSD2PDrr %reg1024
%reg1026<def> = MOVDI2PDIrm <fi#-1>, 1, %reg0, 0, Mem:LD(4,16) [FixedStack-1 + 0]
%reg1027<def> = ORPSrr %reg1025<kill>, %reg1026<kill>
%reg1028<def> = MOVPD2SDrr %reg1027<kill>
%reg1029<def> = SUBSDrr %reg1028<kill>, %reg1024<kill>
%reg1030<def> = CVTSD2SSrr %reg1029<kill>
MOVSSmr <fi#0>, 1, %reg0, 0, %reg1030<kill>, Mem:ST(4,4) [FixedStack0 + 0]
%reg1031<def> = LD_Fp32m80 <fi#0>, 1, %reg0, 0, Mem:LD(4,16) [FixedStack0 + 0]
RET %reg1031<kill>, %ST0<imp-use,kill>
The reason 2-addr pass isn't smart enough to commute the ORPSrr is because it can't look pass the MOVSD2PDrr instruction.
llvm-svn: 62505
2009-01-19 08:19:57 +00:00
Evan Cheng
7e9ef4d776
Now not UINT_TO_FP is legal (it's marked custom), dag combiner won't
...
optimize it to a SINT_TO_FP when the sign bit is known zero. X86 isel should perform the optimization itself.
llvm-svn: 62504
2009-01-19 08:08:22 +00:00
Chris Lattner
f2bb4ea39c
Fix PR3016, a bug which can occur do to an invalid assumption:
...
we assumed a CFG structure that would be valid when all code in
the function is reachable, but not all code is necessarily
reachable. Do a simple, but horrible, CFG walk to check for this
case.
llvm-svn: 62487
2009-01-19 02:46:28 +00:00
Chris Lattner
e381d7026f
reduce indentation by using 'continue', no functionality change.
...
llvm-svn: 62477
2009-01-19 02:07:32 +00:00
Chris Lattner
54f0c61d71
Fix some problems in SpeculativelyExecuteBB. Basically,
...
because of dead code, a phi could use the speculated instruction
that was not in "BB2". Make this check explicit and tighten up
some other corners. This fixes PR3292. No testcase becauase this
depends entirely on visitation order of blocks and requires a
sequence of 8 passes to repro.
llvm-svn: 62476
2009-01-19 00:36:37 +00:00
Chris Lattner
e1c01e4e2b
Make this a bit more explicit about which cases need the
...
check. No functionality change.
llvm-svn: 62474
2009-01-18 23:22:07 +00:00
Chris Lattner
64b7bd7f9e
Fix rdar://6505632, an llc crash on 483.xalancbmk
...
llvm-svn: 62470
2009-01-18 20:35:00 +00:00
Sanjiv Gupta
1d2fc787a9
Few targets like PIC16 wants libcall generation for illegal type i16.
...
llvm-svn: 62467
2009-01-18 18:25:27 +00:00
Oscar Fuentes
963c975975
CMake: Add lib/Analysis/CaptureTracking.cpp
...
llvm-svn: 62462
2009-01-18 13:14:11 +00:00
Duncan Sands
e0aa0d677d
BasicAliasAnalysis and FunctionAttrs were both
...
doing very similar pointer capture analysis.
Factor out the common logic. The new version
is from FunctionAttrs since it does a better
job than the version in BasicAliasAnalysis
llvm-svn: 62461
2009-01-18 12:19:30 +00:00
Mon P Wang
e9e7abb6b8
Simplify extract element based on comments from Duncan Sands.
...
llvm-svn: 62459
2009-01-18 06:43:40 +00:00
Nick Lewycky
3ced0dfa69
Fix copy and pasted typos that prevented strtok_r, realloc, getenv, ungetc,
...
putc, puts, perror, vscanf and vsscanf from getting annotations.
Add annotations for eight printf functions, memalign, pread and pwrite.
On Linux, llvm-gcc sometimes renames strdup, getc, putc, strtok_r, scanf and
sscanf. Match the alternate function names.
Fix a crash annotating opendir.
Don't mark fsetpos's second parameter as nocapture. It's supposed to be
captured.
Do mark fopen's path and mode strings as nocapture. Mark ferror as readonly,
but not fileno which may set errno.
llvm-svn: 62456
2009-01-18 04:34:36 +00:00
Gabor Greif
1b94d420ae
add a comment
...
llvm-svn: 62436
2009-01-18 00:27:21 +00:00
Gabor Greif
20b722fe1c
switch over some other methods from indices to iterators
...
llvm-svn: 62430
2009-01-17 19:46:01 +00:00
Devang Patel
3f634fe364
Remove tabs.
...
llvm-svn: 62423
2009-01-17 08:05:14 +00:00
Devang Patel
8ee1c9f220
Refactor code
...
llvm-svn: 62421
2009-01-17 08:01:33 +00:00
Bill Wendling
f9291cf43c
Extend thi
...
llvm-svn: 62415
2009-01-17 07:40:19 +00:00
Evan Cheng
bf38a5e540
Fix MatchAddress bug that's preventing negative displacement from being folded in 64-bit mode.
...
llvm-svn: 62413
2009-01-17 07:09:27 +00:00
Devang Patel
bf7d432ce4
Assign argument type to appropriate DIE.
...
llvm-svn: 62412
2009-01-17 06:57:25 +00:00
Devang Patel
2e32f71dfa
Remove dead code.
...
llvm-svn: 62410
2009-01-17 06:51:37 +00:00
Devang Patel
d250ef911f
Disable composite type debug info for now.
...
llvm-svn: 62406
2009-01-17 05:05:12 +00:00
Bill Wendling
dd40f26877
Temporarily revert my last change. It is causing a bootstrap failure.
...
llvm-svn: 62405
2009-01-17 04:23:51 +00:00
Bill Wendling
4d5275905e
Implement a special algorithm for converting uint_to_fp for i32 values on
...
X86. This code:
void f() {
uint32_t x;
float y = (float)x;
}
used to be:
movl %eax, -8(%ebp)
movl [2^52 double], -4(%ebp)
movsd -8(%ebp), %xmm0
subsd [2^52 double], %xmm0
cvtsd2ss %xmm0, %xmm0
Is now:
movsd [2^52 double], %xmm0
movsd %xmm0, %xmm1
movd %ecx, %xmm2
orps %xmm2, %xmm1
subsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
This is faster on X86. Note that there's an extra load of %xmm0 into %xmm1. That
will be fixed in a later coalescer fix.
llvm-svn: 62404
2009-01-17 03:56:04 +00:00
Oscar Fuentes
90cc7050f2
CMake: Add lib/Target/IA64/IA64Subtarget.cpp
...
llvm-svn: 62394
2009-01-17 01:50:32 +00:00
Gabor Greif
1c6549db6f
speed up iterative loop by using iterators. changes direction, but functionally equivalent
...
if this works out, I'll change the others next.
llvm-svn: 62385
2009-01-17 00:14:25 +00:00
Gabor Greif
f1abfdccdc
introduce typedef for complicated vector, and use it too
...
llvm-svn: 62384
2009-01-17 00:09:08 +00:00
Mon P Wang
ca6d6dea0b
Simplify extract element of a scalar to vector.
...
llvm-svn: 62383
2009-01-17 00:07:25 +00:00
Gabor Greif
8c573f7e49
typo
...
llvm-svn: 62377
2009-01-16 23:08:50 +00:00
Evan Cheng
41e9f6a854
Fix PPC ISD::Declare isel and eliminate the need for PPCTargetLowering::LowerGlobalAddress to check if isVerifiedDebugInfoDesc() is true. Given the recent changes, it would falsely return true for a lot of GlobalAddressSDNode's.
...
llvm-svn: 62373
2009-01-16 22:57:32 +00:00
Mikhail Glushenkov
cbc26fdb6e
Support for multi-valued options in CommandLine
...
Makes possible to specify options that take multiple arguments (a-la
-sectalign on Darwin). See documentation for details.
llvm-svn: 62372
2009-01-16 22:54:19 +00:00
Dan Gohman
703a6c7274
Give IA64 a TargetSubtarget subclass, so that it can
...
implement getSubtargetImpl.
llvm-svn: 62369
2009-01-16 22:49:36 +00:00
Dan Gohman
5f8a2598b2
Instead of adding dependence edges between terminator instructions
...
and every other instruction in their blocks to keep the terminator
instructions at the end, teach the post-RA scheduler how to operate
on ranges of instructions, and exclude terminators from the range
of instructions that get scheduled.
Also, exclude mid-block labels, such as EH_LABEL instructions, and
schedule code before them separately from code after them. This
fixes problems with the post-RA scheduler moving code past
EH_LABELs.
llvm-svn: 62366
2009-01-16 22:10:20 +00:00
Dan Gohman
157e008816
If an anti-dependence uses a non-allocatable register, set AntiDepReg
...
to 0, to ensure that the subsequent code doesn't try to break the
dependence.
llvm-svn: 62365
2009-01-16 21:57:43 +00:00
Dan Gohman
38978ba972
Use the getNode() accessor instead of accessing the Node
...
member directly, which is private as of r55504.
llvm-svn: 62364
2009-01-16 21:47:21 +00:00
Dan Gohman
014142fd1a
Fix the check for an empty basic block to check for an empty SUnits
...
array instead, since this is what the scheduler actually cares about.
And remove a check that is unnecessary, since it can assume that
SUnits isn't empty.
llvm-svn: 62362
2009-01-16 21:37:14 +00:00
Chris Lattner
41828cdb0a
new nodes should be added to the worklist, not old nodes.
...
llvm-svn: 62359
2009-01-16 21:15:56 +00:00
Devang Patel
5d7813cb2d
Fix comments.
...
llvm-svn: 62358
2009-01-16 21:07:53 +00:00
Evan Cheng
968e2e7b3d
CreateVirtualRegisters does trivial copy coalescing. If a node def is used by a single CopyToReg, it reuses the virtual register assigned to the CopyToReg. This won't work for SDNode that is a clone or is itself cloned. Disable this optimization for those nodes or it can end up with non-SSA machine instructions.
...
llvm-svn: 62356
2009-01-16 20:57:18 +00:00
Chris Lattner
762edbc074
don't assert and die on out of range (undefined) shifts. This fixes
...
PR3334.
llvm-svn: 62352
2009-01-16 20:17:02 +00:00
Chris Lattner
db2d9613d2
Fix PR3335 by not turning a store to one address space into a store to another.
...
llvm-svn: 62351
2009-01-16 20:12:52 +00:00
Chris Lattner
733256fe31
reduce indentation by using early exits, no functionality change.
...
llvm-svn: 62350
2009-01-16 20:08:59 +00:00