File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Optimizer/OpenCLPasses/ProgramScopeConstants Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -995,6 +995,8 @@ namespace IGC
995
995
// Ignore per module fast math flag and use only per instruction fast math flags
996
996
// Add few changes to CustomUnsafeOptPass related to fast flag propagation
997
997
bool m_checkFastFlagPerInstructionInCustomUnsafeOptPass = false ;
998
+ // Map to store global offsets in original global buffer
999
+ std::map<std::string, uint64_t > inlineProgramScopeGlobalOffsets;
998
1000
999
1001
private:
1000
1002
// For storing error message
Original file line number Diff line number Diff line change @@ -348,7 +348,17 @@ bool ProgramScopeConstantAnalysis::runOnModule(Module& M)
348
348
const bool changed = !inlineProgramScopeOffsets.empty ();
349
349
for (auto offset : inlineProgramScopeOffsets)
350
350
{
351
- m_pModuleMd->inlineProgramScopeOffsets [offset.first ] = static_cast <uint64_t >(offset.second );
351
+ std::string globalName = offset.first ->getName ().str ();
352
+ if (Ctx->m_retryManager .IsFirstTry ())
353
+ {
354
+ m_pModuleMd->inlineProgramScopeOffsets [offset.first ] = static_cast <uint64_t >(offset.second );
355
+ Ctx->inlineProgramScopeGlobalOffsets [globalName] = static_cast <uint64_t >(offset.second );
356
+ }
357
+ else
358
+ {
359
+ IGC_ASSERT_MESSAGE (Ctx->inlineProgramScopeGlobalOffsets [globalName], " No offset recorded for global during initial compilation" );
360
+ m_pModuleMd->inlineProgramScopeOffsets [offset.first ] = Ctx->inlineProgramScopeGlobalOffsets [globalName];
361
+ }
352
362
}
353
363
354
364
// Update LLVM metadata based on IGC MetadataUtils
You can’t perform that action at this time.
0 commit comments