Skip to content

Commit

Permalink
Restore DebugInfoProducer.ll test to original state
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleygambarin authored and MrSidims committed May 9, 2023
1 parent e7e51bd commit e82ecc2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
25 changes: 14 additions & 11 deletions lib/SPIRV/libSPIRV/SPIRVModule.cpp
Expand Up @@ -1632,8 +1632,9 @@ SPIRVInstruction *SPIRVModuleImpl::addExpectKHRInst(SPIRVType *ResultTy,
// Create AliasDomainDeclINTEL/AliasScopeDeclINTEL/AliasScopeListDeclINTEL
// instructions
template <typename AliasingInstType>
SPIRVEntry *SPIRVModuleImpl::getOrAddMemAliasingINTELInst(
std::vector<SPIRVId> Args, llvm::MDNode *MD) {
SPIRVEntry *
SPIRVModuleImpl::getOrAddMemAliasingINTELInst(std::vector<SPIRVId> Args,
llvm::MDNode *MD) {
assert(MD && "noalias/alias.scope metadata can't be null");
// Don't duplicate aliasing instruction. For that use a map with a MDNode key
if (AliasInstMDMap.find(MD) != AliasInstMDMap.end())
Expand All @@ -1644,20 +1645,23 @@ SPIRVEntry *SPIRVModuleImpl::getOrAddMemAliasingINTELInst(
}

// Create AliasDomainDeclINTEL instruction
SPIRVEntry *SPIRVModuleImpl::getOrAddAliasDomainDeclINTELInst(
std::vector<SPIRVId> Args, llvm::MDNode *MD) {
SPIRVEntry *
SPIRVModuleImpl::getOrAddAliasDomainDeclINTELInst(std::vector<SPIRVId> Args,
llvm::MDNode *MD) {
return getOrAddMemAliasingINTELInst<SPIRVAliasDomainDeclINTEL>(Args, MD);
}

// Create AliasScopeDeclINTEL instruction
SPIRVEntry *SPIRVModuleImpl::getOrAddAliasScopeDeclINTELInst(
std::vector<SPIRVId> Args, llvm::MDNode *MD) {
SPIRVEntry *
SPIRVModuleImpl::getOrAddAliasScopeDeclINTELInst(std::vector<SPIRVId> Args,
llvm::MDNode *MD) {
return getOrAddMemAliasingINTELInst<SPIRVAliasScopeDeclINTEL>(Args, MD);
}

// Create AliasScopeListDeclINTEL instruction
SPIRVEntry *SPIRVModuleImpl::getOrAddAliasScopeListDeclINTELInst(
std::vector<SPIRVId> Args, llvm::MDNode *MD) {
SPIRVEntry *
SPIRVModuleImpl::getOrAddAliasScopeListDeclINTELInst(std::vector<SPIRVId> Args,
llvm::MDNode *MD) {
return getOrAddMemAliasingINTELInst<SPIRVAliasScopeListDeclINTEL>(Args, MD);
}

Expand Down Expand Up @@ -1869,7 +1873,7 @@ spv_ostream &operator<<(spv_ostream &O, SPIRVModule &M) {
}

if (M.isAllowedToUseExtension(
ExtensionID::SPV_INTEL_memory_access_aliasing)) {
ExtensionID::SPV_INTEL_memory_access_aliasing)) {
O << SPIRVNL() << MI.AliasInstMDVec;
}

Expand All @@ -1894,8 +1898,7 @@ spv_ostream &operator<<(spv_ostream &O, SPIRVModule &M) {
}),
MI.DebugInstVec.end());

O << SPIRVNL() << MI.DebugInstVec << SPIRVNL()
<< MI.FuncVec;
O << SPIRVNL() << MI.DebugInstVec << SPIRVNL() << MI.FuncVec;
return O;
}

Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/NonSemantic/DebugInfoProducer.ll
Expand Up @@ -52,7 +52,7 @@ attributes #0 = { noinline norecurse nounwind optnone "correctly-rounded-divide-
; CHECK-LLVM-200-NOT: producer: "spirv"

; CHECK-LLVM-100: !DICompileUnit
; CHECK-LLVM-100-SAME: producer: "clang{{.*}}version{{.*}}13.0.0{{.*}}(https://github.com/llvm/llvm-project.git{{.*}}16a50c9e642fd085e5ceb68c403b71b5b2e0607c)"
; CHECK-LLVM-100-SAME: producer: "clang version 13.0.0 (https://github.com/llvm/llvm-project.git 16a50c9e642fd085e5ceb68c403b71b5b2e0607c)"
; CHECK-LLVM-100-SAME: flags: "-O2"

; CHECK-SPIRV-200: String [[#ProducerId:]] "clang version 13.0.0 (https://github.com/llvm/llvm-project.git 16a50c9e642fd085e5ceb68c403b71b5b2e0607c)"
Expand Down

0 comments on commit e82ecc2

Please sign in to comment.