daltenty added a comment.

In D89696#2344797 <https://reviews.llvm.org/D89696#2344797>, @jhuber6 wrote:

> In D89696#2344753 <https://reviews.llvm.org/D89696#2344753>, @daltenty wrote:
>
>> In D89696#2344508 <https://reviews.llvm.org/D89696#2344508>, @jhuber6 wrote:
>>
>>> @daltenty Do you think this will fix the problem on AIX?
>>
>> It's not just AIX that will have this problem I suspect. If you configure 
>> any cross-compiling build with a 64-bit host, targeting a 32-bit arch, your 
>> going to run into the problem. I think checking against a list of known 
>> 64-bit arches is good enough for the purposes here, but the check still 
>> needs to be against the target, not the host.
>>
>> Also, the frontend diagnostic looks like it is off for the same reason:
>>
>>   else if (getArchPtrSize(T) != getArchPtrSize(TT))
>>     Diags.Report(diag::err_drv_incompatible_omp_arch)
>>
>> T seems to be the target triple, not the host, but the diagnostic reads: 
>> `pointer size is incompatible with host`.
>
> TT is the target triple, otherwise the error message would be backwards, x86 
> is the OpenMP target architecture and PPC is the host architecture. I'm not 
> sure what you mean by checking the target rather than the host. The target is 
> set explicitly by `-fopenmp-targets=<triple>`, since it's being set in the 
> test file we try to make sure that the host matches it. If this was just a 
> frontend test we could just specify the host Triple and be done with it. 
> Maybe we could add some CMake options for which offloading libraries were 
> built?

Sorry I think I understand what's maybe happening here. I guess the OpenMP 
terminology here doesn't mesh with really well with the LLVM usages. The term 
"host" seems to be overloaded to mean two different things, either the OpenMP 
host target arch ("OpenMP host") or the arch LLVM was compiled for ("LLVM host 
triple").

So in this case, with AIX we have:

The OpenMP target from commandine is x86
The architecture clang/llvm is compiled for is PPC64 ("LLVM host triple")
The architecture the frontend is set to emit for/target is PPC32 ("OpenMP host 
architecture", "LLVM target triple")

(This is also what makes the diagnostic confusing, is it talking about the 
OpenMP host or the compiler host?)

The lit infrastructure uses the LLVM meaning, so config.host_triple is the 
compiler host, not the LLVM target / OpenMP host architecture. That is what I 
mean when I say "check the target instead", I mean check the LLVM target 
instead of the LLVM host triple.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89696

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to