Skip to content
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

Remove _SPIRV_LLVM_API #9

Closed
pierremoreau opened this issue Apr 15, 2018 · 1 comment
Closed

Remove _SPIRV_LLVM_API #9

pierremoreau opened this issue Apr 15, 2018 · 1 comment

Comments

@pierremoreau
Copy link
Contributor

When setting SPIRV_USE_LLVM_API to OFF, the code does not compile due to some parts of the code not using that macro and always using the LLVM API (see further down). The code could be fixed to ensure that the entrypoints properly convert the LLVM streams to the std ones, if needed, but is this option really that useful/used?

/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/SPIRVWriter.cpp:1858:6: error: invalid operands to binary expression ('llvm::raw_ostream' and 'SPIRV::SPIRVModule')
  OS << *BM;
  ~~ ^  ~~~
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:201:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const void *' for 1st argument; take the address of the argument with &
  raw_ostream &operator<<(const void *P);
               ^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVModule.h:325:24: note: candidate function not viable: no known conversion from 'llvm::raw_ostream' to 'std::ostream &' (aka 'basic_ostream<char> &') for 1st argument
  friend spv_ostream & operator<<(spv_ostream &O, SPIRVModule& M);
                       ^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:150:1: note: candidate function not viable: no known conversion from 'llvm::raw_ostream' to 'const SPIRV::SPIRVEncoder' for 1st argument
