Commit 2d9af1c
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 e2cfa08 commit 2d9af1c
File tree
1 file changed
+12
-3
lines changed- llvm/lib/Transforms/Scalar
1 file changed
+12
-3
lines changedLines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
761 | 770 | | |
762 | 771 | | |
763 | 772 | | |
| |||
781 | 790 | | |
782 | 791 | | |
783 | 792 | | |
784 | | - | |
| 793 | + | |
785 | 794 | | |
786 | 795 | | |
787 | 796 | | |
| |||
899 | 908 | | |
900 | 909 | | |
901 | 910 | | |
902 | | - | |
| 911 | + | |
903 | 912 | | |
904 | 913 | | |
905 | 914 | | |
| |||
1156 | 1165 | | |
1157 | 1166 | | |
1158 | 1167 | | |
1159 | | - | |
| 1168 | + | |
1160 | 1169 | | |
1161 | 1170 | | |
1162 | 1171 | | |
| |||
0 commit comments