From fc5040103f2a957d13df76f6169ed5a0ad669aa9 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 25 Jul 2018 03:08:35 +0000 Subject: [PATCH] [RegisterBankInfo] Ignore InstrMappings that create impossible to repair operands Summary: This is a follow-up to r303043. In computeMapping(), we need to disqualify an InstrMapping if it would be impossible to repair one of the registers in the instruction to match the mapping. This change is needed in order to be able to define an instruction mapping for G_SELECT for the AMDGPU target and will be tested by test/CodeGen/AMDGPU/GlobalISel/regbankselect-select.mir Reviewers: ab, qcolombet, t.p.northover, dsanders Reviewed By: qcolombet Subscribers: tpr, llvm-commits Differential Revision: https://reviews.llvm.org/D49735 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337882 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/GlobalISel/RegBankSelect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/lib/CodeGen/GlobalISel/RegBankSelect.cpp index 79fa888357d..9e2d48d1dc4 100644 --- a/lib/CodeGen/GlobalISel/RegBankSelect.cpp +++ b/lib/CodeGen/GlobalISel/RegBankSelect.cpp @@ -475,7 +475,7 @@ RegBankSelect::MappingCost RegBankSelect::computeMapping( // This is an impossible to repair cost. if (RepairCost == std::numeric_limits::max()) - continue; + return MappingCost::ImpossibleCost(); // Bias used for splitting: 5%. const uint64_t PercentageForBias = 5; -- 2.11.0