|
1 |
| -; REQUIRES: asserts |
2 |
| -; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 -o - %s 2>&1 | FileCheck %s |
| 1 | +; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 < %s | FileCheck %s |
3 | 2 |
|
4 |
| -; CHECK-NOT: Assertion `BitWidth == RHS.BitWidth && "Bit widths must be same for comparison"' failed |
| 3 | +; Previously, this would hit an assertion on incompatible comparison between |
| 4 | +; APInts due to BitWidth differences. This was due to assignment of DenseMap |
| 5 | +; value using another value within that same DenseMap which results in a |
| 6 | +; use-after-free if the assignment operator invokes a DenseMap growth. |
5 | 7 |
|
6 |
| -define void @RunTic() { |
7 |
| - %call5.i1 = call i32 @G_CheckDemoStatus() |
8 |
| - tail call void @D_AdvanceDemo() |
9 |
| - call void @G_Ticker() |
| 8 | +; CHECK-LABEL: I_Quit: |
| 9 | +define void @I_Quit() { |
| 10 | + %fptr = load ptr, ptr null, align 8 |
| 11 | + tail call void %fptr() |
10 | 12 | ret void
|
11 | 13 | }
|
12 | 14 |
|
13 |
| -define void @G_Ticker() { |
14 |
| - call void @G_DoReborn() |
15 |
| - tail call void @F_Ticker() |
16 |
| - tail call void @AM_Stop() |
17 |
| - tail call void @F_StartFinale() |
18 |
| - tail call void @D_AdvanceDemo() |
19 |
| - %call.i.i449 = call i32 @R_FlatNumForName() |
20 |
| - %call9.i.i = call i32 @R_TextureNumForName() |
21 |
| - %call.i306 = tail call ptr @P_TempSaveGameFile() |
22 |
| - %call1.i307 = call ptr @P_SaveGameFile() |
23 |
| - call void (...) @I_Error() |
| 15 | +; CHECK-LABEL: P_RemoveMobj: |
| 16 | +define void @P_RemoveMobj() { |
24 | 17 | ret void
|
25 | 18 | }
|
26 | 19 |
|
27 |
| -define void @G_DoReborn() { |
28 |
| - call void @P_RemoveMobj() |
29 |
| - call void @P_SpawnMobj() |
30 |
| - call void @P_SpawnPlayer() |
31 |
| - call void (...) @I_Error() |
| 20 | +; CHECK-LABEL: P_SpawnMobj: |
| 21 | +define void @P_SpawnMobj() { |
32 | 22 | ret void
|
33 | 23 | }
|
34 | 24 |
|
35 |
| -define void @AM_Stop() { |
| 25 | +; CHECK-LABEL: G_PlayerReborn: |
| 26 | +define void @G_PlayerReborn() { |
36 | 27 | ret void
|
37 | 28 | }
|
38 | 29 |
|
39 |
| -define void @D_AdvanceDemo() { |
| 30 | +; CHECK-LABEL: P_SetThingPosition: |
| 31 | +define void @P_SetThingPosition() { |
40 | 32 | ret void
|
41 | 33 | }
|
42 | 34 |
|
43 |
| -define void @F_StartFinale() { |
| 35 | +; CHECK-LABEL: P_SetupPsprites: |
| 36 | +define void @P_SetupPsprites(ptr addrspace(1) %i) { |
| 37 | + %fptr = load ptr, ptr addrspace(1) %i, align 8 |
| 38 | + tail call void %fptr() |
44 | 39 | ret void
|
45 | 40 | }
|
46 | 41 |
|
47 |
| -define void @F_Ticker() { |
| 42 | +; CHECK-LABEL: HU_Start: |
| 43 | +define void @HU_Start() { |
48 | 44 | ret void
|
49 | 45 | }
|
50 | 46 |
|
51 |
| -define void @G_PlayerReborn() { |
| 47 | +; CHECK-LABEL: P_SpawnPlayer: |
| 48 | +define void @P_SpawnPlayer() { |
| 49 | + call void @G_PlayerReborn() |
| 50 | + call void @P_SetThingPosition() |
| 51 | + call void @P_SetupPsprites(ptr addrspace(1) null) |
| 52 | + tail call void @HU_Start() |
52 | 53 | ret void
|
53 | 54 | }
|
54 | 55 |
|
55 |
| -define i32 @G_CheckDemoStatus() { |
56 |
| - tail call void @I_Quit() |
57 |
| - tail call void @D_AdvanceDemo() |
58 |
| - call void (...) @I_Error() |
59 |
| - ret i32 0 |
60 |
| -} |
61 |
| - |
62 |
| -define void @HU_Start() { |
| 56 | +; CHECK-LABEL: I_Error: |
| 57 | +define void @I_Error(...) { |
| 58 | + %fptr = load ptr, ptr null, align 8 |
| 59 | + call void %fptr() |
63 | 60 | ret void
|
64 | 61 | }
|
65 | 62 |
|
66 |
| -define void @I_Quit() { |
67 |
| - %fptr = load ptr, ptr null, align 8 |
68 |
| - tail call void %fptr() |
| 63 | +; CHECK-LABEL: G_DoReborn: |
| 64 | +define void @G_DoReborn() { |
| 65 | + call void @P_RemoveMobj() |
| 66 | + call void @P_SpawnMobj() |
| 67 | + call void @P_SpawnPlayer() |
| 68 | + call void (...) @I_Error() |
69 | 69 | ret void
|
70 | 70 | }
|
71 | 71 |
|
72 |
| -define void @P_SetThingPosition() { |
| 72 | +; CHECK-LABEL: AM_Stop: |
| 73 | +define void @AM_Stop() { |
73 | 74 | ret void
|
74 | 75 | }
|
75 | 76 |
|
76 |
| -define void @P_RemoveMobj() { |
| 77 | +; CHECK-LABEL: D_AdvanceDemo: |
| 78 | +define void @D_AdvanceDemo() { |
77 | 79 | ret void
|
78 | 80 | }
|
79 | 81 |
|
80 |
| -define void @P_SpawnMobj() { |
| 82 | +; CHECK-LABEL: F_StartFinale: |
| 83 | +define void @F_StartFinale() { |
81 | 84 | ret void
|
82 | 85 | }
|
83 | 86 |
|
84 |
| -define void @P_SpawnPlayer() { |
85 |
| - call void @G_PlayerReborn() |
86 |
| - call void @P_SetThingPosition() |
87 |
| - call void @P_SetupPsprites(ptr addrspace(1) null) |
88 |
| - tail call void @HU_Start() |
| 87 | +; CHECK-LABEL: F_Ticker: |
| 88 | +define void @F_Ticker() { |
89 | 89 | ret void
|
90 | 90 | }
|
91 | 91 |
|
92 |
| -define void @P_SetupPsprites(ptr addrspace(1) %i) { |
93 |
| - %fptr = load ptr, ptr addrspace(1) %i, align 8 |
94 |
| - tail call void %fptr() |
95 |
| - ret void |
| 92 | +; CHECK-LABEL: G_CheckDemoStatus: |
| 93 | +define i32 @G_CheckDemoStatus() { |
| 94 | + tail call void @I_Quit() |
| 95 | + tail call void @D_AdvanceDemo() |
| 96 | + call void (...) @I_Error() |
| 97 | + ret i32 0 |
96 | 98 | }
|
97 | 99 |
|
| 100 | + |
| 101 | +; CHECK-LABEL: P_TempSaveGameFile: |
98 | 102 | define ptr @P_TempSaveGameFile() {
|
99 | 103 | ret ptr null
|
100 | 104 | }
|
101 | 105 |
|
| 106 | +; CHECK-LABEL: P_SaveGameFile: |
102 | 107 | define ptr @P_SaveGameFile() {
|
103 | 108 | ret ptr null
|
104 | 109 | }
|
105 | 110 |
|
| 111 | +; CHECK-LABEL: R_FlatNumForName: |
| 112 | +define i32 @R_FlatNumForName() { |
| 113 | + call void (...) @I_Error() |
| 114 | + unreachable |
| 115 | +} |
| 116 | + |
| 117 | +; CHECK-LABEL: R_TextureNumForName: |
106 | 118 | define i32 @R_TextureNumForName() {
|
107 | 119 | %ret = call i32 @R_FlatNumForName()
|
108 | 120 | ret i32 0
|
109 | 121 | }
|
110 | 122 |
|
111 |
| -define void @I_Error(...) { |
112 |
| - %fptr = load ptr, ptr null, align 8 |
113 |
| - call void %fptr() |
| 123 | +; CHECK-LABEL: G_Ticker: |
| 124 | +define void @G_Ticker() { |
| 125 | + call void @G_DoReborn() |
| 126 | + tail call void @F_Ticker() |
| 127 | + tail call void @AM_Stop() |
| 128 | + tail call void @F_StartFinale() |
| 129 | + tail call void @D_AdvanceDemo() |
| 130 | + %call.i.i449 = call i32 @R_FlatNumForName() |
| 131 | + %call9.i.i = call i32 @R_TextureNumForName() |
| 132 | + %call.i306 = tail call ptr @P_TempSaveGameFile() |
| 133 | + %call1.i307 = call ptr @P_SaveGameFile() |
| 134 | + call void (...) @I_Error() |
114 | 135 | ret void
|
115 | 136 | }
|
116 | 137 |
|
117 |
| -define i32 @R_FlatNumForName() { |
118 |
| - call void (...) @I_Error() |
119 |
| - unreachable |
| 138 | +; CHECK-LABEL: RunTic: |
| 139 | +define void @RunTic() { |
| 140 | + %call5.i1 = call i32 @G_CheckDemoStatus() |
| 141 | + tail call void @D_AdvanceDemo() |
| 142 | + call void @G_Ticker() |
| 143 | + ret void |
120 | 144 | }
|
0 commit comments