[cfe-commits] r59130 - /cfe/trunk/lib/CodeGen/README.txt

Daniel Dunbar daniel at zuster.org
Wed Nov 12 04:31:30 PST 2008


Author: ddunbar
Date: Wed Nov 12 06:31:28 2008
New Revision: 59130

URL: http://llvm.org/viewvc/llvm-project?rev=59130&view=rev
Log:
Start a README.txt of possible optimizations to do in IRgen.

Added:
    cfe/trunk/lib/CodeGen/README.txt

Added: cfe/trunk/lib/CodeGen/README.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/README.txt?rev=59130&view=auto

==============================================================================
--- cfe/trunk/lib/CodeGen/README.txt (added)
+++ cfe/trunk/lib/CodeGen/README.txt Wed Nov 12 06:31:28 2008
@@ -0,0 +1,24 @@
+IRgen optimization opportunities.
+
+//===---------------------------------------------------------------------===//
+
+The common pattern of
+--
+short x; // or char, etc
+(x == 10)
+--
+generates an zext/sext of x which can easily be avoided.
+
+//===---------------------------------------------------------------------===//
+
+Bitfields accesses can be shifted to simplify masking and sign
+extension. For example, if the bitfield width is 8 and it is
+appropriately aligned then is is a lot shorter to just load the char
+directly.
+
+//===---------------------------------------------------------------------===//
+
+Bitfields should not reload the stored value just to return the
+correct result.
+
+//===---------------------------------------------------------------------===//





More information about the cfe-commits mailing list