Commit b4fc557
committed
[AArch64][PAC] Fix clobbering registers by BLRA and AUTH_TCRETURN
After isX16X17Safer predicate was introduced, it became possible for
emitPtrauthDiscriminator function to return its AddrDisc argument when
it is neither X16 nor X17 (which are declared as implicit-def'ed
by BLRA and AUTH_TCRETURN[_BTI] pseudo instructions). This resulted in
the above pseudos being able to accidentally clobber unexpected
register.
As a quick fix for miscompilation possibility, this patch virtually
restores the old behavior for the affected pseudo instructions.
It should be possible to improve the efficiency via subsequent patches
by accounting for `killed` flags and register masks.1 parent ce72add commit b4fc557
File tree
2 files changed
+50
-23
lines changed- llvm
- lib/Target/AArch64
- test/CodeGen/AArch64
2 files changed
+50
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2229 | 2229 | | |
2230 | 2230 | | |
2231 | 2231 | | |
2232 | | - | |
2233 | | - | |
2234 | | - | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
2235 | 2242 | | |
2236 | 2243 | | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
2237 | 2248 | | |
2238 | | - | |
| 2249 | + | |
2239 | 2250 | | |
2240 | 2251 | | |
2241 | 2252 | | |
| |||
2968 | 2979 | | |
2969 | 2980 | | |
2970 | 2981 | | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
2971 | 2989 | | |
2972 | | - | |
| 2990 | + | |
2973 | 2991 | | |
2974 | 2992 | | |
2975 | 2993 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| |||
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
216 | | - | |
217 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
218 | 220 | | |
219 | 221 | | |
220 | 222 | | |
| |||
237 | 239 | | |
238 | 240 | | |
239 | 241 | | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
244 | 248 | | |
245 | 249 | | |
246 | 250 | | |
| |||
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
265 | 271 | | |
266 | 272 | | |
267 | 273 | | |
| |||
278 | 284 | | |
279 | 285 | | |
280 | 286 | | |
281 | | - | |
282 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
283 | 290 | | |
284 | 291 | | |
285 | 292 | | |
| |||
292 | 299 | | |
293 | 300 | | |
294 | 301 | | |
295 | | - | |
296 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
297 | 305 | | |
298 | 306 | | |
299 | 307 | | |
| |||
307 | 315 | | |
308 | 316 | | |
309 | 317 | | |
310 | | - | |
311 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
312 | 321 | | |
313 | 322 | | |
314 | 323 | | |
| |||
0 commit comments