[PATCH] D72740: [SLP] Don't allow Div/Rem as alternate opcodes
Andrei Elovikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 14 15:44:25 PST 2020
a.elovikov marked an inline comment as done.
a.elovikov added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:427-429
+ assert(isValidForAlternation(Opcode) &&
+ isValidForAlternation(InstOpcode) &&
+ "Cast isn't safe for alternation, logic needs to be updated!");
----------------
ABataev wrote:
> Do you really need it here? It does not check anything for casts.
If that helper routine was checking for casts, I would have placed the call to it into the condition on line 426, similar to the check on line 414. But since it doesn't, there is no reason to do that there. On the other hand, if later some cast would become invalid, that condition on line 426 must be changed and the assert states exactly that.
In other words, this assert verifies exactly that - the check does not list casts as invalid.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72740/new/
https://reviews.llvm.org/D72740
More information about the llvm-commits
mailing list