1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef BERBERIS_BACKEND_X86_64_MACHINE_IR_TEST_CORPUS_H_
18 #define BERBERIS_BACKEND_X86_64_MACHINE_IR_TEST_CORPUS_H_
19 
20 // TODO(b/232598137) Only intended for use by tests.
21 
22 #include <tuple>
23 
24 #include "berberis/backend/x86_64/machine_ir.h"
25 
26 namespace berberis {
27 
28 std::tuple<const MachineBasicBlock*,
29            const MachineBasicBlock*,
30            const MachineBasicBlock*,
31            MachineReg,
32            MachineReg>
33 BuildDataFlowAcrossBasicBlocks(x86_64::MachineIR* machine_ir);
34 
35 std::tuple<const MachineBasicBlock*, const MachineBasicBlock*, const MachineBasicBlock*, MachineReg>
36 BuildDataFlowFromTwoPreds(x86_64::MachineIR* machine_ir);
37 
38 std::tuple<const MachineBasicBlock*, const MachineBasicBlock*, const MachineBasicBlock*, MachineReg>
39 BuildDataFlowToTwoSuccs(x86_64::MachineIR* machine_ir);
40 
41 std::tuple<const MachineBasicBlock*,
42            const MachineBasicBlock*,
43            const MachineBasicBlock*,
44            const MachineBasicBlock*>
45 BuildDiamondControlFlow(x86_64::MachineIR* machine_ir);
46 
47 std::tuple<const MachineBasicBlock*,
48            const MachineBasicBlock*,
49            const MachineBasicBlock*,
50            const MachineBasicBlock*,
51            MachineReg>
52 BuildDataFlowAcrossEmptyLoop(x86_64::MachineIR* machine_ir);
53 
54 }  // namespace berberis
55 
56 #endif  // BERBERIS_BACKEND_X86_64_MACHINE_IR_TEST_CORPUS_H_
57