opnsense-ports/devel/llvm11/files/patch-lib_Target_X86_X86ISelLowering.cpp
Franco Fichtner b0260197a3 */*: sync with upstream
Taken from: FreeBSD
2022-07-06 08:14:30 +02:00

15 lines
864 B
C++

--- lib/Target/X86/X86ISelLowering.cpp.orig
+++ 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);