Daniel Dunbar | 8787530 | 2008-11-12 12:31:28 +0000 | [diff] [blame] | 1 | IRgen optimization opportunities. |
| 2 | |
| 3 | //===---------------------------------------------------------------------===// |
| 4 | |
| 5 | The common pattern of |
| 6 | -- |
| 7 | short x; // or char, etc |
| 8 | (x == 10) |
| 9 | -- |
| 10 | generates an zext/sext of x which can easily be avoided. |
| 11 | |
| 12 | //===---------------------------------------------------------------------===// |
| 13 | |
| 14 | Bitfields accesses can be shifted to simplify masking and sign |
| 15 | extension. For example, if the bitfield width is 8 and it is |
| 16 | appropriately aligned then is is a lot shorter to just load the char |
| 17 | directly. |
| 18 | |
| 19 | //===---------------------------------------------------------------------===// |