LLVM backends like X86 always lowers prefetch intrinsics into similar
type if the desired one is not available.
For example, T2 hint -> T1 or write hint -> read. See llvm/test/CodeGen/X86/prefetch.ll
However, it's not clear for backend to choose between "write data" or "read
instruction" if there is no native "write instruction" instructions.
As far as I know, there's no upstream target that has supported "write
instruction" at the moment. So there should be no real impact by this
patch.
Details
- Reviewers
craig.topper uweigand lenary efriedma
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The Arm changes (for tests) here are reasonable, and indeed both arm architectures do not allocate encoding space for instruction write.
llvm/test/CodeGen/SystemZ/prefetch-01.ll | ||
---|---|---|
18 | If we decide to declare this invalid, then I'd prefer to remove the test instead of commenting it out. |
clang/lib/Sema/SemaChecking.cpp | ||
---|---|---|
7574 | Not clear to me that we should be changing the definition of __builtin_prefetch. It wouldn't cost much to add a new builtin for X86 for the new instructions. |
clang/lib/Sema/SemaChecking.cpp | ||
---|---|---|
7574 | It definitely shouldn't be buried in this patch the way it is currently titled and described. |
llvm/lib/IR/Verifier.cpp | ||
---|---|---|
5180 | Should add new verifier tests for this. Also, if this requires any auto upgrade, I would appreciate adding address space mangling to the intrinsic at the same time |
Not clear to me that we should be changing the definition of __builtin_prefetch.
It wouldn't cost much to add a new builtin for X86 for the new instructions.