@@ -186,7 +186,7 @@ void LLVM::LLVMSymbolLinkerInterface::setAlignment(
186
186
bool LLVM::LLVMSymbolLinkerInterface::isConstant (Operation *op) {
187
187
if (auto gv = dyn_cast<LLVM::GlobalOp>(op))
188
188
return gv.getConstant ();
189
- if (isa<LLVM::AliasOp>(op))
189
+ if (isa<LLVM::AliasOp, LLVM::ComdatOp >(op))
190
190
return true ;
191
191
if (isa<LLVM::GlobalCtorsOp, LLVM::GlobalDtorsOp>(op))
192
192
return false ;
@@ -202,7 +202,8 @@ llvm::StringRef LLVM::LLVMSymbolLinkerInterface::getSection(Operation *op) {
202
202
auto section = fn.getSection ();
203
203
return section ? section.value () : llvm::StringRef ();
204
204
}
205
- if (isa<LLVM::GlobalCtorsOp, LLVM::GlobalDtorsOp, LLVM::AliasOp>(op))
205
+ if (isa<LLVM::GlobalCtorsOp, LLVM::GlobalDtorsOp, LLVM::AliasOp,
206
+ LLVM::ComdatOp>(op))
206
207
return llvm::StringRef ();
207
208
llvm_unreachable (" unexpected operation" );
208
209
}
@@ -214,7 +215,7 @@ uint32_t LLVM::LLVMSymbolLinkerInterface::getAddressSpace(Operation *op) {
214
215
if (auto alias = dyn_cast<LLVM::AliasOp>(op)) {
215
216
return alias.getAddrSpace ();
216
217
}
217
- if (isa<LLVM::GlobalCtorsOp, LLVM::GlobalDtorsOp>(op))
218
+ if (isa<LLVM::GlobalCtorsOp, LLVM::GlobalDtorsOp, LLVM::ComdatOp >(op))
218
219
return 0 ;
219
220
llvm_unreachable (" unexpected operation" );
220
221
}
0 commit comments