[llvm-branch-commits] [libcxx] 4822f2a - Bump version to 10.0.1

2020-04-13 Thread Tom Stellard via llvm-branch-commits

Author: Tom Stellard
Date: 2020-04-13T14:13:36Z
New Revision: 4822f2a6154742ab24e0266d6c4b0c2937d22ab7

URL: 
https://github.com/llvm/llvm-project/commit/4822f2a6154742ab24e0266d6c4b0c2937d22ab7
DIFF: 
https://github.com/llvm/llvm-project/commit/4822f2a6154742ab24e0266d6c4b0c2937d22ab7.diff

LOG: Bump version to 10.0.1

Added: 


Modified: 
libcxx/CMakeLists.txt
libcxxabi/CMakeLists.txt
libunwind/CMakeLists.txt
llvm/CMakeLists.txt
llvm/utils/gn/secondary/llvm/version.gni
llvm/utils/lit/lit/__init__.py
llvm/utils/release/build_llvm_package.bat

Removed: 




diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 1d6ab58166ef..60564dc96c7b 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -27,7 +27,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR 
LIBCXX_STANDALONE_BUIL
   project(libcxx CXX C)
 
   set(PACKAGE_NAME libcxx)
-  set(PACKAGE_VERSION 10.0.0)
+  set(PACKAGE_VERSION 10.0.1)
   set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
   set(PACKAGE_BUGREPORT "llvm-b...@lists.llvm.org")
 

diff  --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index 59d99971a765..8f9572586b4a 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -21,7 +21,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR 
LIBCXXABI_STANDALONE_B
   project(libcxxabi CXX C)
 
   set(PACKAGE_NAME libcxxabi)
-  set(PACKAGE_VERSION 10.0.0)
+  set(PACKAGE_VERSION 10.0.1)
   set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
   set(PACKAGE_BUGREPORT "llvm-b...@lists.llvm.org")
 

diff  --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index 7726511b6e1f..c033069ef1d0 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -83,7 +83,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR 
LIBUNWIND_STANDALONE_B
   endif()
 
   set(PACKAGE_NAME libunwind)
-  set(PACKAGE_VERSION 10.0.0)
+  set(PACKAGE_VERSION 10.0.1)
   set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
   set(PACKAGE_BUGREPORT "llvm-b...@lists.llvm.org")
 

diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index a02c2a5a23f1..bc45df7a3acb 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -22,7 +22,7 @@ if(NOT DEFINED LLVM_VERSION_MINOR)
   set(LLVM_VERSION_MINOR 0)
 endif()
 if(NOT DEFINED LLVM_VERSION_PATCH)
-  set(LLVM_VERSION_PATCH 0)
+  set(LLVM_VERSION_PATCH 1)
 endif()
 if(NOT DEFINED LLVM_VERSION_SUFFIX)
   set(LLVM_VERSION_SUFFIX "")

diff  --git a/llvm/utils/gn/secondary/llvm/version.gni 
b/llvm/utils/gn/secondary/llvm/version.gni
index 39961ef497e4..184e96bdd0b9 100644
--- a/llvm/utils/gn/secondary/llvm/version.gni
+++ b/llvm/utils/gn/secondary/llvm/version.gni
@@ -1,4 +1,4 @@
 llvm_version_major = 10
 llvm_version_minor = 0
-llvm_version_patch = 0
+llvm_version_patch = 1
 llvm_version = "$llvm_version_major.$llvm_version_minor.$llvm_version_patch"

diff  --git a/llvm/utils/lit/lit/__init__.py b/llvm/utils/lit/lit/__init__.py
index 09e366e1c5cf..2dc89fa0adc6 100644
--- a/llvm/utils/lit/lit/__init__.py
+++ b/llvm/utils/lit/lit/__init__.py
@@ -2,7 +2,7 @@
 
 __author__ = 'Daniel Dunbar'
 __email__ = 'dan...@minormatter.com'
