Merged
Conversation
We want to handle OpKill better. The wrap opkill causes lots of extra code to be generated, even when they are not needed to avoid the main problem: OpKill cannot be found directly in a continue construct. This change will be more selective on which functions the OpKill will be wrapped and inlining will avoid inlining. Fixes KhronosGroup#2912
Collaborator
Author
|
@greg-lunarg FYI |
Contributor
|
@s-perron Could a function call get moved into a continue construct by an optimization pass? |
Collaborator
Author
|
@paulthomson I cannot think of any optimizations we currently do that would do that. The only one that would do anything similar to that would be code-sinking, but that should not be moving function calls. |
ehsannas
approved these changes
Oct 4, 2019
Contributor
ehsannas
left a comment
There was a problem hiding this comment.
LGTM. Just a couple of nits
source/opt/inline_pass.cpp
Outdated
|
|
||
| if (has_opkill) { | ||
| return false; | ||
| } |
Contributor
There was a problem hiding this comment.
just a nit; the code would be easier to understand with fewer nesting:
bool func_has_opkill = !func->WhileEachInst([](Instruction* inst) { return inst->opcode() != SpvOpKill; });
bool func_is_called_from_continue = funcs_called_from_continue_.count(func->result_id()) != 0;
if (func_has_opkill && func_is_called_from_continue)
return false;
Collaborator
Author
There was a problem hiding this comment.
I don't want to do this exactly because I want to avoid walking the instruction of the function when possible. I'll find another way to clean it up.
dneto0
pushed a commit
to dneto0/SPIRV-Tools
that referenced
this pull request
Sep 14, 2024
Roll third_party/glslang/ 7bc0473..4b97a11 (5 commits) KhronosGroup/glslang@7bc0473...4b97a11 $ git log 7bc0473..4b97a11 --date=short --no-merges --format='%ad %ae %s' 2019-10-06 dj2 single line 2019-10-03 dj2 Update appveyor and travis files 2019-10-03 dj2 Move install directory for SPIRV/ folder. 2019-09-29 cepheus HLSL: Fix KhronosGroup#1912: add attribute syntax for nonreadable/nonwritable 2019-09-27 cepheus HLSL: Fix KhronosGroup#1912: add attribute syntax for overriding image formats. Roll third_party/googletest/ dc1ca9ae4..cd17fa2ab (8 commits) google/googletest@dc1ca9a...cd17fa2 $ git log dc1ca9ae4..cd17fa2ab --date=short --no-merges --format='%ad %ae %s' 2019-10-05 soap Add documentation for pkg-config in cross-compilation settings 2019-10-05 soap Revert "Use pcfiledir for prefix in pkgconfig file" 2019-10-03 misterg Googletest export 2019-10-03 absl-team Googletest export 2019-10-02 absl-team Googletest export 2019-09-29 misterg Googletest export 2019-10-01 ant35rookie Fix typo in documents 2019-08-16 pbarker Add many missing override keywords Roll third_party/re2/ 5bd613749..266119da0 (2 commits) google/re2@5bd6137...266119d $ git log 5bd613749..266119da0 --date=short --no-merges --format='%ad %ae %s' 2019-10-09 junyer Tidy up the ersatz benchmark library. 2019-10-07 junyer Move pod_array.h and sparse_{array,set}.h from util/ to re2/. Roll third_party/spirv-headers/ 842ec90..b252a50 (1 commit) KhronosGroup/SPIRV-Headers@842ec90...b252a50 $ git log 842ec90..b252a50 --date=short --no-merges --format='%ad %ae %s' 2019-09-24 lukasz.gotszald add cmake option SPIRV_HEADERS_SKIP_INSTALL Roll third_party/spirv-tools/ 9eb1c9a..df15a4a (15 commits) KhronosGroup/SPIRV-Tools@9eb1c9a...df15a4a $ git log 9eb1c9a..df15a4a --date=short --no-merges --format='%ad %ae %s' 2019-10-09 cwallez CMake: Add support for building with emscripten (KhronosGroup#2948) 2019-10-09 stevenperron Update CHANGES 2019-10-08 stevenperron Link cfg and dominator analysis in the context (KhronosGroup#2946) 2019-10-08 afdx spirv-fuzz: add transformation and pass to construct composites (KhronosGroup#2941) 2019-10-08 paulthomson reduce: improve remove unref instr pass (KhronosGroup#2945) 2019-10-08 afdx spirv-fuzz: add disabled test to document known issue (KhronosGroup#2942) 2019-10-08 afdx spirv-fuzz: Add fuzzer pass to change selection controls (KhronosGroup#2944) 2019-10-07 jeremy-lunarg Enable OpTypeCooperativeMatrix specialization (KhronosGroup#2927) 2019-10-04 stevenperron Handle OpKill better (KhronosGroup#2933) 2019-10-04 greg Generate null pointer by converting uint64 zero to pointer. (KhronosGroup#2935) 2019-10-03 afdx spirv-fuzz: option to convert shader into a form that renders red (KhronosGroup#2934) 2019-10-03 32110296+AaronHaganAMD Add SPV_KHR_shader_clock validation (KhronosGroup#2879) 2019-10-03 paulthomson reduce/fuzz: improve command line args (KhronosGroup#2932) 2019-10-02 alanbaker Validate physical storage buffer restrictions (KhronosGroup#2930) 2019-10-01 paulthomson fuzz: add shrinker-temp-file-prefix (KhronosGroup#2928) Created with: roll-dep third_party/effcee third_party/glslang third_party/googletest third_party/re2 third_party/spirv-cross third_party/spirv-headers third_party/spirv-tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We want to handle OpKill better. The wrap opkill causes lots of extra
code to be generated, even when they are not needed to avoid the main
problem: OpKill cannot be found directly in a continue construct.
This change will be more selective on which functions the OpKill will be
wrapped and inlining will avoid inlining.
Fixes #2912