[PATCH] D49735: [RegisterBankInfo] Ignore InstrMappings that create impossible to repair operands

Tom Stellard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 24 08:11:00 PDT 2018


tstellar created this revision.
tstellar added reviewers: ab, qcolombet, t.p.northover, dsanders.
Herald added a subscriber: tpr.

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


Repository:
  rL LLVM

https://reviews.llvm.org/D49735

Files:
  lib/CodeGen/GlobalISel/RegBankSelect.cpp


Index: lib/CodeGen/GlobalISel/RegBankSelect.cpp
===================================================================
--- lib/CodeGen/GlobalISel/RegBankSelect.cpp
+++ lib/CodeGen/GlobalISel/RegBankSelect.cpp
@@ -475,7 +475,7 @@
 
     // This is an impossible to repair cost.
     if (RepairCost == std::numeric_limits<unsigned>::max())
-      continue;
+      return MappingCost::ImpossibleCost();
 
     // Bias used for splitting: 5%.
     const uint64_t PercentageForBias = 5;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49735.157041.patch
Type: text/x-patch
Size: 479 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180724/42a603b2/attachment.bin>


More information about the llvm-commits mailing list