-__versioninfo__ = (0, 10, 0)
+__versioninfo__ = (0, 10, 1)
 __version__ = '.'.join(str(v) for v in __versioninfo__) + 'dev'
 
 __all__ = []

diff  --git a/llvm/utils/release/build_llvm_package.bat 
b/llvm/utils/release/build_llvm_package.bat
index a54fd1f0e622..e44941d1eb1f 100755
--- a/llvm/utils/release/build_llvm_package.bat
+++ b/llvm/utils/release/build_llvm_package.bat
@@ -27,8 +27,8 @@ set 
python64_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36
 for /f "usebackq" %%i in (`PowerShell ^(Get-Date^).ToString^('MMdd'^)`) do 
set datestamp=%%i
 
 set revision=%1
-set package_version=10.0.0-%revision%
-set clang_format_vs_version=10.0.0.%datestamp%
+set package_version=10.0.1-%revision%
+set clang_format_vs_version=10.0.1.%datestamp%
 set build_dir=llvm_package_%revision%
 
 echo Revision: %revision%



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] 68cd4f7 - Use FinishThunk to finish musttail thunks

2020-04-13 Thread via llvm-branch-commits

Author: Reid Kleckner
Date: 2020-04-13T10:34:45-07:00
New Revision: 68cd4f72beae67a9bdbc11c85fd745dec8fc0999

URL: 
https://github.com/llvm/llvm-project/commit/68cd4f72beae67a9bdbc11c85fd745dec8fc0999
DIFF: 
https://github.com/llvm/llvm-project/commit/68cd4f72beae67a9bdbc11c85fd745dec8fc0999.diff

LOG: Use FinishThunk to finish musttail thunks

FinishThunk, and the invariant of setting and then unsetting
CurCodeDecl, was added in 7f416cc42638 (2015). The invariant didn't
exist when I added this musttail codepath in ab2090d10765 (2014).
Recently in 28328c3771, I started using this codepath on non-Windows
platforms, and users reported problems during release testing (PR44987).

The issue was already present for users of EH on i686-windows-msvc, so I
added a test for that case as well.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D76444

(cherry picked from commit ce5173c0e174870934d1b3a026f631d996136191)

Added: 
clang/test/CodeGenCXX/ms-thunks-ehspec.cpp
clang/test/CodeGenCXX/thunks-ehspec.cpp

