[PATCH] [SimplifyLibCalls] Teach the Fortified libcall simplifier to look through objectsize.

Ahmed Bougacha ahmed.bougacha at gmail.com
Fri Oct 24 16:35:00 PDT 2014


Note that this + D498 seem to have caused two major differences in
the testsuite, lowercase and sqlite3.

The execution time for SingleSource/Benchmarks/Misc/lowercase went
down by 99.98% (!), because the actual lowercasing logic was optimized
out, leaving only the iteration printfs. At first glance, the change
seems correct; I'll look into it in more detail.

MultiSource/Applications/sqlite3 has seen its compile time grow by
~25% to 20s. Interestingly, a ~1.5% execution slowdown is also
incurred (seems unrelated to D498, only caused by moving stuff around
because of the _chk -> intrinsic optimizations enabled by this patch).

getObjectSize, which is used in the objectsize patch, is somewhat
expensive. But profiling shows that there are two slowdown sources: a
little more everywhere, and MemDepAnalysis::getNonLocalPointerDependency.
Both seem to be caused by the transformation of most _chk calls to
intrinsics (enabled by the objectsize patch).

At this point I'm not sure whether it's currently worth it to do this
_chk+llvm.objectsize -> intrinsic lowering, earlier than CGP.
If not I think the D498 optimization would be pretty useless on
fortified targets (like the rest of memcpyopt, one might add.)

I'll try to isolate the impact of this specific patch. Meanwhile, feedback
would be much appreciated!

http://reviews.llvm.org/D5984






More information about the llvm-commits mailing list