[PATCH] D51000: [BypassSlowDivision] Teach bypass slow division not to interfere with div by constant where constants have been constant hoisted, but not moved from their basic block

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 20 15:25:01 PDT 2018


craig.topper added inline comments.


================
Comment at: lib/Transforms/Utils/BypassSlowDivision.cpp:200-203
     // After Constant Hoisting pass, long constants may be represented as
     // bitcast instructions. As a result, some constants may look like an
     // instruction at first, and an additional check is necessary to find out if
     // an operand is actually a constant.
----------------
spatel wrote:
> Similar check - can we handle div opcodes here?
> There's an IR version of peekThroughBitcast() in InstCombineInternal.h. Lift that to a higher header, so we can use it here too?
This code is specifically looking for a code sequence that you might find in a hash function. I don't think we want to check for div here. And it wouldn't help with the problem since this is called on the inputs to the div/rem.

In my case, I need to know the bitcast is there because I need to check the parent so peekthroughbitcast isn't useful.


https://reviews.llvm.org/D51000





More information about the llvm-commits mailing list