Benjamin Kramer
a38019a3de
Teach SimplifyLibCalls to fold memcmp calls with constant arguments.
...
llvm-svn: 86141
2009-11-05 17:44:22 +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
8e056e8b9b
I put the wrong rdar number in this test.
...
llvm-svn: 82829
2009-09-26 01:11:57 +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
Dan Gohman
205b641954
Change tests from "opt %s" to "opt < %s" so that opt doesn't see the
...
input filename so that opt doesn't print the input filename in the
output so that grep lines in the tests don't unintentionally match
strings in the input filename.
llvm-svn: 81537
2009-09-11 18:01:28 +00:00
Dan Gohman
c95df8b6d8
Use opt -S instead of piping bitcode output through llvm-dis.
...
llvm-svn: 81257
2009-09-08 22:34:10 +00:00
Dan Gohman
8d84372836
Change these tests to feed the assembly files to opt directly, instead
...
of using llvm-as, now that opt supports this.
llvm-svn: 81226
2009-09-08 16:50:01 +00:00
Daniel Dunbar
a953c39b9e
Eliminate uses of %prcontext.
...
- I'd appreciate it if someone else eyeballs my changes to make sure I captured
the intent of the test.
llvm-svn: 81083
2009-09-05 11:35:16 +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
Dan Gohman
e3245061a9
Add targetdata strings to these tests, since SimplifyLibCalls uses
...
TargetData to find the pointer size.
llvm-svn: 79490
2009-08-19 23:18:49 +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
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
Nick Lewycky
1961298b63
Just discard the output, no need to turn it back into text.
...
llvm-svn: 77439
2009-07-29 06:14:52 +00:00
Chris Lattner
e5f1099d05
don't dump .bc file to stdout, and simplify this to a trivial testcase.
...
llvm-svn: 77436
2009-07-29 05:32:07 +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
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
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
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
f03202e76d
add some optimizations for strncpy/strncat and factor some
...
code. Patch by Benjamin Kramer!
llvm-svn: 68885
2009-04-12 05:06:39 +00:00
Ed Schouten
ff25f858fd
Let the strcat optimizer return the pointer to the start of the buffer,
...
instead of the place where it started to perform the string copy.
- PR3661
- Patch by Benjamin Kramer!
llvm-svn: 68443
2009-04-06 13:06:48 +00:00
Nick Lewycky
0a8e13fd8b
Mark strto* as readonly when the endptr is null.
...
llvm-svn: 64460
2009-02-13 17:08:33 +00:00
Nick Lewycky
7ec551cfad
On strtod and friends, mark 'endptr' nocapture in the function prototype, and
...
mark the first argument nocapture if endptr=NULL for each particular call.
llvm-svn: 64453
2009-02-13 15:31:46 +00:00
Nick Lewycky
260e80bd90
Reapply r64300:
...
Make sure the SCC pass manager initializes any contained
function pass managers. Without this, simplify-libcalls
would add nocapture attributes when run on its own, but
not when run as part of -std-compile-opts or similar.
llvm-svn: 64443
2009-02-13 07:15:53 +00:00
Bill Wendling
dfb5880317
Revert r64300 and r64301. These were causing the following errors respectively:
...
During llvm-gcc bootstrap:
Undefined symbols:
"llvm::FPPassManager::doFinalization(llvm::Module&)", referenced from:
(anonymous namespace)::CGPassManager::doFinalization(llvm::CallGraph&, llvm::Module&)
in libLLVMipa.a(CallGraphSCCPass.o)
"llvm::FPPassManager::doInitialization(llvm::Module&)", referenced from:
(anonymous namespace)::CGPassManager::doInitialization(llvm::CallGraph&, llvm::Module&)
in libLLVMipa.a(CallGraphSCCPass.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/obj-llvm/Release/bin/opt] Error 1
During an LLVM release build:
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-register-desc -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenRegisterInfo.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td
llvm[3]: Building X86.td instruction names with tblgen
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-instr-enums -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenInstrNames.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td
llvm[3]: Building X86.td instruction information with tblgen
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-instr-desc -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenInstrInfo.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td
llvm[3]: Building X86.td assembly writer with tblgen
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-asm-writer -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenAsmWriter.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td
llvm[3]: Compiling InstructionCombining.cpp for Release build
if /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~dst/Developer/usr/bin/llvm-g++-4.2 -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Transforms/Scalar -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fno-exceptions -Woverloaded-virtual -pedantic -Wall -W -Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter -fstrict-aliasing -Wstrict-aliasing -c -MMD -MP -MF "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d.tmp" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.lo" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.o" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d" /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Transforms/Scalar/InstructionCombining.cpp -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.o ; \
then /bin/mv -f "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d.tmp" "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Trans
llvm-svn: 64311
2009-02-11 18:19:24 +00:00
Duncan Sands
e71d1394f6
Make sure the SCC pass manager initializes any contained
...
function pass managers. Without this, simplify-libcalls
would add nocapture attributes when run on its own, but
not when run as part of -std-compile-opts or similar.
llvm-svn: 64300
2009-02-11 09:58:43 +00:00
Nick Lewycky
f4b028bf4c
Forgot this in the previous checkin: fopen now has nocapture, realloc is
...
supposed to take two arguments.
llvm-svn: 62457
2009-01-18 04:46:10 +00:00
Nick Lewycky
6685977938
Run a post-pass that marks known function declarations by name.
...
llvm-svn: 61632
2009-01-04 20:27:34 +00:00
Nick Lewycky
8fd2389593
Turn strcmp into memcmp, such as strcmp(P, "x") --> memcmp(P, "x", 2).
...
llvm-svn: 61297
2008-12-21 00:19:21 +00:00
Eli Friedman
2bc3921ce2
Optimize memmove and memset into the LLVM builtins. Note that these
...
only show up in code from front-ends besides llvm-gcc, like clang.
llvm-svn: 60287
2008-11-30 08:32:11 +00:00
Dan Gohman
c162a200ad
Add a new pass to simplify specific half_powr function calls. This is
...
a specialized pass that it not likely to be generally useful.
llvm-svn: 58732
2008-11-04 23:41:45 +00:00
Chris Lattner
806f0a8411
lower calls to abs to inline code, PR2337
...
llvm-svn: 52138
2008-06-09 08:26:51 +00:00
Gabor Greif
807c2df887
sabre brings to my attention that the 'tr' suffix is also obsolete
...
llvm-svn: 51349
2008-05-20 21:00:03 +00:00
Gabor Greif
d8a4dbb5da
Rename the last test with .llx extension to .ll, resolve duplicate test by renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too.
...
llvm-svn: 51328
2008-05-20 19:52:04 +00:00
Duncan Sands
7b84c36791
Fix PR2341 - when the length is 4 use an i32 not
...
an i16! Cleaned up trailing whitespace while there.
llvm-svn: 51240
2008-05-19 09:27:24 +00:00
Chris Lattner
96467cc665
strength reduce exp2 into ldexp, rdar://5852514
...
llvm-svn: 50586
2008-05-02 18:43:35 +00:00
Dan Gohman
04e2b94842
Update old-style syntax in some "not grep" tests.
...
llvm-svn: 50560
2008-05-01 23:50:07 +00:00
Chris Lattner
9d73228708
fix typo
...
llvm-svn: 50519
2008-05-01 06:16:48 +00:00
Chris Lattner
9a678d6f55
instcombine does memset optzns.
...
llvm-svn: 50518
2008-05-01 06:16:38 +00:00
Chris Lattner
926efd9174
simplifylibcalls doesn't optimize llvm.memmove, instcombine does.
...
llvm-svn: 50517
2008-05-01 06:14:24 +00:00
Chris Lattner
ce01263bff
no reason for simplifylibcalls to simplify intrinsics, instcombine does
...
a fine job.
llvm-svn: 50470
2008-04-30 06:12:15 +00:00
Chris Lattner
a62a4d407a
remove redundant check.
...
llvm-svn: 50469
2008-04-30 06:06:37 +00:00
Chris Lattner
be01a5f699
Generalize getUnaryFloatFunction to handle any FP unary function, automatically
...
figuring out the suffix to use. implement pow(2,x) -> exp2(x).
llvm-svn: 49437
2008-04-09 17:48:11 +00:00
Chris Lattner
5d0cbe7d22
remove capital letter from test name.
...
llvm-svn: 49436
2008-04-09 17:46:36 +00:00
Chris Lattner
976ea8990e
many cleanups to the pow optimizer. Allow it to handle powf,
...
add support for pow(x, 2.0) -> x*x.
llvm-svn: 49411
2008-04-09 00:07:45 +00:00
Tanya Lattner
8ac346c316
Remove llvm-upgrade and update tests.
...
llvm-svn: 48137
2008-03-10 07:21:50 +00:00
Dan Gohman
34263074cb
Convert tests using "grep -c ... | grep ..." to use the count script.
...
llvm-svn: 41100
2007-08-15 13:49:33 +00:00
John Criswell
57e5ed4b5a
Convert .cvsignore files
...
llvm-svn: 37801
2007-06-29 16:35:07 +00:00
Reid Spencer
df17fa8ef9
For PR1319:
...
Remove && from the end of the lines to prevent tests from throwing run
lines into the background. Also, clean up places where the same command
is run multiple times by using a temporary file.
llvm-svn: 36142
2007-04-16 17:36:08 +00:00