oota-llvm.git
17 years agoGet the signs in the right place!
Reid Spencer [Sat, 24 Mar 2007 22:50:43 +0000 (22:50 +0000)]
Get the signs in the right place!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35307 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a link.
Reid Spencer [Sat, 24 Mar 2007 22:40:44 +0000 (22:40 +0000)]
Fix a link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35306 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUndo the last change and make this really implement remainder and not
Reid Spencer [Sat, 24 Mar 2007 22:37:23 +0000 (22:37 +0000)]
Undo the last change and make this really implement remainder and not
modulus. The previous change was a result of incorrect documentation in
the LangRef.html.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35305 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFlip the srem tests around. Previous commit was to correct an apparent
Reid Spencer [Sat, 24 Mar 2007 22:34:10 +0000 (22:34 +0000)]
Flip the srem tests around. Previous commit was to correct an apparent
bug in the srem implementation. Turns out it was a documentation bug
instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35304 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCorrect the description of srem. remainder follows the dividend not the
Reid Spencer [Sat, 24 Mar 2007 22:23:39 +0000 (22:23 +0000)]
Correct the description of srem. remainder follows the dividend not the
divisor!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35303 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCorrect the implementation of srem to be remainder, not modulus. The sign of
Reid Spencer [Sat, 24 Mar 2007 21:56:22 +0000 (21:56 +0000)]
Correct the implementation of srem to be remainder, not modulus. The sign of
the result must follow the sign of the divisor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35302 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix incorrect test cases for srem. The definition of srem is a remainder so
Reid Spencer [Sat, 24 Mar 2007 21:55:26 +0000 (21:55 +0000)]
Fix incorrect test cases for srem. The definition of srem is a remainder so
that the sign of the result follows the sign of the divisor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35301 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoClean up this interface:
Reid Spencer [Sat, 24 Mar 2007 18:09:18 +0000 (18:09 +0000)]
Clean up this interface:
1. Group similar methods into doxygen groups
2. Reorganize the groups into a consist flow.
3. Significantly improve the quality of the documentation on several methods
4. Rewrite srem and sdiv to eliminate a copy and improve readability.
5. Eliminate unneeded forward references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35300 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agodon't rely on ADL
Chris Lattner [Sat, 24 Mar 2007 17:37:03 +0000 (17:37 +0000)]
don't rely on ADL

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35299 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd a valuetype for v1i64, which is needed by mmx.
Chris Lattner [Sat, 24 Mar 2007 17:36:26 +0000 (17:36 +0000)]
add a valuetype for v1i64, which is needed by mmx.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35298 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake some codes more efficient.
Zhou Sheng [Sat, 24 Mar 2007 15:34:37 +0000 (15:34 +0000)]
Make some codes more efficient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35297 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd a bad case evan though of.
Chris Lattner [Sat, 24 Mar 2007 06:01:32 +0000 (06:01 +0000)]
add a bad case evan though of.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35296 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1205:
Reid Spencer [Sat, 24 Mar 2007 00:42:08 +0000 (00:42 +0000)]
For PR1205:
Convert some calls to ConstantInt::getZExtValue() into getValue() and
use APInt facilities in the subsequent computations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35294 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdjust offset to compensate for big endian machines.
Evan Cheng [Sat, 24 Mar 2007 00:02:43 +0000 (00:02 +0000)]
Adjust offset to compensate for big endian machines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35293 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAutodetect MMX & SSE stuff for AMD processors
Anton Korobeynikov [Fri, 23 Mar 2007 23:46:48 +0000 (23:46 +0000)]
Autodetect MMX & SSE stuff for AMD processors

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35292 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoThis is dead. DEAD I tells you!!
Bill Wendling [Fri, 23 Mar 2007 22:42:04 +0000 (22:42 +0000)]
This is dead. DEAD I tells you!!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35291 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoPR1260:
Bill Wendling [Fri, 23 Mar 2007 22:35:46 +0000 (22:35 +0000)]
PR1260:
Add final support to get the QT example to compile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35290 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake sure SEXTLOAD of the specific type is supported on the target.
Evan Cheng [Fri, 23 Mar 2007 22:13:36 +0000 (22:13 +0000)]
Make sure SEXTLOAD of the specific type is supported on the target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35289 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd more test cases for APIntified InstCombine.
Reid Spencer [Fri, 23 Mar 2007 21:57:47 +0000 (21:57 +0000)]
Add more test cases for APIntified InstCombine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35288 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1205:
Reid Spencer [Fri, 23 Mar 2007 21:24:59 +0000 (21:24 +0000)]
For PR1205:
* APIntify visitAdd and visitSelectInst
* Remove unused uint64_t versions of utility functions that have been
  replaced with APInt versions.