Modified: 
clang/lib/CodeGen/CGVTables.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp
index 59631e802373..e97f7e41499d 100644
--- a/clang/lib/CodeGen/CGVTables.cpp
+++ b/clang/lib/CodeGen/CGVTables.cpp
@@ -437,7 +437,8 @@ void CodeGenFunction::EmitMustTailThunk(GlobalDecl GD,
   // Finish the function to maintain CodeGenFunction invariants.
   // FIXME: Don't emit unreachable code.
   EmitBlock(createBasicBlock());
-  FinishFunction();
+
+  FinishThunk();
 }
 
 void CodeGenFunction::generateThunk(llvm::Function *Fn,
@@ -564,7 +565,7 @@ llvm::Constant *CodeGenVTables::maybeEmitThunk(GlobalDecl 
GD,
   CGM.SetLLVMFunctionAttributesForDefinition(GD.getDecl(), ThunkFn);
 
   // Thunks for variadic methods are special because in general variadic
-  // arguments cannot be perferctly forwarded. In the general case, clang
+  // arguments cannot be perfectly forwarded. In the general case, clang
   // implements such thunks by cloning the original function body. However, for
   // thunks with no return adjustment on targets that support musttail, we can
   // use musttail to perfectly forward the variadic arguments.

diff  --git a/clang/test/CodeGenCXX/ms-thunks-ehspec.cpp 
b/clang/test/CodeGenCXX/ms-thunks-ehspec.cpp
new file mode 100644
index ..f72100d5078b
--- /dev/null
+++ b/clang/test/CodeGenCXX/ms-thunks-ehspec.cpp
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -fexceptions -fcxx-exceptions %s -triple=i686-windows-msvc 
-emit-llvm -o - | FileCheck %s
+
+// When generating thunks using musttail due to inalloca parameters, don't push
+// and pop terminate scopes. PR44987
+
+struct NonTrivial {
+  NonTrivial();
+  NonTrivial(const NonTrivial &o);
+  ~NonTrivial();
+  int x;
+};
+struct A {
+  virtual void f(NonTrivial o) noexcept;
+};
+struct B {
+  virtual void f(NonTrivial o) noexcept;
+};
+class C : A, B {
+  virtual void f(NonTrivial o) noexcept;
+};
+C c;
+
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void 
@"?f@C@@G3AEXUNonTrivial@@@Z"(%class.C* %this, <{ %struct.NonTrivial }>* 
inalloca %0)
+// CHECK-NOT: invoke
+// CHECK: musttail call x86_thiscallcc void 
@"?f@C@@EAEXUNonTrivial@@@Z"(%class.C* %{{.*}}, <{ %struct.NonTrivial }>* 
inalloca %0)
+// CHECK-NEXT  ret void
+

diff  --git a/clang/test/CodeGenCXX/thunks-ehspec.cpp 
b/clang/test/CodeGenCXX/thunks-ehspec.cpp
new file mode 100644
index ..30276948d3fc
--- /dev/null
+++ b/clang/test/CodeGenCXX/thunks-ehspec.cpp
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -fexceptions -fcxx-exceptions %s 
-triple=x86_64-pc-linux-gnu -munwind-tables -emit-llvm -o - -O1 
-disable-llvm-passes | FileCheck %s
+
+// When generating the thunk for secondary, do not push terminate scopes for
+// either the varargs or non-varargs case. Related to PR44987.
+
+struct A {
+  virtual void primary_key();
+};
+struct B {
+  virtual void secondary();
+  virtual void secondary_vararg(int, ...);
+};
+class C : A, B {
+  virtual void primary_key();
+  void secondary() noexcept;
+  void secondary_vararg(int, ...) noexcept;
+};
+void C::primary_key() {}
+
+// CHECK-LABEL: define available_externally void 
@_ZThn8_N1C9secondaryEv(%class.C* %this)
+// CHECK-NOT: invoke
+// CHECK: tail call void @_ZN1C9secondaryEv(%class.C* %{{.*}})
+// CHECK-NOT: invoke
+// CHECK: ret void
+
+// CHECK-LABEL: define available_externally void 
@_ZThn8_N1C16secondary_varargEiz(%class.C* %this, i32 %0, ...)
+// CHECK-NOT: invoke
+// CHECK:  musttail call void (%class.C*, i32, ...) 
@_ZN1C16secondary_varargEiz(%class.C* %{{.*}}, i32 %{{.*}}, ...) #2
+// CHECK-NEXT:  ret void



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 47e68d8 - [CodeGen] Fix sinking local values in lpads with phis

2020-04-13 Thread via llvm-branch-commits

Author: Reid Kleckner
Date: 2020-04-13T13:37:15-07:00
New Revision: 47e68d864420afd42d34fd25e97522e5c149de46

URL: 
https://github.com/llvm/llvm-project/commit/47e68d864420afd42d34fd25e97522e5c149de46
DIFF: 
https://github.com/llvm/llvm-project/commit/47e68d864420afd42d34fd25e97522e5c149de46.diff

LOG: [CodeGen] Fix sinking local values in lpads with phis

There was already a test case for landingpads to handle this case, but I
had forgotten to consider PHI instructions preceding the EH_LABEL in the
landingpad.

PR45261

(cherry picked from commit e5bf5037d869c74bc2faf81fa1f58dfd827e8356)

Added: 


Modified: 
llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
llvm/test/CodeGen/X86/sink-local-value.ll

Removed: 




diff  --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp 
b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 8294591b7326..6ecde9b43c07 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -225,6 +225,21 @@ static bool isRegUsedByPhiNodes(unsigned DefReg,
   return false;
 }
 
+static bool isTerminatingEHLabel(MachineBasicBlock *MBB, MachineInstr &MI) {
+  // Ignore non-EH labels.
+  if (!MI.isEHLabel())
+return false;
+
+  // Any EH label outside a landing pad must be for an invoke. Consider it a
+  // terminator.
+  if (!MBB->isEHPad())
+return true;
+
+  // If this is a landingpad, the first non-phi instruction will be an 
EH_LABEL.
+  // Don't consider that label to be a terminator.
+  return MI.getIterator() != MBB->getFirstNonPHI();
+}
+
 /// Build a map of instruction orders. Return the first terminator and its
 /// order. Consider EH_LABEL instructions to be terminators as well, since 
local
 /// values for phis after invokes must be materialized before the call.
@@ -233,7 +248,7 @@ void FastISel::InstOrderMap::initialize(
   unsigned Order = 0;
   for (MachineInstr &I : *MBB) {
 if (!FirstTerminator &&
-(I.isTerminator() || (I.isEHLabel() && &I != &MBB->front( {
+(I.isTerminator() || isTerminatingEHLabel(MBB, I))) {
   FirstTerminator = &I;
   FirstTerminatorOrder = Order;
 }

diff  --git a/llvm/test/CodeGen/X86/sink-local-value.ll 
b/llvm/test/CodeGen/X86/sink-local-value.ll
index b0e511ac1189..f7d861ac9b6c 100644
--- a/llvm/test/CodeGen/X86/sink-local-value.ll
+++ b/llvm/test/CodeGen/X86/sink-local-value.ll
@@ -145,6 +145,42 @@ try.cont: ; preds 
= %entry, %lpad
 ; CHECK: retl
 
 
+define i32 @lpad_phi() personality i32 (...)* @__gxx_personality_v0 {
+entry:
+  store i32 42, i32* @sink_across
+  invoke void @may_throw()
+  to label %try.cont unwind label %lpad
+
+lpad: ; preds = %entry
+  %p = phi i32 [ 11, %entry ]  ; Trivial, but -O0 keeps it
+  %0 = landingpad { i8*, i32 }
+  catch i8* null
+  store i32 %p, i32* @sink_across
+  br label %try.cont
+
+try.cont: ; preds = %entry, %lpad
+  %r.0 = phi i32 [ 13, %entry ], [ 55, %lpad ]
+  ret i32 %r.0
+}
+
+; The constant materialization should be *after* the stores to sink_across, but
+; before any EH_LABEL.
+
+; CHECK-LABEL: lpad_phi:
+; CHECK: movl$42, sink_across
+; CHECK: movl$13, %{{[a-z]*}}
+; CHECK: .Ltmp{{.*}}:
+; CHECK: calll   may_throw
+; CHECK: .Ltmp{{.*}}:
+; CHECK: jmp .LBB{{.*}}
+; CHECK: .LBB{{.*}}:# %lpad
+; CHECK-NEXT: .Ltmp{{.*}}:
+; CHECK: movl{{.*}}, sink_across
+; CHECK: movl$55, %{{[a-z]*}}
+; CHECK: .LBB{{.*}}:# %try.cont
+; CHECK: retl
+
+
 ; Function Attrs: nounwind readnone speculatable
 declare void @llvm.dbg.value(metadata, metadata, metadata) #0
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] edbe962 - [COFF] Don't treat DWARF sections as GC roots

2020-04-13 Thread Tom Stellard via llvm-branch-commits

Author: Reid Kleckner
Date: 2020-04-13T13:48:04-07:00
New Revision: edbe962459da6e3b7b4168118f93a77847b54e02

URL: 
https://github.com/llvm/llvm-project/commit/edbe962459da6e3b7b4168118f93a77847b54e02
DIFF: 
https://github.com/llvm/llvm-project/commit/edbe962459da6e3b7b4168118f93a77847b54e02.diff

LOG: [COFF] Don't treat DWARF sections as GC roots

DWARF sections are typically live and not COMDAT, so they would be
treated as GC roots. Enabling DWARF would essentially keep all code with
debug info alive, preventing any section GC.

Fixes PR45273

Reviewed By: mstorsjo, MaskRay

Differential Revision: https://reviews.llvm.org/D76935

(cherry picked from commit c579a5b1d92a9bc2046d00ee2d427832e0f5ddec)

Added: 
lld/test/COFF/gc-dwarf.s

Modified: 
lld/COFF/MarkLive.cpp

Removed: 




diff  --git a/lld/COFF/MarkLive.cpp b/lld/COFF/MarkLive.cpp
index 6d34cb864e3c..0afa615a1933 100644
--- a/lld/COFF/MarkLive.cpp
+++ b/lld/COFF/MarkLive.cpp
@@ -28,10 +28,12 @@ void markLive(ArrayRef chunks) {
   // as we push, so sections never appear twice in the list.
   SmallVector worklist;
 
-  // COMDAT section chunks are dead by default. Add non-COMDAT chunks.
+  // COMDAT section chunks are dead by default. Add non-COMDAT chunks. Do not
+  // traverse DWARF sections. They are live, but they should not keep other
+  // sections alive.
   for (Chunk *c : chunks)
 if (auto *sc = dyn_cast(c))
-  if (sc->live)
+  if (sc->live && !sc->isDWARF())
 worklist.push_back(sc);
 
   auto enqueue = [&](SectionChunk *c) {

diff  --git a/lld/test/COFF/gc-dwarf.s b/lld/test/COFF/gc-dwarf.s
new file mode 100644
index ..56b866f4a4ac
--- /dev/null
+++ b/lld/test/COFF/gc-dwarf.s
@@ -0,0 +1,60 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -triple=x86_64-windows-msvc %s -filetype=obj -o %t.obj
+# RUN: lld-link -lldmap:%t.map -out:%t.exe -opt:ref -entry:main %t.obj 
-verbose 2>&1 | FileCheck %s
+# RUN: FileCheck %s --check-prefix=MAP --input-file=%t.map
+
+# CHECK:  Discarded unused1
+# CHECK-NEXT: Discarded unused2
+# CHECK-NOT: Discarded
+
+# MAP: In Symbol
+# MAP: gc-dwarf.s.tmp.obj:(.text)
+# MAP: {{ main$}}
+# MAP: gc-dwarf.s.tmp.obj:(.text)
+# MAP: {{ used$}}
+
+   .def @feat.00; .scl 3; .type0; .endef
+   .globl  @feat.00
+.set @feat.00, 0
+
+   .def main; .scl 2; .type32; .endef
+   .section.text,"xr",one_only,main
+   .globl  main
+main:
+   callq used
+   xorl%eax, %eax
+   retq
+
+   .def used; .scl 2; .type32; .endef
+   .section.text,"xr",one_only,used
+   .globl  used
+used:
+   retq
+
+
+   .def unused1; .scl  2; .type32; .endef
+   .section.text,"xr",one_only,unused1
+   .globl  unused1
+unused1:
+   retq
+
+   .def unused2; .scl  2; .type32; .endef
+   .section.text,"xr",one_only,unused2
+   .globl  unused2
+unused2:
+   retq
+
+# This isn't valid DWARF, but LLD doesn't care. Make up some data that
+# references the functions above.
+.section .debug_info,"r"
+.long main@IMGREL
+.long unused1@IMGREL
+.long unused2@IMGREL
+
+# Similarly, .eh_frame unwind info should not keep functions alive. Again, this
+# is not valid unwind info, but it doesn't matter for testing purposes.
+.section .eh_frame,"r"
+.long main@IMGREL
+.long unused1@IMGREL
+.long unused2@IMGREL



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits