Jeff Cohen
019104459d
Keep tabs and trailing spaces out.
...
llvm-svn: 22565
2005-07-30 18:33:25 +00:00
Jeff Cohen
4f69b0d5cd
Fix VC++ build problems.
...
llvm-svn: 22564
2005-07-30 18:22:27 +00:00
Nate Begeman
13bd25dc1d
Ack, typo
...
llvm-svn: 22560
2005-07-30 00:21:31 +00:00
Nate Begeman
454caae5bd
Commit a new LoopStrengthReduce pass that can use scalar evolutions and
...
target data to decide which loop induction variables to strength reduce
and how to do so. This work is mostly by Chris Lattner, with tweaks by
me to get it working on some of MultiSource.
llvm-svn: 22558
2005-07-30 00:15:07 +00:00
Nate Begeman
0d1a7b6737
Break SCEVExpander out of IndVarSimplify into its own .h/.cpp file so that
...
other passes may use it.
llvm-svn: 22557
2005-07-30 00:12:19 +00:00
Jeff Cohen
bd51ec7461
Eliminate all remaining tabs and trailing spaces.
...
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Chris Lattner
1b22c180d7
ConvertibleToGEP always returns 0, remove some old crufty code which
...
is actually dead because of this!
llvm-svn: 22515
2005-07-26 16:38:28 +00:00
Chris Lattner
faa90d30f5
Do not let MaskedValueIsZero consider undef to be zero, for reasons
...
explained in the comment.
This fixes UnitTests/2003-09-18-BitFieldTest on darwin
llvm-svn: 22483
2005-07-20 18:49:28 +00:00
Chris Lattner
4c9139447d
When transforming &A[i] < &A[j] -> i < j, make sure to perform the comparison
...
as a signed compare. This patch may fix PR597, but is correct in any case.
llvm-svn: 22465
2005-07-18 23:07:33 +00:00
Chris Lattner
e102466ece
Fix a problem that instcombine would hit when dealing with unreachable code.
...
Because the instcombine has to scan the entire function when it starts up
to begin with, we might as well do it in DFO so we can nuke unreachable code.
This fixes: Transforms/InstCombine/2005-07-07-DeadPHILoop.ll
llvm-svn: 22348
2005-07-07 20:40:38 +00:00
Chris Lattner
02fe175f3d
Fix PR590 and Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll.
...
The optimization for locally used allocas was not safe for allocas that
were read before they were written. This change disables that optimization
in that case.
llvm-svn: 22318
2005-06-30 07:29:44 +00:00
John Criswell
a6620d4a6e
Doh! Forgot to LLVMify the style.
...
llvm-svn: 22312
2005-06-29 15:57:50 +00:00
John Criswell
1bafe064da
Basic fix for PR#591; don't convert an fprintf() to an fwrite() if there
...
is a mismatch in their character type pointers (i.e. fprintf() prints an
array of ubytes while fwrite() takes an array of sbytes).
We can probably do better than this (such as casting the ubyte to an
sbyte).
llvm-svn: 22310
2005-06-29 15:03:18 +00:00
Chris Lattner
eb08628106
add a debug type
...
llvm-svn: 22277
2005-06-24 16:00:46 +00:00
Andrew Lenharth
08ff634c2b
prevent va_arg from being hoisted from a loop
...
llvm-svn: 22265
2005-06-20 13:36:33 +00:00
Andrew Lenharth
cdaaa66e7d
prevent DCE of vaarg intrinsics. This should take care of most regressions
...
llvm-svn: 22263
2005-06-19 14:41:20 +00:00
Andrew Lenharth
a9214fec08
core changes for varargs
...
llvm-svn: 22254
2005-06-18 18:34:52 +00:00
Reid Spencer
a6012f9023
Fix a problem with the strcmp optimization checking the wrong string and
...
not casting to the correct type.
llvm-svn: 22250
2005-06-18 17:46:28 +00:00
Reid Spencer
678c9a3b00
Clean up some uninitialized variables and missing return statements that
...
GCC 4.0.0 compiler (sometimes incorrectly) warns about under release build.
llvm-svn: 22249
2005-06-18 17:37:34 +00:00
Chris Lattner
11bbeace0c
This is not true: (X != 13 | X < 15) -> X < 15
...
It is actually always true. This fixes PR586 and
Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll
llvm-svn: 22236
2005-06-17 03:59:17 +00:00
Chris Lattner
01a5794292
Don't crash when dealing with INTMIN. This fixes PR585 and
...
Transforms/InstCombine/2005-06-16-RangeCrash.ll
llvm-svn: 22234
2005-06-17 02:05:55 +00:00
Chris Lattner
8c76d5c957
Don't crash on: X = phi (X, X).
...
This fixes PR584 and Transforms/SimplifyCFG/2005-06-16-PHICrash.ll
llvm-svn: 22232
2005-06-17 01:45:53 +00:00
Chris Lattner
226f919ead
avoid constructing out of range shift amounts.
...
llvm-svn: 22230
2005-06-17 01:29:28 +00:00
Chris Lattner
f95b989825
Fix PR583 and testcase Transforms/InstCombine/2005-06-15-DivSelectCrash.ll
...
llvm-svn: 22227
2005-06-16 04:55:52 +00:00
Chris Lattner
4af04a8d54
Fix PR571, removing code that does just the WRONG thing :)
...
llvm-svn: 22225
2005-06-16 03:00:08 +00:00
Chris Lattner
b99bf21182
Fix a bug in my previous patch. Do not get the shift amount type (which
...
is always ubyte, get the type being shifted). This unbreaks espresso
llvm-svn: 22224
2005-06-16 01:52:07 +00:00
Chris Lattner
4cff3f786f
Fix PR575, patch provided by John Mellor-Crummey. Thanks!
...
llvm-svn: 22223
2005-06-15 22:49:30 +00:00
Chris Lattner
f1369e9532
Fix PR582. The rewriter can move casts around, which invalidated the
...
BB iterator. This fixes Transforms/IndVarsSimplify/2005-06-15-InstMoveCrash.ll
llvm-svn: 22221
2005-06-15 21:29:31 +00:00
Chris Lattner
369ba5da69
Do not promote globals only used by main to locals if there are constantexprs
...
or other uses hanging off of them.
llvm-svn: 22219
2005-06-15 21:11:48 +00:00
Chris Lattner
d553048155
Fix PR577 and testcase InstCombine/2005-06-15-ShiftSetCCCrash.ll.
...
Do not perform undefined out of range shifts.
llvm-svn: 22217
2005-06-15 20:53:31 +00:00
Reid Spencer
3a30fa7ec0
Put the hack back in that removes features, causes regressions to fail, but
...
allows test programs to succeed. Actual fix for this is forthcoming.
llvm-svn: 22213
2005-06-15 18:25:30 +00:00
Reid Spencer
202eb6ff93
Unbreak several InstCombine regression checks introduced by a hack to
...
fix the bzip2 test. A better hack is needed.
llvm-svn: 22209
2005-06-13 06:41:26 +00:00
Chris Lattner
9d3c2260d0
Fix a 64-bit problem, passing (int)0 through ... instead of (void*)0
...
llvm-svn: 22206
2005-06-09 03:32:54 +00:00
Chris Lattner
092a738e18
Fix a problem on 64-bit targets where we passed (int)0 through ... instead of
...
(void*)0.
llvm-svn: 22205
2005-06-09 02:59:00 +00:00
Andrew Lenharth
e68b566084
hack to fix bzip2 (bug 571)
...
llvm-svn: 22192
2005-06-04 12:43:56 +00:00
Reid Spencer
59580db70f
Make the registration hash_map static. No other module needs it. Also,
...
document what its for a little better.
llvm-svn: 22164
2005-05-21 01:27:04 +00:00
Reid Spencer
6c0f6b6458
Adjust the file comment to read a little easier.
...
llvm-svn: 22163
2005-05-21 00:57:44 +00:00
Reid Spencer
5161c39bfe
Make sure ... arguments are casted to sbyte* where needed.
...
llvm-svn: 22162
2005-05-21 00:39:30 +00:00
Reid Spencer
0a43070283
Add a "brief" comment for CastToCStr
...
llvm-svn: 22161
2005-05-21 00:23:23 +00:00
Chris Lattner
d7d4a57a4f
Fix mismatched type problem that crashed on cases like this:
...
sprintf(P, "%s", X);
Where X is not an sbyte*. This fixes the bug JohnMC reported on llvm-bugs.
llvm-svn: 22159
2005-05-20 22:22:25 +00:00
Chris Lattner
b13335fff2
Fix Transforms/SimplifyCFG/switch-simplify-crash.ll
...
llvm-svn: 22158
2005-05-20 22:19:54 +00:00
Chris Lattner
df9c75fb12
teach the inliner about coldcc and noreturn functions
...
llvm-svn: 22113
2005-05-18 04:30:33 +00:00
Reid Spencer
720fbd937a
Don't look for __builtin_ffs, we'll never see it from llvm-gcc and there's
...
not reason to include it for other front ends.
llvm-svn: 22070
2005-05-15 21:27:34 +00:00
Reid Spencer
58ad53e9d3
Provide this optimization as well:
...
ffs(x) -> (x == 0 ? 0 : 1+llvm.cttz(x))
llvm-svn: 22068
2005-05-15 21:19:45 +00:00
Reid Spencer
24104523b5
Duh .. you actually have to #include Config/config.h before you can test
...
for one of the values that it defines!
llvm-svn: 22058
2005-05-15 17:20:47 +00:00
Reid Spencer
9cd1000c52
Changes for ffs lib call simplification:
...
* Check for availability of ffsll call in configure script
* Support ffs, ffsl, and ffsll conversion to constant value if the argument
is constant.
llvm-svn: 22027
2005-05-14 16:42:52 +00:00
Chris Lattner
bcd4c17bfd
Preserve calling conv when hacking on calls
...
llvm-svn: 22025
2005-05-14 12:28:32 +00:00
Chris Lattner
7771ae3fcc
preserve calling conventions when hacking on code
...
llvm-svn: 22024
2005-05-14 12:25:32 +00:00
Chris Lattner
214f1a8cf9
Make sure to preserve the calling convention when changing an invoke into
...
a call. This fixes Prolangs-C++/deriv2, kimwitu++, and Misc-C++/bigfib
on X86 with -enable-x86-fastcc.
llvm-svn: 22023
2005-05-14 12:21:56 +00:00
Chris Lattner
b06ee3dd65
calling a function with the wrong CC is undefined, turn it into an unreachable
...
instruction. This is useful for catching optimizers that don't preserve
calling conventions
llvm-svn: 21928
2005-05-13 07:09:09 +00:00