From bd173de8c0701db91ba6c1db4f39fe452003b5d7 Mon Sep 17 00:00:00 2001 From: Fred Chow Date: Tue, 12 Oct 2021 18:42:26 -0700 Subject: [PATCH 1/2] Fixed bug where it reads opndtype field for opcodes where this field contains garbage --- src/mapleall/maple_me/src/me_value_range_prop.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mapleall/maple_me/src/me_value_range_prop.cpp b/src/mapleall/maple_me/src/me_value_range_prop.cpp index ff139bed1d..06af321121 100644 --- a/src/mapleall/maple_me/src/me_value_range_prop.cpp +++ b/src/mapleall/maple_me/src/me_value_range_prop.cpp @@ -2879,7 +2879,11 @@ void ValueRangePropagation::DealWithOPNeOrEq( PrimType primType = opnd0->GetPrimType(); if (opMeExpr->GetNumOpnds() != 0) { opnd0 = opMeExpr->GetOpnd(0); - primType = opMeExpr->GetOpndType(); + if (kOpcodeInfo.IsTypeCvt(opMeExpr->GetOp()) || kOpcodeInfo.IsCompare(opMeExpr->GetOp())) { + primType = opMeExpr->GetOpndType(); + } else { + primType = opnd0->GetPrimType(); + } } if (leftRange == nullptr) { if (op == OP_eq) { @@ -3347,4 +3351,4 @@ bool MEValueRangePropagation::PhaseRun(maple::MeFunction &f) { } return true; } -} // namespace maple \ No newline at end of file +} // namespace maple -- Gitee From 6f5030321967969dc1da47a302038506b485edf2 Mon Sep 17 00:00:00 2001 From: Fred Chow Date: Tue, 12 Oct 2021 18:42:26 -0700 Subject: [PATCH 2/2] Fixed bug where it reads opndtype field for opcodes where this field contains garbage --- src/mapleall/maple_me/src/me_value_range_prop.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mapleall/maple_me/src/me_value_range_prop.cpp b/src/mapleall/maple_me/src/me_value_range_prop.cpp index a236b10aad..851652fc3d 100644 --- a/src/mapleall/maple_me/src/me_value_range_prop.cpp +++ b/src/mapleall/maple_me/src/me_value_range_prop.cpp @@ -2881,7 +2881,11 @@ void ValueRangePropagation::DealWithOPNeOrEq( PrimType primType = opnd0->GetPrimType(); if (opMeExpr->GetNumOpnds() != 0) { opnd0 = opMeExpr->GetOpnd(0); - primType = opMeExpr->GetOpndType(); + if (kOpcodeInfo.IsTypeCvt(opMeExpr->GetOp()) || kOpcodeInfo.IsCompare(opMeExpr->GetOp())) { + primType = opMeExpr->GetOpndType(); + } else { + primType = opnd0->GetPrimType(); + } } if (leftRange == nullptr) { if (op == OP_eq) { @@ -3349,4 +3353,4 @@ bool MEValueRangePropagation::PhaseRun(maple::MeFunction &f) { } return true; } -} // namespace maple \ No newline at end of file +} // namespace maple -- Gitee