[PATCH] D28200: [BypassSlowDivision] Do not bypass division of hash-like values
Nikolai Bozhenov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 31 07:06:25 PST 2016
n.bozhenov created this revision.
n.bozhenov added reviewers: spatel, craig.topper, bkramer, jlebar.
n.bozhenov added subscribers: llvm-commits, zansari, DavidKreitzer, aaboud, volkalexey.
Disable bypassing if one of the operands looks like a hash value. Slow
division often occurs in hashtable implementations and fast division is
never taken there because a hash value is extremely unlikely to have
enough upper bits set to zero.
A value is considered to be hash-like if it is produced by a
1. XOR operation
2. Multiplication by a constant wider than the shorter type
3. PHI instruction with at least one XOR or MUL+CONST operand.
https://reviews.llvm.org/D28200
Files:
lib/Transforms/Utils/BypassSlowDivision.cpp
test/CodeGen/X86/bypass-slow-division-64.ll
test/CodeGen/X86/bypass-slow-division-fnv.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28200.82767.patch
Type: text/x-patch
Size: 6663 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161231/5b536a44/attachment.bin>
More information about the llvm-commits
mailing list