operator<<(const SPIRVEncoder& O, T V) {
^
/home/pmoreau/projects/llvm/include/llvm/ADT/APInt.h:2018:21: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const llvm::APInt' for 2nd argument
inline raw_ostream &operator<<(raw_ostream &OS, const APInt &I) {
                    ^
/home/pmoreau/projects/llvm/include/llvm/IR/Value.h:670:21: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const llvm::Value' for 2nd argument
inline raw_ostream &operator<<(raw_ostream &OS, const Value &V) {
                    ^
/home/pmoreau/projects/llvm/include/llvm/IR/Type.h:455:21: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const llvm::Type' for 2nd argument
inline raw_ostream &operator<<(raw_ostream &OS, const Type &T) {
                    ^
/home/pmoreau/projects/llvm/include/llvm/ADT/Twine.h:533:23: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const llvm::Twine' for 2nd argument
  inline raw_ostream &operator<<(raw_ostream &OS, const Twine &RHS) {
                      ^
/home/pmoreau/projects/llvm/include/llvm/IR/Metadata.h:160:21: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const llvm::Metadata' for 2nd argument
inline raw_ostream &operator<<(raw_ostream &OS, const Metadata &MD) {
                    ^
/home/pmoreau/projects/llvm/include/llvm/IR/Comdat.h:64:21: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const llvm::Comdat' for 2nd argument
inline raw_ostream &operator<<(raw_ostream &OS, const Comdat &C) {
                    ^
/home/pmoreau/projects/llvm/include/llvm/IR/Module.h:859:21: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const llvm::Module' for 2nd argument
inline raw_ostream &operator<<(raw_ostream &O, const Module &M) {
                    ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:145:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'char' for 1st argument
  raw_ostream &operator<<(char C) {
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:152:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'unsigned char' for 1st argument
  raw_ostream &operator<<(unsigned char C) {
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:159:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'signed char' for 1st argument
  raw_ostream &operator<<(signed char C) {
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:166:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'llvm::StringRef' for 1st argument
  raw_ostream &operator<<(StringRef Str) {
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:181:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const char *' for 1st argument
  raw_ostream &operator<<(const char *Str) {
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:188:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const std::string' (aka 'const basic_string<char>') for 1st argument
  raw_ostream &operator<<(const std::string &Str) {
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:193:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const SmallVectorImpl<char>' for 1st argument
  raw_ostream &operator<<(const SmallVectorImpl<char> &Str) {
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:197:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'unsigned long' for 1st argument
  raw_ostream &operator<<(unsigned long N);
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:198:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'long' for 1st argument
  raw_ostream &operator<<(long N);
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:199:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'unsigned long long' for 1st argument
  raw_ostream &operator<<(unsigned long long N);
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:200:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'long long' for 1st argument
  raw_ostream &operator<<(long long N);
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:203:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'unsigned int' for 1st argument
  raw_ostream &operator<<(unsigned int N) {
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:207:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'int' for 1st argument
  raw_ostream &operator<<(int N) {
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:211:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'double' for 1st argument
  raw_ostream &operator<<(double N);
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:228:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const llvm::format_object_base' for 1st argument
  raw_ostream &operator<<(const format_object_base &Fmt);
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:231:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const llvm::FormattedString' for 1st argument
  raw_ostream &operator<<(const FormattedString &);
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:234:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const llvm::FormattedNumber' for 1st argument
  raw_ostream &operator<<(const FormattedNumber &);
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:237:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const llvm::formatv_object_base' for 1st argument
  raw_ostream &operator<<(const formatv_object_base &);
               ^
/home/pmoreau/projects/llvm/include/llvm/Support/raw_ostream.h:240:16: note: candidate function not viable: no known conversion from 'SPIRV::SPIRVModule' to 'const llvm::FormattedBytes' for 1st argument
  raw_ostream &operator<<(const FormattedBytes &);
               ^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:190:1: note: candidate function not viable: no known conversion from 'llvm::raw_ostream' to 'const SPIRV::SPIRVEncoder' for 1st argument
SPIRV_DEC_ENCDEC(Op)
^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:185:21: note: expanded from macro 'SPIRV_DEC_ENCDEC'
const SPIRVEncoder& \
                    ^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:191:1: note: candidate function not viable: no known conversion from 'llvm::raw_ostream' to 'const SPIRV::SPIRVEncoder' for 1st argument
SPIRV_DEC_ENCDEC(Capability)
^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:185:21: note: expanded from macro 'SPIRV_DEC_ENCDEC'
const SPIRVEncoder& \
                    ^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:192:1: note: candidate function not viable: no known conversion from 'llvm::raw_ostream' to 'const SPIRV::SPIRVEncoder' for 1st argument
SPIRV_DEC_ENCDEC(Decoration)
^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:185:21: note: expanded from macro 'SPIRV_DEC_ENCDEC'
const SPIRVEncoder& \
                    ^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:193:1: note: candidate function not viable: no known conversion from 'llvm::raw_ostream' to 'const SPIRV::SPIRVEncoder' for 1st argument
SPIRV_DEC_ENCDEC(OCLExtOpKind)
^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:185:21: note: expanded from macro 'SPIRV_DEC_ENCDEC'
const SPIRVEncoder& \
                    ^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:194:1: note: candidate function not viable: no known conversion from 'llvm::raw_ostream' to 'const SPIRV::SPIRVEncoder' for 1st argument
SPIRV_DEC_ENCDEC(LinkageType)
^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:185:21: note: expanded from macro 'SPIRV_DEC_ENCDEC'
const SPIRVEncoder& \
                    ^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:197:1: note: candidate function not viable: no known conversion from 'llvm::raw_ostream' to 'const SPIRV::SPIRVEncoder' for 1st argument
operator<<(const SPIRVEncoder&O, const std::string& Str);
^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:164:1: note: candidate template ignored: could not match 'T *' against 'SPIRV::SPIRVModule'
operator<<(const SPIRVEncoder& O, T* P) {
^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:170:1: note: candidate template ignored: could not match 'vector<type-parameter-0-0, allocator<type-parameter-0-0> >' against 'SPIRV::SPIRVModule'
operator<<(const SPIRVEncoder& O, const std::vector<T>& V) {
^
/home/pmoreau/projects/llvm/tools/SPIRV-LLVM-Translator/lib/SPIRV/libSPIRV/SPIRVStream.h:178:1: note: candidate template ignored: could not match 'pair<type-parameter-0-0, type-parameter-0-0>' against 'SPIRV::SPIRVModule'
operator<<(const SPIRVEncoder& Encoder, const std::pair<IterTy,IterTy> &Range) {
^
/home/pmoreau/projects/llvm/include/llvm/Support/ScaledNumber.h:731:23: note: candidate template ignored: could not match 'ScaledNumber<type-parameter-0-0>' against 'llvm::raw_ostream'
ScaledNumber<DigitsT> operator<<(const ScaledNumber<DigitsT> &L,
                      ^
/home/pmoreau/projects/llvm/include/llvm/Support/ScaledNumber.h:743:14: note: candidate template ignored: could not match 'ScaledNumber<type-parameter-0-0>' against 'SPIRV::SPIRVModule'
raw_ostream &operator<<(raw_ostream &OS, const ScaledNumber<DigitsT> &X) {
             ^
19 warnings and 1 error generated.
ninja: build stopped: subcommand failed.
@pierremoreau
Copy link
Contributor Author

@AlexeySotkin and @bader: any opinions on this?

pierremoreau added a commit to pierremoreau/SPIRV-LLVM-Translator that referenced this issue Jun 9, 2018
The default remains the same, i.e. using the LLVM API, but removes the
option of using the std API, as it was untested and failed to compile.

Fixes KhronosGroup#9
pierremoreau added a commit to pierremoreau/SPIRV-LLVM-Translator that referenced this issue Dec 13, 2018
The default is changed from llvm::raw_ostream to std::ostream.

Fixes KhronosGroup#9
pierremoreau added a commit to pierremoreau/SPIRV-LLVM-Translator that referenced this issue Dec 13, 2018
The default is changed from llvm::raw_ostream to std::ostream.

Fixes KhronosGroup#9

Signed-off-by: Pierre Moreau <[email protected]>
pierremoreau added a commit to pierremoreau/SPIRV-LLVM-Translator that referenced this issue Dec 25, 2018
The default is changed from llvm::raw_ostream to std::ostream.

Fixes KhronosGroup#9
pierremoreau added a commit to pierremoreau/SPIRV-LLVM-Translator that referenced this issue Dec 25, 2018
The default is changed from llvm::raw_ostream to std::ostream.

Fixes KhronosGroup#9
pierremoreau added a commit to pierremoreau/SPIRV-LLVM-Translator that referenced this issue Feb 4, 2019
The default is changed from llvm::raw_ostream to std::ostream.

Fixes KhronosGroup#9
AlexeySotkin pushed a commit that referenced this issue Feb 15, 2019
The default is changed from llvm::raw_ostream to std::ostream.

Fixes #9
StuartDBrady pushed a commit to StuartDBrady/SPIRV-LLVM-Translator that referenced this issue Jul 16, 2019
The default is changed from llvm::raw_ostream to std::ostream.

Fixes KhronosGroup#9
StuartDBrady pushed a commit to StuartDBrady/SPIRV-LLVM-Translator that referenced this issue Jul 17, 2019
The default is changed from llvm::raw_ostream to std::ostream.

Fixes KhronosGroup#9
AlexeySotkin pushed a commit that referenced this issue Jul 29, 2019
The default is changed from llvm::raw_ostream to std::ostream.

Fixes #9
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this issue Sep 1, 2022
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this issue Sep 1, 2022
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this issue Sep 1, 2022
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this issue Sep 1, 2022
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this issue Sep 1, 2022
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this issue Sep 1, 2022
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this issue Sep 1, 2022
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this issue Sep 1, 2022
… in SPIR-V (KhronosGroup#9.. 'master' -> 'xmain-web' (KhronosGroup#46)

  CONFLICT (content): Merge conflict in lib/SPIRV/SPIRVToLLVMDbgTran.cpp

  commit aa78268
  Author: KornevNikita <[email protected]>
  Date:   Mon Mar 22 18:22:21 2021 +0300

      [SPIRV] Encode CodeView checksum information in SPIR-V (KhronosGroup#936)

      * [SPIRV] Encode CodeView checksum information in SPIR-V

      This is a workaround to keep CodeView checksum information throughout the
      translation. The idea is to store checksum kind and value to Ops[TextIdx]
      and then parse this string while creating DIFile.

Change-Id: I9a8efbc778a908467403ab13a8568550c97fee4b
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this issue Sep 1, 2022
… on arrays (KhronosGroup#9.. 'master' -> 'xmain-web' (#1)

  CONFLICT (content): Merge conflict in test/transcoding/IntelFPGAMemoryAttributes.ll

  commit ea6935b
  Author: Dmitry <[email protected]>
  Date:   Wed Apr 14 13:13:13 2021 +0300

      Fix incorrect translation of FPGA decoration on arrays (KhronosGroup#983)

      * Fix incorrect translation of FPGA decoration on arrays

      var.annotation shall be emitted, but instead the translator was
      generating ptr.annotation. It was happening due to incorrect assumption,
      that for attributed static memory variable decoration shall be applied
      to alloca instruction, whilst in the reality the alloca instruction
      might be hidden by several cast instructions.

      Signed-off-by: Dmitry Sidorov <[email protected]>

Change-Id: I2783612ff414be252dfa82a24d4fbcd78f845ac3
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this issue Sep 1, 2022
…coration use cases accord.. '"master"' -> '"xmain-web"' (111 commits) (KhronosGroup#9)

  CONFLICT (content): Merge conflict in lib/SPIRV/SPIRVWriter.cpp
  CONFLICT (content): Merge conflict in lib/SPIRV/SPIRVReader.cpp

  commit 4eb63bf
  Author: Dmitry Bushev <[email protected]>
  Date:   Wed Sep 15 17:44:06 2021 +0300

      Amend SingleElementVectorINTEL decoration use cases according to spec update (KhronosGroup#1192)

      DecorationSingleElementVectorINTEl now has one extra operand
      representing number of pointer stars owned by the element of vector.
      It helps to restore scalars after translation back. Eg:

      <i32* x 1>** -> i32*** "VCSingleElementVector"="1"

      Also it now can be applied to global variables.

Co-authored-by: iclsrc <[email protected]>
Co-authored-by: Sebastian Peryt <[email protected]>
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this issue Sep 1, 2022
…rINTEL decoration use cases accord.. '"master"' -> '"xmain-web"' (111 commits) (KhronosGroup#9)

  CONFLICT (content): Merge conflict in lib/SPIRV/SPIRVWriter.cpp
  CONFLICT (content): Merge conflict in lib/SPIRV/SPIRVReader.cpp

  commit 4eb63bf
  Author: Dmitry Bushev <[email protected]>
  Date:   Wed Sep 15 17:44:06 2021 +0300

      Amend SingleElementVectorINTEL decoration use cases according to spec update (KhronosGroup#1192)

      DecorationSingleElementVectorINTEl now has one extra operand
      representing number of pointer stars owned by the element of vector.
      It helps to restore scalars after translation back. Eg:

      <i32* x 1>** -> i32*** "VCSingleElementVector"="1"

      Also it now can be applied to global variables.

Co-authored-by: iclsrc <[email protected]>
Co-authored-by: Sebastian Peryt <[email protected]>
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

No branches or pull requests

1 participant