Loop invariant code motion initial implementation
[platform/upstream/SPIRV-Tools.git] / CHANGES
1 Revision history for SPIRV-Tools
2
3 v2018.1-dev 2018-02-02
4  - General:
5    - Support Visual Studio 2013 again. (Continue support for VS 2015 and VS 2017.)
6  - Optimizer:
7    - Improve folding
8    - Aggressive dead code elimination: Understands capability hierarchy when finding
9      instructions it can eliminate (combinators). (PR #1268)
10  - Validator:
11    - Validate barrier instructions.
12  - Fixes:
13    - #1265: Optimizer: Fix use-after free bug in if-conversion. (Fix object lifecycle bug
14      in type manager.)
15
16
17 v2018.0 2018-02-02
18  - General
19    - VisualStudio 2013 is no longer supported.  VisualStudio 2015 is supported.
20    - Use "include/unified1" directory from SPIRV-Headers.  Requires recent SPIRV-Headers source.
21  - Disassembler: spirv-dis adds --color option to force color disassembly.
22  - Optimizer:
23    - Add pass to eliminate dead insertions.
24    - Aggressive dead code elimination now removes OpSwitch constructs.
25    - Block merging occurs in more cases.
26    - Add driver workaround transform: replace OpUnreachable with harmless branch to merge.
27    - Improve instruction folding framework.
28    - Add loop analysis.
29    - Add scalar replacement of aggregates to size-optimization recipe.
30    - Add pass to replace instructions invalid for a shader stage, with a harmless value.
31      This changes the semantics of the program!  Not for general use!
32    - Rearragne and add passes to performance-optimization recipe, to produce better results.
33  - Validator:
34    - Validate OpenCL extended instructions.
35    - Shaders can't perform atomics on floats.
36    - Validate memory semantics values in atomics.
37    - Validate instruction-adjacency constraints, e.g. OpPhi predecessors, merge instructions
38      immediately precede branches.
39  - Fixes:
40    - PR 1198: Optimizer: Fix CCP in presence of matrix constants.
41    - #1199: Optimizer: Fix CCP: don't propagate spec constants.
42    - #1203: Optimizer: Fix common uniform elim bug introduced by refactoring.
43    - #1210: Optimizer: Aggressive dead code elimination: Fix 'break' identification.
44    - #1212: Optimizer: Aggressive dead code elimination: Was skipping too many instructions.
45    - #1214: Optimizer: Aggressive dead code elimination: Fix infinite loop.
46    - #1228: Optimizer: Fix CCP: Handling of varying Phi nodes; was resulting in infinite loop.
47    - #1245: Optimizer: Dead branch elimination: Avoid a null pointer dereference.
48    - #1250: Optimizer: Dead branch elimination: Avoid spuriously reporting a change.
49
50 v2017.3 2018-01-12
51  - General:
52    - Support DebugInfo extended instruction set, targeted at OpenCL environments.
53      See the SPIR-V Registry.
54    - Generate a SPIRV-Tools.pc file for pkg-config.
55  - Optimizer:
56    - Progress for legalization of code generated from HLSL (issue #1118):
57      - Add --legalize-hlsl option to run transforms used to transform intermediate
58        code generated by HLSL to SPIR-V for Vulkan compilers.  Those compilers
59        normally run these transforms automatically.  This option is used for developing
60        those transforms.
61      - Add Private-to-Function variable conversion for modules with logical
62        addressing.
63    - Add --ccp: SSA Conditional Constant Propagation (CCP)
64    - Add --print-all to show disassembly for each optimization pass.
65    - Internal: Add loop descriptors and post-order tree iterator.
66    - Generalized dead branch elimination
67    - Aggressive dead code elimination (ADCE) now removes dead functions and
68      module-scope variables.
69    - Vector extract/insert elimination now optimizes through some cases of
70      VectorShuffle, and GLSL.std.450 Mix extended instruction.
71  - Validator:
72    - Add validation for GLSL.std.450 extended instruction set.
73    - Check out of bounds composite accesses, where that's statically computable.
74      Fixes #1112.
75    - Check upper bits of literal numbers that aren't a multiple of 32-bits wide.
76    - More validation of primitive instructions
77    - Add optional "relaxed" checking logical addressing mode to permit some
78      cases of pointer-to-pointer.  Contributes to HLSL legalization (issue #1118).
79  - Fixes:
80    #1100: Validator: Image operand Sample can be used with OpImageSparseFetch,
81      OpImageSparseRead.
82    #1108: Remove duplicates transform was incorrectly removing non-duplicate
83      decorations.
84    #1111: Optimizer's type manager could reference deleted memory.
85    #1112: Fix decoration equality check, e.g. it is now symmetric.
86    #1129: Validator now disallows Dim=SupbassData for OpImageSparseRead.
87    #1143: Fix CCP: Was generating incorrect code for loops.
88    #1153: Fix CCP crash.
89    #1154: Optimizer's internal instruction-to-block mappings were sometimes
90        inconsistent.
91    #1159: Fix CCP infinite loop.
92    #1168: Fix dead branch elimination intermittently generating incorrect code.
93        Fixes https://github.com/KhronosGroup/glslang/issues/1205
94    #1186: Fix validation of PackDouble2x32 and UnpackDouble2x32
95
96 v2017.2 2017-12-15
97  - General:
98    - Support OpenCL 1.2, 2.0 target environments, including embedded profiles
99    - Add CONTRIBUTING.md
100    - Fix exit status code for spirv-link
101    - Disassember: Enable emitting ANSI colour codes to a string
102    - Library avoids polluting global namespace.  The libraries can export C and C++
103      symbols starting with "spv", or in a C++ namespace.  Add a test for this.
104    - Linux release builds include debug information, for easier profiling
105    - Build bots no longer test VisualStudio 2013
106      - Testing dependency RE2 requires VisualStudio 2015 or later
107    - Build bots check code formatting
108  - Optimizer:
109    - Add --skip-validation to spirv-opt
110    - Add dominance tree analysis
111    - Add generic value propagation engine
112    - Add global redundancy elimination within a function
113    - Add scalar replacement of function-scope variables of composite type
114    - Aggressive dead code elimination: Remove empty loops
115    - Killing an instruction notifies the IRContext
116    - IRContext::KillInst deletes the instruction
117    - Move CFG analysis to IRContext
118    - Add constant manager
119    - Fix: Don't consider derivative instructions as combinators.
120    - Fix: Don't delete an instruction twice in local dead-code-elimination
121    - Fix: Don't consider derivative instructions as combinators.
122  - Validator:
123    - Finish checking of image instructions (Section 3.32.10)
124      - Check sparse image instructions
125      - Check OpTypeImage, OpTypeSampleImage
126    - Check composite instructions (Section 3.32.12)
127    - Check atomic instructions (Section 3.32.18)
128    - Check OpEmitStreamVertex, OpEndStreamPrimitive instructions
129    - Re-enable validation of OpCopyObject
130    - OpKill, image ImplicitLod and QueryLod instructions can only be used in Fragment
131      shaders.
132    - Fixes for image instruction validation:
133      - Lod image operand only usable with ExplicitLod and OpImageFetch
134      - ExplicitLod Lod image operand must be float scalar
135      - OpImageFectch Lod image operand must be int scalar
136      - OpImageGather component operand must be 32-bits (integer scalar)
137      - OpImageQuerySizeLod Lod must be integer scalar
138  - Fixes:
139    #622: Remove names and decorations when inlining
140    #989: Aggressive dead code elim: Don't optimize away live breaks from a loop
141    #991: Fix validation of SPV_AMD_shader_ballot
142    #1004: Use after free of an instruction, in remove-duplicates transform
143    #1007: OpImageRead not required to return 4-component vector
144    #1009: OpImageRead can return scalar int/float types
145    #1011: OpImageWrite should allow scalar int/float texel types
146    #1012: Fix validat Dref type check
147    #1017: Load-store elimination considers variable initializations
148    #1034: Fix Windows debug build: operator< should be a weak ordering
149    #1083: Inlining: Set parent (function) for each inlined basic block.
150    #1075: Aggressive dead code elimination: Was leaving dangling references to
151      removed blocks.
152
153 v2017.1 2017-11-23
154  - Update README with details on the public_spirv_tools_dev@khronos.org mailing list.
155  - General:
156    - Automatically deploy built artifacts to GitHub Releases
157    - Add a Linker (module combiner). Under development.
158    - Add Android.mk for Android NDK builds.
159    - Add the 'effcee' library as an optional dependency for use in tests.
160      Eventually it will be a required dependency, once downstream projects have
161      a chance to adjust.  Requires 're2' library.
162    - Avoid static-duration variables of class type (with constructors).
163    - Hack around bugs in gcc-4.8.1 template handling
164    - Faster opcode lookup
165  - Validator:
166    - Recognize extensions listed on SPIR-V registry,
167      through #25 SPV_AMD_shader_fragment_mask
168    - Validator issues an info message when it sees an unrecognized extension.
169    - Type check basic arithmetic operations
170    - Type check carry/extended arithmetic operations
171    - Type check vector arithmetic operations
172    - Type check Relational and Logical instructions
173    - Type check Bit instructions
174    - Check type uniqueness rules
175    - Check conversion instructions
176    - Check image instructions
177    - Check derivative instructions
178    - Check OpVectorShuffle
179    - Check OpBranchConditional
180    - OpModuleProcessed is only allowed after debug names section and before annotations
181      section.
182    - Checks the right kind of return is called for each function (void or non-void).
183    - Add option to relax type check when storing structs (--relax-store-struct)
184  - Optimizer:
185    - Refactoring internal representation of the module, including:
186      - IRContext: owns a module and manages analyses
187      - Instructions are owned by intrusive lists, and have unique IDs
188      - BasicBlock owns its instruction list.
189      - DefUseManager: change representation of uses, for faster processing
190        on large modules.
191    - Add high level recipes: -O, -Os, and -Oconfig
192      Recipes for -O and -Os are under development.
193    - Add eliminate-dead-function transform
194    - Add strength reduction transform: For now, convert multiply by power of 2
195      to a bit shift.
196    - Add CFG cleanup transform
197    - Add removal of dead module-scope variables
198    - Add merge-return transform for modules without structured control flow
199    - Add redundancy elimination within a basic block (local value numbering)
200    - Extract-insert elimination:
201      - Recognize the case where the first instruction in the sequence is an
202        OpCompositeConstruct or OpConstantComposite
203      - Handle some cases of nested structs
204    - Dead branch elimination now can eliminate entire selection constructs
205      when all arms are dead.
206  - Compressing codec:
207    - Updated algorithm to 1.01, 1.02, 1.03
208    - Not built by default.  Use -DSPIRV_BUILD_COMPRESSION=ON to build.
209    - Codec can be parameterized by a customized model.
210  - Fixes:
211    #728: Fix decoration of inlined functions
212    #798: spirv-as should fail when given unrecognized long option
213    #800: Inliner: Fix inlining function into header of multi-block loop
214    #824: Eliminate-local-multi-store: Fix a crash
215    #826: Elimiante-local-multi-store: Fix a crash
216    #827: Fix crash when compact-ids transform runs before another transform.
217    #834: Add Cmake option to build the compressing codec. Off by default.
218    #911: Fix classification of Line and NoLine instructions
219
220 v2017.0 2017-09-01
221  - Update README to describe that assembler, disassembler, and binary parser support
222    are based on grammar files from the SPIRV-Headers repository.
223
224 v2016.7 2017-09-01
225  - Add SPIR-V 1.2
226  - OpenCL 2.2 support is now based on SPIR-V 1.2
227  - Support AMD extensions in assembler, disassembler:
228     SPV_AMD_gcn_shader
229     SPV_AMD_shader_ballot
230     SPV_AMD_shader_explicit_vertex_parameter
231     SPV_AMD_shader_trinary_minmax
232     SPV_AMD_gpu_shader_half_float
233     SPV_AMD_texture_gather_bias_lod
234     SPV_AMD_gpu_shader_int16
235  - Optimizer: Add support for:
236    - Inline all function calls in entry points.
237    - Flatten decoration groups.  Fixes #602
238    - Id compaction (minimize Id bound).  Fixes #624
239    - Eliminate redundant composite insert followed by extract
240    - Simplify access chains to local variables
241    - Eliminate local variables with a single store, if possible
242    - Eliminate local variables with a several stores, if possible
243    - Eliminate loads and stores in same block to local variables
244    - Eliminate redundant insert/extract to composite values
245    - Aggressive dead instruction elimination
246    - Eliminate dead branches
247    - Merge blocks when the second can only be preceded by the first
248    - Eliminate ommon uniform loads
249  - Assembler: Add option to preserve numeric ids. Fixes #625
250  - Add build target spirv-tools-vimsyntax to generate spvasm.vim, a SPIR-V
251    assembly syntax file for Vim.
252  - Version string: Allow overriding of wall clock timestamp with contents
253    of environment variable SOURCE_DATE_EPOCH.
254  - Validator implements relaxed rules for SPV_KHR_16bit_storage.
255  - CMake installation rules use GNUInstallDirs.  For example, libraries
256    will be installed into a lib64 directory if that's the norm for the
257    current system.
258  - Fixes:
259    #500: Parameterize validator limit checks
260    #508: Support compilation under CYGWIN
261    #517: Fix validation when continue (or case) contstruct is also the head of a
262      nested control construct.
263    #551: If a merge block is reachable, it must be *strictly* dominated by its
264      header.
265    #548: Validator: Error when the reserved OpImageSparseSampleProj* opcodes
266      are used.
267    #611: spvtools::Optimizer was failing to save the module to the output
268      binary vector when all passes succeded without changes.
269    #629: The inline-entry-points-all optimization could generate invalidly
270      structured code when the inlined function had early returns.
271    #697: Optimizer's Instruction::ForEachInId method was skipping semantics-id
272      and scope-id.
273    #755: Inliner: Fix inlining of callee with single Return appearing before
274      the end of the function.
275    #776: Fix dead branch elimination in presence of complex but dead control
276      flow.
277    #781: SPV_KHR_variable_pointers allows duplicate pointer types
278    #782: Inliner: Fix remapping of non-label forward references in callee
279    #787: Inliner: Fix remapping of inlined entry block when called from
280      single block loop.
281    #790: Inliner: Fix remapping of inlined entry block when callee has
282      multiple returns.
283
284 v2016.6 2016-12-13
285  - Published the C++ interface for assembling, disassembling, validation, and
286    optimization.
287  - Support SPV_KHR_shader_draw_parameters in assembler, disassembler, parser.
288  - Validator:
289    - Add validator API accepting raw binary words
290    - Increased coverage:
291      - Checks "Data rules" in Universal Validation Rules, section 2.16.1
292      - WIP: Universal Limits.
293        - The minimum mandated upper bounds are checked.
294        - TODO: Parameterize the validator to allow larger limits accepted by
295          a more than minimally capable implementation.
296    - OpSampledImage checks
297    - OpConstantComposite checks
298    - Id bound check
299  - Disasssembler:
300    - Generates friendly GLSL-based names for more builtin variables
301    - Generates friendly names for numeric OpConstant values
302    - Vendor tool info extracted from SPIR-V XML registry file.
303  - Fixes issues:
304    #429: Validator: Allow OpTypeForwardPointer and OpTypeStruct to reference
305      undefined IDs
306    #482: Validator: OpVariable initializer can be an ID of a module-scope variable
307
308 v2016.5 2016-09-16
309  - Support SPV_KHR_shader_ballot in assembler, disassembler, parser.
310  - Disassembler: Generate friendly names for built-in variables.
311  - Partial fixes:
312    #359: Add Emacs helper for automatically diassembling/assembling a SPIR-V
313      binary on file load/save.
314  - Fixes:
315    #414: Validator: Allow OpUndef for composite constants
316    #415: Validator: Phi can use its own value in some cases.
317
318 v2016.4 2016-09-01
319  - Relicensed under Apache 2.0
320  - Add optimization passes (in API and spirv-opt command)
321    - Fold spec constants defined with OpSpecConstantOp and
322        OpSpecConstantComposite to normal constants with fixed value(s).
323  - Fixes issues:
324    #318: Relicensed under Apache 2.0
325
326 v2016.3 2016-08-24
327  - Add target environment enums for OpenCL 2.1, OpenCL 2.2,
328    OpenGL 4.0, OpenGL 4.1, OpenGL 4.2, OpenGL 4.3, OpenGL 4.5.
329  - Add spirv-cfg, an experimental tool to dump the control flow graph
330    as a GraphiViz "dot" graph
331  - Add optimization pass: Eliminate dead constants.
332  - Add spirv-lesspipe.sh filter utility
333  - Fixes issues:
334    #288: Check def-use dominance rules for OpPhi (variable,parent) operands
335    #339: Allow OpUndef in types-constants-global-vars section, as required
336      by SPIR-V 1.0 Rev7, 1.1 Rev 3.
337    #340: Avoid race on mkdir during build
338    #365: Relax PointSize, ClipDistance, CullDistance capability check in all
339      environments not just Vulkan 1.0.
340
341 v2016.2 2016-08-05
342  - Validator is incomplete
343    - Checks ID use block is dominated by definition block
344  - Add optimization passes (in API and spirv-opt command)
345    - Strip debug info instructions
346    - Freeze spec constant to their default values
347  - Allow INotEqual as operation for OpSpecConstantOp
348  - Fixes bugs:
349    #270: validator: crash when continue construct is unreachable
350    #279: validator: infinite loop when analyzing some degenerate control
351      flow graphs
352    #286: validator: don't incorrectly generate def-use error for
353          (variable,parent) parameters to OpPhi
354    #290: disassembler: never generate bare % for an identifier
355    #295: validator: def-use dominance check should ignore unreachable uses
356    #276: validator: allow unreachable continue constructs
357    #297: validator: allow an unreachable block to branch to a reachable
358          merge block
359
360 v2016.1 2016-07-19
361  - Fix https://github.com/KhronosGroup/SPIRV-Tools/issues/261
362    Turn off ClipDistance and CullDistance capability checks for Vulkan.
363  - The disassembler can emit friendly names based on debug info (OpName
364    instructions), and will infer somewhat friendly names for most types.
365    This is turned on by default for the spirv-dis command line tool.
366  - Updated to support SPIR-V 1.1 rev 2
367    - Input StorageClass, Sampled1D capability, and SampledBuffer capability
368      do not require Shader capability anymore.
369
370 v2016.0 2016-07-04
371
372  - Adds v<year>.<index> versioning, with "-dev" indicating
373    work in progress.  The intent is to more easly report
374    and summarize functionality when SPIRV-Tools is incorporated
375    in downstream projects.
376
377  - Summary of functionality (See the README.md for more):
378    - Supports SPIR-V 1.1 Rev 1
379    - Supports SPIR-V 1.0 Rev 5
380    - Supports GLSL std450 extended instructions 1.0 Rev 3
381    - Supports OpenCL extended instructions 1.0 Rev 2
382    - Assembler, disassembler are complete
383      - Supports floating point widths of 16, 32, 64 bits
384      - Supports integer widths up to 64 bits
385    - Validator is incomplete
386      - Checks capability requirements in most cases
387      - Checks module layout constraints
388      - Checks ID use-definition ordering constraints,
389        ignoring control flow
390      - Checks some control flow graph rules
391    - Optimizer is introduced, with few available transforms.
392    - Supported on Linux, OSX, Android, Windows
393
394  - Fixes bugs:
395    - #143: OpenCL pow and pown arguments