This completes most of the changes for APIntification of InstCombine. This
passes llvm-test and llvm/test/Transforms/InstCombine/APInt.

Patch by Zhou Sheng.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35287 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAlso replace uses of SRL if that's also folded during ReduceLoadWidth().
Evan Cheng [Fri, 23 Mar 2007 20:55:21 +0000 (20:55 +0000)]
Also replace uses of SRL if that's also folded during ReduceLoadWidth().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35286 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd test case for testing InstCombine with arbitrary precision integer
Reid Spencer [Fri, 23 Mar 2007 20:48:34 +0000 (20:48 +0000)]
Add test case for testing InstCombine with arbitrary precision integer
types. These tests mimic the integer test cases in the normal InstCombine
test suite but use "strange" integer bit widths.

Most tests written by Zhou Sheng, a few by me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35284 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1205:
Reid Spencer [Fri, 23 Mar 2007 20:05:17 +0000 (20:05 +0000)]
For PR1205:
APIntify visitDiv, visitMul and visitRem.

Patch by Zhou Sheng.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35283 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoswitch AddReachableCodeToWorklist from being recursive to being iterative.
Chris Lattner [Fri, 23 Mar 2007 19:17:18 +0000 (19:17 +0000)]
switch AddReachableCodeToWorklist from being recursive to being iterative.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35282 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1205:
Reid Spencer [Fri, 23 Mar 2007 18:46:34 +0000 (18:46 +0000)]
For PR1205:
APIntify several utility functions supporting logical operators and shift
operators.

Patch by Zhou Sheng.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35281 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd the 'explicit' keyword to several constructors that accept one
Dan Gohman [Fri, 23 Mar 2007 18:44:11 +0000 (18:44 +0000)]
Add the 'explicit' keyword to several constructors that accept one
argument that don't appear intended as implicit-conversion operators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35280 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTest handling of switches with wide case ranges.
Duncan Sands [Fri, 23 Mar 2007 07:17:52 +0000 (07:17 +0000)]
Test handling of switches with wide case ranges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35279 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix constant fold of div by zero and rem by zero to match IEEE 754
Reid Spencer [Fri, 23 Mar 2007 05:33:23 +0000 (05:33 +0000)]
Fix constant fold of div by zero and rem by zero to match IEEE 754
requirements. We must return NaN in some cases and correctly signed
infinity in other cases. Passes CFP2006 (not that that says much).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35277 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake the "KnownZero ^ TypeMask" computation just once.
Zhou Sheng [Fri, 23 Mar 2007 03:13:21 +0000 (03:13 +0000)]
Make the "KnownZero ^ TypeMask" computation just once.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35276 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSimplify the code.
Zhou Sheng [Fri, 23 Mar 2007 02:39:25 +0000 (02:39 +0000)]
Simplify the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35275 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoA couple of bug fixes for reducing load width xform:
Evan Cheng [Fri, 23 Mar 2007 02:16:52 +0000 (02:16 +0000)]
A couple of bug fixes for reducing load width xform:
1. Address offset is in bytes.
2. Make sure truncate node uses are replaced with new load.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35274 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1205:
Reid Spencer [Thu, 22 Mar 2007 22:19:58 +0000 (22:19 +0000)]
For PR1205:
APInt support for logical operators in visitAnd, visitOr, and visitXor.

