<HTML xmlns:o><HEAD><TITLE>Samsung Enterprise Portal mySingle</TITLE>
<META content="text/html; charset=euc-kr" http-equiv=Content-Type>
<STYLE id=mysingle_style type=text/css>P {
        MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt; FONT-FAMILY: ±¼¸²Ã¼, arial; MARGIN-TOP: 5px
}
TD {
        MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt; FONT-FAMILY: ±¼¸²Ã¼, arial; MARGIN-TOP: 5px
}
LI {
        MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt; FONT-FAMILY: ±¼¸²Ã¼, arial; MARGIN-TOP: 5px
}
BODY {
        FONT-SIZE: 9pt; FONT-FAMILY: ±¼¸²Ã¼, arial; MARGIN: 10px; LINE-HEIGHT: 1.4
}
</STYLE>

<META content=IE=5 http-equiv=X-UA-Compatible>
<META content=IE=5 http-equiv=X-UA-Compatible>
<META name=GENERATOR content="MSHTML 11.00.9600.17842"></HEAD>
<BODY>
<P style='FONT-SIZE: 12pt; TEXT-DECORATION: ; FONT-FAMILY: "Times New Roman","serif"; MARGIN: 0cm 0cm 0pt'><SPAN lang=EN-US style='FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman; mso-fareast-font-family: "Times New Roman"'>Hi </SPAN><SPAN lang=EN-US style='FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-size: 11.0pt; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: KO; mso-bidi-language: AR-SA'>Guozhi</SPAN><SPAN lang=EN-US style='FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman; mso-fareast-font-family: "Times New Roman"'>,</SPAN><o:p><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman"></SPAN></o:p></P>
<P style='FONT-SIZE: 12pt; TEXT-DECORATION: ; FONT-FAMILY: "Times New Roman","serif"; MARGIN: 0cm 0cm 0pt'><o:p><SPAN lang=EN-US style='FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman; mso-fareast-font-family: "Times New Roman"'> </SPAN></o:p></P>
<P style='FONT-SIZE: 12pt; TEXT-DECORATION: ; FONT-FAMILY: "Times New Roman","serif"; MARGIN: 0cm 0cm 0pt'><SPAN lang=EN-US style='FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman; mso-fareast-font-family: "Times New Roman"'>I reverted the patch in r262916 due to compile failure. Feel free to recommit when the issue is fixed.</SPAN></P>
<P style='FONT-SIZE: 12pt; TEXT-DECORATION: ; FONT-FAMILY: "Times New Roman","serif"; MARGIN: 0cm 0cm 0pt'><SPAN lang=EN-US style='FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman; mso-fareast-font-family: "Times New Roman"'>I already sent a test-case for debugging.</SPAN></P>
<P style='FONT-SIZE: 12pt; TEXT-DECORATION: ; FONT-FAMILY: "Times New Roman","serif"; MARGIN: 0cm 0cm 0pt'><o:p><SPAN lang=EN-US style='FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman; mso-fareast-font-family: "Times New Roman"'> </SPAN></o:p></P>
<P style='FONT-SIZE: 12pt; TEXT-DECORATION: ; FONT-FAMILY: "Times New Roman","serif"; MARGIN: 0cm 0cm 0pt'><SPAN lang=EN-US style='FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman; mso-fareast-font-family: "Times New Roman"'>Thanks,</SPAN><o:p><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman"></SPAN></o:p></P>
<P style='FONT-SIZE: 12pt; TEXT-DECORATION: ; FONT-FAMILY: "Times New Roman","serif"; MARGIN: 0cm 0cm 0pt'><SPAN lang=EN-US style='FONT-SIZE: 9pt; FONT-FAMILY: Times New Roman; mso-fareast-font-family: "Times New Roman"'>Junmo Park.</SPAN></P>
<P> </P>
<P>------- <B>Original Message</B> -------</P>
<P><B>Sender</B> : Junmo Park via llvm-commits<llvm-commits@lists.llvm.org></P>
<P><B>Date</B> : 2016-03-08 16:09 (GMT+09:00)</P>
<P><B>Title</B> : [llvm] r262916 - Revert "[InstCombine] Combine A->B->A BitCast"</P>
<P> </P>Author: flyingforyou<BR>Date: Tue Mar  8 01:09:46 2016<BR>New Revision: 262916<BR><BR>URL: http://llvm.org/viewvc/llvm-project?rev=262916&view=rev<BR>Log:<BR>Revert "[InstCombine] Combine A->B->A BitCast"<BR><BR>This reverts commit r262670 due to compile failure.<BR><BR>Modified:<BR>    llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp<BR>    llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h<BR><BR>Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp<BR>URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp?rev=262916&r1=262915&r2=262916&view=diff<BR>==============================================================================<BR>--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp (original)<BR>+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp Tue Mar  8 01:09:46 2016<BR>@@ -12,7 +12,6 @@<BR>//===----------------------------------------------------------------------===//<BR><BR>#include "InstCombineInternal.h"<BR>-#include "llvm/ADT/SetVector.h"<BR>#include "llvm/Analysis/ConstantFolding.h"<BR>#include "llvm/IR/DataLayout.h"<BR>#include "llvm/IR/PatternMatch.h"<BR>@@ -1787,103 +1786,6 @@ static Instruction *canonicalizeBitCastE<BR>   return ExtractElementInst::Create(NewBC, ExtElt->getIndexOperand());<BR>}<BR><BR>-/// This function handles following case<BR>-///<BR>-///     A  ->  B    cast<BR>-///     PHI<BR>-///     B  ->  A    cast<BR>-///<BR>-/// All the related PHI nodes can be replaced by new PHI nodes with type A.<BR>-/// The uses of \p CI can be changed to the new PHI node corresponding to \p PN.<BR>-Instruction *InstCombiner::optimizeBitCastFromPhi(CastInst &CI, PHINode *PN) {<BR>-  Value *Src = CI.getOperand(0);<BR>-  Type *SrcTy = Src->getType();         // Type B<BR>-  Type *DestTy = CI.getType();          // Type A<BR>-<BR>-  SmallVector<PHINODE *, 4> Worklist;<BR>-  SmallSetVector<PHINODE *, 4> OldPhiNodes;<BR>-<BR>-  // Find all of the A->B casts and PHI nodes.<BR>-  // We need to inpect all related PHI nodes, but PHIs can be cyclic, so<BR>-  // OldPhiNodes is used to track all known PHI nodes, before adding a new<BR>-  // PHI to Worklist, it is checked against and added to OldPhiNodes first.<BR>-  Worklist.push_back(PN);<BR>-  OldPhiNodes.insert(PN);<BR>-  while (!Worklist.empty()) {<BR>-    auto *OldPN = Worklist.pop_back_val();<BR>-    for (Value *IncValue : OldPN->incoming_values()) {<BR>-      if (isa<CONSTANT>(IncValue))<BR>-        continue;<BR>-<BR>-      if (isa<LOADINST>(IncValue)) {<BR>-        if (IncValue->hasOneUse())<BR>-          continue;<BR>-        // If a LoadInst has more than one use, changing the type of loaded<BR>-        // value may create another bitcast.<BR>-        return nullptr;<BR>-      }<BR>-<BR>-      auto *PNode = dyn_cast<PHINODE>(IncValue);<BR>-      if (PNode) {<BR>-        if (OldPhiNodes.insert(PNode))<BR>-          Worklist.push_back(PNode);<BR>-        continue;<BR>-      }<BR>-<BR>-      auto *BCI = dyn_cast<BITCASTINST>(IncValue);<BR>-      // We can't handle other instructions.<BR>-      if (!BCI)<BR>-        return nullptr;<BR>-<BR>-      // Verify it's a A->B cast.<BR>-      Type *TyA = BCI->getOperand(0)->getType();<BR>-      Type *TyB = BCI->getType();<BR>-      if (TyA != DestTy || TyB != SrcTy)<BR>-        return nullptr;<BR>-    }<BR>-  }<BR>-<BR>-  // For each old PHI node, create a corresponding new PHI node with a type A.<BR>-  SmallDenseMap<PHINODE *, PHINode *> NewPNodes;<BR>-  for (auto *OldPN : OldPhiNodes) {<BR>-    Builder->SetInsertPoint(OldPN);<BR>-    PHINode *NewPN = Builder->CreatePHI(DestTy, OldPN->getNumOperands());<BR>-    NewPNodes[OldPN] = NewPN;<BR>-  }<BR>-<BR>-  // Fill in the operands of new PHI nodes.<BR>-  for (auto *OldPN : OldPhiNodes) {<BR>-    PHINode *NewPN = NewPNodes[OldPN];<BR>-    for (unsigned j = 0, e = OldPN->getNumOperands(); j != e; ++j) {<BR>-      Value *V = OldPN->getOperand(j);<BR>-      Value *NewV = nullptr;<BR>-      if (auto *C = dyn_cast<CONSTANT>(V)) {<BR>-        NewV = Builder->CreateBitCast(C, DestTy);<BR>-      } else if (auto *LI = dyn_cast<LOADINST>(V)) {<BR>-        Builder->SetInsertPoint(OldPN->getIncomingBlock(j)->getTerminator());<BR>-        NewV = Builder->CreateBitCast(LI, DestTy);<BR>-      } else if (auto *BCI = dyn_cast<BITCASTINST>(V)) {<BR>-        NewV = BCI->getOperand(0);<BR>-      } else if (auto *PrevPN = dyn_cast<PHINODE>(V)) {<BR>-        NewV = NewPNodes[PrevPN];<BR>-      }<BR>-      assert(NewV);<BR>-      NewPN->addIncoming(NewV, OldPN->getIncomingBlock(j));<BR>-    }<BR>-  }<BR>-<BR>-  // If there is a store with type B, change it to type A.<BR>-  for (User *U : PN->users()) {<BR>-    auto *SI = dyn_cast<STOREINST>(U);<BR>-    if (SI && SI->getOperand(0) == PN) {<BR>-      Builder->SetInsertPoint(SI);<BR>-      SI->setOperand(0, Builder->CreateBitCast(NewPNodes[PN], SrcTy));<BR>-    }<BR>-  }<BR>-<BR>-  return replaceInstUsesWith(CI, NewPNodes[PN]);<BR>-}<BR>-<BR>Instruction *InstCombiner::visitBitCast(BitCastInst &CI) {<BR>   // If the operands are integer typed then apply the integer transforms,<BR>   // otherwise just apply the common ones.<BR>@@ -2000,11 +1902,6 @@ Instruction *InstCombiner::visitBitCast(<BR>     }<BR>   }<BR><BR>-  // Handle the A->B->A cast, and there is an intervening PHI node.<BR>-  if (PHINode *PN = dyn_cast<PHINODE>(Src))<BR>-    if (Instruction *I = optimizeBitCastFromPhi(CI, PN))<BR>-      return I;<BR>-<BR>   if (Instruction *I = canonicalizeBitCastExtElt(CI, *this, DL))<BR>     return I;<BR><BR><BR>Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h<BR>URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h?rev=262916&r1=262915&r2=262916&view=diff<BR>==============================================================================<BR>--- llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h (original)<BR>+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h Tue Mar  8 01:09:46 2016<BR>@@ -391,7 +391,6 @@ private:<BR>   Instruction *scalarizePHI(ExtractElementInst &EI, PHINode *PN);<BR>   Value *EvaluateInDifferentElementOrder(Value *V, ArrayRef<INT> Mask);<BR>   Instruction *foldCastedBitwiseLogic(BinaryOperator &I);<BR>-  Instruction *optimizeBitCastFromPhi(CastInst &CI, PHINode *PN);<BR><BR>public:<BR>   /// \brief Inserts an instruction \p New before instruction \p Old<BR><BR><BR>_______________________________________________<BR>llvm-commits mailing list<BR>llvm-commits@lists.llvm.org<BR>http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<BR>
<TABLE id=confidentialsignimg>
<TBODY>
<TR>
<TD NAMO_LOCK>
<P><IMG border=0 src="cid:4XEV4D4TEW9B@namo.co.kr"></P></TD></TR></TBODY></TABLE></BODY></HTML><img src='http://ext.samsung.net/mailcheck/SeenTimeChecker?do=22f8650517ba6865d2d790cabae4c26a84281211dbc44160f013dd452bfcfef4b5b181570026814a101a1d05a57ecb788811b2cd7e9e9e2649e5ff3dfdc8681d76f80bf81d31c863cf878f9a26ce15a0' border=0 width=0 height=0 style='display:none'>