-
Notifications
You must be signed in to change notification settings - Fork 787
[ESIMD] Fix usage of uninitialized field ESIMDVerifier::ForceStateles… #8000
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
Conversation
@@ -187,4 +187,6 @@ INITIALIZE_PASS_BEGIN(ESIMDVerifier, DEBUG_TYPE, "ESIMD-specific IR verifier", | |||
INITIALIZE_PASS_END(ESIMDVerifier, DEBUG_TYPE, "ESIMD-specific IR verifier", | |||
false, false) | |||
|
|||
ModulePass *llvm::createESIMDVerifierPass() { return new ESIMDVerifier(); } | |||
ModulePass *llvm::createESIMDVerifierPass(bool MayNeedForceStatelessMemModeAPI) { |
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.
Before this PR: Creation of ESIMDVerifier() without arguments left the field 'ForceStatelessMem' uninitialized and thus having random value.
@@ -173,7 +173,7 @@ struct ESIMDVerifier : public ModulePass { | |||
} | |||
|
|||
bool runOnModule(Module &M) override { | |||
ESIMDVerifierImpl(M, ForceStatelessMem).verify(); | |||
ESIMDVerifierImpl(M, MayNeedForceStatelessMemModeAPI).verify(); |
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.
Before this PR: ForceStatelessMem field was used uninitialized here.
…sMem The field was properly initialized in 'ESIMDVerifierPass` struct, but not in `ESIMDVerifier`. The first one gets the proper/guarantted value from LangOpts.SYCLESIMDForceStatelessMem, while the second(i.e. ESIMDVerifier) could not do the same as it is initialized from llvm::createESIMDVerifierPass() Fixing this issue showed that those SYCL methods that are allowed with -fsycl-esimd-force-stateless-mem, can potentially and legally be used in some other modes, for example, when used in LLVM IR consumed by 'opt' component. Thus the meaning and name of the corresponding fields in ESIMDVerifier and ESIMDVerifierPass structs were renamed from ForceStatelessMem to MayNeedForceStatelessMemModeAPI. Signed-off-by: Vyacheslav N Klochkov <vyacheslav.n.klochkov@intel.com>
f5bc63c
to
53f9622
Compare
…sMem
The field was properly initialized in 'ESIMDVerifierPass
struct, but not in
ESIMDVerifier`.The first one gets the proper/guarantted value from LangOpts.SYCLESIMDForceStatelessMem, while the second(i.e. ESIMDVerifier) could not do the same as it is initialized from
llvm::createESIMDVerifierPass()
Fixing this issue showed that those SYCL methods that are allowed with -fsycl-esimd-force-stateless-mem, can potentially and legally be used in some other modes, for example, when used in LLVM IR consumed by 'opt' component. Thus the meaning and name of the corresponding fields in ESIMDVerifier and ESIMDVerifierPass structs were renamed from ForceStatelessMem to MayNeedForceStatelessMemModeAPI.
Signed-off-by: Vyacheslav N Klochkov vyacheslav.n.klochkov@intel.com