Hi,
Please find the latest report on new defect(s) introduced to llvm found with Coverity Scan.
333 new defect(s) introduced to llvm found with Coverity Scan.
384 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 20 of 333 defect(s)
** CID 1522231: Performance inefficiencies (AUTO_CAUSES_COPY)
/mlir/lib/Dialect/IRDL/IRDLLoading.cpp: 80 in getSegmentSizesFromAttr(mlir::Operation *, llvm::StringRef, llvm::StringRef, unsigned int, llvm::ArrayRefmlir::irdl::Variadicity, llvm::SmallVectorImpl &)()
*** CID 1522231: Performance inefficiencies (AUTO_CAUSES_COPY)
/mlir/lib/Dialect/IRDL/IRDLLoading.cpp: 80 in getSegmentSizesFromAttr(mlir::Operation *, llvm::StringRef, llvm::StringRef, unsigned int, llvm::ArrayRefmlir::irdl::Variadicity, llvm::SmallVectorImpl &)()
74 << elemName << " segments must have "
75 << variadicities.size() << " elements, but got "
76 << denseSegmentSizes.size();
77 }
78
79 // Check that the segment sizes are corresponding to the given variadicities,
CID 1522231: Performance inefficiencies (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type enumerator_result.
80 for (auto [i, segmentSize, variadicity] :
81 enumerate(denseSegmentSizes.asArrayRef(), variadicities)) {
82 if (segmentSize < 0)
83 return op->emitError()
84 << “'” << attrName << “’ attribute for specifying " << elemName
85 << " segments must have non-negative values”;
** CID 1522230: (AUTO_CAUSES_COPY)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.cpp.inc: 7846 in mlir::NVVM::MBarrierTryWaitParitySharedOp::verifyInvariantsImpl()()
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.cpp.inc: 7852 in mlir::NVVM::MBarrierTryWaitParitySharedOp::verifyInvariantsImpl()()
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.cpp.inc: 7840 in mlir::NVVM::MBarrierTryWaitParitySharedOp::verifyInvariantsImpl()()
*** CID 1522230: (AUTO_CAUSES_COPY)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.cpp.inc: 7846 in mlir::NVVM::MBarrierTryWaitParitySharedOp::verifyInvariantsImpl()()
7840 for (auto v : valueGroup0) {
7841 if (::mlir::failed(__mlir_ods_local_type_constraint_NVVMOps1(*this, v.getType(), “operand”, index++)))
7842 return ::mlir::failure();
7843 }
7844 auto valueGroup1 = getODSOperands(1);
7845
CID 1522230: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type Value.
7846 for (auto v : valueGroup1) {
7847 if (::mlir::failed(__mlir_ods_local_type_constraint_NVVMOps3(*this, v.getType(), “operand”, index++)))
7848 return ::mlir::failure();
7849 }
7850 auto valueGroup2 = getODSOperands(2);
7851
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.cpp.inc: 7852 in mlir::NVVM::MBarrierTryWaitParitySharedOp::verifyInvariantsImpl()()
7846 for (auto v : valueGroup1) {
7847 if (::mlir::failed(__mlir_ods_local_type_constraint_NVVMOps3(*this, v.getType(), “operand”, index++)))
7848 return ::mlir::failure();
7849 }
7850 auto valueGroup2 = getODSOperands(2);
7851
CID 1522230: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type Value.
7852 for (auto v : valueGroup2) {
7853 if (::mlir::failed(__mlir_ods_local_type_constraint_NVVMOps3(*this, v.getType(), “operand”, index++)))
7854 return ::mlir::failure();
7855 }
7856 }
7857 return ::mlir::success();
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.cpp.inc: 7840 in mlir::NVVM::MBarrierTryWaitParitySharedOp::verifyInvariantsImpl()()
7834
7835 ::mlir::LogicalResult MBarrierTryWaitParitySharedOp::verifyInvariantsImpl() {
7836 {
7837 unsigned index = 0; (void)index;
7838 auto valueGroup0 = getODSOperands(0);
7839
CID 1522230: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type Value.
7840 for (auto v : valueGroup0) {
7841 if (::mlir::failed(__mlir_ods_local_type_constraint_NVVMOps1(*this, v.getType(), “operand”, index++)))
7842 return ::mlir::failure();
7843 }
7844 auto valueGroup1 = getODSOperands(1);
7845
** CID 1522229: (AUTO_CAUSES_COPY)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.cpp.inc: 20449 in mlir::linalg::MaxOp::verifyInvariantsImpl()()
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.cpp.inc: 20458 in mlir::linalg::MaxOp::verifyInvariantsImpl()()
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.cpp.inc: 20443 in mlir::linalg::MaxOp::verifyInvariantsImpl()()
*** CID 1522229: (AUTO_CAUSES_COPY)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.cpp.inc: 20449 in mlir::linalg::MaxOp::verifyInvariantsImpl()()
20443 for (auto v : valueGroup0) {
20444 if (::mlir::failed(__mlir_ods_local_type_constraint_LinalgStructuredOps0(*this, v.getType(), “operand”, index++)))
20445 return ::mlir::failure();
20446 }
20447 auto valueGroup1 = getODSOperands(1);
20448
CID 1522229: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type Value.
20449 for (auto v : valueGroup1) {
20450 if (::mlir::failed(__mlir_ods_local_type_constraint_LinalgStructuredOps1(*this, v.getType(), “operand”, index++)))
20451 return ::mlir::failure();
20452 }
20453 }
20454 {
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.cpp.inc: 20458 in mlir::linalg::MaxOp::verifyInvariantsImpl()()
20452 }
20453 }
20454 {
20455 unsigned index = 0; (void)index;
20456 auto valueGroup0 = getODSResults(0);
20457
CID 1522229: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type OpResult.
20458 for (auto v : valueGroup0) {
20459 if (::mlir::failed(__mlir_ods_local_type_constraint_LinalgStructuredOps2(*this, v.getType(), “result”, index++)))
20460 return ::mlir::failure();
20461 }
20462 }
20463 {
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.cpp.inc: 20443 in mlir::linalg::MaxOp::verifyInvariantsImpl()()
20437
20438 ::mlir::LogicalResult MaxOp::verifyInvariantsImpl() {
20439 {
20440 unsigned index = 0; (void)index;
20441 auto valueGroup0 = getODSOperands(0);
20442
CID 1522229: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type Value.
20443 for (auto v : valueGroup0) {
20444 if (::mlir::failed(__mlir_ods_local_type_constraint_LinalgStructuredOps0(*this, v.getType(), “operand”, index++)))
20445 return ::mlir::failure();
20446 }
20447 auto valueGroup1 = getODSOperands(1);
20448
** CID 1522228: Uninitialized members (UNINIT_CTOR)
/llvm/utils/TableGen/GlobalISelMatchTable.h: 2219 in llvm::gi::ReplaceRegAction::ReplaceRegAction(unsigned int, unsigned int, unsigned int)()
*** CID 1522228: Uninitialized members (UNINIT_CTOR)
/llvm/utils/TableGen/GlobalISelMatchTable.h: 2219 in llvm::gi::ReplaceRegAction::ReplaceRegAction(unsigned int, unsigned int, unsigned int)()
2213 unsigned NewOpIdx)
2214 : MatchAction(AK_EraseInst), OldInsnID(OldInsnID), OldOpIdx(OldOpIdx),
2215 NewInsnId(NewInsnId), NewOpIdx(NewOpIdx) {}
2216
2217 ReplaceRegAction(unsigned OldInsnID, unsigned OldOpIdx, unsigned TempRegID)
2218 : MatchAction(AK_EraseInst), OldInsnID(OldInsnID), OldOpIdx(OldOpIdx),
CID 1522228: Uninitialized members (UNINIT_CTOR) Non-static class member "NewOpIdx" is not initialized in this constructor nor in any functions that it calls.
2219 TempRegID(TempRegID) {}
2220
2221 static bool classof(const MatchAction *A) {
2222 return A->getKind() == AK_ReplaceReg;
2223 }
2224
** CID 1522227: Performance inefficiencies (PASS_BY_VALUE)
/clang/include/clang/ExtractAPI/API.h: 925 in clang::extractapi::CXXClassRecord::CXXClassRecord(llvm::StringRef, llvm::StringRef, clang::PresumedLoc, clang::extractapi::AvailabilitySet, const std::vector<clang::RawComment::CommentLine, std::allocatorclang::RawComment::CommentLine> &, clang::extractapi::DeclarationFragments, clang::extractapi::DeclarationFragments, clang::extractapi::APIRecord::RecordKind, clang::extractapi::AccessControl, bool)()
*** CID 1522227: Performance inefficiencies (PASS_BY_VALUE)
/clang/include/clang/ExtractAPI/API.h: 925 in clang::extractapi::CXXClassRecord::CXXClassRecord(llvm::StringRef, llvm::StringRef, clang::PresumedLoc, clang::extractapi::AvailabilitySet, const std::vector<clang::RawComment::CommentLine, std::allocatorclang::RawComment::CommentLine> &, clang::extractapi::DeclarationFragments, clang::extractapi::DeclarationFragments, clang::extractapi::APIRecord::RecordKind, clang::extractapi::AccessControl, bool)()
919 SmallVector<std::unique_ptr> Fields;
920 SmallVector<std::unique_ptr> Methods;
921 SmallVector Bases;
922 AccessControl Access;
923
924 CXXClassRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
CID 1522227: Performance inefficiencies (PASS_BY_VALUE) Passing parameter Availabilities of type "clang::extractapi::AvailabilitySet" (size 376 bytes) by value, which exceeds the medium threshold of 256 bytes.
925 AvailabilitySet Availabilities, const DocComment &Comment,
926 DeclarationFragments Declaration,
927 DeclarationFragments SubHeading, RecordKind Kind,
928 AccessControl Access, bool IsFromSystemHeader)
929 : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities),
930 LinkageInfo::none(), Comment, Declaration, SubHeading,
** CID 1522226: Uninitialized members (UNINIT_CTOR)
/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h: 149 in llvm::codeview::JumpTableSym::JumpTableSym(llvm::codeview::SymbolRecordKind)()
*** CID 1522226: Uninitialized members (UNINIT_CTOR)
/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h: 149 in llvm::codeview::JumpTableSym::JumpTableSym(llvm::codeview::SymbolRecordKind)()
143
144 uint32_t RecordOffset = 0;
145 };
146
147 class JumpTableSym : public SymbolRecord {
148 public:
CID 1522226: Uninitialized members (UNINIT_CTOR) Non-static class member "SwitchType" is not initialized in this constructor nor in any functions that it calls.
149 explicit JumpTableSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
150 JumpTableSym(uint32_t RecordOffset)
151 : SymbolRecord(SymbolRecordKind::JumpTableSym),
152 RecordOffset(RecordOffset) {}
153
154 uint32_t BaseOffset = 0;
** CID 1522225: Performance inefficiencies (AUTO_CAUSES_COPY)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.cpp.inc: 2432 in mlir::NVVM::ClusterId::verifyInvariantsImpl()()
*** CID 1522225: Performance inefficiencies (AUTO_CAUSES_COPY)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.cpp.inc: 2432 in mlir::NVVM::ClusterId::verifyInvariantsImpl()()
2426
2427 ::mlir::LogicalResult ClusterId::verifyInvariantsImpl() {
2428 {
2429 unsigned index = 0; (void)index;
2430 auto valueGroup0 = getODSResults(0);
2431
CID 1522225: Performance inefficiencies (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type OpResult.
2432 for (auto v : valueGroup0) {
2433 if (::mlir::failed(__mlir_ods_local_type_constraint_NVVMOps0(*this, v.getType(), “result”, index++)))
2434 return ::mlir::failure();
2435 }
2436 }
2437 return ::mlir::success();
** CID 1522224: Uninitialized members (UNINIT_CTOR)
/llvm/tools/llvm-profgen/ProfileGenerator.h: 41 in llvm::sampleprof::ProfileGeneratorBase::ProfileGeneratorBase(llvm::sampleprof::ProfiledBinary *, const llvm::sampleprof::SampleProfileMap &&)()
*** CID 1522224: Uninitialized members (UNINIT_CTOR)
/llvm/tools/llvm-profgen/ProfileGenerator.h: 41 in llvm::sampleprof::ProfileGeneratorBase::ProfileGeneratorBase(llvm::sampleprof::ProfiledBinary *, const llvm::sampleprof::SampleProfileMap &&)()
35 ProfileGeneratorBase(ProfiledBinary *Binary) : Binary(Binary){};
36 ProfileGeneratorBase(ProfiledBinary *Binary,
37 const ContextSampleCounterMap *Counters)
38 : Binary(Binary), SampleCounters(Counters){};
39 ProfileGeneratorBase(ProfiledBinary *Binary,
40 const SampleProfileMap &&Profiles)
CID 1522224: Uninitialized members (UNINIT_CTOR) Non-static class member "ColdCountThreshold" is not initialized in this constructor nor in any functions that it calls.
41 : Binary(Binary), ProfileMap(std::move(Profiles)){};
42
43 virtual ~ProfileGeneratorBase() = default;
44 static std::unique_ptr
45 create(ProfiledBinary *Binary, const ContextSampleCounterMap *Counters,
46 bool profileIsCS);
** CID 1522223: (AUTO_CAUSES_COPY)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.cpp.inc: 5314 in mlir::arm_sme::LoadTileSliceOp::verifyInvariantsImpl()()
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.cpp.inc: 5323 in mlir::arm_sme::LoadTileSliceOp::verifyInvariantsImpl()()
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.cpp.inc: 5308 in mlir::arm_sme::LoadTileSliceOp::verifyInvariantsImpl()()
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.cpp.inc: 5302 in mlir::arm_sme::LoadTileSliceOp::verifyInvariantsImpl()()
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.cpp.inc: 5296 in mlir::arm_sme::LoadTileSliceOp::verifyInvariantsImpl()()
*** CID 1522223: (AUTO_CAUSES_COPY)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.cpp.inc: 5314 in mlir::arm_sme::LoadTileSliceOp::verifyInvariantsImpl()()
5308 for (auto v : valueGroup2) {
5309 if (::mlir::failed(__mlir_ods_local_type_constraint_ArmSME10(*this, v.getType(), “operand”, index++)))
5310 return ::mlir::failure();
5311 }
5312 auto valueGroup3 = getODSOperands(3);
5313
CID 1522223: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type Value.
5314 for (auto v : valueGroup3) {
5315 if (::mlir::failed(__mlir_ods_local_type_constraint_ArmSME10(*this, v.getType(), “operand”, index++)))
5316 return ::mlir::failure();
5317 }
5318 }
5319 {
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.cpp.inc: 5323 in mlir::arm_sme::LoadTileSliceOp::verifyInvariantsImpl()()
5317 }
5318 }
5319 {
5320 unsigned index = 0; (void)index;
5321 auto valueGroup0 = getODSResults(0);
5322
CID 1522223: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type OpResult.
5323 for (auto v : valueGroup0) {
5324 if (::mlir::failed(__mlir_ods_local_type_constraint_ArmSME1(*this, v.getType(), “result”, index++)))
5325 return ::mlir::failure();
5326 }
5327 }
5328 if (!((((*this->getODSOperands(1).begin()).getType()) == ((*this->getODSResults(0).begin()).getType()) && ((*this->getODSResults(0).begin()).getType()) == ((*this->getODSOperands(1).begin()).getType()))))
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.cpp.inc: 5308 in mlir::arm_sme::LoadTileSliceOp::verifyInvariantsImpl()()
5302 for (auto v : valueGroup1) {
5303 if (::mlir::failed(__mlir_ods_local_type_constraint_ArmSME1(*this, v.getType(), “operand”, index++)))
5304 return ::mlir::failure();
5305 }
5306 auto valueGroup2 = getODSOperands(2);
5307
CID 1522223: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type Value.
5308 for (auto v : valueGroup2) {
5309 if (::mlir::failed(__mlir_ods_local_type_constraint_ArmSME10(*this, v.getType(), “operand”, index++)))
5310 return ::mlir::failure();
5311 }
5312 auto valueGroup3 = getODSOperands(3);
5313
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.cpp.inc: 5302 in mlir::arm_sme::LoadTileSliceOp::verifyInvariantsImpl()()
5296 for (auto v : valueGroup0) {
5297 if (::mlir::failed(__mlir_ods_local_type_constraint_ArmSME9(*this, v.getType(), “operand”, index++)))
5298 return ::mlir::failure();
5299 }
5300 auto valueGroup1 = getODSOperands(1);
5301
CID 1522223: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type Value.
5302 for (auto v : valueGroup1) {
5303 if (::mlir::failed(__mlir_ods_local_type_constraint_ArmSME1(*this, v.getType(), “operand”, index++)))
5304 return ::mlir::failure();
5305 }
5306 auto valueGroup2 = getODSOperands(2);
5307
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.cpp.inc: 5296 in mlir::arm_sme::LoadTileSliceOp::verifyInvariantsImpl()()
5290
5291 ::mlir::LogicalResult LoadTileSliceOp::verifyInvariantsImpl() {
5292 {
5293 unsigned index = 0; (void)index;
5294 auto valueGroup0 = getODSOperands(0);
5295
CID 1522223: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type Value.
5296 for (auto v : valueGroup0) {
5297 if (::mlir::failed(__mlir_ods_local_type_constraint_ArmSME9(*this, v.getType(), “operand”, index++)))
5298 return ::mlir::failure();
5299 }
5300 auto valueGroup1 = getODSOperands(1);
5301
** CID 1522222: (AUTO_CAUSES_COPY)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.cpp.inc: 12039 in mlir::ROCDL::wmma_i32_16x16x16_iu8::verifyInvariantsImpl()()
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.cpp.inc: 12048 in mlir::ROCDL::wmma_i32_16x16x16_iu8::verifyInvariantsImpl()()
*** CID 1522222: (AUTO_CAUSES_COPY)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.cpp.inc: 12039 in mlir::ROCDL::wmma_i32_16x16x16_iu8::verifyInvariantsImpl()()
12033
12034 ::mlir::LogicalResult wmma_i32_16x16x16_iu8::verifyInvariantsImpl() {
12035 {
12036 unsigned index = 0; (void)index;
12037 auto valueGroup0 = getODSOperands(0);
12038
CID 1522222: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type Value.
12039 for (auto v : valueGroup0) {
12040 if (::mlir::failed(__mlir_ods_local_type_constraint_ROCDLOps0(*this, v.getType(), “operand”, index++)))
12041 return ::mlir::failure();
12042 }
12043 }
12044 {
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.cpp.inc: 12048 in mlir::ROCDL::wmma_i32_16x16x16_iu8::verifyInvariantsImpl()()
12042 }
12043 }
12044 {
12045 unsigned index = 0; (void)index;
12046 auto valueGroup0 = getODSResults(0);
12047
CID 1522222: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type OpResult.
12048 for (auto v : valueGroup0) {
12049 if (::mlir::failed(__mlir_ods_local_type_constraint_ROCDLOps0(*this, v.getType(), “result”, index++)))
12050 return ::mlir::failure();
12051 }
12052 }
12053 return ::mlir::success();
** CID 1522221: Memory - corruptions (ARRAY_VS_SINGLETON)
*** CID 1522221: Memory - corruptions (ARRAY_VS_SINGLETON)
/llvm/lib/Target/RISCV/RISCVISelLowering.cpp: 6717 in llvm::RISCVTargetLowering::lowerSELECT(llvm::SDValue, llvm::SelectionDAG &) const()
6711 if (Op.hasOneUse()) {
6712 unsigned UseOpc = Op->use_begin()->getOpcode();
6713 if (isBinOp(UseOpc) && DAG.isSafeToSpeculativelyExecute(UseOpc)) {
6714 SDNode *BinOp = *Op->use_begin();
6715 if (SDValue NewSel = foldBinOpIntoSelectIfProfitable(*Op->use_begin(),
6716 DAG, Subtarget)) {
CID 1522221: Memory - corruptions (ARRAY_VS_SINGLETON) Passing "&NewSel" to function "ReplaceAllUsesWith" which uses it as an array. This might corrupt or misinterpret adjacent memory locations.
6717 DAG.ReplaceAllUsesWith(BinOp, &NewSel);
6718 return lowerSELECT(NewSel, DAG);
6719 }
6720 }
6721 }
6722
** CID 1522220: (UNINIT)
/clang/include/clang/ExtractAPI/ExtractAPIVisitor.h: 192 in clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor>::getBases(const clang::CXXRecordDecl *)()
/clang/include/clang/ExtractAPI/ExtractAPIVisitor.h: 192 in clang::extractapi::impl::ExtractAPIVisitorBase<::LibClangExtractAPIVisitor>::getBases(const clang::CXXRecordDecl *)()
/clang/include/clang/ExtractAPI/ExtractAPIVisitor.h: 192 in clang::extractapi::impl::ExtractAPIVisitorBase<::BatchExtractAPIVisitor>::getBases(const clang::CXXRecordDecl *)()
*** CID 1522220: (UNINIT)
/clang/include/clang/ExtractAPI/ExtractAPIVisitor.h: 192 in clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor>::getBases(const clang::CXXRecordDecl *)()
186 BaseSpecifier.getType().getTypePtr()->getAsCXXRecordDecl();
187 BaseClass.Name = BaseClassDecl->getName();
188 BaseClass.USR = API.recordUSR(BaseClassDecl);
189 }
190 Bases.emplace_back(BaseClass);
191 }
CID 1522220: (UNINIT) Using uninitialized value "Bases". Field "Bases.InlineElts" is uninitialized.
192 return Bases;
193 }
194
195 APIRecord *determineParentRecord(const DeclContext *Context) {
196 SmallString<128> ParentUSR;
197 if (Context->getDeclKind() == Decl::TranslationUnit)
/clang/include/clang/ExtractAPI/ExtractAPIVisitor.h: 192 in clang::extractapi::impl::ExtractAPIVisitorBase<::LibClangExtractAPIVisitor>::getBases(const clang::CXXRecordDecl *)()
186 BaseSpecifier.getType().getTypePtr()->getAsCXXRecordDecl();
187 BaseClass.Name = BaseClassDecl->getName();
188 BaseClass.USR = API.recordUSR(BaseClassDecl);
189 }
190 Bases.emplace_back(BaseClass);
191 }
CID 1522220: (UNINIT) Using uninitialized value "Bases". Field "Bases.InlineElts" is uninitialized.
192 return Bases;
193 }
194
195 APIRecord *determineParentRecord(const DeclContext *Context) {
196 SmallString<128> ParentUSR;
197 if (Context->getDeclKind() == Decl::TranslationUnit)
/clang/include/clang/ExtractAPI/ExtractAPIVisitor.h: 192 in clang::extractapi::impl::ExtractAPIVisitorBase<::BatchExtractAPIVisitor>::getBases(const clang::CXXRecordDecl *)()
186 BaseSpecifier.getType().getTypePtr()->getAsCXXRecordDecl();
187 BaseClass.Name = BaseClassDecl->getName();
188 BaseClass.USR = API.recordUSR(BaseClassDecl);
189 }
190 Bases.emplace_back(BaseClass);
191 }
CID 1522220: (UNINIT) Using uninitialized value "Bases". Field "Bases.InlineElts" is uninitialized.
192 return Bases;
193 }
194
195 APIRecord *determineParentRecord(const DeclContext *Context) {
196 SmallString<128> ParentUSR;
197 if (Context->getDeclKind() == Decl::TranslationUnit)
** CID 1522219: Control flow issues (DEADCODE)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/NVGPU/TransformOps/NVGPUTransformOps.cpp.inc: 841 in mlir::transform::PipelineSharedMemoryCopiesOp::setPeelEpilogue(bool)()
*** CID 1522219: Control flow issues (DEADCODE)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/NVGPU/TransformOps/NVGPUTransformOps.cpp.inc: 841 in mlir::transform::PipelineSharedMemoryCopiesOp::setPeelEpilogue(bool)()
835 void PipelineSharedMemoryCopiesOp::setPeelEpilogueAttr(::mlir::UnitAttr attr) {
836 (*this)->setAttr(getPeelEpilogueAttrName(), attr);
837 }
838
839 void PipelineSharedMemoryCopiesOp::setPeelEpilogue(bool attrValue) {
840 if (attrValue)
CID 1522219: Control flow issues (DEADCODE) Execution cannot reach this statement: "<temporary>.UnitAttr(NULL);".
841 return (*this)->setAttr(getPeelEpilogueAttrName(), ((attrValue) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr));
842 (*this)->removeAttr(getPeelEpilogueAttrName());
843 }
844
845 void PipelineSharedMemoryCopiesOp::setFailurePropagationModeAttr(::mlir::transform::FailurePropagationModeAttr attr) {
846 (*this)->setAttr(getFailurePropagationModeAttrName(), attr);
** CID 1522218: Performance inefficiencies (PASS_BY_VALUE)
/clang/include/clang/ExtractAPI/API.h: 372 in clang::extractapi::GlobalVariableRecord::GlobalVariableRecord(clang::extractapi::APIRecord::RecordKind, llvm::StringRef, llvm::StringRef, clang::PresumedLoc, clang::extractapi::AvailabilitySet, clang::LinkageInfo, const std::vector<clang::RawComment::CommentLine, std::allocatorclang::RawComment::CommentLine> &, clang::extractapi::DeclarationFragments, clang::extractapi::DeclarationFragments, bool)()
*** CID 1522218: Performance inefficiencies (PASS_BY_VALUE)
/clang/include/clang/ExtractAPI/API.h: 372 in clang::extractapi::GlobalVariableRecord::GlobalVariableRecord(clang::extractapi::APIRecord::RecordKind, llvm::StringRef, llvm::StringRef, clang::PresumedLoc, clang::extractapi::AvailabilitySet, clang::LinkageInfo, const std::vector<clang::RawComment::CommentLine, std::allocatorclang::RawComment::CommentLine> &, clang::extractapi::DeclarationFragments, clang::extractapi::DeclarationFragments, bool)()
366 DeclarationFragments SubHeading, bool IsFromSystemHeader)
367 : APIRecord(RK_GlobalVariable, USR, Name, Loc, std::move(Availabilities),
368 Linkage, Comment, Declaration, SubHeading,
369 IsFromSystemHeader) {}
370
371 GlobalVariableRecord(RecordKind Kind, StringRef USR, StringRef Name,
CID 1522218: Performance inefficiencies (PASS_BY_VALUE) Passing parameter Availabilities of type "clang::extractapi::AvailabilitySet" (size 376 bytes) by value, which exceeds the medium threshold of 256 bytes.
372 PresumedLoc Loc, AvailabilitySet Availabilities,
373 LinkageInfo Linkage, const DocComment &Comment,
374 DeclarationFragments Declaration,
375 DeclarationFragments SubHeading, bool IsFromSystemHeader)
376 : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities), Linkage,
377 Comment, Declaration, SubHeading, IsFromSystemHeader) {}
** CID 1522217: Uninitialized variables (UNINIT)
*** CID 1522217: Uninitialized variables (UNINIT)
/flang/lib/Optimizer/Builder/IntrinsicCall.cpp: 5016 in fir::IntrinsicLibrary::genTand(mlir::Type, llvm::ArrayRefmlir::Value)()
5010 llvm::ArrayRefmlir::Value args) {
5011 assert(args.size() == 1);
5012 mlir::MLIRContext *context = builder.getContext();
5013 mlir::FunctionType ftype =
5014 mlir::FunctionType::get(context, {resultType}, {args[0].getType()});
5015 llvm::APFloat pi = llvm::APFloat(llvm::numbers::pi);
CID 1522217: Uninitialized variables (UNINIT) Using uninitialized value "pi.U" when calling "operator /".
5016 mlir::Value dfactor = builder.createRealConstant(
5017 loc, mlir::FloatType::getF64(context), pi / llvm::APFloat(180.0));
5018 mlir::Value factor = builder.createConvert(loc, args[0].getType(), dfactor);
5019 mlir::Value arg = builder.createmlir::arith::MulFOp(loc, args[0], factor);
5020 return getRuntimeCallGenerator(“tan”, ftype)(builder, loc, {arg});
5021 }
** CID 1522216: Performance inefficiencies (AUTO_CAUSES_COPY)
/clang/lib/Analysis/FlowSensitive/RecordOps.cpp: 38 in clang::dataflow::copyRecord(clang::dataflow::RecordStorageLocation &, clang::dataflow::RecordStorageLocation &, clang::dataflow::Environment &)()
*** CID 1522216: Performance inefficiencies (AUTO_CAUSES_COPY)
/clang/lib/Analysis/FlowSensitive/RecordOps.cpp: 38 in clang::dataflow::copyRecord(clang::dataflow::RecordStorageLocation &, clang::dataflow::RecordStorageLocation &, clang::dataflow::Environment &)()
32 llvm::dbgs() << "Source type " << Src.getType() << “\n”;
33 llvm::dbgs() << "Destination type " << Dst.getType() << “\n”;
34 }
35 });
36 assert(compatibleTypes);
37
CID 1522216: Performance inefficiencies (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type DenseMapPair.
38 for (auto [Field, DstFieldLoc] : Dst.children()) {
39 StorageLocation *SrcFieldLoc = Src.getChild(*Field);
40
41 assert(Field->getType()->isReferenceType() ||
42 (SrcFieldLoc != nullptr && DstFieldLoc != nullptr));
43
** CID 1522215: Performance inefficiencies (AUTO_CAUSES_COPY)
/llvm/lib/TargetParser/LoongArchTargetParser.cpp: 31 in llvm::LoongArch::isValidArchName(llvm::StringRef)()
*** CID 1522215: Performance inefficiencies (AUTO_CAUSES_COPY)
/llvm/lib/TargetParser/LoongArchTargetParser.cpp: 31 in llvm::LoongArch::isValidArchName(llvm::StringRef)()
25 #define LOONGARCH_ARCH(NAME, KIND, FEATURES)
26 {NAME, LoongArch::ArchKind::KIND, FEATURES},
27 #include “llvm/TargetParser/LoongArchTargetParser.def”
28 };
29
30 bool LoongArch::isValidArchName(StringRef Arch) {
CID 1522215: Performance inefficiencies (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type ArchInfo.
31 for (const auto A : AllArchs)
32 if (A.Name == Arch)
33 return true;
34 return false;
35 }
36
** CID 1522214: Uninitialized variables (UNINIT)
/build-llvm/tools/clang/stage2-bins/lib/Target/AMDGPU/AMDGPUGenRegBankGICombiner.inc: 230 in ::AMDGPURegBankCombinerImpl::computeAvailableModuleFeatures(const llvm::GCNSubtarget *) const()
*** CID 1522214: Uninitialized variables (UNINIT)
/build-llvm/tools/clang/stage2-bins/lib/Target/AMDGPU/AMDGPUGenRegBankGICombiner.inc: 230 in ::AMDGPURegBankCombinerImpl::computeAvailableModuleFeatures(const llvm::GCNSubtarget *) const()
224 enum SubtargetFeatureBits : uint8_t {
225 };
226
227 PredicateBitset AMDGPURegBankCombinerImpl::
228 computeAvailableModuleFeatures(const AMDGPUSubtarget *Subtarget) const {
229 PredicateBitset Features;
CID 1522214: Uninitialized variables (UNINIT) Using uninitialized value "Features".
230 return Features;
231 }
232
233 void AMDGPURegBankCombinerImpl::setupGeneratedPerFunctionState(MachineFunction &MF) {
234 AvailableFunctionFeatures = computeAvailableFunctionFeatures((const AMDGPUSubtarget *)&MF.getSubtarget(), &MF);
235 }
** CID 1522213: Null pointer dereferences (FORWARD_NULL)
/lldb/source/API/SBTarget.cpp: 1528 in lldb::SBTarget::AddModule(const lldb::SBModuleSpec &)()
*** CID 1522213: Null pointer dereferences (FORWARD_NULL)
/lldb/source/API/SBTarget.cpp: 1528 in lldb::SBTarget::AddModule(const lldb::SBModuleSpec &)()
1522 }
1523 }
1524 }
1525 }
1526 // If the target hasn’t initialized any architecture yet, use the
1527 // binary’s architecture.
CID 1522213: Null pointer dereferences (FORWARD_NULL) Attempting to access the managed object of an empty smart pointer "target_sp".
1528 if (sb_module.IsValid() && !target_sp->GetArchitecture().IsValid() &&
1529 sb_module.GetSP()->GetArchitecture().IsValid())
1530 target_sp->SetArchitecture(sb_module.GetSP()->GetArchitecture());
1531 return sb_module;
1532 }
1533
** CID 1522212: (AUTO_CAUSES_COPY)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp.inc: 5246 in mlir::transform::MapCopyToThreadsOp::verifyInvariantsImpl()()
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp.inc: 5240 in mlir::transform::MapCopyToThreadsOp::verifyInvariantsImpl()()
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp.inc: 5231 in mlir::transform::MapCopyToThreadsOp::verifyInvariantsImpl()()
*** CID 1522212: (AUTO_CAUSES_COPY)
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp.inc: 5246 in mlir::transform::MapCopyToThreadsOp::verifyInvariantsImpl()()
5240 for (auto v : valueGroup0) {
5241 if (::mlir::failed(__mlir_ods_local_type_constraint_LinalgTransformOps0(*this, v.getType(), “result”, index++)))
5242 return ::mlir::failure();
5243 }
5244 auto valueGroup1 = getODSResults(1);
5245
CID 1522212: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type OpResult.
5246 for (auto v : valueGroup1) {
5247 if (::mlir::failed(__mlir_ods_local_type_constraint_LinalgTransformOps0(*this, v.getType(), “result”, index++)))
5248 return ::mlir::failure();
5249 }
5250 }
5251 return ::mlir::success();
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp.inc: 5240 in mlir::transform::MapCopyToThreadsOp::verifyInvariantsImpl()()
5234 }
5235 }
5236 {
5237 unsigned index = 0; (void)index;
5238 auto valueGroup0 = getODSResults(0);
5239
CID 1522212: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type OpResult.
5240 for (auto v : valueGroup0) {
5241 if (::mlir::failed(__mlir_ods_local_type_constraint_LinalgTransformOps0(*this, v.getType(), “result”, index++)))
5242 return ::mlir::failure();
5243 }
5244 auto valueGroup1 = getODSResults(1);
5245
/build-llvm/tools/clang/stage2-bins/tools/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp.inc: 5231 in mlir::transform::MapCopyToThreadsOp::verifyInvariantsImpl()()
5225 if (::mlir::failed(__mlir_ods_local_attr_constraint_LinalgTransformOps5(*this, tblgen_desired_bit_alignment, “desired_bit_alignment”)))
5226 return ::mlir::failure();
5227 {
5228 unsigned index = 0; (void)index;
5229 auto valueGroup0 = getODSOperands(0);
5230
CID 1522212: (AUTO_CAUSES_COPY) Using the "auto" keyword without an "&" causes the copy of an object of type Value.
5231 for (auto v : valueGroup0) {
5232 if (::mlir::failed(__mlir_ods_local_type_constraint_LinalgTransformOps0(*this, v.getType(), “operand”, index++)))
5233 return ::mlir::failure();
5234 }
5235 }
5236 {
To view the defects in Coverity Scan visit, Coverity Scan - Sign in