Fix kinds of operands of HandleCmp dismatch

MachineType::ARCH is equal to MachineType::I32 on 32 bits platform and
MachineType::I64 on 64 bits platform

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I41dfc96c5dacc0b2108dc90730500f2bc51ecd24
This commit is contained in:
zhangyukun
2022-02-24 15:53:56 +08:00
parent 1f65e390c5
commit 5d393aeee1
2 changed files with 7 additions and 3 deletions
+2 -2
View File
@@ -1049,7 +1049,7 @@ DECLARE_ASM_HANDLER(SingleStepDebugging)
Label shouldReturn(env);
Label shouldContinue(env);
Branch(IntPtrEqual(ChangeTaggedPointerToInt64(*varPc), GetInt64Constant(0)), &shouldReturn, &shouldContinue);
Branch(IntPtrEqual(*varPc, GetIntPtrConstant(0)), &shouldReturn, &shouldContinue);
Bind(&shouldReturn);
{
Return();
@@ -3948,7 +3948,7 @@ DECLARE_ASM_HANDLER(ExceptionHandler)
GateRef exception = Load(StubMachineType::TAGGED, glue, GetIntPtrConstant(0));
StubDescriptor *upFrame = GET_STUBDESCRIPTOR(UpFrame);
varPc = CallRuntime(upFrame, glue, GetInt64Constant(FAST_STUB_ID(UpFrame)), { glue, sp });
Branch(IntPtrEqual(ChangeTaggedPointerToInt64(*varPc), GetInt64Constant(0)), &pcIsInvalid, &pcNotInvalid);
Branch(IntPtrEqual(*varPc, GetIntPtrConstant(0)), &pcIsInvalid, &pcNotInvalid);
Bind(&pcIsInvalid);
{
Return();
+5 -1
View File
@@ -1412,7 +1412,11 @@ void LLVMIRBuilder::VisitCmp(GateRef gate, GateRef e1, GateRef e2)
LLVMValueRef result = nullptr;
auto e1ValCode = circuit_->LoadGatePtrConst(e1)->GetMachineType();
[[maybe_unused]]auto e2ValCode = circuit_->LoadGatePtrConst(e2)->GetMachineType();
ASSERT(e1ValCode == e2ValCode);
ASSERT((e1ValCode == e2ValCode) ||
(compCfg_->Is32Bit() && (e1ValCode == MachineType::ARCH) && (e2ValCode == MachineType::I32)) ||
(compCfg_->Is64Bit() && (e1ValCode == MachineType::ARCH) && (e2ValCode == MachineType::I64)) ||
(compCfg_->Is32Bit() && (e2ValCode == MachineType::ARCH) && (e1ValCode == MachineType::I32)) ||
(compCfg_->Is64Bit() && (e2ValCode == MachineType::ARCH) && (e1ValCode == MachineType::I64)));
LLVMIntPredicate intOpcode = LLVMIntEQ;
LLVMRealPredicate realOpcode = LLVMRealPredicateFalse;
switch (circuit_->GetOpCode(gate)) {