[PATCH] D29489: Optimize SETCC + VSEL of incompatible or illegal types

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 12:31:35 PST 2017


efriedma added a comment.

Type legalization for SIGN_EXTEND(SETCC) should do the right thing, as opposed to special-casing VSELECT(SETCC), because it's more general.  For example, consider the IR `sext(icmp <4 x i32>...)`.

Legalization should avoid scalarizing the inputs where possible; scalarization is the ultimate fallback when we can't figure out some other reasonable way to lower an operation, but it's never a good thing (both for compile-time and runtime performance).

Where it makes sense, we should improve our analysis of DAG nodes, rather than adding special cases; if an existing transform does the right thing given a higher-quality ComputeNumSignBits, it makes sense to fix ComputeNumSignBits rather than add more transforms.  We have a lot of existing transforms using ComputeNumSignBits, so it's better to make them all more powerful.

Does that make sense?


https://reviews.llvm.org/D29489





More information about the llvm-commits mailing list