From 179757ef054baabf09053b189ee4f9ea4e0e3c7f 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 llvm-svn: 337882 --- llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp index 79fa888..9e2d48d 100644 --- a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp +++ b/llvm/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.7.4