[all-commits] [llvm/llvm-project] 6c64c8: [NVPTX] add an optional early copy of byval argume...
Artem Belevich via All-commits
all-commits at lists.llvm.org
Thu Oct 24 12:01:17 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6c64c8a6f3f77c30745c751d4163ff6bf2fc323b
https://github.com/llvm/llvm-project/commit/6c64c8a6f3f77c30745c751d4163ff6bf2fc323b
Author: Artem Belevich <tra at google.com>
Date: 2024-10-24 (Thu, 24 Oct 2024)
Changed paths:
M llvm/lib/Target/NVPTX/NVPTX.h
M llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
M llvm/lib/Target/NVPTX/NVPTXPassRegistry.def
M llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
M llvm/test/CodeGen/NVPTX/lower-byval-args.ll
Log Message:
-----------
[NVPTX] add an optional early copy of byval arguments (#113384)
byval arguments in NVPTX are special. We're only allowed to read from
them using a special instruction, and if we ever need to write to them
or take an address, we must make a local copy and use it, instead.
The problem is that local copies are very expensive, and we create them
very late in the compilation pipeline, so LLVM does not have much of a
chance to eliminate them, if they turn out to be unnecessary.
One way around that is to create such copies early on, and let them
percolate through the optimizations. The copying itself will never
trigger creation of another copy later on, as the reads are allowed. If
LLVM can eliminate it, it's a win. It the full optimization pipeline
can't remove the copy, that's as good as it gets in terms of the effort
we could've done, and it's certainly a much better effort than what we
do now.
This early injection of the copies has potential to create undesireable
side-effects, so it's disabled by default, for now, until it sees more
testing.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list