Page MenuHomePhabricator

Reset PAL metadata when AMDGPU traget stream finishes
ClosedPublic

Authored by s-perron on Aug 10 2020, 10:24 AM.

Details

Summary

If the same stream object is used for multiple compiles, the PAL metadata from eariler compilations will leak into later one. See https://github.com/GPUOpen-Drivers/llpc/issues/882 for how this is happening in LLPC.

No tests were added because multiple compiles will have to happen using the same pass manager, and I do not see a setup for that on the LLVM side. Let me know if there is a good way to test this.

Diff Detail

Unit TestsFailed

TimeTest
30 mslinux > Flang.Preprocessing::compiler_defined_macros.F90
Script: -- : 'RUN: at line 6'; /mnt/disks/ssd0/agent/llvm-project/build/bin/f18 -intrinsic-module-directory /mnt/disks/ssd0/agent/llvm-project/build/tools/flang/include/flang -E /mnt/disks/ssd0/agent/llvm-project/flang/test/Preprocessing/compiler_defined_macros.F90 | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck --ignore-case /mnt/disks/ssd0/agent/llvm-project/flang/test/Preprocessing/compiler_defined_macros.F90

Event Timeline

s-perron created this revision.Aug 10 2020, 10:24 AM
s-perron requested review of this revision.Aug 10 2020, 10:24 AM

LGTM (minor comment typo), but I'm adding Tim who did most of the original code I think.

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
175

its?

440

its?

s-perron updated this revision to Diff 285680.Aug 14 2020, 10:05 AM

Fix typo in comment

s-perron marked 2 inline comments as done.Aug 14 2020, 10:06 AM
nhaehnle accepted this revision.Aug 14 2020, 10:19 AM

LGTM minus something rather obvious.

llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
581 ↗(On Diff #285680)

Looks like some unrelated change got into this patch? (FWIW, I usually do arc diff @^ as part of a git rebase -i -- maybe newer versions of arc can do something smarter, I haven't reevaluated my workflow in some time)

This revision is now accepted and ready to land.Aug 14 2020, 10:19 AM
s-perron updated this revision to Diff 285686.Aug 14 2020, 10:26 AM

Remove unrelated changes

This revision was automatically updated to reflect the committed changes.