summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
blob: 1f5c533815d709313cd255171697f3c4aeac27d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
- // MIR for `float_to_exponential_common` before ConstProp
+ // MIR for `float_to_exponential_common` after ConstProp
  
  fn float_to_exponential_common(_1: &mut Formatter<'_>, _2: &T, _3: bool) -> Result<(), std::fmt::Error> {
      debug fmt => _1;                     // in scope 0 at $DIR/funky_arms.rs:+0:35: +0:38
      debug num => _2;                     // in scope 0 at $DIR/funky_arms.rs:+0:60: +0:63
      debug upper => _3;                   // in scope 0 at $DIR/funky_arms.rs:+0:69: +0:74
      let mut _0: std::result::Result<(), std::fmt::Error>; // return place in scope 0 at $DIR/funky_arms.rs:+0:85: +0:91
      let _4: bool;                        // in scope 0 at $DIR/funky_arms.rs:+4:9: +4:19
      let mut _5: &std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
      let mut _7: std::option::Option<usize>; // in scope 0 at $DIR/funky_arms.rs:+13:30: +13:45
      let mut _8: &std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+13:30: +13:45
      let mut _9: isize;                   // in scope 0 at $DIR/funky_arms.rs:+13:12: +13:27
      let mut _11: &mut std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+15:43: +15:46
      let mut _12: &T;                     // in scope 0 at $DIR/funky_arms.rs:+15:48: +15:51
      let mut _13: core::num::flt2dec::Sign; // in scope 0 at $DIR/funky_arms.rs:+15:53: +15:57
      let mut _14: u32;                    // in scope 0 at $DIR/funky_arms.rs:+15:59: +15:79
      let mut _15: u32;                    // in scope 0 at $DIR/funky_arms.rs:+15:59: +15:75
      let mut _16: usize;                  // in scope 0 at $DIR/funky_arms.rs:+15:59: +15:68
      let mut _17: bool;                   // in scope 0 at $DIR/funky_arms.rs:+15:81: +15:86
      let mut _18: &mut std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+17:46: +17:49
      let mut _19: &T;                     // in scope 0 at $DIR/funky_arms.rs:+17:51: +17:54
      let mut _20: core::num::flt2dec::Sign; // in scope 0 at $DIR/funky_arms.rs:+17:56: +17:60
      let mut _21: bool;                   // in scope 0 at $DIR/funky_arms.rs:+17:62: +17:67
      scope 1 {
          debug force_sign => _4;          // in scope 1 at $DIR/funky_arms.rs:+4:9: +4:19
          let _6: core::num::flt2dec::Sign; // in scope 1 at $DIR/funky_arms.rs:+8:9: +8:13
          scope 2 {
              debug sign => _6;            // in scope 2 at $DIR/funky_arms.rs:+8:9: +8:13
              scope 3 {
                  debug precision => _10;  // in scope 3 at $DIR/funky_arms.rs:+13:17: +13:26
                  let _10: usize;          // in scope 3 at $DIR/funky_arms.rs:+13:17: +13:26
              }
          }
      }
  
      bb0: {
          StorageLive(_4);                 // scope 0 at $DIR/funky_arms.rs:+4:9: +4:19
          StorageLive(_5);                 // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
          _5 = &(*_1);                     // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
          _4 = Formatter::<'_>::sign_plus(move _5) -> bb1; // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
                                           // mir::Constant
                                           // + span: $DIR/funky_arms.rs:15:26: 15:35
                                           // + literal: Const { ty: for<'a> fn(&'a Formatter<'_>) -> bool {Formatter::<'_>::sign_plus}, val: Value(<ZST>) }
      }
  
      bb1: {
          StorageDead(_5);                 // scope 0 at $DIR/funky_arms.rs:+4:36: +4:37
          StorageLive(_6);                 // scope 1 at $DIR/funky_arms.rs:+8:9: +8:13
          switchInt(_4) -> [0: bb3, otherwise: bb2]; // scope 1 at $DIR/funky_arms.rs:+8:16: +8:32
      }
  
      bb2: {
-         _6 = MinusPlus;                  // scope 1 at $DIR/funky_arms.rs:+10:17: +10:41
+         _6 = const MinusPlus;            // scope 1 at $DIR/funky_arms.rs:+10:17: +10:41
+                                          // mir::Constant
+                                          // + span: $DIR/funky_arms.rs:21:17: 21:41
+                                          // + literal: Const { ty: Sign, val: Value(Scalar(0x01)) }
          goto -> bb4;                     // scope 1 at $DIR/funky_arms.rs:+10:17: +10:41
      }
  
      bb3: {
-         _6 = Minus;                      // scope 1 at $DIR/funky_arms.rs:+9:18: +9:38
+         _6 = const Minus;                // scope 1 at $DIR/funky_arms.rs:+9:18: +9:38
+                                          // mir::Constant
+                                          // + span: $DIR/funky_arms.rs:20:18: 20:38
+                                          // + literal: Const { ty: Sign, val: Value(Scalar(0x00)) }
          goto -> bb4;                     // scope 1 at $DIR/funky_arms.rs:+9:18: +9:38
      }
  
      bb4: {
          StorageLive(_7);                 // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
          StorageLive(_8);                 // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
          _8 = &(*_1);                     // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
          _7 = Formatter::<'_>::precision(move _8) -> bb5; // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
                                           // mir::Constant
                                           // + span: $DIR/funky_arms.rs:24:34: 24:43
                                           // + literal: Const { ty: for<'a> fn(&'a Formatter<'_>) -> Option<usize> {Formatter::<'_>::precision}, val: Value(<ZST>) }
      }
  
      bb5: {
          StorageDead(_8);                 // scope 3 at $DIR/funky_arms.rs:+13:44: +13:45
          _9 = discriminant(_7);           // scope 3 at $DIR/funky_arms.rs:+13:12: +13:27
          switchInt(move _9) -> [1: bb6, otherwise: bb8]; // scope 3 at $DIR/funky_arms.rs:+13:12: +13:27
      }
  
      bb6: {
          _10 = ((_7 as Some).0: usize);   // scope 3 at $DIR/funky_arms.rs:+13:17: +13:26
          StorageLive(_13);                // scope 3 at $DIR/funky_arms.rs:+15:53: +15:57
          _13 = _6;                        // scope 3 at $DIR/funky_arms.rs:+15:53: +15:57
          StorageLive(_14);                // scope 3 at $DIR/funky_arms.rs:+15:59: +15:79
          StorageLive(_15);                // scope 3 at $DIR/funky_arms.rs:+15:59: +15:75
          _15 = _10 as u32 (IntToInt);     // scope 3 at $DIR/funky_arms.rs:+15:59: +15:75
          _14 = Add(move _15, const 1_u32); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:79
          StorageDead(_15);                // scope 3 at $DIR/funky_arms.rs:+15:78: +15:79
          _0 = float_to_exponential_common_exact::<T>(_1, _2, move _13, move _14, _3) -> bb7; // scope 3 at $DIR/funky_arms.rs:+15:9: +15:87
                                           // mir::Constant
                                           // + span: $DIR/funky_arms.rs:26:9: 26:42
                                           // + literal: Const { ty: for<'a, 'b, 'c> fn(&'a mut Formatter<'b>, &'c T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::<T>}, val: Value(<ZST>) }
      }
  
      bb7: {
          StorageDead(_14);                // scope 3 at $DIR/funky_arms.rs:+15:86: +15:87
          StorageDead(_13);                // scope 3 at $DIR/funky_arms.rs:+15:86: +15:87
          goto -> bb10;                    // scope 2 at $DIR/funky_arms.rs:+13:5: +18:6
      }
  
      bb8: {
          StorageLive(_20);                // scope 2 at $DIR/funky_arms.rs:+17:56: +17:60
          _20 = _6;                        // scope 2 at $DIR/funky_arms.rs:+17:56: +17:60
          _0 = float_to_exponential_common_shortest::<T>(_1, _2, move _20, _3) -> bb9; // scope 2 at $DIR/funky_arms.rs:+17:9: +17:68
                                           // mir::Constant
                                           // + span: $DIR/funky_arms.rs:28:9: 28:45
                                           // + literal: Const { ty: for<'a, 'b, 'c> fn(&'a mut Formatter<'b>, &'c T, Sign, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_shortest::<T>}, val: Value(<ZST>) }
      }
  
      bb9: {
          StorageDead(_20);                // scope 2 at $DIR/funky_arms.rs:+17:67: +17:68
          goto -> bb10;                    // scope 2 at $DIR/funky_arms.rs:+13:5: +18:6
      }
  
      bb10: {
          StorageDead(_6);                 // scope 1 at $DIR/funky_arms.rs:+19:1: +19:2
          StorageDead(_4);                 // scope 0 at $DIR/funky_arms.rs:+19:1: +19:2
          StorageDead(_7);                 // scope 0 at $DIR/funky_arms.rs:+19:1: +19:2
          return;                          // scope 0 at $DIR/funky_arms.rs:+19:2: +19:2
      }
  }