[PATCH] D33144: [RegisterBankInfo] Remove overly-agressive asserts

Tom Stellard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 11:49:05 PDT 2017


tstellar created this revision.
Herald added a subscriber: tpr.

We were asserting in RegisterBankInfo if RBI.copyCost() returns
UINT_MAX.  This is OK for RegBankSelect::Mode::Fast since we only
try one instruction mapping and can't recover from this, but for
RegBankSelect::Mode::Greedy we will be considering multiple
instruction mappings, so we can recover if we see a UNIT_MAX copy
cost.

The copy cost for one pair of register banks in the AMDGPU backend
will be UNIT_MAX, so this patch will prevent AMDGPU tests from
breaking.


https://reviews.llvm.org/D33144

Files:
  lib/CodeGen/GlobalISel/RegBankSelect.cpp


Index: lib/CodeGen/GlobalISel/RegBankSelect.cpp
===================================================================
--- lib/CodeGen/GlobalISel/RegBankSelect.cpp
+++ lib/CodeGen/GlobalISel/RegBankSelect.cpp
@@ -204,12 +204,8 @@
     // TODO: use a dedicated constant for ImpossibleCost.
     if (Cost != UINT_MAX)
       return Cost;
-    assert(!TPC->isGlobalISelAbortEnabled() &&
-           "Legalization not available yet");
     // Return the legalization cost of that repairing.
   }
-  assert(!TPC->isGlobalISelAbortEnabled() &&
-         "Complex repairing not implemented yet");
   return UINT_MAX;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33144.98810.patch
Type: text/x-patch
Size: 612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170512/d0e1214f/attachment.bin>


More information about the llvm-commits mailing list