@@ -617,8 +617,8 @@ void GenXCoalescing::recordCandidates(FunctionGroup *FG)
617
617
}
618
618
}
619
619
} else if (isa<BitCastInst>(Inst) || isa<AddrSpaceCastInst>(Inst)) {
620
- IGC_ASSERT (!isa<StructType>(Inst->getType ()) && " not expecting bitcast to struct" );
621
- IGC_ASSERT (!isa<StructType>(Inst->getOperand (0 )->getType ()) && " not expecting bitcast from struct" );
620
+ IGC_ASSERT_MESSAGE (!isa<StructType>(Inst->getType ()), " not expecting bitcast to struct" );
621
+ IGC_ASSERT_MESSAGE (!isa<StructType>(Inst->getOperand (0 )->getType ()), " not expecting bitcast from struct" );
622
622
// The source and destination of a bitcast can copy coalesce,
623
623
// but only if it is not the case that the source is a phi and
624
624
// the destination has a use in a phi node in the same block and
@@ -1138,10 +1138,10 @@ void GenXCoalescing::processPhiCopy(PHINode *Phi, unsigned Inc,
1138
1138
Value *Incoming = Phi->getIncomingValue (Inc);
1139
1139
auto *IncomingBlock = Phi->getIncomingBlock (Inc);
1140
1140
// Should be checked in analysePhiCopies
1141
- IGC_ASSERT (DestLR->getCategory () < RegCategory::NUMREALCATEGORIES &&
1142
- " Should be checked earlier!" );
1143
- IGC_ASSERT (!isa<UndefValue>(Incoming) && " Should be checked earlier!" );
1144
- IGC_ASSERT (!isa<Constant>(Incoming) && " Should be checked earlier!" );
1141
+ IGC_ASSERT_MESSAGE (DestLR->getCategory () < RegCategory::NUMREALCATEGORIES,
1142
+ " Should be checked earlier!" );
1143
+ IGC_ASSERT_MESSAGE (!isa<UndefValue>(Incoming), " Should be checked earlier!" );
1144
+ IGC_ASSERT_MESSAGE (!isa<Constant>(Incoming), " Should be checked earlier!" );
1145
1145
// Check it again: something could change
1146
1146
if (Liveness->getLiveRange (Incoming) == DestLR) {
1147
1147
LLVM_DEBUG (dbgs () << " Already coalesced " << Incoming->getName () << " -> "
@@ -1167,8 +1167,8 @@ void GenXCoalescing::processPhiCopy(PHINode *Phi, unsigned Inc,
1167
1167
if (auto *I = dyn_cast<Instruction>(Incoming)) {
1168
1168
// This should not happen for good BBs (not join blocks)
1169
1169
// if DFG is correct.
1170
- IGC_ASSERT (DomTree->dominates (I->getParent (), InsertPoint->getParent ()) &&
1171
- " Dominance corrupted!" );
1170
+ IGC_ASSERT_MESSAGE (DomTree->dominates (I->getParent (), InsertPoint->getParent ()),
1171
+ " Dominance corrupted!" );
1172
1172
}
1173
1173
1174
1174
// Store info for copy
@@ -1187,15 +1187,15 @@ void GenXCoalescing::processPhiBranchingJoinLabelCopy(
1187
1187
Value *Incoming = Phi->getIncomingValue (Inc);
1188
1188
auto *IncomingBlock = Phi->getIncomingBlock (Inc);
1189
1189
// Should be checked in analysePhiCopies
1190
- IGC_ASSERT (DestLR->getCategory () < RegCategory::NUMREALCATEGORIES &&
1191
- " Should be checked earlier!" );
1192
- IGC_ASSERT (!isa<UndefValue>(Incoming) && " Should be checked earlier!" );
1193
- IGC_ASSERT (!isa<Constant>(Incoming) && " Should be checked earlier!" );
1190
+ IGC_ASSERT_MESSAGE (DestLR->getCategory () < RegCategory::NUMREALCATEGORIES,
1191
+ " Should be checked earlier!" );
1192
+ IGC_ASSERT_MESSAGE (!isa<UndefValue>(Incoming), " Should be checked earlier!" );
1193
+ IGC_ASSERT_MESSAGE (!isa<Constant>(Incoming), " Should be checked earlier!" );
1194
1194
// Should be checked in processPhiCopy
1195
- IGC_ASSERT (Liveness->getLiveRange (Incoming) != DestLR &&
1196
- " Should be checked earlier!" );
1197
- IGC_ASSERT (GotoJoin::isBranchingJoinLabelBlock (IncomingBlock) &&
1198
- " Should be checked earlier!" );
1195
+ IGC_ASSERT_MESSAGE (Liveness->getLiveRange (Incoming) != DestLR,
1196
+ " Should be checked earlier!" );
1197
+ IGC_ASSERT_MESSAGE (GotoJoin::isBranchingJoinLabelBlock (IncomingBlock),
1198
+ " Should be checked earlier!" );
1199
1199
1200
1200
LLVM_DEBUG (dbgs () << " Handling branching join label block case\n " );
1201
1201
@@ -1214,7 +1214,7 @@ void GenXCoalescing::processPhiBranchingJoinLabelCopy(
1214
1214
// This situation is detected via corrupted dominance.
1215
1215
if (!DomTree->dominates (PhiPred->getParent (), InsertPoint->getParent ())) {
1216
1216
auto *PhiCopy = copyNonCoalescedPhi (PhiPred, Phi);
1217
- IGC_ASSERT (PhiCopy && " Invalid phi copy!" );
1217
+ IGC_ASSERT_MESSAGE (PhiCopy, " Invalid phi copy!" );
1218
1218
Phis.push_back (PhiCopy);
1219
1219
return ;
1220
1220
}
@@ -1227,8 +1227,8 @@ void GenXCoalescing::processPhiBranchingJoinLabelCopy(
1227
1227
// For join block, def must be somewhere before it
1228
1228
// because of SIMD CF Conformance. Case for Phi is
1229
1229
// described and handled above.
1230
- IGC_ASSERT (DomTree->dominates (I->getParent (), InsertPoint->getParent ()) &&
1231
- " Dominance corrupted!" );
1230
+ IGC_ASSERT_MESSAGE (DomTree->dominates (I->getParent (), InsertPoint->getParent ()),
1231
+ " Dominance corrupted!" );
1232
1232
}
1233
1233
1234
1234
// Store info for copy
@@ -1306,8 +1306,8 @@ void GenXCoalescing::processCalls(FunctionGroup *FG)
1306
1306
for (unsigned StructIdx = 0 ,
1307
1307
se = IndexFlattener::getNumElements (Arg->getType ());
1308
1308
StructIdx != se; ++StructIdx) {
1309
- IGC_ASSERT (!StructIdx &&
1310
- " coalesce failure on struct call arg not tested" );
1309
+ IGC_ASSERT_MESSAGE (!StructIdx,
1310
+ " coalesce failure on struct call arg not tested" );
1311
1311
auto FuncArgSV = SimpleValue (Arg, StructIdx);
1312
1312
auto CallArgSV = SimpleValue (CallArg, StructIdx);
1313
1313
// See if they are coalesced.
@@ -1960,8 +1960,8 @@ Iter GenXCoalescing::mergeCopiesTillFailed(SimpleValue CopySV, Iter BeginIt,
1960
1960
if (It->Source .getValue ()->getType () == CurrCopy->getType ()) {
1961
1961
*It->UseInDest = CurrCopy;
1962
1962
} else {
1963
- IGC_ASSERT (It->Source .getIndex () == 0 &&
1964
- " Must be non-aggregated type: should come from bitcast" );
1963
+ IGC_ASSERT_MESSAGE (It->Source .getIndex () == 0 ,
1964
+ " Must be non-aggregated type: should come from bitcast" );
1965
1965
IRBuilder<> Builder (CurrCopy->getNextNode ());
1966
1966
BCI = cast<BitCastInst>(Builder.CreateBitCast (
1967
1967
CurrCopy, It->Source .getValue ()->getType (), " red_copy_type_conv" ));
@@ -2033,7 +2033,7 @@ Instruction *GenXCoalescing::createCopy(const CopyData &CD) {
2033
2033
case PHICOPY:
2034
2034
case PHICOPY_BRANCHING_JP: {
2035
2035
PHINode *Phi = dyn_cast<PHINode>(CD.Dest .getValue ());
2036
- IGC_ASSERT (Phi && " Expected PHI" );
2036
+ IGC_ASSERT_MESSAGE (Phi, " Expected PHI" );
2037
2037
unsigned Num =
2038
2038
(CD.CopyT == PHICOPY)
2039
2039
? Numbering->getPhiNumber (
@@ -2072,7 +2072,7 @@ Instruction *GenXCoalescing::createCopy(const CopyData &CD) {
2072
2072
Liveness->rebuildLiveRange (DestLR);
2073
2073
}
2074
2074
2075
- IGC_ASSERT (NewCopy && " Bad copy" );
2075
+ IGC_ASSERT_MESSAGE (NewCopy, " Bad copy" );
2076
2076
2077
2077
return NewCopy;
2078
2078
}
0 commit comments