Patch by Zhou Sheng.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35273 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoThe -funcresolve and -raise options no longer exist.
Duncan Sands [Thu, 22 Mar 2007 21:06:50 +0000 (21:06 +0000)]
The -funcresolve and -raise options no longer exist.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35272 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1205:
Reid Spencer [Thu, 22 Mar 2007 20:56:53 +0000 (20:56 +0000)]
For PR1205:
* APIntify commonIntCastTransforms
* APIntify visitTrunc
* APIntify visitZExt

Patch by Zhou Sheng.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35271 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1205:
Reid Spencer [Thu, 22 Mar 2007 20:36:03 +0000 (20:36 +0000)]
For PR1205:
* Re-enable the APInt version of MaskedValueIsZero.
* APIntify the Comput{Un}SignedMinMaxValuesFromKnownBits functions
* APIntify visitICmpInst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35270 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoWe generate a shufflevector instruction, so we don't need the builtin
Bill Wendling [Thu, 22 Mar 2007 20:29:26 +0000 (20:29 +0000)]
We generate a shufflevector instruction, so we don't need the builtin
intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35269 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCleanup obsolete stuff.
Jeff Cohen [Thu, 22 Mar 2007 19:13:29 +0000 (19:13 +0000)]
Cleanup obsolete stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35268 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoBe more explicit concerning argument sizes.
Jeff Cohen [Thu, 22 Mar 2007 19:11:57 +0000 (19:11 +0000)]
Be more explicit concerning argument sizes.
Use VC++ byteswap intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35267 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSupport added for shifts and unpacking MMX instructions.
Bill Wendling [Thu, 22 Mar 2007 18:42:45 +0000 (18:42 +0000)]
Support added for shifts and unpacking MMX instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35266 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoChange uses of Function::front to Function::getEntryBlock for readability.
Dan Gohman [Thu, 22 Mar 2007 16:38:57 +0000 (16:38 +0000)]
Change uses of Function::front to Function::getEntryBlock for readability.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35265 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUnbreak non-debug builds.
Evan Cheng [Thu, 22 Mar 2007 07:43:51 +0000 (07:43 +0000)]
Unbreak non-debug builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35264 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake this test actually match the generated code.
Reid Spencer [Thu, 22 Mar 2007 02:53:05 +0000 (02:53 +0000)]
Make this test actually match the generated code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35263 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd noreturn function attribute.
Reid Spencer [Thu, 22 Mar 2007 02:18:56 +0000 (02:18 +0000)]
Add noreturn function attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35262 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd tests for nounwind and noreturn function attributes.
Reid Spencer [Thu, 22 Mar 2007 02:15:17 +0000 (02:15 +0000)]
Add tests for nounwind and noreturn function attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35261 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd the NoUnwind function attribute.
Reid Spencer [Thu, 22 Mar 2007 02:14:48 +0000 (02:14 +0000)]
Add the NoUnwind function attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35260 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRegenerate.
Reid Spencer [Thu, 22 Mar 2007 02:14:08 +0000 (02:14 +0000)]
Regenerate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35259 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd support for the noreturn and nounwind function attributes.
Reid Spencer [Thu, 22 Mar 2007 02:13:23 +0000 (02:13 +0000)]
Add support for the noreturn and nounwind function attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35258 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix broken optimization disabled by a logic bug.
Nick Lewycky [Thu, 22 Mar 2007 02:02:51 +0000 (02:02 +0000)]
Fix broken optimization disabled by a logic bug.

Analyze GEPs. If the indices are all zero, transfer whether the pointer is
known to be not null through the GEP.

