-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve ClangCL support by disabling, fixing warnings #5876
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
This will certainly break if we don't test it, but I guess that's ok for now ("best effort"). If we get better Windows testing capability it would be worth adding. |
I'm wondering if a different approach here is appropriate... the only ClangCL-specific changes are:
I wonder if a better approach is to fix/selectively disable warnings and disable introspection on MSVC-like compilers using the usual macros. @steven-johnson -- any thoughts? |
Disabling |
d2ef021
to
014afc3
Compare
It does support
I wonder if clang-cl's Another wrinkle: ClangCL doesn't have exceptions enabled by default and it doesn't honor |
|
||
return load; |
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.
Ouch. I wonder if this was a bad merge. Probably worth turning on this warning explicitly.
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.
Yow. I'm genuinely surprised this is merely a warning.
@@ -571,7 +571,7 @@ class LowerWarpShuffles : public IRMutator { | |||
|
|||
Expr wild = Variable::make(Int(32), "*"); | |||
vector<Expr> result; | |||
int bits; | |||
int bits = 0; |
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.
The reason this isn't needed is extremely subtle: the function is_const_power_of_two_integer
returns true iff it initializes bits
. The first read of bits is guarded by short-circuit &&
below. ClangCL isn't clever enough to see this, and I don't blame it.
There's no downside to this (this is not performance-critical) and disabling uninitialized use warnings seems significantly worse.
return ""; | ||
#endif | ||
} |
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.
This emits an unreachable code warning.
@@ -529,7 +528,7 @@ struct TickStackEntry { | |||
int line; | |||
}; | |||
|
|||
vector<TickStackEntry> tick_stack; |
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.
Throws a warning about missing extern and that it should be static if module-local, which it is. No need to export this.
#endif | ||
|
||
#else | ||
WasmModule wasm_module; | ||
wasm_module.contents = new WasmModuleContents(module, arguments, fn_name, jit_externs, extern_deps); | ||
return wasm_module; | ||
#endif | ||
} |
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.
Similar to above: unreachable code.
@@ -1672,4 +1672,4 @@ Stmt vectorize_loops(const Stmt &stmt, const map<string, Function> &env, const T | |||
} | |||
|
|||
} // namespace Internal | |||
} // namespace Halide |
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.
This was the only file without a trailing newline.
Ouch -- yeah, maybe it's intended to be equivalent of MSVC's warning-level-4, which is pretty insanely high IIRC.
uh, what? how on earth would a clang-compatible(-ish) compiler omit this? |
@@ -568,12 +568,12 @@ class Buffer { | |||
Expr operator()(const Expr &first, Args... rest) const { | |||
std::vector<Expr> args = {first, rest...}; | |||
return (*this)(args); | |||
}; | |||
} |
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.
Ooh, I'd actually love to enable whatever warnings complains about this, it's a minor pet peeve of mine
Failures are unrelated (error in nightly LLVM13), ok to land |
Landing. Still need a way to reliably enable exceptions on ClangCL, but that can be done in another PR. This one's scope has crept far enough. |
Supersedes @emmenlau's #5858, which I guess didn't provide maintainers with write permissions to the PR branch.
Improves ClangCL support by disabling (or fixing) warnings its
-Wall
mode emits.