Add shufflevector instruction to the expression graph post-dominated by trunc,
allowing TruncInstCombine to reduce bitwidth of expressions containing these
instructions.
Fixes #54149
Paths
| Differential D122233
[AggressiveInstCombine] Add `shufflevector` instr support to `TruncInstCombine` AbandonedPublic Authored by anton-afanasyev on Mar 22 2022, 8:05 AM.
Details
Summary Add shufflevector instruction to the expression graph post-dominated by trunc, Fixes #54149
Diff Detail
Unit TestsFailed
Event TimelineComment Actions
I don't see this could be an issue. For instance, @unary_shuffle() test-case contains shuffle with undef (line 25). Do you mean this case? Comment Actions
I mean, what if we have a two-input shuffle, and one of the operands is unused as per the shuffle mask. Comment Actions This might introduce regressions as the shuffle costs for the same mask but different element types can vary considerably (SSE v4i32/v4i16 unary shuffles are really cheap but v4i8 or v4i64 can be a lot more expensive). Comment Actions
Do you mean using TTI.getShuffleCost()? There's an issue here: we don't know the exact shuffle type at the moment we need to get its cost. We infer this type (given by MinBitWidth) after the expression graph has been built already. Need to refactor whole pass for this case, which looks redundant.
Revision Contents
Diff 417301 llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
llvm/test/Transforms/AggressiveInstCombine/trunc_vector_instrs.ll
|