Chris Lattner
2d5fc1649a
reapply my strstr optimization. I have reproduced the x86-64 bootstrap
...
miscompile (i386.o miscompares) but it happens both with and without
this patch.
llvm-svn: 91532
2009-12-16 09:32:05 +00:00
Chris Lattner
8751050a34
revert my strstr optimization, I'm told it breaks x86-64 bootstrap.
...
Will reapply with a fix when I get a chance.
llvm-svn: 91486
2009-12-16 00:46:02 +00:00
Chris Lattner
fa960751b1
optimize strstr, PR5783
...
llvm-svn: 91438
2009-12-15 19:14:40 +00:00
Chris Lattner
284fe3f14c
add some other xforms that should be done as part of PR5783
...
llvm-svn: 91428
2009-12-15 09:05:13 +00:00
Chris Lattner
cb2c4e9f42
tidy up, remove dependence on order of evaluation of function args from EmitMemCpy.
...
llvm-svn: 90297
2009-12-02 06:05:42 +00:00
Eric Christopher
455f4d8400
Add more optimizations for object size checking, enable handling of
...
object size intrinsic and verify return type is correct. Collect various
code in one place.
llvm-svn: 89523
2009-11-21 01:01:30 +00:00
Daniel Dunbar
09a7f92b02
Revert "Add some rough optimizations for checking routines.", it buildeth not.
...
llvm-svn: 89482
2009-11-20 20:17:30 +00:00
Eric Christopher
61485dfd00
Add some rough optimizations for checking routines.
...
llvm-svn: 89479
2009-11-20 19:57:37 +00:00
Duncan Sands
03e15012ed
CreateIntCast takes an "isSigned" parameter. Pass "true" for it, rather than
...
a name.
llvm-svn: 88908
2009-11-16 12:32:28 +00:00
Chris Lattner
aaa7706cd5
fix PR5104: when printing a single character, return the result of
...
putchar in case there is an error.
llvm-svn: 86515
2009-11-09 04:57:04 +00:00
Benjamin Kramer
a38019a3de
Teach SimplifyLibCalls to fold memcmp calls with constant arguments.
...
llvm-svn: 86141
2009-11-05 17:44:22 +00:00
Eric Christopher
89c2f934d6
Add objectsize intrinsic and hook it up through codegen. Doesn't
...
do anything than return "I don't know" at the moment.
llvm-svn: 85189
2009-10-27 00:52:25 +00:00
Eric Christopher
a42e55349d
80-column and whitespace fixes.
...
llvm-svn: 83489
2009-10-07 21:14:25 +00:00
Duncan Sands
2400ad7236
Introduce and use convenience methods for getting pointer types
...
where the element is of a basic builtin type. For example, to get
an i8* use getInt8PtrTy.
llvm-svn: 83379
2009-10-06 15:40:36 +00:00
Chris Lattner
a3cf123e86
strength reduce a ton of type equality tests to check the typeid (Through
...
the new predicates I added) instead of going through a context and doing a
pointer comparison. Besides being cheaper, this allows a smart compiler
to turn the if sequence into a switch.
llvm-svn: 83297
2009-10-05 05:54:46 +00:00
Dan Gohman
0a396aa546
Fix SimplifyLibCalls to transfer attributes from callees rather than
...
calls, since direct calls don't always reflect the attributes of their
callees.
llvm-svn: 82867
2009-09-26 18:10:13 +00:00
Dan Gohman
d585364b0b
Rename ConstantFP's getInf to getInfinity.
...
llvm-svn: 82823
2009-09-25 23:40:21 +00:00
Dan Gohman
d564cd42d9
Transform pow(x, 0.5) to (x == -inf ? inf : fabs(sqrt(x))), which is
...
typically faster then doing a general pow.
llvm-svn: 82819
2009-09-25 23:10:17 +00:00
Victor Hernandez
fe5347d782
Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.
...
Reviewed by Dan Gohman.
llvm-svn: 82300
2009-09-18 22:35:49 +00:00
Chris Lattner
3ac0c58031
In C++, code is not allowed to call main. In C it is, this
...
simplifylibcalls optimization is thus valid for C++ but not C.
It's not important enough to worry about for C++ apps, so just
remove it.
rdar://7191924
llvm-svn: 80887
2009-09-03 05:19:59 +00:00
Chris Lattner
5f54c5bd1c
eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861
...
llvm-svn: 80766
2009-09-02 06:11:42 +00:00
Dan Gohman
807652ac3a
Fix SimplifyLibcalls and ValueTracking to check mayBeOverridden
...
before performing optimizations based on constant string values.
llvm-svn: 79384
2009-08-19 00:11:12 +00:00
Dan Gohman
3137ac23bc
Make TargetData optional in SimplifyLibCalls.
...
llvm-svn: 79298
2009-08-18 00:48:13 +00:00
Owen Anderson
9df206d02d
Push LLVMContexts through the IntegerType APIs.
...
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Owen Anderson
1dc40e205b
Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
...
metadata related, which I'm waiting on to avoid conflicting with Devang.
llvm-svn: 77721
2009-07-31 20:28:14 +00:00
Owen Anderson
881d928f9b
Move types back to the 2.5 API.
...
llvm-svn: 77516
2009-07-29 22:17:13 +00:00
Daniel Dunbar
89cb72a6bc
Fix PR4645 which was fallout from the fix for PR4641.
...
- Call RAUW to delete all instructions (this is a patch from Nick Lewycky).
llvm-svn: 77512
2009-07-29 22:00:43 +00:00
Owen Anderson
0ce2151b36
Move ConstantExpr to 2.5 API.
...
llvm-svn: 77494
2009-07-29 18:55:55 +00:00
Nick Lewycky
e0524c1795
Bulk erasing instructions without RAUWing them is unsafe. Instead, break them
...
into a new BB that has no predecessors.
llvm-svn: 77433
2009-07-29 05:17:50 +00:00
Owen Anderson
aa8c94b051
Change ConstantArray to 2.5 API.
...
llvm-svn: 77347
2009-07-28 18:32:17 +00:00
Owen Anderson
256c2c250e
Move ConstantFP construction back to the 2.5-ish API.
...
llvm-svn: 77247
2009-07-27 20:59:43 +00:00
Daniel Dunbar
64abfd0337
Remove Value::getNameLen
...
llvm-svn: 77148
2009-07-26 08:34:35 +00:00
Daniel Dunbar
75a66c519b
Eliminate some uses of DOUT, cerr, and getNameStart().
...
llvm-svn: 77145
2009-07-26 07:49:05 +00:00
Daniel Dunbar
038a7f0d35
Remove Value::{isName, getNameRef}.
...
Also, change MDString to use a StringRef.
llvm-svn: 77098
2009-07-25 23:55:21 +00:00
Owen Anderson
cc33e89571
Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
...
llvm-svn: 77011
2009-07-24 23:12:02 +00:00
Daniel Dunbar
b5adc13728
Convert StringMap to using StringRef for its APIs.
...
- Yay for '-'s and simplifications!
- I kept StringMap::GetOrCreateValue for compatibility purposes, this can
eventually go away. Likewise the StringMapEntry Create functions still follow
the old style.
- NIFC.
llvm-svn: 76888
2009-07-23 18:17:34 +00:00
Owen Anderson
cc287b28c9
Get rid of the Pass+Context magic.
...
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Eli Friedman
7b1597133d
Fix simplifylibcalls memset recognition to work on 64-bit platforms
...
where int is 32 bits.
llvm-svn: 76293
2009-07-18 08:34:51 +00:00
Owen Anderson
21d2d69727
Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a number of issues in
...
our current context-passing stuff, which is also fixed here
llvm-svn: 76089
2009-07-16 18:04:31 +00:00
Owen Anderson
1e5155161a
Move more functionality over to LLVMContext.
...
llvm-svn: 75497
2009-07-13 20:58:05 +00:00
Owen Anderson
9331034838
Push LLVMContext _back_ through IRBuilder.
...
llvm-svn: 75040
2009-07-08 20:50:47 +00:00
Owen Anderson
332aae685b
Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
...
llvm-svn: 75025
2009-07-08 19:03:57 +00:00
Owen Anderson
7a1f69e433
Push LLVMContext through GlobalVariables and IRBuilder.
...
llvm-svn: 74985
2009-07-08 01:26:06 +00:00
Owen Anderson
a8ce571a68
Even more passes being LLVMContext'd.
...
llvm-svn: 74781
2009-07-03 19:42:02 +00:00
Chris Lattner
3a683c551f
part of PR4405: disable a contentious optimization for
...
strcmp -> memcmp when the lengths of the strings are unknown.
Patch by Nick Lewycky!
llvm-svn: 73751
2009-06-19 04:17:36 +00:00
Anton Korobeynikov
fed9dcc88c
Revert IRBuilder CC propagation. Fix SimplifyLibCalls instead.
...
llvm-svn: 73715
2009-06-18 20:05:31 +00:00
Dan Gohman
5f6f8101d5
Split the Add, Sub, and Mul instruction opcodes into separate
...
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.
For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.
This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt
llvm-svn: 72897
2009-06-04 22:49:04 +00:00
Chris Lattner
8ac63163fe
fix PR4284, a bug in simplifylibcalls handling memcmp. Patch by
...
Benjamin Kramer!
llvm-svn: 72625
2009-05-30 18:43:04 +00:00
Chris Lattner
927ebd34e2
Fix PR4206 - crash in simplify lib calls
...
llvm-svn: 71644
2009-05-13 06:26:11 +00:00
Chris Lattner
8ad1efdfe1
"There was a typo in my previous patch which leads to miscompilation of
...
strncat :(
strncat(foo, "bar", 99)
would be optimized to
memcpy(foo+strlen(foo), "bar", 100, 1)
instead of
memcpy(foo+strlen(foo), "bar", 4, 1)"
Patch by Benjamin Kramer!
llvm-svn: 68905
2009-04-12 18:22:33 +00:00