[PATCH] Factor check for the assume intrinsic out of checks in computeKnownBitsFromAssume

Philip Reames listmail at philipreames.com
Tue Nov 18 11:48:14 PST 2014


Hi hfinkel,

We were matching against the assume intrinsic in every check.  Since we know that it must be an assume, this is just wasted work.  Somewhat surprisingly, matching an intrinsic id is actually relatively expensive.  It devolves to a string construction and comparison in Function::isIntrinsic.

I originally spotted this because it showed up in a performance profile of my compiler.  I've since discovered a separate issue which seems to be the actual root cause, but this is minor perf goodness regardless.  

I'm likely to follow up with another change to factor out the comparison matching.  There's no need to match the compare instruction in every single one of the tests.

http://reviews.llvm.org/D6312

Files:
  lib/Analysis/ValueTracking.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6312.16347.patch
Type: text/x-patch
Size: 11643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141118/5cddd5fe/attachment.bin>


More information about the llvm-commits mailing list