Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Handle more cases
  • Loading branch information
jakobbotsch committed Nov 6, 2023
commit 2d2d2a994abaf274c636c00dcbac69b8bf58df9b
9 changes: 6 additions & 3 deletions src/coreclr/jit/valuenum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7810,10 +7810,13 @@ ValueNum ValueNumStore::EvalHWIntrinsicFunBinary(var_types type,

assert((TypeOfVN(arg0VN) == type) && (TypeOfVN(arg1VN) == TYP_SIMD8));

// Handle x * 1 => x, but only if the scalar RHS is 1.
if (arg1VN == VNOneForSimdType(TYP_SIMD8, baseType))
// Handle x * 1 => x, but only if the scalar RHS is <1, ...>.
if (IsVNConstant(arg1VN))
{
return arg0VN;
if (EvaluateSimdGetElement(this, TYP_SIMD8, baseType, arg1VN, 0) == VNOneForType(baseType))
{
return arg0VN;
}
}
break;
}
Expand Down