From 03db9ef03b534fc5eef89e2315a8843a683dc82a Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Thu, 29 Aug 2019 12:37:46 +0000 Subject: [PATCH] ReleaseNotes: sinking of instructions without uses git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@370344 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ReleaseNotes.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst index 7130242cc49..2e81b0b3e6c 100644 --- a/docs/ReleaseNotes.rst +++ b/docs/ReleaseNotes.rst @@ -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 ---------------------- -- 2.11.0