Skip to content

[SYCL] Add MSVC predefined type characteristics for wchar VaListKind,… #284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

mibintc
Copy link

@mibintc mibintc commented Jul 2, 2019

… temporary workaround vectorcall problem

Signed-off-by: Melanie Blower [email protected]

@mibintc mibintc requested a review from againull July 2, 2019 19:13
@againull
Copy link
Contributor

againull commented Jul 2, 2019

Could you please shorten the subject of the commit message. Please move details to commit message body.

Add MSVC-specific predefined type characteristics for wchar, builtin
VaListKind, and a temporary workaround for the vectorcall attribute.
We'll allow vectorcall to appear on function declarations, since they
occur in the Microsoft headers, but we won't allow or will ignore
vectorcall on function invocations from SYCL target. The handling for
vectorcall is a work in progress.

Signed-off-by: Melanie Blower <[email protected]>
@@ -74,6 +74,8 @@ class LLVM_LIBRARY_VISIBILITY SPIRTargetInfo : public TargetInfo {
// Define available target features
// These must be defined in sorted order!
NoAsmVariants = true;
if (Triple.isWindowsMSVCEnvironment() && Triple.isSYCLDeviceEnvironment())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change to SYCL device compiler?
If so, I'm not sure I understand that msvc environment is valid configuration here.
According to my understanding it can be used only for aux-triple, but target triple, which is currently can be only SPIR.
I think setting msvc environment might be interpreted by the compiler that the device compiler supports MCVC runtime libraries, which might not be provided by the OpenCL implementation.

Could clarify, please?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When compiling with Windows system headers, for compatibility with Windows, the sizeof wchar needs to be unsigned short. @romanovvlad wants this to be restricted to sycl device so that it doesn't interfere with OpenCL, @v-klochkov requested the msvc restricton

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS The aux-triple isn't completely implemented yet, if possible i'll change the if- to something more acceptable when the aux-triple changes are fixed/incorporated

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Melanie, when you say that aux triple changes not incorporated yet, what do you mean?
// (1). Generate LLVM IR for SPIR64 target
"C:\Users\vklochko\ws\gs_winfix2_public\build\bin\clang.EXE" "-cc1" "-triple" "spir64-unknown-windows-sycldevice" "-std=c++14" "-fms-extensions" "-fsycl-is-device" "-aux-triple" "x86_64-pc-windows-msvc" "-disable-llvm-passes" "-emit-llvm-bc" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "accessor.cpp" ... ... ... ...
Here we have triple="spir64-unknown-windows-sycldevice" and aux-triple="x86_64-pc-windows-msvc"

Is there some way to check that a) triple targets sycldevice and b) aux-triple targets msvc ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the settings from aux-triple aren't available here, i'm preparing a separate patch to address this problem.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, understood. I didn't know about problems with aux-triple.
Then for now I suggest replacing 'isWindowsMSVCEnvironment()' (i.e. "-aux-triple" "x86_64-pc-windows-msvc") with check of Windows only from here (spir64-unknown-windows-sycldevice)

Copy link
Author

@mibintc mibintc Jul 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@v-klochkov I'm sorry i don't know what you mean exactly, you want me to change SPIR.h to use "isWindows" instead of the current? And you want me to change the lit test case too?

Alternatively can i add a FIXME comment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mibintc, today SYCL device compiler support compilation only for SPIR target (or one of its sub-targets) and only for sycldevice environment (i.e. spir/spir64---sycldevice).
This PR enables unsupported test case, so it's not clear why it's implemented this way.

To detect compilation for Windows, we should check "OS" triple component.
isWindowsMSVCEnvironment check doesn't make sense for SYCL device compilation.

@mibintc
Copy link
Author

mibintc commented Jul 16, 2019

I have created updates to this PR, they are available for code review in #325
I am closing this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants