-
Notifications
You must be signed in to change notification settings - Fork 852
[clang][NFC] Remove redundant SPIR/SPIR-V TargetInfo types #23055
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
base: sycl
Are you sure you want to change the base?
Changes from all commits
3b156d9
6bad476
8e1eb32
cba0ce0
7e27893
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -279,24 +279,13 @@ class LLVM_LIBRARY_VISIBILITY SPIR64TargetInfo : public SPIRTargetInfo { | |
| MacroBuilder &Builder) const override; | ||
| }; | ||
|
|
||
| // spir64_fpga target | ||
| class LLVM_LIBRARY_VISIBILITY SPIR64FPGATargetInfo : public SPIR64TargetInfo { | ||
| public: | ||
| SPIR64FPGATargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) | ||
| : SPIR64TargetInfo(Triple, Opts) {} | ||
| virtual size_t getMaxBitIntWidth() const override { return 4096; } | ||
| }; | ||
|
|
||
| // x86-32 SPIR Windows target | ||
| class LLVM_LIBRARY_VISIBILITY WindowsX86_32SPIRTargetInfo | ||
| : public WindowsTargetInfo<SPIR32TargetInfo> { | ||
| public: | ||
| WindowsX86_32SPIRTargetInfo(const llvm::Triple &Triple, | ||
| const TargetOptions &Opts) | ||
| : WindowsTargetInfo<SPIR32TargetInfo>(Triple, Opts) { | ||
| DoubleAlign = LongLongAlign = 64; | ||
| WCharType = UnsignedShort; | ||
|
Comment on lines
-297
to
-298
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These removals are dependent on llvm/llvm-project#208196 having been merged via pulldown, aren't they? Likewise for the other
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, they are. |
||
| } | ||
| : WindowsTargetInfo<SPIR32TargetInfo>(Triple, Opts) {} | ||
|
|
||
| BuiltinVaListKind getBuiltinVaListKind() const override { | ||
| return TargetInfo::CharPtrBuiltinVaList; | ||
|
|
@@ -311,41 +300,16 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_32SPIRTargetInfo | |
| } | ||
| }; | ||
|
|
||
| // x86-32 SPIR Windows Visual Studio target | ||
| class LLVM_LIBRARY_VISIBILITY MicrosoftX86_32SPIRTargetInfo | ||
| : public WindowsX86_32SPIRTargetInfo { | ||
| public: | ||
| MicrosoftX86_32SPIRTargetInfo(const llvm::Triple &Triple, | ||
| const TargetOptions &Opts) | ||
| : WindowsX86_32SPIRTargetInfo(Triple, Opts) { | ||
| } | ||
|
|
||
| void getTargetDefines(const LangOptions &Opts, | ||
| MacroBuilder &Builder) const override { | ||
| WindowsX86_32SPIRTargetInfo::getTargetDefines(Opts, Builder); | ||
| // The value of the following reflects processor type. | ||
| // 300=386, 400=486, 500=Pentium, 600=Blend (default) | ||
| // We lost the original triple, so we use the default. | ||
| // TBD should we keep these lines? Copied from X86.h. | ||
| Builder.defineMacro("_M_IX86", "600"); | ||
| } | ||
| }; | ||
|
|
||
| // x86-64 SPIR64 Windows target | ||
| class LLVM_LIBRARY_VISIBILITY WindowsX86_64_SPIR64TargetInfo | ||
| : public WindowsTargetInfo<SPIR64TargetInfo> { | ||
|
Comment on lines
304
to
305
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to retain the Windows variants here? I was expecting them to be removable as well. Perhaps the places where these are still constructed can be replaced with, e.g.,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Properly doing this involves a pull down of upstream's host-delegating getBuiltinVaListKind, adding a protected adoptHostPointerTypes() called from the four concrete SPIR/SPIR-V constructors (guarded on matching pointer width, deliberately not from logical SPIRVTargetInfo), and a few more changes to CC_X86VectorCall, moving sse/sse2 into the base etc. I tried to keep this PR NFC but would it make sense to just go ahead and do these?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the cleaner option from a git history perspective would be to wait for the pulldown to complete and then remove all of the obsolete cases. But I'm not opposed to going in stages either if that is your preference. |
||
| public: | ||
| WindowsX86_64_SPIR64TargetInfo(const llvm::Triple &Triple, | ||
| const TargetOptions &Opts) | ||
| : WindowsTargetInfo<SPIR64TargetInfo>(Triple, Opts) { | ||
| LongWidth = LongAlign = 32; | ||
| DoubleAlign = LongLongAlign = 64; | ||
| IntMaxType = SignedLongLong; | ||
| Int64Type = SignedLongLong; | ||
| SizeType = UnsignedLongLong; | ||
| PtrDiffType = SignedLongLong; | ||
| IntPtrType = SignedLongLong; | ||
| WCharType = UnsignedShort; | ||
| } | ||
|
|
||
| BuiltinVaListKind getBuiltinVaListKind() const override { | ||
|
|
@@ -368,38 +332,16 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_64_SPIR64TargetInfo | |
| const std::vector<std::string> &FeaturesVec) const override; | ||
| }; | ||
|
|
||
| // x86-64 SPIR64 Windows Visual Studio target | ||
| class LLVM_LIBRARY_VISIBILITY MicrosoftX86_64_SPIR64TargetInfo | ||
| : public WindowsX86_64_SPIR64TargetInfo { | ||
| public: | ||
| MicrosoftX86_64_SPIR64TargetInfo(const llvm::Triple &Triple, | ||
| const TargetOptions &Opts) | ||
| : WindowsX86_64_SPIR64TargetInfo(Triple, Opts) { | ||
| } | ||
|
|
||
| void getTargetDefines(const LangOptions &Opts, | ||
| MacroBuilder &Builder) const override { | ||
| WindowsX86_64_SPIR64TargetInfo::getTargetDefines(Opts, Builder); | ||
| Builder.defineMacro("_M_X64", "100"); | ||
| Builder.defineMacro("_M_AMD64", "100"); | ||
| } | ||
| }; | ||
|
|
||
| // ARM64 SPIR64 Windows target | ||
| class LLVM_LIBRARY_VISIBILITY WindowsARM64_SPIR64TargetInfo | ||
| : public WindowsTargetInfo<SPIR64TargetInfo> { | ||
| public: | ||
| WindowsARM64_SPIR64TargetInfo(const llvm::Triple &Triple, | ||
| const TargetOptions &Opts) | ||
| : WindowsTargetInfo<SPIR64TargetInfo>(Triple, Opts) { | ||
| LongWidth = LongAlign = 32; | ||
| DoubleAlign = LongLongAlign = 64; | ||
| IntMaxType = SignedLongLong; | ||
| Int64Type = SignedLongLong; | ||
| SizeType = UnsignedLongLong; | ||
| PtrDiffType = SignedLongLong; | ||
| IntPtrType = SignedLongLong; | ||
| WCharType = UnsignedShort; | ||
| } | ||
|
|
||
| BuiltinVaListKind getBuiltinVaListKind() const override { | ||
|
|
@@ -412,20 +354,6 @@ class LLVM_LIBRARY_VISIBILITY WindowsARM64_SPIR64TargetInfo | |
| } | ||
| }; | ||
|
|
||
| // ARM64 SPIR64 Windows Visual Studio target | ||
| class LLVM_LIBRARY_VISIBILITY MicrosoftARM64_SPIR64TargetInfo | ||
| : public WindowsARM64_SPIR64TargetInfo { | ||
| public: | ||
| MicrosoftARM64_SPIR64TargetInfo(const llvm::Triple &Triple, | ||
| const TargetOptions &Opts) | ||
| : WindowsARM64_SPIR64TargetInfo(Triple, Opts) {} | ||
|
|
||
| void getTargetDefines(const LangOptions &Opts, | ||
| MacroBuilder &Builder) const override { | ||
| WindowsARM64_SPIR64TargetInfo::getTargetDefines(Opts, Builder); | ||
| } | ||
| }; | ||
|
|
||
| class LLVM_LIBRARY_VISIBILITY BaseSPIRVTargetInfo : public BaseSPIRTargetInfo { | ||
| public: | ||
| BaseSPIRVTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) | ||
|
|
@@ -566,10 +494,7 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_32SPIRV32TargetInfo | |
| public: | ||
| WindowsX86_32SPIRV32TargetInfo(const llvm::Triple &Triple, | ||
| const TargetOptions &Opts) | ||
| : WindowsTargetInfo<SPIRV32TargetInfo>(Triple, Opts) { | ||
| DoubleAlign = LongLongAlign = 64; | ||
| WCharType = UnsignedShort; | ||
| } | ||
| : WindowsTargetInfo<SPIRV32TargetInfo>(Triple, Opts) {} | ||
|
|
||
| BuiltinVaListKind getBuiltinVaListKind() const override { | ||
| return TargetInfo::CharPtrBuiltinVaList; | ||
|
|
@@ -584,39 +509,16 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_32SPIRV32TargetInfo | |
| } | ||
| }; | ||
|
|
||
| // x86-32 SPIRV32 Windows Visual Studio target | ||
| class LLVM_LIBRARY_VISIBILITY MicrosoftX86_32SPIRV32TargetInfo | ||
| : public WindowsX86_32SPIRV32TargetInfo { | ||
| public: | ||
| MicrosoftX86_32SPIRV32TargetInfo(const llvm::Triple &Triple, | ||
| const TargetOptions &Opts) | ||
| : WindowsX86_32SPIRV32TargetInfo(Triple, Opts) {} | ||
|
|
||
| void getTargetDefines(const LangOptions &Opts, | ||
| MacroBuilder &Builder) const override { | ||
| WindowsX86_32SPIRV32TargetInfo::getTargetDefines(Opts, Builder); | ||
| // The value of the following reflects processor type. | ||
| // 300=386, 400=486, 500=Pentium, 600=Blend (default) | ||
| // We lost the original triple, so we use the default. | ||
| Builder.defineMacro("_M_IX86", "600"); | ||
| } | ||
| }; | ||
|
|
||
| // x86-64 SPIRV64 Windows target | ||
| class LLVM_LIBRARY_VISIBILITY WindowsX86_64_SPIRV64TargetInfo | ||
| : public WindowsTargetInfo<SPIRV64TargetInfo> { | ||
| public: | ||
| WindowsX86_64_SPIRV64TargetInfo(const llvm::Triple &Triple, | ||
| const TargetOptions &Opts) | ||
| : WindowsTargetInfo<SPIRV64TargetInfo>(Triple, Opts) { | ||
| LongWidth = LongAlign = 32; | ||
| DoubleAlign = LongLongAlign = 64; | ||
| IntMaxType = SignedLongLong; | ||
| Int64Type = SignedLongLong; | ||
| SizeType = UnsignedLongLong; | ||
| PtrDiffType = SignedLongLong; | ||
| IntPtrType = SignedLongLong; | ||
| WCharType = UnsignedShort; | ||
| } | ||
|
|
||
| BuiltinVaListKind getBuiltinVaListKind() const override { | ||
|
|
@@ -634,37 +536,16 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_64_SPIRV64TargetInfo | |
| } | ||
| }; | ||
|
|
||
| // x86-64 SPIRV64 Windows Visual Studio target | ||
| class LLVM_LIBRARY_VISIBILITY MicrosoftX86_64_SPIRV64TargetInfo | ||
| : public WindowsX86_64_SPIRV64TargetInfo { | ||
| public: | ||
| MicrosoftX86_64_SPIRV64TargetInfo(const llvm::Triple &Triple, | ||
| const TargetOptions &Opts) | ||
| : WindowsX86_64_SPIRV64TargetInfo(Triple, Opts) {} | ||
|
|
||
| void getTargetDefines(const LangOptions &Opts, | ||
| MacroBuilder &Builder) const override { | ||
| WindowsX86_64_SPIRV64TargetInfo::getTargetDefines(Opts, Builder); | ||
| Builder.defineMacro("_M_X64", "100"); | ||
| Builder.defineMacro("_M_AMD64", "100"); | ||
| } | ||
| }; | ||
|
|
||
| // ARM64 SPIRV64 Windows target | ||
| class LLVM_LIBRARY_VISIBILITY WindowsARM64_SPIRV64TargetInfo | ||
| : public WindowsTargetInfo<SPIRV64TargetInfo> { | ||
| public: | ||
| WindowsARM64_SPIRV64TargetInfo(const llvm::Triple &Triple, | ||
| const TargetOptions &Opts) | ||
| : WindowsTargetInfo<SPIRV64TargetInfo>(Triple, Opts) { | ||
| LongWidth = LongAlign = 32; | ||
| DoubleAlign = LongLongAlign = 64; | ||
| IntMaxType = SignedLongLong; | ||
| Int64Type = SignedLongLong; | ||
| SizeType = UnsignedLongLong; | ||
| PtrDiffType = SignedLongLong; | ||
| IntPtrType = SignedLongLong; | ||
| WCharType = UnsignedShort; | ||
| } | ||
|
|
||
| BuiltinVaListKind getBuiltinVaListKind() const override { | ||
|
|
@@ -677,20 +558,6 @@ class LLVM_LIBRARY_VISIBILITY WindowsARM64_SPIRV64TargetInfo | |
| } | ||
| }; | ||
|
|
||
| // ARM64 SPIRV64 Windows Visual Studio target | ||
| class LLVM_LIBRARY_VISIBILITY MicrosoftARM64_SPIRV64TargetInfo | ||
| : public WindowsARM64_SPIRV64TargetInfo { | ||
| public: | ||
| MicrosoftARM64_SPIRV64TargetInfo(const llvm::Triple &Triple, | ||
| const TargetOptions &Opts) | ||
| : WindowsARM64_SPIRV64TargetInfo(Triple, Opts) {} | ||
|
|
||
| void getTargetDefines(const LangOptions &Opts, | ||
| MacroBuilder &Builder) const override { | ||
| WindowsARM64_SPIRV64TargetInfo::getTargetDefines(Opts, Builder); | ||
| } | ||
| }; | ||
|
|
||
| class LLVM_LIBRARY_VISIBILITY SPIRV64AMDGCNTargetInfo final | ||
| : public BaseSPIRVTargetInfo { | ||
| public: | ||
|
|
||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per one of my other comments, can this be changed to match what is done for Linux?