svn commit: r360134 - head/contrib/llvm-project/llvm/lib/Target/PowerPC

Dimitry Andric dim at FreeBSD.org
Mon Apr 20 19:16:11 UTC 2020


Author: dim
Date: Mon Apr 20 19:16:10 2020
New Revision: 360134
URL: https://svnweb.freebsd.org/changeset/base/360134

Log:
  Merge commit 64b31d96d from llvm git (by Nemanja Ivanovic):
  
    [PowerPC] Do not attempt to reuse load for 64-bit FP_TO_UINT without
    FPCVT
  
    We call the function that attempts to reuse the conversion without
    checking whether the target matches the constraints that the callee
    expects. This patch adds the check prior to the call.
  
    Fixes: https://bugs.llvm.org/show_bug.cgi?id=43976
  
    Differential revision: https://reviews.llvm.org/D77564
  
  This should fix 'Assertion failed: ((Op.getOpcode() == ISD::FP_TO_SINT
  || Subtarget.hasFPCVT()) && "i64 FP_TO_UINT is supported only with
  FPCVT"), function LowerFP_TO_INTForReuse, file
  /usr/src/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp, line 7276'
  when building the devel/libslang2 port (and a few others) for PowerPC64.
  
  Requested by:	pkubaj
  MFC after:	6 weeks
  X-MFC-With:	358851

Modified:
  head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Modified: head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
==============================================================================
--- head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp	Mon Apr 20 19:08:45 2020	(r360133)
+++ head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp	Mon Apr 20 19:16:10 2020	(r360134)
@@ -7848,9 +7848,10 @@ bool PPCTargetLowering::canReuseLoadAddress(SDValue Op
                                             SelectionDAG &DAG,
                                             ISD::LoadExtType ET) const {
   SDLoc dl(Op);
+  bool ValidFPToUint = Op.getOpcode() == ISD::FP_TO_UINT &&
+                       (Subtarget.hasFPCVT() || Op.getValueType() == MVT::i32);
   if (ET == ISD::NON_EXTLOAD &&
-      (Op.getOpcode() == ISD::FP_TO_UINT ||
-       Op.getOpcode() == ISD::FP_TO_SINT) &&
+      (ValidFPToUint || Op.getOpcode() == ISD::FP_TO_SINT) &&
       isOperationLegalOrCustom(Op.getOpcode(),
                                Op.getOperand(0).getValueType())) {
 


More information about the svn-src-head mailing list