[PATCH] D13427: RFC: faster isa<IntrinsicInst> (bugged tests?)
Sean Silva via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 5 16:57:15 PDT 2015
silvas added a subscriber: silvas.
silvas added a comment.
We should optimize getName().startswith("llvm.") on x86 into loading the address and length of the name, a bounds check, a 4-byte integer comparison, a 1-byte integer comparison, and cmp+jmp for each comparison. Assuming the name is in cache (which is probably not the case?) and the branch prediction is good (which it probably is?), that is < 10 cycles on a modern x86. Even on ARM where we can't use unaligned loads, it should still be pretty darn fast.
What is actually taking ~50 cycles? How did you measure that?
(I'm not defending using a string comparison vs. not; just wondering why a comparison against a "short, constant string" is ending up so slow)
Repository:
rL LLVM
http://reviews.llvm.org/D13427
More information about the llvm-commits
mailing list