Commit Graph

1988 Commits

Author SHA1 Message Date
Chris Lattner 9ef1294210 Add a comment
Make LSR ignore GEP's that have loop variant base values, as we currently
cannot codegen them

llvm-svn: 22576
2005-08-02 01:32:29 +00:00
Chris Lattner 564900e5e5 Fix an iterator invalidation problem
llvm-svn: 22575
2005-08-02 00:41:11 +00:00
Chris Lattner e17c5d0e59 ConstantInt::get only works for arguments < 128.
SimplifyLibCalls probably has to be audited to make sure it does not make
this mistake elsewhere.  Also, if this code knows that the type will be
unsigned, obviously one arm of this is dead.

Reid, can you take a look into this further?

llvm-svn: 22566
2005-08-01 16:52:50 +00:00
Jeff Cohen 546fd5944e Keep tabs and trailing spaces out.
llvm-svn: 22565
2005-07-30 18:33:25 +00:00
Jeff Cohen c500991055 Fix VC++ build problems.
llvm-svn: 22564
2005-07-30 18:22:27 +00:00
Nate Begeman 17a0e2afea Ack, typo
llvm-svn: 22560
2005-07-30 00:21:31 +00:00
Nate Begeman e68bcd1946 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 2bca4d9b7b 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 5f4ef3c5a8 Eliminate all remaining tabs and trailing spaces.
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Chris Lattner 31d0ac2414 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 18aa4d8196 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 247aef884c 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 4ed40f7c6f 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 937c71f2b3 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 810b4f8d55 Doh! Forgot to LLVMify the style.
llvm-svn: 22312
2005-06-29 15:57:50 +00:00
John Criswell 4642afdcc1 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 9610c6f287 add a debug type
llvm-svn: 22277
2005-06-24 16:00:46 +00:00
Andrew Lenharth cf52eb2b99 prevent va_arg from being hoisted from a loop
llvm-svn: 22265
2005-06-20 13:36:33 +00:00
Andrew Lenharth d4b103107e 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 9144ec4764 core changes for varargs
llvm-svn: 22254
2005-06-18 18:34:52 +00:00
Reid Spencer a7828baa3c 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 4fdd96c4e0 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 2ceb6ee576 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 73bcba5f61 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 5e735294bf 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 c53cb9d3ff avoid constructing out of range shift amounts.
llvm-svn: 22230
2005-06-17 01:29:28 +00:00
Chris Lattner 89dc4f16f5 Fix PR583 and testcase Transforms/InstCombine/2005-06-15-DivSelectCrash.ll
llvm-svn: 22227
2005-06-16 04:55:52 +00:00
Chris Lattner 252a845e30 Fix PR571, removing code that does just the WRONG thing :)
llvm-svn: 22225
2005-06-16 03:00:08 +00:00
Chris Lattner 104002bee3 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 d48b127aea Fix PR575, patch provided by John Mellor-Crummey. Thanks!
llvm-svn: 22223
2005-06-15 22:49:30 +00:00
Chris Lattner df81539278 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 50bdfcb045 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 19b57f55aa 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 a299d6f701 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 6d231e55fa 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 1609a541cd 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 fbc45f10d0 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 ffe65458e7 hack to fix bzip2 (bug 571)
llvm-svn: 22192
2005-06-04 12:43:56 +00:00
Reid Spencer 9fbad13dd7 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 0b13cdabae Adjust the file comment to read a little easier.
llvm-svn: 22163
2005-05-21 00:57:44 +00:00
Reid Spencer 45bb4afc79 Make sure ... arguments are casted to sbyte* where needed.
llvm-svn: 22162
2005-05-21 00:39:30 +00:00
Reid Spencer 895af9ef24 Add a "brief" comment for CastToCStr
llvm-svn: 22161
2005-05-21 00:23:23 +00:00
Chris Lattner f8053cee7c 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 19f9f32a5c Fix Transforms/SimplifyCFG/switch-simplify-crash.ll
llvm-svn: 22158
2005-05-20 22:19:54 +00:00
Chris Lattner 05deb04cb0 teach the inliner about coldcc and noreturn functions
llvm-svn: 22113
2005-05-18 04:30:33 +00:00
Reid Spencer 74305a6233 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 17f7784c5d 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 3de98ee643 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 b195fcd5ef 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 403d1c204c Preserve calling conv when hacking on calls
llvm-svn: 22025
2005-05-14 12:28:32 +00:00