From 344a3780b2e33f6ca763666c380202b18aab72a3 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 29 Jul 2021 22:15:26 +0200 Subject: Vendor import of llvm-project main 88e66fa60ae5, the last commit before the upstream release/13.x branch was created. --- llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp') diff --git a/llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp b/llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp index 3101820d476e..04b69c66bc0d 100644 --- a/llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp +++ b/llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp @@ -716,10 +716,11 @@ void MipsRegisterBankInfo::setRegBank(MachineInstr &MI, static void combineAwayG_UNMERGE_VALUES(LegalizationArtifactCombiner &ArtCombiner, - MachineInstr &MI, GISelChangeObserver &Observer) { + GUnmerge &MI, GISelChangeObserver &Observer) { SmallVector UpdatedDefs; SmallVector DeadInstrs; - ArtCombiner.tryCombineUnmergeValues(MI, DeadInstrs, UpdatedDefs, Observer); + ArtCombiner.tryCombineUnmergeValues(MI, DeadInstrs, + UpdatedDefs, Observer); for (MachineInstr *DeadMI : DeadInstrs) DeadMI->eraseFromParent(); } @@ -750,8 +751,8 @@ void MipsRegisterBankInfo::applyMappingImpl( // This is new G_UNMERGE that was created during narrowScalar and will // not be considered for regbank selection. RegBankSelect for mips // visits/makes corresponding G_MERGE first. Combine them here. - if (NewMI->getOpcode() == TargetOpcode::G_UNMERGE_VALUES) - combineAwayG_UNMERGE_VALUES(ArtCombiner, *NewMI, NewInstrObserver); + if (auto *Unmerge = dyn_cast(NewMI)) + combineAwayG_UNMERGE_VALUES(ArtCombiner, *Unmerge, NewInstrObserver); // This G_MERGE will be combined away when its corresponding G_UNMERGE // gets regBankSelected. else if (NewMI->getOpcode() == TargetOpcode::G_MERGE_VALUES) @@ -763,7 +764,8 @@ void MipsRegisterBankInfo::applyMappingImpl( return; } case TargetOpcode::G_UNMERGE_VALUES: - combineAwayG_UNMERGE_VALUES(ArtCombiner, MI, NewInstrObserver); + combineAwayG_UNMERGE_VALUES(ArtCombiner, cast(MI), + NewInstrObserver); return; default: break; -- cgit v1.3