]> granicus.if.org Git - clang/commitdiff
Add some IRgen improvement notes.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 20 Feb 2009 19:34:45 +0000 (19:34 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 20 Feb 2009 19:34:45 +0000 (19:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65146 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/README.txt

index 56069dd99d2983b7cbf638a51eb79e8514cd6c0a..ea2cf8cf0ee04ff88768b23e51b78045707ab626 100644 (file)
@@ -30,3 +30,20 @@ block.
 
 //===---------------------------------------------------------------------===//
 
+We should try and avoid generating basic blocks which only contain
+jumps. At -O0, this penalizes us all the way from IRgen (malloc &
+instruction overhead), all the way down through code generation and
+assembly time.
+
+On 176.gcc:expr.ll, it looks like over 12% of basic blocks are just
+direct branches.
+
+//===---------------------------------------------------------------------===//
+
+There are some more places where we could avoid generating unreachable code. For
+example:
+  void f0(int a) { abort(); if (a) printf("hi"); }
+still generates a call to printf. This doesn't occur much in real
+code, but would still be nice to clean up.
+
+//===---------------------------------------------------------------------===//