Skip to content

Commit

Permalink
Apply more suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaksimo authored and AlexeySotkin committed Mar 27, 2020
1 parent 4981d2f commit 8114d7f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/SPIRV/SPIRVReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,14 +795,15 @@ void SPIRVToLLVM::setLLVMLoopMetadata(const LoopInstType *LM,
"Missing loop control parameter!");
}
if (LC & LoopControlLoopCoalesceINTEL) {
if (LoopControlParameters.size()) {
// If LoopCoalesce has no parameters
if (LoopControlParameters.empty()) {
Metadata.push_back(llvm::MDNode::get(
*Context, getMetadataFromName("llvm.loop.coalesce.enable")));
} else {
Metadata.push_back(llvm::MDNode::get(
*Context,
getMetadataFromNameAndParameter("llvm.loop.coalesce.count",
LoopControlParameters[NumParam++])));
} else { // If LoopCoalesce has no parameters
Metadata.push_back(llvm::MDNode::get(
*Context, getMetadataFromName("llvm.loop.coalesce.enable")));
}
assert(NumParam <= LoopControlParameters.size() &&
"Missing loop control parameter!");
Expand Down

0 comments on commit 8114d7f

Please sign in to comment.