Skip to content

Commit fcd42b1

Browse files
committed
[NFC] Code cleanup revealed by self-build.
1 parent f126512 commit fcd42b1

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

llvm-spirv/lib/SPIRV/SPIRVToOCL.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,7 @@ llvm::createSPIRVBIsLoweringPass(Module &M,
537537
case SPIRV::BIsRepresentation::SPIRVFriendlyIR:
538538
// nothing to do, already done
539539
return nullptr;
540-
default:
541-
llvm_unreachable("Unsupported built-ins representation");
542-
return nullptr;
543540
}
541+
llvm_unreachable("Unsupported built-ins representation");
542+
return nullptr;
544543
}

llvm-spirv/lib/SPIRV/SPIRVToOCL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class SPIRVToOCL : public ModulePass, public InstVisitor<SPIRVToOCL> {
5151
SPIRVToOCL(char &ID) : ModulePass(ID), M(nullptr), Ctx(nullptr) {}
5252

5353
public:
54-
virtual bool runOnModule(Module &M) = 0;
54+
virtual bool runOnModule(Module &M) override = 0;
5555

5656
void visitCallInst(CallInst &CI);
5757

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,12 +2529,14 @@ SPIRVValue *LLVMToSPIRV::transIntrinsicInst(IntrinsicInst *II,
25292529
MemSetInst *MSI = cast<MemSetInst>(II);
25302530
Value *Val = MSI->getValue();
25312531
if (!isa<Constant>(Val)) {
2532-
assert(!"Can't translate llvm.memset with non-const `value` argument");
2532+
assert(false &&
2533+
"Can't translate llvm.memset with non-const `value` argument");
25332534
return nullptr;
25342535
}
25352536
Value *Len = MSI->getLength();
25362537
if (!isa<ConstantInt>(Len)) {
2537-
assert(!"Can't translate llvm.memset with non-const `length` argument");
2538+
assert(false &&
2539+
"Can't translate llvm.memset with non-const `length` argument");
25382540
return nullptr;
25392541
}
25402542
uint64_t NumElements = static_cast<ConstantInt *>(Len)->getZExtValue();

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVModule.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,9 @@ class SPIRVModule {
504504
return SPIRVEIS_Debug;
505505
case DebugInfoEIS::OpenCL_DebugInfo_100:
506506
return SPIRVEIS_OpenCL_DebugInfo_100;
507-
default:
508-
assert(false && "Unexpected debug info EIS!");
509-
return SPIRVEIS_Debug;
510507
}
508+
assert(false && "Unexpected debug info EIS!");
509+
return SPIRVEIS_Debug;
511510
}
512511

513512
BIsRepresentation getDesiredBIsRepresentation() const {

llvm/lib/SYCLLowerIR/LowerESIMD.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,6 @@ static void createESIMDIntrinsicArgs(const ESIMDIntrinDesc &Desc,
976976
GenXArgs.push_back(llvm::ConstantInt::get(Ty, Rule.I.ArgConst));
977977
break;
978978
}
979-
default:
980-
llvm_unreachable_internal("unknown argument rule kind");
981979
}
982980
}
983981
}

0 commit comments

Comments
 (0)