Skip to content

Commit 89e7fe7

Browse files
amielczaigcbot
authored andcommitted
Change getGlobalList calls to globals()
Change getGlobalList calls to globals(). This is done to ensure the compatibility with the LLVM17 API.
1 parent 66e6046 commit 89e7fe7

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

IGC/AdaptorOCL/dllInterfaceCompute.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ void GenerateCompilerOptionsMD(llvm::LLVMContext &C, llvm::Module &M, llvm::Stri
299299
// Naming global variables after kernels removal can result in inconsistent naming compared to the first compilation,
300300
// potentially causing crashes in the ProgramScopeConstantAnalysis pass.
301301
void AssignNamesToUnnamedGlobalVariables(llvm::Module &M) {
302-
for (auto &G : M.getGlobalList()) {
302+
for (auto &G : M.globals()) {
303303
if (!G.hasName()) {
304304
G.setName("gVar");
305305
}

IGC/Compiler/Optimizer/BuiltInFuncImport.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,7 @@ std::unique_ptr<llvm::Module> BIImport::Construct(Module &M, CLElfLib::CElfReade
386386
// 2)Check if Global has a user
387387
// 3)link all of the Globals with a user to BIM
388388

389-
auto &Globals = BIM->getGlobalList();
390-
for (auto &global_iterator : Globals) {
389+
for (auto &global_iterator : BIM->globals()) {
391390
if (!global_iterator.hasInitializer() && !global_iterator.use_empty()) {
392391
int SectionIndex = Map[global_iterator.getName()];
393392
if (SectionIndex == 0)

IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ void GenXKernelBuilder::buildInputs(Function *F, bool NeedRetIP) {
12091209
// Number of globals to be binded statically.
12101210
std::vector<std::pair<GlobalVariable *, int32_t>> Bindings;
12111211
Module *M = F->getParent();
1212-
for (auto &GV : M->getGlobalList()) {
1212+
for (auto &GV : M->globals()) {
12131213
int32_t Offset = 0;
12141214
GV.getAttribute(genx::FunctionMD::GenXByteOffset)
12151215
.getValueAsString()

IGC/VectorCompiler/lib/GenXOpts/CMPacketize/GenXPacketize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ bool GenXPacketize::isUniformIntrinsic(unsigned ID) {
578578

579579
void GenXPacketize::findUniformInsts(Function &F) {
580580
// global variable load is uniform
581-
for (auto &Global : M->getGlobalList()) {
581+
for (auto &Global : M->globals()) {
582582
for (auto UI = Global.use_begin(), UE = Global.use_end(); UI != UE; ++UI) {
583583
if (auto *LD = dyn_cast<LoadInst>(UI->getUser())) {
584584
UniformInsts.insert(LD);
@@ -1756,7 +1756,7 @@ void GenXPacketize::fixupLLVMIntrinsics(Function &F) {
17561756
/// CM SIMD control-flow representation after packetization
17571757
GlobalVariable *GenXPacketize::findGlobalExecMask() {
17581758
// look for the global EMask variable if exists
1759-
for (auto &Global : M->getGlobalList()) {
1759+
for (auto &Global : M->globals()) {
17601760
auto *Ty = Global.getValueType();
17611761
if (Ty->isVectorTy() &&
17621762
cast<IGCLLVM::FixedVectorType>(Ty)->getNumElements() ==

IGC/VectorCompiler/lib/GenXOpts/CMTrans/CMABI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ bool CMLowerVLoadVStore::lowerLoadStore(Function &F) {
12561256
auto M = F.getParent();
12571257
DenseMap<AllocaInst *, GlobalVariable *> AllocaMap;
12581258
// collect all the allocas that store the address of genx-volatile variable
1259-
for (auto &G : M->getGlobalList()) {
1259+
for (auto &G : M->globals()) {
12601260
if (!G.hasAttribute("genx_volatile"))
12611261
continue;
12621262
std::vector<User *> WL;

0 commit comments

Comments
 (0)