Add a few more cases for xor and shift instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35257 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoPreview nounwind function attribute.
Reid Spencer [Thu, 22 Mar 2007 02:02:11 +0000 (02:02 +0000)]
Preview nounwind function attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35256 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAnother test case.
Evan Cheng [Thu, 22 Mar 2007 01:55:16 +0000 (01:55 +0000)]
Another test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35255 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMore opportunities to reduce load size.
Evan Cheng [Thu, 22 Mar 2007 01:54:19 +0000 (01:54 +0000)]
More opportunities to reduce load size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35254 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTest case for PR1257
Evan Cheng [Thu, 22 Mar 2007 01:52:57 +0000 (01:52 +0000)]
Test case for PR1257

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35253 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix for PR1257. Bug in live range shortening as a result of copy coalescing
Evan Cheng [Thu, 22 Mar 2007 01:26:05 +0000 (01:26 +0000)]
Fix for PR1257. Bug in live range shortening as a result of copy coalescing
where the destination is dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35252 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTest case for PR1248
Reid Spencer [Thu, 22 Mar 2007 00:49:40 +0000 (00:49 +0000)]
Test case for PR1248

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35251 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1145:
Reid Spencer [Thu, 22 Mar 2007 00:32:02 +0000 (00:32 +0000)]
For PR1145:
Add the NoUnwindAttribute to allow explicit marking of functions that do
not unwind the stack via the unwind instruction. This is akin to gcc's
NoThrow attribute and used for optimizing exception handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35250 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMore LangRef fixes. Corrected names of intrinsics.
Anton Korobeynikov [Thu, 22 Mar 2007 00:02:17 +0000 (00:02 +0000)]
More LangRef fixes. Corrected names of intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35249 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFixed va_arg example. Reported by Roman Samoilov
Anton Korobeynikov [Wed, 21 Mar 2007 23:58:04 +0000 (23:58 +0000)]
Fixed va_arg example. Reported by Roman Samoilov

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35248 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1248:
Reid Spencer [Wed, 21 Mar 2007 23:19:50 +0000 (23:19 +0000)]
For PR1248:
* Fix some indentation and comments in InsertRangeTest
* Add an "IsSigned" parameter to AddWithOverflow and make it handle signed
  additions. Also, APIntify this function so it works with any bitwidth.
* For the icmp pred ([us]div %X, C1), C2 transforms, exit early if the
  div instruction's RHS is zero.
* Finally, for icmp pred (sdiv %X, C1), -C2, fix an off-by-one error. The
  HiBound needs to be incremented in order to get the range test correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35247 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a comment.
Reid Spencer [Wed, 21 Mar 2007 22:22:19 +0000 (22:22 +0000)]
Fix a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35246 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agorepair x86 performance, dejagnu problems from previous change
Dale Johannesen [Wed, 21 Mar 2007 21:51:52 +0000 (21:51 +0000)]
repair x86 performance, dejagnu problems from previous change

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35245 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd TODO list for MSIL backend
Anton Korobeynikov [Wed, 21 Mar 2007 21:48:59 +0000 (21:48 +0000)]
Add TODO list for MSIL backend

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35244 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd Roman to credits
Anton Korobeynikov [Wed, 21 Mar 2007 21:45:25 +0000 (21:45 +0000)]
Add Roman to credits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35243 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoLet the new backend begin!
Anton Korobeynikov [Wed, 21 Mar 2007 21:38:25 +0000 (21:38 +0000)]
Let the new backend begin!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35242 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd generation of unnecessary push/pop around calls
Dale Johannesen [Wed, 21 Mar 2007 21:16:39 +0000 (21:16 +0000)]
add generation of unnecessary push/pop around calls

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35241 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoNew test case.
Evan Cheng [Wed, 21 Mar 2007 20:14:56 +0000 (20:14 +0000)]
New test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35240 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agofold (truncate (srl (load x), c)) -> (smaller load (x+c/vt bits))
Evan Cheng [Wed, 21 Mar 2007 20:14:05 +0000 (20:14 +0000)]
fold (truncate (srl (load x), c)) -> (smaller load (x+c/vt bits))

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35239 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRegenerate.
Reid Spencer [Wed, 21 Mar 2007 17:27:53 +0000 (17:27 +0000)]
Regenerate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35237 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1243:
Reid Spencer [Wed, 21 Mar 2007 17:26:41 +0000 (17:26 +0000)]
For PR1243:
Okay, really fix it this time. Make sure the CurFun.Linkage is set early
and consolidate some duplicate code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35236 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRegenerate.
Reid Spencer [Wed, 21 Mar 2007 17:15:50 +0000 (17:15 +0000)]
Regenerate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35235 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1256:
Reid Spencer [Wed, 21 Mar 2007 17:14:36 +0000 (17:14 +0000)]
For PR1256:
Make Signedness information pervasive throughout all types and values.
There is no easy way to get around this. Because the GEP instruction can
index through an arbitrarily complex value structure, it is necessary to
keep track of signedness information throughout that structure. This change
makes Signedness a full class, capable of representing Signedness in
arbitrarily shaped types. The class is then used throughout llvm-upgrade to
track signedness and differentiate between globals, locals, and functions
based on their signedness.

