Skip to content

Commit

Permalink
Fix asserts that were always true due to a missed neg. (#44095)
Browse files Browse the repository at this point in the history
* Fix asserts that were always true due to missed neg.

* Ensure we don't assert for HWIntrinsics that already had the imm operand marked contained

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
  • Loading branch information
Sergey Andreenko and tannergooding committed Nov 3, 2020
1 parent 8fc05ec commit 2eb63c2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/coreclr/src/gc/gchandletable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ IGCHandleStore* GCHandleManager::CreateHandleStore()

return store;
#else
assert("CreateHandleStore is not implemented when FEATURE_REDHAWK is defined!");
assert(!"CreateHandleStore is not implemented when FEATURE_REDHAWK is defined!");
return nullptr;
#endif
}
Expand Down
24 changes: 22 additions & 2 deletions src/coreclr/src/jit/lowerxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5464,9 +5464,29 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node)
break;
}

case NI_SSE2_ShiftLeftLogical128BitLane:
case NI_SSE2_ShiftRightLogical128BitLane:
case NI_AVX2_ShiftLeftLogical128BitLane:
case NI_AVX2_ShiftRightLogical128BitLane:
{
#if DEBUG
// These intrinsics should have been marked contained by the general-purpose handling earlier in the method.

GenTree* lastOp = HWIntrinsicInfo::lookupLastOp(node);
assert(lastOp != nullptr);

if (HWIntrinsicInfo::isImmOp(intrinsicId, lastOp) && lastOp->IsCnsIntOrI())
{
assert(lastOp->isContained());
}
#endif

break;
}

default:
{
assert("Unhandled containment for binary hardware intrinsic with immediate operand");
assert(!"Unhandled containment for binary hardware intrinsic with immediate operand");
break;
}
}
Expand Down Expand Up @@ -5643,7 +5663,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node)

default:
{
assert("Unhandled containment for ternary hardware intrinsic with immediate operand");
assert(!"Unhandled containment for ternary hardware intrinsic with immediate operand");
break;
}
}
Expand Down

0 comments on commit 2eb63c2

Please sign in to comment.