Commit e2cfa08
committed
[CVP] Implement type narrowing for LShr
Implements type narrowing for LShr. The treatment is analogous to the type narrowing of UDiv. Since LShr is a relatively cheap instruction, the narrowing occurs only if the following conditions hold: i) all the users of the LShr instruction are already TruncInst; ii) the narrowing is carried out to the largest TruncInst following the LShr instruction. Additionally, the function optimizes the cases where the result of the LShr instruction is guaranteed to vanish or be equal to poison.1 parent 0ce38dd commit e2cfa08
File tree
1 file changed
+4
-9
lines changed- llvm/lib/Transforms/Scalar
1 file changed
+4
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1103 | 1103 | | |
1104 | 1104 | | |
1105 | 1105 | | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
| 1106 | + | |
| 1107 | + | |
1110 | 1108 | | |
1111 | 1109 | | |
1112 | 1110 | | |
| |||
1138 | 1136 | | |
1139 | 1137 | | |
1140 | 1138 | | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
| 1139 | + | |
| 1140 | + | |
1145 | 1141 | | |
1146 | | - | |
1147 | 1142 | | |
1148 | 1143 | | |
1149 | 1144 | | |
| |||
0 commit comments