For PR1243:
This patch also removes bogus warnings about renaming internal globals. It
now only emits such warnings when renaming non-internal globals because
they may affect linkage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35234 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoProtect R31's frame offset from being used by callee-saved registers, when R31
Nicolas Geoffray [Wed, 21 Mar 2007 16:44:14 +0000 (16:44 +0000)]
Protect R31's frame offset from being used by callee-saved registers, when R31
is the frame pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35233 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a bug in getAllOnesValue() which broke
Zhou Sheng [Wed, 21 Mar 2007 04:34:37 +0000 (04:34 +0000)]
Fix a bug in getAllOnesValue() which broke
some test cases for bitwidth > 64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35232 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMark re-materializable instructions.
Evan Cheng [Wed, 21 Mar 2007 00:16:56 +0000 (00:16 +0000)]
Mark re-materializable instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35230 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUpdated.
Evan Cheng [Tue, 20 Mar 2007 22:32:39 +0000 (22:32 +0000)]
Updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35229 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoPotential spiller improvement.
Evan Cheng [Tue, 20 Mar 2007 22:22:38 +0000 (22:22 +0000)]
Potential spiller improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35228 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agodo not share old induction variables when this would result in invalid
Dale Johannesen [Tue, 20 Mar 2007 21:54:54 +0000 (21:54 +0000)]
do not share old induction variables when this would result in invalid
instructions (that would have to be split later)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35227 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agomaintain LiveIn when splitting blocks (register scavenging needs it)
Dale Johannesen [Tue, 20 Mar 2007 21:35:06 +0000 (21:35 +0000)]
maintain LiveIn when splitting blocks (register scavenging needs it)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35226 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoDominanceFrontier::calculate().
Devang Patel [Tue, 20 Mar 2007 21:25:31 +0000 (21:25 +0000)]
DominanceFrontier::calculate().
Avoid recursion, Use iterative algorithm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35225 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix some VC++ warnings.
Jeff Cohen [Tue, 20 Mar 2007 20:43:18 +0000 (20:43 +0000)]
Fix some VC++ warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35224 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix (and simplify) 48-bit byte swap.
Jeff Cohen [Tue, 20 Mar 2007 20:42:36 +0000 (20:42 +0000)]
Fix (and simplify) 48-bit byte swap.
Get pos/neg infinity the correct way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35223 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoLoopSimplify::FindPHIToPartitionLoops()
Devang Patel [Tue, 20 Mar 2007 20:19:48 +0000 (20:19 +0000)]
LoopSimplify::FindPHIToPartitionLoops()
Use ETForest instead of DominatorSet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35222 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoLoopSimplify::FindPHIToPartitionLoops()
Devang Patel [Tue, 20 Mar 2007 20:18:12 +0000 (20:18 +0000)]
LoopSimplify::FindPHIToPartitionLoops()
Use ETForest instead of DominatorSet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35221 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCode clean up.
Lauro Ramos Venancio [Tue, 20 Mar 2007 20:09:03 +0000 (20:09 +0000)]
Code clean up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35220 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMinor bug.
Evan Cheng [Tue, 20 Mar 2007 19:32:11 +0000 (19:32 +0000)]
Minor bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35219 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agobugfix: When the source register of CALL_NOLINK was LR, the following code was emitted:
Lauro Ramos Venancio [Tue, 20 Mar 2007 17:57:23 +0000 (17:57 +0000)]
bugfix: When the source register of CALL_NOLINK was LR, the following code was emitted:
    mov lr, pc
    bx lr
