diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-10-24 12:18:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-24 12:18:34 -0700 |
| commit | 58ad4b1a9ca43098a071c42bd752a4a48405bf0e (patch) | |
| tree | e35ae6280bddb0fa4a91c96c5d37b4d0b091612b /tests | |
| parent | 4fd0448d7341e57e355d4414ca60e786001d40a9 (diff) | |
Strip IR after front-end steps are done (#1092)
* Strip IR after front-end steps are done
The main feature of this change is to unconditonally strip out the `IRHighLevelDeclDecoration`s in an IR module once the "mandatory" IR passes in the front end have run. This ensures that later IR passes (e.g., code emission) *cannot* rely on AST-level information to get their job done.
Since I was already writing a pass to remove some instructions at the end of the front-end passes, I went ahead and also made the `-obfuscate` flag apply to the front-end IR generation by causing it to strip `IRNameHintDecoration`s while it is doing the other stripping. With this, the main identifying information left in IR modules (other than semantics and entry-point names) is mangled name strings for imported/exported symbols.
A few other things got changes along the way:
* Removed the `.expected` file for one of the tests, where that file seemingly shouldn't have been checked in at all.
* Updated the signature of the DCE pass both so that it doesn't require a back-end compile request (it wasn't using it anyway), and so that it takes some options to decide whether to keep symbols marked `[export(...)]` alive (the front-end wants to keep these, while back-end passes currently need to be able to eliminate them).
* Moved the `obfuscateCode` flag from the back-end compile request to the base class shared between front- and back-end requests, and updated the options and repro logic to set both as needed. An obvious improvement in the future would be to have the front- and back-end requests share these settings by referencing a single common object in the end-to-end case, rather than each having their own copy.
* Removed logic that was keeping layout instructions alive in DCE, even if they weren't used. This seems to have been a vestige of an intermediate step between AST and IR layout.
* fixup: add the new files
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bugs/texture2d-ms.hlsl.expected | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/tests/bugs/texture2d-ms.hlsl.expected b/tests/bugs/texture2d-ms.hlsl.expected deleted file mode 100644 index 2202bbbec..000000000 --- a/tests/bugs/texture2d-ms.hlsl.expected +++ /dev/null @@ -1,55 +0,0 @@ -result code = 0 -standard error = { -} -standard output = { -// Module Version 10000 -// Generated by (magic number): 80007 -// Id's are bound by 30 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint GLCompute 4 "main" 17 - ExecutionMode 4 LocalSize 4 4 1 - Source GLSL 450 - SourceExtension "GL_EXT_samplerless_texture_functions" - SourceExtension "GL_GOOGLE_cpp_style_line_directive" - Name 4 "main" - Name 9 "_S1" - Name 12 "tex_0" - Name 17 "gl_WorkGroupID" - Decorate 12(tex_0) DescriptorSet 0 - Decorate 12(tex_0) Binding 0 - Decorate 17(gl_WorkGroupID) BuiltIn WorkgroupId - Decorate 29 BuiltIn WorkgroupSize - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeFloat 32 - 7: TypeVector 6(float) 4 - 8: TypePointer Function 7(fvec4) - 10: TypeImage 6(float) 2D multi-sampled sampled format:Unknown - 11: TypePointer UniformConstant 10 - 12(tex_0): 11(ptr) Variable UniformConstant - 14: TypeInt 32 0 - 15: TypeVector 14(int) 3 - 16: TypePointer Input 15(ivec3) -17(gl_WorkGroupID): 16(ptr) Variable Input - 18: TypeVector 14(int) 2 - 21: TypeInt 32 1 - 22: TypeVector 21(int) 2 - 24: 21(int) Constant 0 - 27: 14(int) Constant 4 - 28: 14(int) Constant 1 - 29: 15(ivec3) ConstantComposite 27 27 28 - 4(main): 2 Function None 3 - 5: Label - 9(_S1): 8(ptr) Variable Function - 13: 10 Load 12(tex_0) - 19: 15(ivec3) Load 17(gl_WorkGroupID) - 20: 18(ivec2) VectorShuffle 19 19 0 1 - 23: 22(ivec2) Bitcast 20 - 25: 7(fvec4) ImageFetch 13 23 Sample 24 - Store 9(_S1) 25 - Return - FunctionEnd -} |
