Skip to content

Fix some uninitialized pointer usage in Driver #1683

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

Merged
merged 1 commit into from
May 13, 2020

Conversation

jinge90
Copy link
Contributor

@jinge90 jinge90 commented May 13, 2020

Signed-off-by: gejin [email protected]

@jinge90 jinge90 force-pushed the fix_uinitialized_ptr_use_driver branch from 826b84f to 67228b5 Compare May 13, 2020 06:22
@AGindinson
Copy link
Contributor

A [SYCL] tag would also be desired for the commit message. Thanks in advance!

@jinge90 jinge90 force-pushed the fix_uinitialized_ptr_use_driver branch from 67228b5 to c3569b5 Compare May 13, 2020 07:42
@jinge90
Copy link
Contributor Author

jinge90 commented May 13, 2020

A [SYCL] tag would also be desired for the commit message. Thanks in advance!

The tag is added. Thank you for kind remind.

@jinge90 jinge90 force-pushed the fix_uinitialized_ptr_use_driver branch from c3569b5 to 872ae70 Compare May 13, 2020 07:54
@bader bader merged commit 5e05e2e into intel:sycl May 13, 2020
@jinge90 jinge90 deleted the fix_uinitialized_ptr_use_driver branch May 30, 2020 06:43
Fznamznon pushed a commit to Fznamznon/llvm that referenced this pull request Nov 8, 2022
One of the reasons behind this change is to make code more easily deal with the
future prospect of opaque types, so that helper methods (like adjusting image
types) can handle both pointer type and opaque type representations simply by
querying if the input type is a TypedPointerType or an OpaqueType [name for the
latter still pending].

The set of changes are:
* OCLTypeToSPIRV now uses TypedPointerType internally
* adaptSPIRVImageType and getSPIRVStructTypeByChangeBaseTypeName are collapsed
  into one method (adjustImageType) that works with TypedPointerTypes.
* A few is*StructType methods have been reverted back to is*Type methods, taking
  a TypedPointerType parameter instead.
* BuiltinCallHelper::addSPIRVCall{Pair} allows for the creation of SPIR-V calls
  that can use TypedPointerType or actual type for parameters and return value.
* BuiltinCallHelper::getCallValue{Type} is a simple helper that hides many of
  the uses of getParameterTypes.
* The Type* parameter of the callback in BuiltinCallMutator::mapArg now provides
  a TypedPointerType or the actual type, instead of the pointer element type.
* BuiltinCallMutator::ValueTypePair similarly takes a TypedPointerType or the
  actual type.
* getParameterTypes (when passed a SmallVector<Type *>) does a similar thing.
  (The SmallVector<TypedPointerType *> variant has been removed in favor of only
  using the other one.)

Note that the last few changes do change the semantics of function parameters
without changing the function name or signature.

Co-authored-by: Dmitry Sidorov <[email protected]>

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@5ce6a99
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.

4 participants