[llvm-commits] CVS: llvm/test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll
Changes in directory llvm/test/Regression/Linker: 2005-12-06-AppendingZeroLengthArrays.ll added (r1.1) --- Log message: new testcase for PR662: http://llvm.cs.uiuc.edu/PR662 --- Diffs of the changes: (+8 -0) 2005-12-06-AppendingZeroLengthArrays.ll |8 1 files changed, 8 insertions(+) Index: llvm/test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll diff -c /dev/null llvm/test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll:1.1 *** /dev/null Tue Dec 6 11:30:05 2005 --- llvm/test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll Tue Dec 6 11:29:54 2005 *** *** 0 --- 1,8 + ; RUN: echo "%G = appending global [0 x int] zeroinitializer" | llvm-as > %t.out2.bc + ; RUN: llvm-as < %s > %t.out1.bc + ; RUN: llvm-link %t.out[12].bc | llvm-dis | grep '%G =' + + ; When linked, the globals should be merged, and the result should still + ; be named '%G'. + + %G = appending global [1 x int] zeroinitializer ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp
Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.107 -> 1.108 --- Log message: Fix test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll and PR662: http://llvm.cs.uiuc.edu/PR662 . Thanks to Markus for providing me with a ton of files to reproduce the problem! --- Diffs of the changes: (+2 -0) LinkModules.cpp |2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.107 llvm/lib/Linker/LinkModules.cpp:1.108 --- llvm/lib/Linker/LinkModules.cpp:1.107 Thu Jul 7 18:21:43 2005 +++ llvm/lib/Linker/LinkModules.cpp Tue Dec 6 11:30:58 2005 @@ -748,6 +748,8 @@ unsigned NewSize = T1->getNumElements() + T2->getNumElements(); ArrayType *NewType = ArrayType::get(T1->getElementType(), NewSize); + G1->setName(""); // Clear G1's name in case of a conflict! + // Create the new global variable... GlobalVariable *NG = new GlobalVariable(NewType, G1->isConstant(), G1->getLinkage(), ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Analysis/DataStructure/DSNode.h
Changes in directory llvm/include/llvm/Analysis/DataStructure: DSNode.h updated: 1.54 -> 1.55 --- Log message: Handling of zero length last fields in struct used for growing it arbitrarily --- Diffs of the changes: (+2 -1) DSNode.h |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Analysis/DataStructure/DSNode.h diff -u llvm/include/llvm/Analysis/DataStructure/DSNode.h:1.54 llvm/include/llvm/Analysis/DataStructure/DSNode.h:1.55 --- llvm/include/llvm/Analysis/DataStructure/DSNode.h:1.54 Thu Apr 21 15:18:05 2005 +++ llvm/include/llvm/Analysis/DataStructure/DSNode.h Tue Dec 6 12:01:20 2005 @@ -424,12 +424,13 @@ // Disabling this assertion because it is failing on a "magic" struct // in named (from bind). The fourth field is an array of length 0, // presumably used to create struct instances of different sizes. - assert((!N || + /* assert((!N || N->isNodeCompletelyFolded() || (N->Size == 0 && Offset == 0) || (int(Offset) >= 0 && Offset < N->Size) || (int(Offset) < 0 && -int(Offset) < int(N->Size)) || N->isForwarding()) && "Node handle offset out of range!"); + */ if (N == 0 || !N->isForwarding()) return N; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp
Changes in directory llvm/lib/Analysis/DataStructure: Local.cpp updated: 1.134 -> 1.135 --- Log message: Collapsing node if variable length struct with final field of length zero --- Diffs of the changes: (+18 -1) Local.cpp | 19 ++- 1 files changed, 18 insertions(+), 1 deletion(-) Index: llvm/lib/Analysis/DataStructure/Local.cpp diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.134 llvm/lib/Analysis/DataStructure/Local.cpp:1.135 --- llvm/lib/Analysis/DataStructure/Local.cpp:1.134 Sat Jun 18 13:34:51 2005 +++ llvm/lib/Analysis/DataStructure/Local.cpp Tue Dec 6 12:04:30 2005 @@ -434,7 +434,24 @@ // Add in the offset calculated... Value.setOffset(Value.getOffset()+Offset); - // Value is now the pointer we want to GEP to be... + // Check the offset + DSNode *N = Value.getNode(); + if (N && + !N->isNodeCompletelyFolded() && + (N->getSize() != 0 || Offset != 0) && + !N->isForwarding()) { +if ((Offset >= N->getSize()) || int(Offset) < 0) { + // Accessing offsets out of node size range + // This is seen in the "magic" struct in named (from bind), where the + // fourth field is an array of length 0, presumably used to create struct + // instances of different sizes + + // Collapse the node since its size is now variable + N->foldNodeCompletely(); +} + } + + // Value is now the pointer we want to GEP to be... setDestTo(GEP, Value); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp
Changes in directory llvm-poolalloc/lib/PoolAllocate: TransformFunctionBody.cpp updated: 1.46 -> 1.47 --- Log message: Removing unnecesary code mapping global nodes --- Diffs of the changes: (+12 -8) TransformFunctionBody.cpp | 20 1 files changed, 12 insertions(+), 8 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp diff -u llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.46 llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.47 --- llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.46 Wed May 18 14:56:28 2005 +++ llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Tue Dec 6 12:06:43 2005 @@ -514,14 +514,18 @@ DSGraph::computeNodeMapping(CalleeGraph->getReturnNodeFor(*CF), getDSNodeHFor(TheCall), NodeMapping, false); -// Map the nodes that are pointed to by globals. - DSScalarMap &CalleeSM = CalleeGraph->getScalarMap(); - for (DSScalarMap::global_iterator GI = G.getScalarMap().global_begin(), - E = G.getScalarMap().global_end(); GI != E; ++GI) -if (CalleeSM.count(*GI)) - DSGraph::computeNodeMapping(CalleeGraph->getNodeForValue(*GI), - getDSNodeHFor(*GI), - NodeMapping, false); + // This code seems redundant (and crashes occasionally) + // There is no reason to map globals here, since they are not passed as + // arguments + + // Map the nodes that are pointed to by globals. + // DSScalarMap &CalleeSM = CalleeGraph->getScalarMap(); + // for (DSScalarMap::global_iterator GI = G.getScalarMap().global_begin(), + // E = G.getScalarMap().global_end(); GI != E; ++GI) + //if (CalleeSM.count(*GI)) + // DSGraph::computeNodeMapping(CalleeGraph->getNodeForValue(*GI), + // getDSNodeHFor(*GI), + // NodeMapping, false); // Okay, now that we have established our mapping, we can figure out which // pool descriptors to pass in... ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Analysis/DataStructure/DSNode.h
Changes in directory llvm/include/llvm/Analysis/DataStructure: DSNode.h updated: 1.55 -> 1.56 --- Log message: Added comment for removing assert --- Diffs of the changes: (+3 -0) DSNode.h |3 +++ 1 files changed, 3 insertions(+) Index: llvm/include/llvm/Analysis/DataStructure/DSNode.h diff -u llvm/include/llvm/Analysis/DataStructure/DSNode.h:1.55 llvm/include/llvm/Analysis/DataStructure/DSNode.h:1.56 --- llvm/include/llvm/Analysis/DataStructure/DSNode.h:1.55 Tue Dec 6 12:01:20 2005 +++ llvm/include/llvm/Analysis/DataStructure/DSNode.h Tue Dec 6 12:16:08 2005 @@ -424,6 +424,9 @@ // Disabling this assertion because it is failing on a "magic" struct // in named (from bind). The fourth field is an array of length 0, // presumably used to create struct instances of different sizes. + // In a variable length struct, Offset could exceed Size when getNode() + // is called before such a node is folded. In this case, the DS Analysis now + // correctly folds this node after calling getNode. /* assert((!N || N->isNodeCompletelyFolded() || (N->Size == 0 && Offset == 0) || ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaInstrFormats.td
Changes in directory llvm/lib/Target/Alpha: AlphaInstrFormats.td updated: 1.17 -> 1.18 --- Log message: OK, this does wonders for broken stuff --- Diffs of the changes: (+1 -0) AlphaInstrFormats.td |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Target/Alpha/AlphaInstrFormats.td diff -u llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.17 llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.18 --- llvm/lib/Target/Alpha/AlphaInstrFormats.td:1.17 Mon Dec 5 18:33:53 2005 +++ llvm/lib/Target/Alpha/AlphaInstrFormats.td Tue Dec 6 14:40:34 2005 @@ -102,6 +102,7 @@ let Inst{25-21} = Ra; let Inst{20-0} = disp; } +let isBranch = 1, isTerminator = 1 in class BFormD opcode, string asmstr> : InstAlpha { bits<5> Ra = 31; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
Changes in directory llvm/lib/Target/Alpha: AlphaISelDAGToDAG.cpp updated: 1.13 -> 1.14 --- Log message: more decent branches for FP. I might have to make some intermediate nodes to actually be able to use the DAG for FPcmp --- Diffs of the changes: (+33 -2) AlphaISelDAGToDAG.cpp | 35 +-- 1 files changed, 33 insertions(+), 2 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.13 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.14 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.13Mon Dec 5 14:50:53 2005 +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Tue Dec 6 14:43:30 2005 @@ -155,6 +155,38 @@ return SDOperand(Result.Val, Op.ResNo); } case ISD::BRCOND: { +if (N->getOperand(1).getOpcode() == ISD::SETCC && + MVT::isFloatingPoint(N->getOperand(1).getOperand(0).getValueType())) { + SDOperand Chain = Select(N->getOperand(0)); + SDOperand CC1 = Select(N->getOperand(1).getOperand(0)); + SDOperand CC2 = Select(N->getOperand(1).getOperand(1)); + ISD::CondCode cCode= cast(N->getOperand(1).getOperand(2))->get(); + + bool rev = false; + bool isNE = false; + unsigned Opc = Alpha::WTF; + switch(cCode) { + default: N->dump(); assert(0 && "Unknown FP comparison!"); + case ISD::SETEQ: Opc = Alpha::CMPTEQ; break; + case ISD::SETLT: Opc = Alpha::CMPTLT; break; + case ISD::SETLE: Opc = Alpha::CMPTLE; break; + case ISD::SETGT: Opc = Alpha::CMPTLT; rev = true; break; + case ISD::SETGE: Opc = Alpha::CMPTLE; rev = true; break; + case ISD::SETNE: Opc = Alpha::CMPTEQ; isNE = true; break; + }; + SDOperand cmp = CurDAG->getTargetNode(Opc, MVT::f64, +rev?CC2:CC1, +rev?CC1:CC2); + + MachineBasicBlock *Dest = + cast(N->getOperand(2))->getBasicBlock(); + if(isNE) + return CurDAG->SelectNodeTo(N, Alpha::FBEQ, MVT::Other, cmp, + CurDAG->getBasicBlock(Dest), Chain); + else + return CurDAG->SelectNodeTo(N, Alpha::FBNE, MVT::Other, cmp, + CurDAG->getBasicBlock(Dest), Chain); +} SDOperand Chain = Select(N->getOperand(0)); SDOperand CC = Select(N->getOperand(1)); MachineBasicBlock *Dest = @@ -220,10 +252,9 @@ Address, Chain); } - case ISD::BR: + case ISD::BR: return CurDAG->SelectNodeTo(N, Alpha::BR_DAG, MVT::Other, N->getOperand(1), Select(N->getOperand(0))); - case ISD::FrameIndex: { int FI = cast(N)->getIndex(); return CurDAG->SelectNodeTo(N, Alpha::LDA, MVT::i64, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/bugpoint/Miscompilation.cpp
Changes in directory llvm/tools/bugpoint: Miscompilation.cpp updated: 1.72 -> 1.73 --- Log message: This solves the problem of the CBE renaming symbols that start with . but the assembly side still trying to reference them by their old names. Should be safe untill we hit a language front end that lets you specify such a name. --- Diffs of the changes: (+2 -0) Miscompilation.cpp |2 ++ 1 files changed, 2 insertions(+) Index: llvm/tools/bugpoint/Miscompilation.cpp diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.72 llvm/tools/bugpoint/Miscompilation.cpp:1.73 --- llvm/tools/bugpoint/Miscompilation.cpp:1.72 Sat Oct 22 23:37:20 2005 +++ llvm/tools/bugpoint/Miscompilation.cpp Tue Dec 6 14:51:30 2005 @@ -232,6 +232,8 @@ // mangler is used by the two code generators), but having symbols with the // same name causes warnings to be emitted by the code generator. Mangler Mang(*M); + // Agree with the CBE on symbol naming + Mang.markCharUnacceptable('.'); for (Module::global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I) I->setName(Mang.getValueName(I)); for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.138 -> 1.139 --- Log message: Silence another annoying GCC warning --- Diffs of the changes: (+1 -1) PPCISelDAGToDAG.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.138 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.139 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.138 Sun Dec 4 13:04:38 2005 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Tue Dec 6 14:56:18 2005 @@ -720,7 +720,7 @@ // Force the ccreg into CR7. SDOperand CR7Reg = CurDAG->getRegister(PPC::CR7, MVT::i32); - SDOperand InFlag; // Null incoming flag value. + SDOperand InFlag(0, 0); // Null incoming flag value. CCReg = CurDAG->getCopyToReg(CurDAG->getEntryNode(), CR7Reg, CCReg, InFlag).getValue(1); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp AlphaInstrInfo.td
Changes in directory llvm/lib/Target/Alpha: AlphaISelDAGToDAG.cpp updated: 1.14 -> 1.15 AlphaInstrInfo.td updated: 1.80 -> 1.81 --- Log message: fix divide and remainder --- Diffs of the changes: (+14 -13) AlphaISelDAGToDAG.cpp | 24 +++- AlphaInstrInfo.td |3 +++ 2 files changed, 14 insertions(+), 13 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.14 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.15 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.14Tue Dec 6 14:43:30 2005 +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Tue Dec 6 17:27:39 2005 @@ -339,19 +339,17 @@ } SDOperand Tmp1 = Select(N->getOperand(0)), Tmp2 = Select(N->getOperand(1)), -Addr = CurDAG->getExternalSymbol(opstr, AlphaLowering.getPointerTy()); - SDOperand Tmp3 = Select(Addr); - SDOperand Chain = CurDAG->getCopyToReg(CurDAG->getRoot(), Alpha::R24, - Tmp1, SDOperand()); - Chain = CurDAG->getCopyToReg(CurDAG->getRoot(), Alpha::R25, - Tmp2, Chain.getValue(1)); - Chain = CurDAG->getCopyToReg(CurDAG->getRoot(), Alpha::R27, - Tmp3, Chain.getValue(1)); - Chain = CurDAG->getTargetNode(Alpha::JSRs, MVT::i64, MVT::Flag, -CurDAG->getRegister(Alpha::R27, MVT::i64), -getI64Imm(0)); - return CurDAG->getCopyFromReg(Chain.getValue(1), Alpha::R27, MVT::i64, -Chain.getValue(1)); +Addr = Select(CurDAG->getExternalSymbol(opstr, + AlphaLowering.getPointerTy())); + SDOperand Chain; + Chain = CurDAG->getCopyToReg(CurDAG->getEntryNode(), Alpha::R24, Tmp1, + SDOperand(0,0)); + Chain = CurDAG->getCopyToReg(Chain, Alpha::R25, Tmp2, Chain.getValue(1)); + Chain = CurDAG->getCopyToReg(Chain, Alpha::R27, Addr, Chain.getValue(1)); + Chain = CurDAG->getTargetNode(Alpha::JSRsDAG, MVT::Other, MVT::Flag, + Chain, Chain.getValue(1)); + return CurDAG->getCopyFromReg(Chain, Alpha::R27, MVT::i64, + Chain.getValue(1)); } break; Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.80 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.81 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.80Mon Dec 5 18:33:53 2005 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Tue Dec 6 17:27:39 2005 @@ -429,6 +429,9 @@ let isCall = 1, Defs = [R24, R25, R27, R28], Uses = [R24, R25] in def JSRs : MbrForm< 0x1A, 0x01, (ops GPRC:$RD, GPRC:$RS, s14imm:$DISP), "jsr $RD,($RS),$DISP">; //Jump to div or rem +let isCall = 1, Defs = [R23, R24, R25, R27, R28], Uses = [R24, R25, R27] in + def JSRsDAG : MbrForm< 0x1A, 0x01, (ops ), "jsr $$23,($$27),0">; //Jump to div or rem + def JSR_COROUTINE : MbrForm< 0x1A, 0x03, (ops GPRC:$RD, GPRC:$RS, s14imm:$DISP), "jsr_coroutine $RD,($RS),$DISP">; //Jump to subroutine return def BR : BForm<0x30, "br $RA,$DISP">; //Branch ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/ADT/PostOrderIterator.h
Changes in directory llvm/include/llvm/ADT: PostOrderIterator.h updated: 1.19 -> 1.20 --- Log message: Remove a now-dead map, patch by Saem Ghani, thanks! --- Diffs of the changes: (+1 -2) PostOrderIterator.h |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/include/llvm/ADT/PostOrderIterator.h diff -u llvm/include/llvm/ADT/PostOrderIterator.h:1.19 llvm/include/llvm/ADT/PostOrderIterator.h:1.20 --- llvm/include/llvm/ADT/PostOrderIterator.h:1.19 Tue Dec 6 01:05:27 2005 +++ llvm/include/llvm/ADT/PostOrderIterator.h Tue Dec 6 23:41:44 2005 @@ -46,8 +46,7 @@ typedef forward_iterator super; typedef typename GT::NodeType NodeType; typedef typename GT::ChildIteratorType ChildItTy; - - std::set Visited;// All of the blocks visited so far... + // VisitStack - Used to maintain the ordering. Top = current block // First element is basic block pointer, second is the 'next child' to visit std::stack > VisitStack; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.62 -> 1.63 --- Log message: Teach the dag combiner to turn a truncate/sign_extend pair into a sextinreg when the types match up. This allows the X86 backend to compile: sbyte %toggle_value(sbyte* %tmp.1) { %tmp.2 = load sbyte* %tmp.1 ret sbyte %tmp.2 } to this: _toggle_value: mov %EAX, DWORD PTR [%ESP + 4] movsx %EAX, BYTE PTR [%EAX] ret instead of this: _toggle_value: mov %EAX, DWORD PTR [%ESP + 4] movsx %EAX, BYTE PTR [%EAX] movsx %EAX, %AL ret noticed in Shootout/objinst. -Chris --- Diffs of the changes: (+4 -0) DAGCombiner.cpp |4 1 files changed, 4 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.62 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.63 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.62 Fri Nov 11 18:59:01 2005 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Dec 7 01:11:03 2005 @@ -1546,6 +1546,10 @@ // fold (sext (sextload x)) -> (sextload x) if (N0.getOpcode() == ISD::SEXTLOAD && VT == N0.getValueType()) return N0; + // fold (sext (truncate x)) -> (sextinreg x) iff x size == sext size. + if (N0.getOpcode() == ISD::TRUNCATE && N0.getOperand(0).getValueType() == VT) +return DAG.getNode(ISD::SIGN_EXTEND_INREG, VT, N0.getOperand(0), + DAG.getValueType(N0.getValueType())); // fold (sext (load x)) -> (sextload x) if (N0.getOpcode() == ISD::LOAD && N0.hasOneUse()) { SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N0.getOperand(0), ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits