git: 5509f8e7f242 - main - devel/llvm12: fix hangs with CPUTYPE=skylake-avx512

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Mon, 13 Jun 2022 16:40:31 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5509f8e7f242d4de27d457834995386b07f11410

commit 5509f8e7f242d4de27d457834995386b07f11410
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2022-06-13 16:40:26 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2022-06-13 16:40:26 +0000

    devel/llvm12: fix hangs with CPUTYPE=skylake-avx512
    
    Merge commit e8305c0b8f49 from llvm git (by Simon Pilgrim)
    
        [X86] combineX86ShuffleChain - don't fold to truncate(concat(V1,V2)) if it was already a PACK op
    
        Fixes #55050
    
    PR:             264480
    MFH:            2022Q2
    Sponsored by:   DARPA, AFRL
---
 devel/llvm12/Makefile                                     |  2 +-
 .../files/patch-llvm_lib_Target_X86_X86ISelLowering.cpp   | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/devel/llvm12/Makefile b/devel/llvm12/Makefile
index d6ddffb680fc..1324fab94452 100644
--- a/devel/llvm12/Makefile
+++ b/devel/llvm12/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	llvm
 DISTVERSION=	12.0.1
-PORTREVISION=	9
+PORTREVISION=	10
 CATEGORIES=	devel lang
 MASTER_SITES=	https://github.com/llvm/llvm-project/releases/download/llvmorg-${DISTVERSION:S/rc/-rc/}/ \
 		https://${PRE_}releases.llvm.org/${LLVM_RELEASE}/${RCDIR}
diff --git a/devel/llvm12/files/patch-llvm_lib_Target_X86_X86ISelLowering.cpp b/devel/llvm12/files/patch-llvm_lib_Target_X86_X86ISelLowering.cpp
new file mode 100644
index 000000000000..877b03db54b9
--- /dev/null
+++ b/devel/llvm12/files/patch-llvm_lib_Target_X86_X86ISelLowering.cpp
@@ -0,0 +1,15 @@
+--- llvm/lib/Target/X86/X86ISelLowering.cpp.orig
++++ llvm/lib/Target/X86/X86ISelLowering.cpp
+@@ -36201,7 +36201,11 @@
+          (RootVT.is128BitVector() && Subtarget.hasVLX())) &&
+         (MaskEltSizeInBits > 8 || Subtarget.hasBWI()) &&
+         isSequentialOrUndefInRange(Mask, 0, NumMaskElts, 0, 2)) {
+-      if (Depth == 0 && Root.getOpcode() == ISD::TRUNCATE)
++      // Bail if this was already a truncation or PACK node.
++      // We sometimes fail to match PACK if we demand known undef elements.
++      if (Depth == 0 && (Root.getOpcode() == ISD::TRUNCATE ||
++                         Root.getOpcode() == X86ISD::PACKSS ||
++                         Root.getOpcode() == X86ISD::PACKUS))
+         return SDValue(); // Nothing to do!
+       ShuffleSrcVT = MVT::getIntegerVT(MaskEltSizeInBits * 2);
+       ShuffleSrcVT = MVT::getVectorVT(ShuffleSrcVT, NumMaskElts / 2);