[PATCH] D38234: [ARM] isTruncateFree fix

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 01:32:38 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL314280: [ARM] isTruncateFree fix (authored by sam_parker).

Changed prior to commit:
  https://reviews.llvm.org/D38234?vs=116540&id=116771#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38234

Files:
  llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp


Index: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
@@ -12320,18 +12320,18 @@
 bool ARMTargetLowering::isTruncateFree(Type *SrcTy, Type *DstTy) const {
   if (!SrcTy->isIntegerTy() || !DstTy->isIntegerTy())
     return false;
-  unsigned NumBits1 = SrcTy->getPrimitiveSizeInBits();
-  unsigned NumBits2 = DstTy->getPrimitiveSizeInBits();
-  return NumBits1 > NumBits2;
+  unsigned SrcBits = SrcTy->getPrimitiveSizeInBits();
+  unsigned DestBits = DstTy->getPrimitiveSizeInBits();
+  return (SrcBits == 64 && DestBits == 32);
 }
 
 bool ARMTargetLowering::isTruncateFree(EVT SrcVT, EVT DstVT) const {
   if (SrcVT.isVector() || DstVT.isVector() || !SrcVT.isInteger() ||
       !DstVT.isInteger())
     return false;
-  unsigned NumBits1 = SrcVT.getSizeInBits();
-  unsigned NumBits2 = DstVT.getSizeInBits();
-  return NumBits1 > NumBits2;
+  unsigned SrcBits = SrcVT.getSizeInBits();
+  unsigned DestBits = DstVT.getSizeInBits();
+  return (SrcBits == 64 && DestBits == 32);
 }
 
 bool ARMTargetLowering::isZExtFree(SDValue Val, EVT VT2) const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38234.116771.patch
Type: text/x-patch
Size: 1214 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170927/c2d7db27/attachment.bin>


More information about the llvm-commits mailing list