Commit e2489b0
[AMDGPU] Use "hostcall" module flag instead of searching for ockl_hostcall_internal() declaration.
The current way to detect hostcalls by looking for "ockl_hostcall_internal()" function in the module seems to be not reliable enough. The LTO may rename the "ockl_hostcall_internal()" function when an application is compiled with "-fgpu-rdc", and MetadataStreamer pass to fail to detect hostcalls, therefore it does not set the "hidden_hostcall_buffer" kernel argument.
This change adds a new module flag: hostcall that can be used to detect whether GPU functions use host calls for printf.
Differential revision: https://reviews.llvm.org/D110337
[AMDGPU] Correction to 095c48f.
Differential Revision: https://reviews.llvm.org/D110337
Change-Id: I5eb847884f4cb98687dcfdef85f78d2d2c380bcd1 parent f54f00d commit e2489b0
File tree
3 files changed
+13
-8
lines changed- llvm
- lib
- Target/AMDGPU
- Transforms/Utils
- test/CodeGen/AMDGPU
3 files changed
+13
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
797 | | - | |
| 797 | + | |
| 798 | + | |
798 | 799 | | |
799 | 800 | | |
800 | 801 | | |
| |||
810 | 811 | | |
811 | 812 | | |
812 | 813 | | |
813 | | - | |
814 | | - | |
| 814 | + | |
| 815 | + | |
815 | 816 | | |
816 | | - | |
| 817 | + | |
817 | 818 | | |
818 | 819 | | |
819 | | - | |
| 820 | + | |
820 | 821 | | |
821 | 822 | | |
822 | | - | |
| 823 | + | |
823 | 824 | | |
824 | 825 | | |
825 | 826 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
54 | 55 | | |
0 commit comments