Skip to content

Commit 75cee7e

Browse files
committed
* format
* enable diffs
1 parent 9f5f9f5 commit 75cee7e

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

src/coreclr/jit/ifconversion.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -637,20 +637,20 @@ bool OptIfConversionDsc::optIfConvert(int* pReachabilityBudget)
637637
}
638638
}
639639

640-
// We only produce float SELECTs for optimization into non-SELECTs, otherwise bail
641-
if (varTypeIsFloating(select))
642-
{
643-
return true;
644-
}
645-
646-
#ifdef TARGET_RISCV64
647640
if (select->OperIs(GT_SELECT))
648641
{
642+
#ifdef TARGET_RISCV64
649643
JITDUMP("Skipping if-conversion that could not be optimized to ordinary operations\n");
650644
return true;
651-
}
652645
#endif
653646

647+
// We only produce float SELECTs for optimization into non-SELECTs, otherwise bail
648+
if (varTypeIsFloating(select))
649+
{
650+
return true;
651+
}
652+
}
653+
654654
// Use the SELECT as the source of the Then STORE/RETURN.
655655
m_thenOperation.node->AddAllEffectsFlags(select);
656656
if (m_mainOper == GT_STORE_LCL_VAR)
@@ -976,22 +976,23 @@ GenTree* OptIfConversionDsc::TrySelectToCondOpLcl(GenTreeConditional* select)
976976
GenTree* OptIfConversionDsc::TrySelectToMinMax(GenTreeConditional* select)
977977
{
978978
#ifdef TARGET_XARCH
979-
GenTree* condInput = select->gtCond;
979+
GenTree* condInput = select->gtCond;
980980
GenTree* trueInput = select->gtOp1;
981981
GenTree* falseInput = select->gtOp2;
982-
983-
if (!varTypeIsFloating(select) || !varTypeIsFloating(condInput->gtGetOp1()) || !varTypeIsFloating(condInput->gtGetOp2()))
982+
983+
if (!varTypeIsFloating(select) || !varTypeIsFloating(condInput->gtGetOp1()) ||
984+
!varTypeIsFloating(condInput->gtGetOp2()))
984985
{
985986
return nullptr;
986987
}
987-
988+
988989
GenCondition cond = GenCondition::FromFloatRelop(condInput);
989990
if (cond.IsUnordered() || !cond.Is(GenCondition::Code::FLT, GenCondition::Code::FGT))
990991
{
991992
return nullptr;
992993
}
993994

994-
bool isMax = cond.Is(GenCondition::Code::FGT);
995+
bool isMax = cond.Is(GenCondition::Code::FGT);
995996
bool reversed = !GenTree::Compare(trueInput, condInput->gtGetOp1());
996997
if (reversed)
997998
{
@@ -1000,7 +1001,7 @@ GenTree* OptIfConversionDsc::TrySelectToMinMax(GenTreeConditional* select)
10001001
std::swap(trueInput, falseInput);
10011002
}
10021003

1003-
if (GenTree::Compare(trueInput, condInput->gtGetOp1()) &&
1004+
if (GenTree::Compare(trueInput, condInput->gtGetOp1()) &&
10041005
GenTree::Compare(falseInput, condInput->gtGetOp2()->gtEffectiveVal()))
10051006
{
10061007
return m_compiler->gtNewSimdMinMaxNativeNode(select->TypeGet(),

0 commit comments

Comments
 (0)