[PATCH] D142797: [X86] Make `prefetchit{0/1}` emit an assembler warning if the operand is not rip-rel

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 28 09:54:46 PST 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/test/CodeGen/X86/prefetchi-warning.ll:1
+; -filetype=obj as the warning is from the assembler
+; RUN: llc -filetype=obj -mtriple=x86_64-- -mattr=+prefetchi < %s 2>&1 | FileCheck %s
----------------
goldstein.w.n wrote:
> pengfei wrote:
> > This seems miss a half use case. User may use gas rather than native assembler. Maybe move it to early pass? `X86InstrInfo::verifyInstruction` looks like an ideal place, but it is just for error check.
> > This seems miss a half use case. User may use gas rather than native assembler. Maybe move it to early pass? `X86InstrInfo::verifyInstruction` looks like an ideal place, but it is just for error check.
> 
> Or pass files assembler by GCC/hand-written to llvm-as...
> Imo it makes more sense in `gas` + `llvm-as` than earlier.
> This seems miss a half use case. User may use gas rather than native assembler. Maybe move it to early pass? `X86InstrInfo::verifyInstruction` looks like an ideal place, but it is just for error check.

So the warning exists in GAS at the moment, since these commits:
```
commit ef07be453e0edf2f43034fcbc0581f61e630993e
Author: Cui, Lili <lili.cui at intel.com>
Date:   Mon Oct 31 21:07:17 2022 +0800

    Support Intel PREFETCHI

commit f2462532e24ebfc137598d73ee6541948121f040
Author: H.J. Lu <hjl.tools at gmail.com>
Date:   Mon Oct 31 09:01:15 2022 -0700

    x86: Silence GCC 12 warning on tc-i386.c
```

New warning matches verbatim with GAS.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142797/new/

https://reviews.llvm.org/D142797



More information about the llvm-commits mailing list