Skip to content

[Comgr] Materialize header inputs in the VFS instead of on disk - #3842

Draft
chinmaydd wants to merge 1 commit into
amd/dev/chdeshpa/comgr-symbol-indexfrom
amd/dev/chdeshpa/comgr-vfs-user-io
Draft

[Comgr] Materialize header inputs in the VFS instead of on disk#3842
chinmaydd wants to merge 1 commit into
amd/dev/chdeshpa/comgr-symbol-indexfrom
amd/dev/chdeshpa/comgr-vfs-user-io

Conversation

@chinmaydd

Copy link
Copy Markdown

This is third in a series of PRs that improves Comgr.

Includes, precompiled headers and opencl-c-base.h were written to real temp files on every compile even though the in-memory VFS is enabled by default. These paths are read back only through Clang's FileManager, which is built on the driver's OverlayFS, so they can be served from memory. Source, bitcode and link inputs stay on disk: cc1as, lld, the offload bundler and the command cache's input hashing all read the real filesystem.

Also stop getFilePath running fs::create_directories on every path it builds; only the three paths the in-process driver writes need it, and outputToFile already creates the parent for the paths Comgr writes. And take ownership of the output buffer in inputFromFile rather than malloc+memcpy every artifact a second time.

60 OpenCL preprocess actions with 24 8KB includes: 1521 ms -> ~1400 ms.

[1/3] <- #3840
[2/3] <- #3841
[3/3] <- you are here

Includes, precompiled headers and opencl-c-base.h were written to real temp files on every compile even though the in-memory VFS is enabled by default. These paths are read back only through Clang's FileManager, which is built on the driver's OverlayFS, so they can be served from memory. Source, bitcode and link inputs stay on disk: cc1as, lld, the offload bundler and the command cache's input hashing all read the real filesystem.

Also stop getFilePath running fs::create_directories on every path it builds; only the three paths the in-process driver writes need it, and outputToFile already creates the parent for the paths Comgr writes. And take ownership of the output buffer in inputFromFile rather than malloc+memcpy every artifact a second time.

60 OpenCL preprocess actions with 24 8KB includes: 1521 ms -> ~1400 ms.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chinmaydd
chinmaydd force-pushed the amd/dev/chdeshpa/comgr-vfs-user-io branch from 1ba2154 to 2e48dfc Compare August 10, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comgr Related to Code Object Manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant