// Copyright (c) 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "source/opt/loop_unswitch_pass.h" #include <functional> #include <list> #include <memory> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> #include "source/opt/basic_block.h" #include "source/opt/dominator_tree.h" #include "source/opt/fold.h" #include "source/opt/function.h" #include "source/opt/instruction.h" #include "source/opt/ir_builder.h" #include "source/opt/ir_context.h" #include "source/opt/loop_descriptor.h" #include "source/opt/loop_utils.h" namespace spvtools { namespace opt { namespace { constexpr uint32_t kTypePointerStorageClassInIdx = …; // This class handle the unswitch procedure for a given loop. // The unswitch will not happen if: // - The loop has any instruction that will prevent it; // - The loop invariant condition is not uniform. class LoopUnswitch { … }; } // namespace Pass::Status LoopUnswitchPass::Process() { … } bool LoopUnswitchPass::ProcessFunction(Function* f) { … } } // namespace opt } // namespace spvtools