[PATCH] D130164: [LV] Support predicated div/rem operations via safe-divisor select idiom
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 20 10:20:42 PDT 2022
reames added a comment.
In D130164#3666181 <https://reviews.llvm.org/D130164#3666181>, @craig.topper wrote:
> What does SelectionDAG do with a scalable vector division if it isn't legal for the target?
Not sure, but this patch shouldn't result in that being created. Such a target is responsible for setting a reasonable cost. If that cost is invalid, existing logic should bailout of vectorization for scalable vector factors.
In D130164#3666157 <https://reviews.llvm.org/D130164#3666157>, @craig.topper wrote:
>>> Div/Rem by 1 is the same as using the undisturbed LHS.
>
> That's true for Div, but Rem by 1 would produce 0.
True, didn't think carefully enough. If we end up trying to implement the undisturbed case, we can explore using an alternate value for the safe-divisor for rem. Not thinking about it real hard, int_max/uint_max might be reasonable.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130164/new/
https://reviews.llvm.org/D130164
More information about the llvm-commits
mailing list