summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-11-12 12:31:28 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-11-12 12:31:28 +0000
commit2889780436ebc7feccb81aa11117e8a0a4de42ed (patch)
treee6d00dc5d135991a61f4affffafa7b88cf820a20 /clang/lib/CodeGen
parentbf3c22e51d35707aeecf062b14fa0518c4391940 (diff)
downloadbcm5719-llvm-2889780436ebc7feccb81aa11117e8a0a4de42ed.tar.gz
bcm5719-llvm-2889780436ebc7feccb81aa11117e8a0a4de42ed.zip
Start a README.txt of possible optimizations to do in IRgen.
llvm-svn: 59130
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/README.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/README.txt b/clang/lib/CodeGen/README.txt
new file mode 100644
index 00000000000..33fbfdb744a
--- /dev/null
+++ b/clang/lib/CodeGen/README.txt
@@ -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.
+
+//===---------------------------------------------------------------------===//
OpenPOWER on IntegriCloud