spirv-fuzz: Generalise transformation access chain#3546
spirv-fuzz: Generalise transformation access chain#3546afd merged 18 commits intoKhronosGroup:masterfrom
Conversation
paulthomson
left a comment
There was a problem hiding this comment.
This looks really good. I have done a first pass giving some suggestions.
c8c24e2 to
6f940da
Compare
afd
left a comment
There was a problem hiding this comment.
You've done a great job with this and your PR looks functionally correct and shows a deep understanding of the code base.
I've done a detailed and fairly picky review because there are some aspects of your approach that make the code hard to read in places, to me at least: use of a helper function that in my view obfuscates the code without providing benefits of re-use, and in another place sharing of code across IsApplicable and Apply in a manner that, again to me, is to the detriment of readability.
afd
left a comment
There was a problem hiding this comment.
I really like what you've done here! Just a few changes and then I think we'll be good to merge.
…e dynamic and clamped to be in-bound
…ed using in-bound constants.
Move GetBoundForCompositeIndex to fuzzer_util.cpp, removing it from TransformationAccessChain and TransformationAddFunction and changing all references to it accordingly.
e34dfdb to
563afd7
Compare
afd
left a comment
There was a problem hiding this comment.
One comment - perhaps a merge problem? Otherwise looks good.
This PR generalises TransformationAddAccessChain so that dynamic indices for non-struct composites (with clamping to ensure that accesses are in-bound) are allowed. The transformation will add instructions to clamp any index to a non-struct composite, regardless of whether it is a constant or not. Fixes KhronosGroup#3179.
* Rolling 2 dependencies and updating expectations Roll third_party/spirv-cross/ 6575e451f..0376576d2 (5 commits) KhronosGroup/SPIRV-Cross@6575e45...0376576 $ git log 6575e451f..0376576d2 --date=short --no-merges --format='%ad %ae %s' 2020-07-22 tommek Enabling setting a fixed sampleMask in Metal fragment shaders. 2020-02-20 cdavis MSL: Add support for processing more than one patch per workgroup. 2020-07-22 dsinclair Roll GLSLang, SPIRV-Headers and SPIRV-Tools. 2020-07-22 cdavis MSL: Factor creating a uint type into its own method. 2020-07-22 cdavis MSL: Factor a really gnarly condition into its own method. Created with: roll-dep third_party/spirv-cross Roll third_party/spirv-tools/ 969f028..b63f0e5 (13 commits) KhronosGroup/SPIRV-Tools@969f028...b63f0e5 $ git log 969f028..b63f0e5 --date=short --no-merges --format='%ad %ae %s' 2020-07-27 rdb Fix SyntaxWarning in Python 3.8 (KhronosGroup#3388) 2020-07-27 bclayton CMake: Enable building with BUILD_SHARED_LIBS=1 (KhronosGroup#3490) 2020-07-27 dneto Avoid operand type range checks (KhronosGroup#3379) 2020-07-27 jaebaek Preserve debug info in scalar replacement pass (KhronosGroup#3461) 2020-07-27 pierremoreau Update OpenCL capabilities validation (KhronosGroup#3149) 2020-07-27 stevenperron build(deps): bump lodash from 4.17.15 to 4.17.19 in /tools/sva (KhronosGroup#3596) 2020-07-27 antonikarp spirv-fuzz: adds TransformationReplaceLoadStoreWithCopyMemory (KhronosGroup#3586) 2020-07-27 jaebaek Preserve OpenCL.DebugInfo.100 through private-to-local pass (KhronosGroup#3571) 2020-07-27 stefanomil spirv-fuzz: Relax type checking for int contants (KhronosGroup#3573) 2020-07-27 stefanomil spirv-fuzz: Generalise transformation access chain (KhronosGroup#3546) 2020-07-27 stefanomil spirv-fuzz: Split blocks starting with OpPhi before trying to outline (KhronosGroup#3581) 2020-07-27 afdx spirv-fuzz: Set message consumer in replayer when shrinking (KhronosGroup#3591) 2020-07-24 vasniktel spirv-fuzz: Don't use default parameters (KhronosGroup#3583) Created with: roll-dep third_party/spirv-tools * Add in missing expectations update
This PR generalises TransformationAddAccessChain so that dynamic
indices for non-struct composites (with clamping to ensure that
accesses are in-bound) are allowed.
The transformation will add instructions to clamp any index to
a non-struct composite, regardless of whether it is a constant
or not.
Fixes #3179