[llvm] [DAG] SDPatternMatch m_Zero/m_One/m_AllOnes have inconsistent undef h… (PR #147044)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 7 03:52:07 PDT 2025
================
@@ -12569,6 +12569,18 @@ bool llvm::isAllOnesOrAllOnesSplat(SDValue N, bool AllowUndefs) {
return C && C->isAllOnes() && C->getValueSizeInBits(0) == BitWidth;
}
+bool llvm::isOnesOrOnesSplat(SDValue N, bool AllowUndefs) {
+ N = peekThroughBitcasts(N);
----------------
RKSimon wrote:
you can't peek through bitcast for isOnesOrOnesSplat - e.g. otherwise you could match a v4i32 <1,1,1,1> to a v2i64 type (which wouldn't be <1,1>).
https://github.com/llvm/llvm-project/pull/147044
More information about the llvm-commits
mailing list