[DAGCombiner][X86] Fold sra (sub AddC, (shl X, N1C)), N1C --> sext (sub...
[DAGCombiner][X86] Fold sra (sub AddC, (shl X, N1C)), N1C --> sext (sub AddC1',(trunc X to (width - N1C))) We already handled this case for add with a constant RHS. A similar pattern can occur for sub with a constant left hand side. Test cases use add and a mul representing (neg (shl X, C)) because that's what I saw in the wild. The mul will be decomposed and then the new transform can kick in. Tests have not been committed, but this patch shows the changes. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D128769
Loading
Please sign in to comment