| Issue |
241375
|
| Summary |
[X86] UINTR remains disabled after -64bit-mode,+64bit-mode,+uintr
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
SeanTAllen
|
On x86-64 with LLVM 23.1.3, `llc -mattr=+uintr uintr.ll -o enabled.s` succeeds, but `llc -mattr=-64bit-mode,+64bit-mode,+uintr uintr.ll -o restored.s` aborts with `LLVM ERROR: Cannot select: intrinsic %llvm.x86.clui`. The final feature entries enable both 64-bit mode and UINTR, so the earlier mode removal should not leave UINTR disabled. Minimal `uintr.ll`:
```llvm
target triple = "x86_64-pc-linux-gnu"
declare void @llvm.x86.clui()
define void @probe() {
call void @llvm.x86.clui()
ret void
}
```
`X86Subtarget::initSubtargetFeatures` searches the entire feature string for `-64bit-mode` and appends `-uintr` plus disables for several APX features before parsing the entries. The appended disables override the later positive entries. A breakpoint at `ParseSubtargetFeatures` confirms the trailing disables are present despite a final `+64bit-mode`. The same failure occurs when ponyc passes these features through function attributes to LTO. An equivalent C shim using `__builtin_ia32_clui()` compiles successfully: Clang supplies a canonical feature list without the earlier negative mode entry. Filtering 64-bit-only features by the effective mode would preserve the valid restored-mode case.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs