Loop invariant code motion initial implementation
[platform/upstream/SPIRV-Tools.git] / source / opt / CMakeLists.txt
1 # Copyright (c) 2016 Google Inc.
2
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 add_library(SPIRV-Tools-opt
15   aggressive_dead_code_elim_pass.h
16   basic_block.h
17   block_merge_pass.h
18   build_module.h
19   ccp_pass.h
20   cfg_cleanup_pass.h
21   cfg.h
22   common_uniform_elim_pass.h
23   compact_ids_pass.h
24   composite.h
25   constants.h
26   dead_branch_elim_pass.h
27   dead_insert_elim_pass.h
28   dead_variable_elimination.h
29   decoration_manager.h
30   def_use_manager.h
31   dominator_analysis.h
32   dominator_tree.h
33   eliminate_dead_constant_pass.h
34   eliminate_dead_functions_pass.h
35   feature_manager.h
36   flatten_decoration_pass.h
37   fold.h
38   folding_rules.h
39   fold_spec_constant_op_and_composite_pass.h
40   freeze_spec_constant_value_pass.h
41   function.h
42   if_conversion.h
43   inline_exhaustive_pass.h
44   inline_opaque_pass.h
45   inline_pass.h
46   insert_extract_elim.h
47   instruction.h
48   ir_context.h
49   ir_loader.h
50   licm_pass.h
51   local_access_chain_convert_pass.h
52   local_redundancy_elimination.h
53   local_single_block_elim_pass.h
54   local_single_store_elim_pass.h
55   local_ssa_elim_pass.h
56   log.h
57   loop_descriptor.h
58   loop_utils.h
59   mem_pass.h
60   merge_return_pass.h
61   module.h
62   null_pass.h
63   passes.h
64   pass.h
65   pass_manager.h
66   private_to_local_pass.h
67   propagator.h
68   redundancy_elimination.h
69   reflect.h
70   remove_duplicates_pass.h
71   replace_invalid_opc.h
72   scalar_replacement_pass.h
73   set_spec_constant_default_value_pass.h
74   simplification_pass.h
75   strength_reduction_pass.h
76   strip_debug_info_pass.h
77   tree_iterator.h
78   type_manager.h
79   types.h
80   unify_const_pass.h
81   value_number_table.h
82   workaround1209.h
83
84   aggressive_dead_code_elim_pass.cpp
85   basic_block.cpp
86   block_merge_pass.cpp
87   build_module.cpp
88   ccp_pass.cpp
89   cfg_cleanup_pass.cpp
90   cfg.cpp
91   common_uniform_elim_pass.cpp
92   compact_ids_pass.cpp
93   composite.cpp
94   constants.cpp
95   dead_branch_elim_pass.cpp
96   dead_insert_elim_pass.cpp
97   dead_variable_elimination.cpp
98   decoration_manager.cpp
99   def_use_manager.cpp
100   dominator_analysis.cpp
101   dominator_tree.cpp
102   eliminate_dead_constant_pass.cpp
103   eliminate_dead_functions_pass.cpp
104   feature_manager.cpp
105   flatten_decoration_pass.cpp
106   fold.cpp
107   folding_rules.cpp
108   fold_spec_constant_op_and_composite_pass.cpp
109   freeze_spec_constant_value_pass.cpp
110   function.cpp
111   if_conversion.cpp
112   inline_exhaustive_pass.cpp
113   inline_opaque_pass.cpp
114   inline_pass.cpp
115   insert_extract_elim.cpp
116   instruction.cpp
117   instruction_list.cpp
118   ir_context.cpp
119   ir_loader.cpp
120   licm_pass.cpp
121   local_access_chain_convert_pass.cpp
122   local_redundancy_elimination.cpp
123   local_single_block_elim_pass.cpp
124   local_single_store_elim_pass.cpp
125   local_ssa_elim_pass.cpp
126   loop_descriptor.cpp
127   loop_utils.cpp
128   mem_pass.cpp
129   merge_return_pass.cpp
130   module.cpp
131   optimizer.cpp
132   pass.cpp
133   pass_manager.cpp
134   private_to_local_pass.cpp
135   propagator.cpp
136   redundancy_elimination.cpp
137   remove_duplicates_pass.cpp
138   replace_invalid_opc.cpp
139   scalar_replacement_pass.cpp
140   set_spec_constant_default_value_pass.cpp
141   simplification_pass.cpp
142   strength_reduction_pass.cpp
143   strip_debug_info_pass.cpp
144   type_manager.cpp
145   types.cpp
146   unify_const_pass.cpp
147   value_number_table.cpp
148   workaround1209.cpp
149 )
150
151 spvtools_default_compile_options(SPIRV-Tools-opt)
152 target_include_directories(SPIRV-Tools-opt
153   PUBLIC ${spirv-tools_SOURCE_DIR}/include
154   PUBLIC ${SPIRV_HEADER_INCLUDE_DIR}
155   PRIVATE ${spirv-tools_BINARY_DIR}
156 )
157 # We need the assembling and disassembling functionalities in the main library.
158 target_link_libraries(SPIRV-Tools-opt
159   PUBLIC ${SPIRV_TOOLS})
160
161 set_property(TARGET SPIRV-Tools-opt PROPERTY FOLDER "SPIRV-Tools libraries")
162 spvtools_check_symbol_exports(SPIRV-Tools-opt)
163
164 if(ENABLE_SPIRV_TOOLS_INSTALL)
165   install(TARGETS SPIRV-Tools-opt
166     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
167     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
168     ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
169 endif(ENABLE_SPIRV_TOOLS_INSTALL)
170