Skip to content

Commit 7e144d7

Browse files
Dont patch implicit args relocation to zero
IGC should set the value to zero by default Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent d066e2d commit 7e144d7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

shared/source/compiler_interface/linker.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,6 @@ void Linker::resolveImplicitArgs(const KernelDescriptorsT &kernelDescriptors, De
525525
kernelDescriptor.kernelAttributes.flags.requiresImplicitArgs = kernelDescriptor.kernelAttributes.flags.useStackCalls || pDevice->getDebugger() != nullptr;
526526
if (kernelDescriptor.kernelAttributes.flags.requiresImplicitArgs) {
527527
*pImplicitArgsReloc = sizeof(ImplicitArgs);
528-
} else {
529-
*pImplicitArgsReloc = 0u;
530528
}
531529
}
532530
}

shared/test/unit_test/compiler_interface/linker_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,7 +2160,7 @@ TEST(LinkerTests, givenImplicitArgRelocationAndEnabledDebuggerThenPatchRelocatio
21602160
EXPECT_TRUE(kernelDescriptor.kernelAttributes.flags.requiresImplicitArgs);
21612161
}
21622162

2163-
TEST(LinkerTests, givenImplicitArgRelocationWithoutStackCallsAndDisabledDebuggerThenPatchRelocationWithZeroAndUpdateKernelDescriptor) {
2163+
TEST(LinkerTests, givenImplicitArgRelocationWithoutStackCallsAndDisabledDebuggerThenDontPatchRelocationAndUpdateKernelDescriptor) {
21642164
NEO::LinkerInput linkerInput;
21652165

21662166
vISA::GenRelocEntry reloc = {};
@@ -2211,7 +2211,7 @@ TEST(LinkerTests, givenImplicitArgRelocationWithoutStackCallsAndDisabledDebugger
22112211
EXPECT_EQ(0U, relocatedSymbols.size());
22122212

22132213
auto addressToPatch = reinterpret_cast<const uint32_t *>(instructionSegment.data() + reloc.r_offset);
2214-
EXPECT_EQ(0u, *addressToPatch);
2214+
EXPECT_EQ(initData, *addressToPatch);
22152215
EXPECT_EQ(initData, *(addressToPatch - 1));
22162216
EXPECT_EQ(initData, *(addressToPatch + 1));
22172217
EXPECT_FALSE(kernelDescriptor.kernelAttributes.flags.requiresImplicitArgs);

0 commit comments

Comments
 (0)