From: Hans Wennborg <hans@hanshq.net>
Date: Wed, 3 Feb 2016 21:18:35 +0000 (+0000)
Subject: Merging r259645:
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=18a86c95fc36b5f622e8dc87f71252de37a1ed44;p=oota-llvm.git

Merging r259645:
------------------------------------------------------------------------
r259645 | nemanjai | 2016-02-03 04:53:38 -0800 (Wed, 03 Feb 2016) | 4 lines

Fix for PR 26381

Simple fix - Constant values were not being sign extended in FastIsel.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@259698 91177308-0d34-0410-b5e6-96231b3b80d8
---

diff --git a/lib/Target/PowerPC/PPCFastISel.cpp b/lib/Target/PowerPC/PPCFastISel.cpp
index b451ebf7f27..188c8e84c64 100644
--- a/lib/Target/PowerPC/PPCFastISel.cpp
+++ b/lib/Target/PowerPC/PPCFastISel.cpp
@@ -2108,7 +2108,7 @@ unsigned PPCFastISel::PPCMaterializeInt(const ConstantInt *CI, MVT VT,
   }
 
   // Construct the constant piecewise.
-  int64_t Imm = CI->getZExtValue();
+  int64_t Imm = UseSExt ? CI->getSExtValue() : CI->getZExtValue();
 
   if (VT == MVT::i64)
     return PPCMaterialize64BitInt(Imm, RC);