Skip to content

Commit e962fa7

Browse files
committed
[OpenMPOpt][FIX] Internalization is an IR change too
The bots reported that we changed the IR w/o reporting it. The reason was that internalization was not reported as changed. Forwarding the result solves the problem. Test coverage via llvm/test/Transforms/Attributor/reduced/openmp_opt_constant_type_crash.ll
1 parent 05fb769 commit e962fa7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

llvm/lib/Transforms/IPO/OpenMPOpt.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5407,6 +5407,8 @@ PreservedAnalyses OpenMPOptPass::run(Module &M, ModuleAnalysisManager &AM) {
54075407
});
54085408
};
54095409

5410+
bool Changed = false;
5411+
54105412
// Create internal copies of each function if this is a kernel Module. This
54115413
// allows iterprocedural passes to see every call edge.
54125414
DenseMap<Function *, Function *> InternalizedMap;
@@ -5422,7 +5424,8 @@ PreservedAnalyses OpenMPOptPass::run(Module &M, ModuleAnalysisManager &AM) {
54225424
}
54235425
}
54245426

5425-
Attributor::internalizeFunctions(InternalizeFns, InternalizedMap);
5427+
Changed |=
5428+
Attributor::internalizeFunctions(InternalizeFns, InternalizedMap);
54265429
}
54275430

54285431
// Look at every function in the Module unless it was internalized.
@@ -5435,7 +5438,7 @@ PreservedAnalyses OpenMPOptPass::run(Module &M, ModuleAnalysisManager &AM) {
54355438
}
54365439

54375440
if (SCC.empty())
5438-
return PreservedAnalyses::all();
5441+
return Changed ? PreservedAnalyses::none() : PreservedAnalyses::all();
54395442

54405443
AnalysisGetter AG(FAM);
54415444

@@ -5468,7 +5471,7 @@ PreservedAnalyses OpenMPOptPass::run(Module &M, ModuleAnalysisManager &AM) {
54685471
Attributor A(Functions, InfoCache, AC);
54695472

54705473
OpenMPOpt OMPOpt(SCC, CGUpdater, OREGetter, InfoCache, A);
5471-
bool Changed = OMPOpt.run(true);
5474+
Changed |= OMPOpt.run(true);
54725475

54735476
// Optionally inline device functions for potentially better performance.
54745477
if (AlwaysInlineDeviceFunctions && isOpenMPDevice(M))

0 commit comments

Comments
 (0)