[PATCH] D111500: [InstSimplify] Simplify intrinsic comparisons with domain knoweldge
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 11 13:39:54 PDT 2021
spatel added a comment.
We should not add target-specific code to generic analysis/passes if we can avoid it. I realize there are still target-specific intrinsic references in instcombine and even constant folding, but those are considered mistakes.
Previous discussions about this were:
https://lists.llvm.org/pipermail/llvm-dev/2016-July/102317.html
https://lists.llvm.org/pipermail/llvm-dev/2020-June/142859.html
So I think it's correct -- at least currently -- that all target-specific intrinsic definitions are included whether you build all targets or not. But that's not ideal - if someone only cares about one particular target, they shouldn't be burdened with defs and code for other targets.
D81728 <https://reviews.llvm.org/D81728> made instcombine more flexible by adding a TTI hook as mentioned in an earlier comment. Using that (even if it's in a hacky way that walks uses of the intrinsic) or a target-specific pass would be better than polluting a generic analysis with target-specific code.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111500/new/
https://reviews.llvm.org/D111500
More information about the llvm-commits
mailing list