| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 26482
|
| |
|
|
| |
llvm-svn: 26218
|
| |
|
|
| |
llvm-svn: 25530
|
| |
|
|
| |
llvm-svn: 25525
|
| |
|
|
|
|
|
|
|
| |
1. Do not statically construct a map when the program starts up, this
is expensive and cannot be optimized. Instead, create a list.
2. Do not insert entries for all function in the module into a hashmap
that lives the full life of the compiler.
llvm-svn: 25512
|
| |
|
|
|
|
|
|
|
| |
1. Use the varargs version of getOrInsertFunction to simplify code.
2. remove #include
3. Reduce the number of #ifdef's.
4. remove extraneous vertical whitespace.
llvm-svn: 25508
|
| |
|
|
|
|
|
|
| |
Don't do floor->floorf conversion if floorf is not available. This checks
the compiler's host, not its target, which is incorrect for cross-compilers
Not sure that's important as we don't build many cross-compilers.
llvm-svn: 25456
|
| |
|
|
|
|
|
| |
unsigned llvm.cttz.* intrinsic, fixing the 2005-05-11-Popcount-ffs-fls regression
last night.
llvm-svn: 25398
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
pointer marking the end of the list, the zero *must* be cast to the pointer
type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.
The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.
llvm-svn: 23888
|
| |
|
|
|
|
| |
bringing the LLC time down to the CBE time.
llvm-svn: 23521
|
| |
|
|
| |
llvm-svn: 23519
|
| |
|
|
| |
llvm-svn: 23517
|
| |
|
|
|
|
| |
SimplifyLibCalls/2005-05-20-sprintf-crash.ll
llvm-svn: 23430
|
| |
|
|
|
|
|
|
| |
sprintf("%s", P)'s that have uses.
s/hasNUses(0)/use_empty()/
llvm-svn: 23425
|
| |
|
|
|
|
|
| |
Regression/Transforms/SimplifyLibCalls/floor.ll. This triggers 19 times in
177.mesa.
llvm-svn: 23017
|
| |
|
|
| |
llvm-svn: 22694
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
llvm-svn: 22523
|
| |
|
|
| |
llvm-svn: 22312
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
not casting to the correct type.
llvm-svn: 22250
|
| |
|
|
|
|
| |
document what its for a little better.
llvm-svn: 22164
|
| |
|
|
| |
llvm-svn: 22163
|
| |
|
|
| |
llvm-svn: 22162
|
| |
|
|
| |
llvm-svn: 22161
|
| |
|
|
|
|
|
|
| |
sprintf(P, "%s", X);
Where X is not an sbyte*. This fixes the bug JohnMC reported on llvm-bugs.
llvm-svn: 22159
|
| |
|
|
|
|
| |
not reason to include it for other front ends.
llvm-svn: 22070
|
| |
|
|
|
|
| |
ffs(x) -> (x == 0 ? 0 : 1+llvm.cttz(x))
llvm-svn: 22068
|
| |
|
|
|
|
| |
for one of the values that it defines!
llvm-svn: 22058
|
| |
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
strlen(x) != 0 -> *x != 0
strlen(x) == 0 -> *x == 0
* Change nested statistics to use style of other LLVM statistics so that
only the name of the optimization (simplify-libcalls) is used as the
statistic name, and the description indicates which specific all is
optimized. Cuts down on some redundancy and saves a few bytes of space.
* Make note of stpcpy optimization that could be done.
llvm-svn: 21766
|
| |
|
|
| |
llvm-svn: 21762
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
library function:
isdigit(chr) -> 0 or 1 if chr is constant
isdigit(chr) -> chr - '0' <= 9 otherwise
Although there are many calls to isdigit in llvm-test, most of them are
compiled away by macros leaving only this:
2 MultiSource/Applications/hexxagon
llvm-svn: 21688
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
actual spec (int -> uint)
* Add the ability to get/cache the strlen function prototype.
* Make sure generated values are appropriately named for debugging purposes
* Add the SPrintFOptimiation for 4 casts of sprintf optimization:
sprintf(str,cstr) -> llvm.memcpy(str,cstr) (if cstr has no %)
sprintf(str,"") -> store sbyte 0, str
sprintf(str,"%s",src) -> llvm.memcpy(str,src) (if src is constant)
sprintf(str,"%c",chr) -> store chr, str ; store sbyte 0, str+1
The sprintf optimization didn't fire as much as I had hoped:
2 MultiSource/Applications/SPASS
5 MultiSource/Benchmarks/McCat/18-imp
22 MultiSource/Benchmarks/Prolangs-C/TimberWolfMC
1 MultiSource/Benchmarks/Prolangs-C/assembler
6 MultiSource/Benchmarks/Prolangs-C/unix-smail
2 MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec
llvm-svn: 21679
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Neither of these activated as many times as was hoped:
strchr:
9 MultiSource/Applications/siod
1 MultiSource/Applications/d
2 MultiSource/Prolangs-C/archie-client
1 External/SPEC/CINT2000/176.gcc/176.gcc
llvm.memset:
no hits
llvm-svn: 21669
|
| |
|
|
|
|
|
|
| |
strings passed to Statistic's constructor are not destructable. The stats
are printed during static destruction and the SimplifyLibCalls module was
getting destructed before the statistics.
llvm-svn: 21661
|
| |
|
|
|
|
| |
Unfortunately, this optimization didn't trigger on any llvm-test tests.
llvm-svn: 21660
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fprintf(F,"hello") -> fwrite("hello",strlen("hello"),1,F)
fprintf(F,"%s","hello") -> fwrite("hello",strlen("hello"),1,F)
fprintf(F,"%c",'x') -> fputc('c',F)
This optimization fires severals times in llvm-test:
313 MultiSource/Applications/Burg
302 MultiSource/Benchmarks/Prolangs-C/TimberWolfMC
189 MultiSource/Benchmarks/Prolangs-C/mybison
175 MultiSource/Benchmarks/Prolangs-C/football
130 MultiSource/Benchmarks/Prolangs-C/unix-tbl
llvm-svn: 21657
|
| |
|
|
| |
llvm-svn: 21638
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
type be obtained from a CallInst we're optimizing.
* Make it possible for getConstantStringLength to return the ConstantArray
that it extracts in case the content is needed by an Optimization.
* Implement the strcmp optimization
* Implement the toascii optimization
This pass is now firing several to many times in the following MultiSource
tests:
Applications/Burg - 7 (strcat,strcpy)
Applications/siod - 13 (strcat,strcpy,strlen)
Applications/spiff - 120 (exit,fputs,strcat,strcpy,strlen)
Applications/treecc - 66 (exit,fputs,strcat,strcpy)
Applications/kimwitu++ - 34 (strcmp,strcpy,strlen)
Applications/SPASS - 588 (exit,fputs,strcat,strcpy,strlen)
llvm-svn: 21626
|
| |
|
|
| |
llvm-svn: 21618
|
| |
|
|
| |
llvm-svn: 21612
|
| |
|
|
|
|
| |
constant folding implemented in lib/Transforms/Utils/Local.cpp.
llvm-svn: 21604
|
| |
|
|
|
|
|
|
| |
Help Wanted!
There's a lot of them to write.
llvm-svn: 21603
|
| |
|
|
| |
llvm-svn: 21602
|
| |
|
|
|
|
|
| |
* Name the instructions by appending to name of original
* Factor common part out of a switch statement.
llvm-svn: 21597
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Correct stale documentation in a few places
* Re-order the file to better associate things and reduce line count
* Make the pass thread safe by caching the Function* objects needed by the
optimizers in the pass object instead of globally.
* Provide the SimplifyLibCalls pass object to the optimizer classes so they
can access cached Function* objects and TargetData info
* Make sure the pass resets its cache if the Module passed to runOnModule
changes
* Rename CallOptimizer LibCallOptimization. All the classes are named
*Optimization while the objects are *Optimizer.
* Don't cache Function* in the optimizer objects because they could be used
by multiple PassManager's running in multiple threads
* Add an optimization for strcpy which is similar to strcat
* Add a "TODO" list at the end of the file for ideas on additional libcall
optimizations that could be added (get ideas from other compilers).
Sorry for the huge diff. Its mostly reorganization of code. That won't
happen again as I believe the design and infrastructure for this pass is
now done or close to it.
llvm-svn: 21589
|
| |
|
|
| |
llvm-svn: 21583
|
| |
|
|
|
|
|
| |
helps track down what gets triggered in the pass so its easier to identify
good test cases.
llvm-svn: 21582
|
| |
|
|
| |
llvm-svn: 21580
|