[all-commits] [llvm/llvm-project] 9a5b0f: Reapply "[InstCombine] Match scalable splats in m_...
Luke Lau via All-commits
all-commits at lists.llvm.org
Thu Apr 3 10:03:37 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9a5b0f302be2ce155d5a4a0f0ca998ecb9bca497
https://github.com/llvm/llvm-project/commit/9a5b0f302be2ce155d5a4a0f0ca998ecb9bca497
Author: Luke Lau <luke at igalia.com>
Date: 2025-04-03 (Thu, 03 Apr 2025)
Changed paths:
M llvm/include/llvm/IR/PatternMatch.h
M llvm/test/Transforms/InstCombine/select.ll
M llvm/test/Transforms/InstCombine/shl-bo.ll
M llvm/test/Transforms/InstCombine/shl-twice-constant.ll
M llvm/test/Transforms/InstCombine/sub.ll
M llvm/test/Transforms/InstSimplify/vec-icmp-of-cast.ll
Log Message:
-----------
Reapply "[InstCombine] Match scalable splats in m_ImmConstant (#132522)" (#134262)
This reapplies #132522.
Previously casts of scalable m_ImmConstant splats weren't being folded
by ConstantFoldCastOperand, triggering the "Constant-fold of ImmConstant
should not fail" assertion.
There are no changes to the code in this PR, instead we just needed
#133207 to land first.
A test has been added for the assertion in
llvm/test/Transforms/InstSimplify/vec-icmp-of-cast.ll
@icmp_ult_sext_scalable_splat_is_true.
<hr/>
#118806 fixed an infinite loop in FoldShiftByConstant that could occur
when the shift amount was a ConstantExpr.
However this meant that FoldShiftByConstant no longer kicked in for
scalable vectors because scalable splats are represented by
ConstantExprs.
This fixes it by allowing scalable splats of non-ConstantExprs in
m_ImmConstant, which also fixes a few other test cases where scalable
splats were being missed.
But I'm also hoping that UseConstantIntForScalableSplat will eventually
remove the need for this.
I noticed this when trying to reverse a combine on RISC-V in #132245,
and saw that the resulting vector and scalar forms were different.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list