So, the function was not called.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35218 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agollvm-gcc now requires -fnested-functions to enable them in C.
Chris Lattner [Tue, 20 Mar 2007 17:34:31 +0000 (17:34 +0000)]
llvm-gcc now requires -fnested-functions to enable them in C.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35217 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoBreak up huge line so that this file is almost readable.
Reid Spencer [Tue, 20 Mar 2007 17:27:19 +0000 (17:27 +0000)]
Break up huge line so that this file is almost readable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35216 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRegenerate.
Reid Spencer [Tue, 20 Mar 2007 17:19:31 +0000 (17:19 +0000)]
Regenerate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35215 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoDon't delete things before their last use (avoids bad reads).
Reid Spencer [Tue, 20 Mar 2007 17:18:33 +0000 (17:18 +0000)]
Don't delete things before their last use (avoids bad reads).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35214 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCopyToReg source operand can be a physical register.
Lauro Ramos Venancio [Tue, 20 Mar 2007 16:46:44 +0000 (16:46 +0000)]
CopyToReg source operand can be a physical register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35213 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTest handling of structs with multiple variable-sized fields.
Duncan Sands [Tue, 20 Mar 2007 14:13:20 +0000 (14:13 +0000)]
Test handling of structs with multiple variable-sized fields.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35212 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSimplify isHighOnes().
Zhou Sheng [Tue, 20 Mar 2007 12:49:06 +0000 (12:49 +0000)]
Simplify isHighOnes().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35211 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAda testcase for structs with multiple variable sized fields.
Duncan Sands [Tue, 20 Mar 2007 09:54:02 +0000 (09:54 +0000)]
Ada testcase for structs with multiple variable sized fields.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35210 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTest that ARRAY_RANGE_REF returns an array not an element.
Duncan Sands [Tue, 20 Mar 2007 09:50:42 +0000 (09:50 +0000)]
Test that ARRAY_RANGE_REF returns an array not an element.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35209 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFirst cut trivial re-materialization support.
Evan Cheng [Tue, 20 Mar 2007 08:13:50 +0000 (08:13 +0000)]
First cut trivial re-materialization support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35208 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake two piece constant generation as a single instruction. It's re-materialized...
Evan Cheng [Tue, 20 Mar 2007 08:11:30 +0000 (08:11 +0000)]
Make two piece constant generation as a single instruction. It's re-materialized as a load from constantpool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35207 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoNew entry.
Evan Cheng [Tue, 20 Mar 2007 08:10:17 +0000 (08:10 +0000)]
New entry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35206 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdded MRegisterInfo hook to re-materialize an instruction.
Evan Cheng [Tue, 20 Mar 2007 08:09:38 +0000 (08:09 +0000)]
Added MRegisterInfo hook to re-materialize an instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35205 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTwo changes:
Chris Lattner [Tue, 20 Mar 2007 06:08:29 +0000 (06:08 +0000)]
Two changes:
1) codegen a shift of a register as a shift, not an LEA.
2) teach the RA to convert a shift to an LEA instruction if it wants something
   in three-address form.

This gives us asm diffs like:

-       leal (,%eax,4), %eax
+       shll $2, %eax

which is faster on some processors and smaller on all of them.

and, more interestingly:

-       movl 24(%esi), %eax
-       leal (,%eax,4), %edi
+       movl 24(%esi), %edi
+       shll $2, %edi

Without #2, #1 was a significant pessimization in some cases.

This implements CodeGen/X86/shift-codegen.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35204 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoThese functions should use shll, not lea.
Chris Lattner [Tue, 20 Mar 2007 06:01:41 +0000 (06:01 +0000)]
These functions should use shll, not lea.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35203 91177308-0d34-0410-b5e6-96231b3b80d8