Skip to content

Instantly share code, notes, and snippets.

@fhahn
fhahn / MergeFunction Size Impact -O3
Last active February 26, 2025 16:29
MergeFunction Size Impact -O3
Program size.__text
lhs rhs diff
MultiSourc...ench/adpcm/rawdaudio/rawdaudio 736.00 908.00 23.4%
MultiSourc...ench/adpcm/rawcaudio/rawcaudio 736.00 908.00 23.4%
MultiSourc.../telecomm-adpcm/telecomm-adpcm 736.00 908.00 23.4%
MultiSourc...nchmarks/tramp3d-v4/tramp3d-v4 747748.00 774404.00 3.6%
MultiSourc...Benchmarks/Olden/bisort/bisort 1856.00 1904.00 2.6%
MultiSourc...ench/telecomm-gsm/telecomm-gsm 32492.00 32972.00 1.5%
MultiSourc...rks/mediabench/gsm/toast/toast 32492.00 32972.00 1.5%
MultiSource/Benchmarks/Olden/mst/mst 2272.00 2304.00 1.4%
@fhahn
fhahn / VectorizationPlan-CurrentStatus.pdf
Last active March 16, 2024 20:46
Vectorization Plan rendered
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fhahn
fhahn / p.diff
Created November 28, 2023 11:55
Reset IsRestored for multiple return blocks
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index a3a71a8ec09a..d37316dcb0eb 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
@@ -2065,6 +2065,31 @@ bool ARMFrameLowering::restoreCalleeSavedRegisters(
&isARMArea1Register, 0);
}
+ // If there are multiple returns, not all of them may uses a POP that restores
+ // LR into PC and LR's Restored info may be incorrect for some return blocks.
#![feature(test, libc)]
#![feature(negate_unsigned)]
extern crate libc;
extern crate test;
use test::Bencher;
use std::iter;
Build it:
g++ -c -shared -o libfoo.so foo.c
rustc --link-args "-L /path/to/libfoo." test.rs
./test
[1] 4163 segmentation fault (core dumped)
@fhahn
fhahn / gist:3135912
Created July 18, 2012 12:28 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter