[llvm-branch-commits] [llvm-branch] r370344 - ReleaseNotes: sinking of instructions without uses

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 29 05:37:46 PDT 2019


Author: hans
Date: Thu Aug 29 05:37:46 2019
New Revision: 370344

URL: http://llvm.org/viewvc/llvm-project?rev=370344&view=rev
Log:
ReleaseNotes: sinking of instructions without uses

Modified:
    llvm/branches/release_90/docs/ReleaseNotes.rst

Modified: llvm/branches/release_90/docs/ReleaseNotes.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_90/docs/ReleaseNotes.rst?rev=370344&r1=370343&r2=370344&view=diff
==============================================================================
--- llvm/branches/release_90/docs/ReleaseNotes.rst (original)
+++ llvm/branches/release_90/docs/ReleaseNotes.rst Thu Aug 29 05:37:46 2019
@@ -115,6 +115,26 @@ Noteworthy optimizations
            jmp     qword ptr [8*rax + .LJTI0_0]
 
 
+* LLVM can now sink similar instructions to a common successor block also when
+  the instructions have no uses, such as calls to void functions. This allows
+  code such as
+
+  .. code-block:: c
+
+   void g(int);
+   enum e { A, B, C, D };
+   void f(e x, int y, int z) {
+       switch(x) {
+           case A: g(6); break;
+           case B: g(3); break;
+           case C: g(9); break;
+           case D: g(2); break;
+       }
+   }
+
+  to be optimized to a single call to ``g``, with the argument loaded from a
+  lookup table.
+
 
 Changes to the LLVM IR
 ----------------------




More information about the llvm-branch-commits mailing list