Dan Gohman
6134fbccef
Fix a bogus srem rule - a negative value srem'd by a power-of-2
...
can have a non-negative result; for example, -16%16 is 0. Also,
clarify the related comments. This fixes PR2670.
llvm-svn: 54767
2008-08-13 23:12:35 +00:00
Matthijs Kooijman
b85cc9db19
Don't use ++idx_begin when I actually mean idx_begin + 1, especially since we
...
also use *idx_begin in the same expression, giving unpredictable results.
This fixes this bug: http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-July/015877.html
llvm-svn: 53670
2008-07-16 10:47:35 +00:00
Evan Cheng
da3db11db3
- Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an empty string for ConstantAggregateZero case which surprises selectiondag.
...
- Correctly handle memcpy from constant string which is zero-initialized.
llvm-svn: 52891
2008-06-30 07:31:25 +00:00
Anton Korobeynikov
a7c583d584
Revert (52748 and friends):
...
Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.
This unbreaks llvm-gcc bootstrap.
llvm-svn: 52884
2008-06-29 17:57:03 +00:00
Chris Lattner
1701328675
Add back the capability to include nul characters in strings with
...
GetConstantStringInfo. This will hopefully restore llvm-gcc to
happy bootstrap land.
llvm-svn: 52851
2008-06-28 05:33:32 +00:00
Chris Lattner
ebf1f67193
Tighten up checking.
...
llvm-svn: 52850
2008-06-28 04:37:04 +00:00
Chris Lattner
dc3f946137
fix the regressions from Eric's patch by making GetConstantStringInfo
...
tolerate a non-nul-terminated string, and handling a direct global
reference.
llvm-svn: 52813
2008-06-27 03:36:51 +00:00
Owen Anderson
db0a48b1a7
Reserve the size we'll need in advance.
...
llvm-svn: 52763
2008-06-26 04:47:41 +00:00
Eric Christopher
d0ab9c47e6
Move GetConstantStringInfo to lib/Analysis. Remove
...
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.
llvm-svn: 52748
2008-06-26 00:31:12 +00:00
Duncan Sands
db356eea26
Fix some warnings reported by gcc-4.3. Hopefully
...
this still compiles on windows - I can't test!
llvm-svn: 52488
2008-06-19 08:47:31 +00:00
Matthijs Kooijman
8369c67cbd
Use a SmallVector instead of an array, since auto_ptr doesn't handle arrays
...
properly.
llvm-svn: 52390
2008-06-17 08:24:37 +00:00
Matthijs Kooijman
fa4d0b883a
Make BuildSubAggregate use FindInsertedElement again to prevent it from
...
inserting extractvalues. In particular, this prevents the insertion of
extractvalues that can't be folded away later. Also add an example of when this
stuff is needed.
llvm-svn: 52328
2008-06-16 14:13:46 +00:00
Matthijs Kooijman
69801d4fd1
Make the InsertBefore argument to FindInsertedValue optional, so you can find an inserted value without modifying the code.
...
llvm-svn: 52319
2008-06-16 13:28:31 +00:00
Matthijs Kooijman
86cda9e050
Pass around Instruction* instead of Instruction& in FindInsertedValue and friends.
...
llvm-svn: 52318
2008-06-16 13:13:08 +00:00
Matthijs Kooijman
5cb387735d
80 column fixes.
...
llvm-svn: 52316
2008-06-16 12:57:37 +00:00
Matthijs Kooijman
e92e18be5a
Move FindScalarValue from InstructionCombining.cpp to ValueTracking.cpp. While
...
I'm at it, rename it to FindInsertedValue.
The only functional change is that newly created instructions are no longer
added to instcombine's worklist, but that is not really necessary anyway (and
I'll commit some improvements next that will completely remove the need).
llvm-svn: 52315
2008-06-16 12:48:21 +00:00
Chris Lattner
6449690da4
Add #includes required by GCC 4.3, thanks for Zhongxing Xu
...
for reporting this.
llvm-svn: 51926
2008-06-04 04:46:14 +00:00
Chris Lattner
2e01a69e72
Remove unneeded code I added.
...
llvm-svn: 51878
2008-06-02 18:39:07 +00:00
Chris Lattner
a12a6de683
move CannotBeNegativeZero to ValueTracking. Simplify some signbit comparisons.
...
llvm-svn: 51864
2008-06-02 01:29:46 +00:00
Chris Lattner
965c769b3c
move ComputeMaskedBits, MaskedValueIsZero, and ComputeNumSignBits
...
out of instcombine into a new file in libanalysis. This also teaches
ComputeNumSignBits about the number of sign bits in a constantint.
llvm-svn: 51863
2008-06-02 01:18:21 +00:00