Skip to content

Commit cfa3a01

Browse files
vmaksimovladimirlaz
authored andcommitted
Apply more suggestions
Signed-off-by: Viktoria Maksimova <[email protected]>
1 parent 1fa323d commit cfa3a01

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm-spirv/lib/SPIRV/SPIRVReader.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -795,14 +795,15 @@ void SPIRVToLLVM::setLLVMLoopMetadata(const LoopInstType *LM,
795795
"Missing loop control parameter!");
796796
}
797797
if (LC & LoopControlLoopCoalesceINTEL) {
798-
if (LoopControlParameters.size()) {
798+
// If LoopCoalesce has no parameters
799+
if (LoopControlParameters.empty()) {
800+
Metadata.push_back(llvm::MDNode::get(
801+
*Context, getMetadataFromName("llvm.loop.coalesce.enable")));
802+
} else {
799803
Metadata.push_back(llvm::MDNode::get(
800804
*Context,
801805
getMetadataFromNameAndParameter("llvm.loop.coalesce.count",
802806
LoopControlParameters[NumParam++])));
803-
} else { // If LoopCoalesce has no parameters
804-
Metadata.push_back(llvm::MDNode::get(
805-
*Context, getMetadataFromName("llvm.loop.coalesce.enable")));
806807
}
807808
assert(NumParam <= LoopControlParameters.size() &&
808809
"Missing loop control parameter!");

0 commit comments

Comments
 (0)