From sabre at nondot.org Mon Jul 14 00:10:41 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 14 Jul 2008 05:10:41 -0000 Subject: [llvm-commits] [llvm] r53541 - /llvm/trunk/lib/VMCore/Constants.cpp Message-ID: <200807140510.m6E5AgmC012677@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 14 00:10:41 2008 New Revision: 53541 URL: http://llvm.org/viewvc/llvm-project?rev=53541&view=rev Log: Document and fix Constant::getVectorElements to return an empty vector when presented with a constant expr. If ConstantExpr::getV[IF]Cmp to work when ConstantFoldCompareInstruction returns an undef or constant expr. Modified: llvm/trunk/lib/VMCore/Constants.cpp Modified: llvm/trunk/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=53541&r1=53540&r2=53541&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Constants.cpp (original) +++ llvm/trunk/lib/VMCore/Constants.cpp Mon Jul 14 00:10:41 2008 @@ -157,7 +157,8 @@ /// getVectorElements - This method, which is only valid on constant of vector /// type, returns the elements of the vector in the specified smallvector. -/// This handles breaking down a vector undef into undef elements, etc. +/// This handles breaking down a vector undef into undef elements, etc. For +/// constant exprs and other cases we can't handle, we return an empty vector. void Constant::getVectorElements(SmallVectorImpl &Elts) const { assert(isa(getType()) && "Not a vector constant!"); @@ -174,8 +175,12 @@ return; } - assert(isa(this) && "Unknown vector constant type!"); - Elts.assign(VT->getNumElements(), UndefValue::get(VT->getElementType())); + if (isa(this)) { + Elts.assign(VT->getNumElements(), UndefValue::get(VT->getElementType())); + return; + } + + // Unknown type, must be constant expr etc. } @@ -2206,16 +2211,19 @@ const Type *EltTy = VTy->getElementType(); unsigned NumElts = VTy->getNumElements(); - SmallVector Elts; + SmallVector Elts; for (unsigned i = 0; i != NumElts; ++i) { Constant *FC = ConstantFoldCompareInstruction(pred, LHS->getOperand(i), - RHS->getOperand(i)); - if (FC) { - uint64_t Val = cast(FC)->getZExtValue(); - if (Val != 0ULL) + RHS->getOperand(i)); + if (ConstantInt *FCI = dyn_cast_or_null(FC)) { + if (FCI->getZExtValue()) Elts.push_back(ConstantInt::getAllOnesValue(EltTy)); else Elts.push_back(ConstantInt::get(EltTy, 0ULL)); + } else if (FC && isa(FC)) { + Elts.push_back(UndefValue::get(EltTy)); + } else { + break; } } if (Elts.size() == NumElts) @@ -2243,16 +2251,19 @@ const Type *REltTy = IntegerType::get(EltTy->getPrimitiveSizeInBits()); const Type *ResultTy = VectorType::get(REltTy, NumElts); - SmallVector Elts; + SmallVector Elts; for (unsigned i = 0; i != NumElts; ++i) { Constant *FC = ConstantFoldCompareInstruction(pred, LHS->getOperand(i), RHS->getOperand(i)); - if (FC) { - uint64_t Val = cast(FC)->getZExtValue(); - if (Val != 0ULL) + if (ConstantInt *FCI = dyn_cast_or_null(FC)) { + if (FCI->getZExtValue()) Elts.push_back(ConstantInt::getAllOnesValue(REltTy)); else Elts.push_back(ConstantInt::get(REltTy, 0ULL)); + } else if (FC && isa(FC)) { + Elts.push_back(UndefValue::get(REltTy)); + } else { + break; } } if (Elts.size() == NumElts) From resistor at mac.com Mon Jul 14 00:14:57 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 14 Jul 2008 05:14:57 -0000 Subject: [llvm-commits] [test-suite] r53542 - in /test-suite/trunk/SingleSource/Benchmarks: Himeno/ Misc/himenobmtxpa.c Message-ID: <200807140514.m6E5EvTt012827@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 14 00:14:57 2008 New Revision: 53542 URL: http://llvm.org/viewvc/llvm-project?rev=53542&view=rev Log: Move the himeno benchmark into SingleSource/Misc. Added: test-suite/trunk/SingleSource/Benchmarks/Misc/himenobmtxpa.c - copied unchanged from r53520, test-suite/trunk/SingleSource/Benchmarks/Himeno/himenobmtxpa.c Removed: test-suite/trunk/SingleSource/Benchmarks/Himeno/ From resistor at mac.com Mon Jul 14 00:15:18 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 14 Jul 2008 05:15:18 -0000 Subject: [llvm-commits] [test-suite] r53543 - /test-suite/trunk/SingleSource/Benchmarks/Makefile Message-ID: <200807140515.m6E5FI6V012844@zion.cs.uiuc.edu> Author: resistor Date: Mon Jul 14 00:15:18 2008 New Revision: 53543 URL: http://llvm.org/viewvc/llvm-project?rev=53543&view=rev Log: Himeno is now under Misc. Modified: test-suite/trunk/SingleSource/Benchmarks/Makefile Modified: test-suite/trunk/SingleSource/Benchmarks/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Makefile?rev=53543&r1=53542&r2=53543&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Makefile (original) +++ test-suite/trunk/SingleSource/Benchmarks/Makefile Mon Jul 14 00:15:18 2008 @@ -1,6 +1,6 @@ LEVEL = ../.. PARALLEL_DIRS=Dhrystone CoyoteBench Shootout Shootout-C++ Stanford McGill \ - Misc Misc-C++ BenchmarkGame Himeno + Misc Misc-C++ BenchmarkGame # Misc-C++-EH - someday when EH is supported in llvm-gcc we should # re-enable this test. It always fails and its very slow # (100MB Bytecode) so we disable it for now. From sabre at nondot.org Mon Jul 14 00:17:31 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 14 Jul 2008 05:17:31 -0000 Subject: [llvm-commits] [llvm] r53544 - in /llvm/trunk: lib/VMCore/Constants.cpp test/Assembler/vector-cmp.ll Message-ID: <200807140517.m6E5HWjR012924@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 14 00:17:31 2008 New Revision: 53544 URL: http://llvm.org/viewvc/llvm-project?rev=53544&view=rev Log: Fix a bunch of bugs handling vector compare constant expressions, fixing PR2317. Added: llvm/trunk/test/Assembler/vector-cmp.ll Modified: llvm/trunk/lib/VMCore/Constants.cpp Modified: llvm/trunk/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=53544&r1=53543&r2=53544&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Constants.cpp (original) +++ llvm/trunk/lib/VMCore/Constants.cpp Mon Jul 14 00:17:31 2008 @@ -730,7 +730,8 @@ } bool ConstantExpr::isCompare() const { - return getOpcode() == Instruction::ICmp || getOpcode() == Instruction::FCmp; + return getOpcode() == Instruction::ICmp || getOpcode() == Instruction::FCmp || + getOpcode() == Instruction::VICmp || getOpcode() == Instruction::VFCmp; } bool ConstantExpr::hasIndices() const { @@ -2201,9 +2202,8 @@ Constant * ConstantExpr::getVICmp(unsigned short pred, Constant* LHS, Constant* RHS) { - assert(isa(LHS->getType()) && + assert(isa(LHS->getType()) && LHS->getType() == RHS->getType() && "Tried to create vicmp operation on non-vector type!"); - assert(LHS->getType() == RHS->getType()); assert(pred >= ICmpInst::FIRST_ICMP_PREDICATE && pred <= ICmpInst::LAST_ICMP_PREDICATE && "Invalid VICmp Predicate"); @@ -2211,23 +2211,30 @@ const Type *EltTy = VTy->getElementType(); unsigned NumElts = VTy->getNumElements(); - SmallVector Elts; - for (unsigned i = 0; i != NumElts; ++i) { - Constant *FC = ConstantFoldCompareInstruction(pred, LHS->getOperand(i), - RHS->getOperand(i)); - if (ConstantInt *FCI = dyn_cast_or_null(FC)) { - if (FCI->getZExtValue()) - Elts.push_back(ConstantInt::getAllOnesValue(EltTy)); - else - Elts.push_back(ConstantInt::get(EltTy, 0ULL)); - } else if (FC && isa(FC)) { - Elts.push_back(UndefValue::get(EltTy)); - } else { - break; + // See if we can fold the element-wise comparison of the LHS and RHS. + SmallVector LHSElts, RHSElts; + LHS->getVectorElements(LHSElts); + RHS->getVectorElements(RHSElts); + + if (!LHSElts.empty() && !RHSElts.empty()) { + SmallVector Elts; + for (unsigned i = 0; i != NumElts; ++i) { + Constant *FC = ConstantFoldCompareInstruction(pred, LHSElts[i], + RHSElts[i]); + if (ConstantInt *FCI = dyn_cast_or_null(FC)) { + if (FCI->getZExtValue()) + Elts.push_back(ConstantInt::getAllOnesValue(EltTy)); + else + Elts.push_back(ConstantInt::get(EltTy, 0ULL)); + } else if (FC && isa(FC)) { + Elts.push_back(UndefValue::get(EltTy)); + } else { + break; + } } + if (Elts.size() == NumElts) + return ConstantVector::get(&Elts[0], Elts.size()); } - if (Elts.size() == NumElts) - return ConstantVector::get(&Elts[0], Elts.size()); // Look up the constant in the table first to ensure uniqueness std::vector ArgVec; @@ -2251,23 +2258,30 @@ const Type *REltTy = IntegerType::get(EltTy->getPrimitiveSizeInBits()); const Type *ResultTy = VectorType::get(REltTy, NumElts); - SmallVector Elts; - for (unsigned i = 0; i != NumElts; ++i) { - Constant *FC = ConstantFoldCompareInstruction(pred, LHS->getOperand(i), - RHS->getOperand(i)); - if (ConstantInt *FCI = dyn_cast_or_null(FC)) { - if (FCI->getZExtValue()) - Elts.push_back(ConstantInt::getAllOnesValue(REltTy)); - else - Elts.push_back(ConstantInt::get(REltTy, 0ULL)); - } else if (FC && isa(FC)) { - Elts.push_back(UndefValue::get(REltTy)); - } else { - break; + // See if we can fold the element-wise comparison of the LHS and RHS. + SmallVector LHSElts, RHSElts; + LHS->getVectorElements(LHSElts); + RHS->getVectorElements(RHSElts); + + if (!LHSElts.empty() && !RHSElts.empty()) { + SmallVector Elts; + for (unsigned i = 0; i != NumElts; ++i) { + Constant *FC = ConstantFoldCompareInstruction(pred, LHSElts[i], + RHSElts[i]); + if (ConstantInt *FCI = dyn_cast_or_null(FC)) { + if (FCI->getZExtValue()) + Elts.push_back(ConstantInt::getAllOnesValue(REltTy)); + else + Elts.push_back(ConstantInt::get(REltTy, 0ULL)); + } else if (FC && isa(FC)) { + Elts.push_back(UndefValue::get(REltTy)); + } else { + break; + } } + if (Elts.size() == NumElts) + return ConstantVector::get(&Elts[0], Elts.size()); } - if (Elts.size() == NumElts) - return ConstantVector::get(&Elts[0], Elts.size()); // Look up the constant in the table first to ensure uniqueness std::vector ArgVec; @@ -2683,8 +2697,14 @@ if (C2 == From) C2 = To; if (getOpcode() == Instruction::ICmp) Replacement = ConstantExpr::getICmp(getPredicate(), C1, C2); - else + else if (getOpcode() == Instruction::FCmp) Replacement = ConstantExpr::getFCmp(getPredicate(), C1, C2); + else if (getOpcode() == Instruction::VICmp) + Replacement = ConstantExpr::getVICmp(getPredicate(), C1, C2); + else { + assert(getOpcode() == Instruction::VFCmp); + Replacement = ConstantExpr::getVFCmp(getPredicate(), C1, C2); + } } else if (getNumOperands() == 2) { Constant *C1 = getOperand(0); Constant *C2 = getOperand(1); Added: llvm/trunk/test/Assembler/vector-cmp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/vector-cmp.ll?rev=53544&view=auto ============================================================================== --- llvm/trunk/test/Assembler/vector-cmp.ll (added) +++ llvm/trunk/test/Assembler/vector-cmp.ll Mon Jul 14 00:17:31 2008 @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep {global.*vicmp slt} +; PR2317 +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i686-apple-darwin9.2.2" + +define <4 x i32> @foo(<4 x float> %a, <4 x float> %b) nounwind { +entry: + %cmp = vfcmp olt <4 x float> %a, %b ; <4 x i32> [#uses=1] + ret <4 x i32> %cmp +} + +global <4 x i32> vicmp slt ( <4 x i32> , <4 x i32> ) ; + + at B = external global i32; + +global <4 x i32> vicmp slt ( <4 x i32> , <4 x i32> ) ; From sabre at nondot.org Mon Jul 14 00:52:33 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 14 Jul 2008 05:52:33 -0000 Subject: [llvm-commits] [llvm] r53545 - /llvm/trunk/lib/Linker/LinkModules.cpp Message-ID: <200807140552.m6E5qX1A013911@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 14 00:52:33 2008 New Revision: 53545 URL: http://llvm.org/viewvc/llvm-project?rev=53545&view=rev Log: wrap long lines, remove some code from a non-assert build. Modified: llvm/trunk/lib/Linker/LinkModules.cpp Modified: llvm/trunk/lib/Linker/LinkModules.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=53545&r1=53544&r2=53545&view=diff ============================================================================== --- llvm/trunk/lib/Linker/LinkModules.cpp (original) +++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Jul 14 00:52:33 2008 @@ -340,6 +340,7 @@ return false; } +#ifndef NDEBUG static void PrintMap(const std::map &M) { for (std::map::const_iterator I = M.begin(), E =M.end(); I != E; ++I) { @@ -350,6 +351,7 @@ cerr << "\n"; } } +#endif // RemapOperand - Use ValueMap to convert constants from one module to another. @@ -388,9 +390,8 @@ for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) Ops.push_back(cast(RemapOperand(CE->getOperand(i),ValueMap))); Result = CE->getWithOperands(Ops); - } else if (isa(CPV)) { - assert(0 && "Unmapped global?"); } else { + assert(!isa(CPV) && "Unmapped global?"); assert(0 && "Unknown type of derived type constant value!"); } } else if (isa(In)) { @@ -403,12 +404,13 @@ return Result; } - +#ifndef NDEBUG cerr << "LinkModules ValueMap: \n"; PrintMap(ValueMap); cerr << "Couldn't remap value: " << (void*)In << " " << *In << "\n"; assert(0 && "Couldn't remap value!"); +#endif return 0; } @@ -533,8 +535,8 @@ std::multimap &AppendingVars, std::string *Err) { // Loop over all of the globals in the src module, mapping them over as we go - for (Module::const_global_iterator I = Src->global_begin(), E = Src->global_end(); - I != E; ++I) { + for (Module::const_global_iterator I = Src->global_begin(), + E = Src->global_end(); I != E; ++I) { const GlobalVariable *SGV = I; GlobalValue *DGV = 0; From sabre at nondot.org Mon Jul 14 01:49:45 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 14 Jul 2008 06:49:45 -0000 Subject: [llvm-commits] [llvm] r53546 - in /llvm/trunk: lib/Linker/LinkModules.cpp test/Linker/link-global-to-func.ll Message-ID: <200807140649.m6E6nj4T016062@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 14 01:49:45 2008 New Revision: 53546 URL: http://llvm.org/viewvc/llvm-project?rev=53546&view=rev Log: implement linking of globals to functions, in one direction (replacing a function with a global). This is needed when building llvm itself with LTO on darwin, because of the EXPLICIT_SYMBOL hack in lib/system/DynamicLibrary.cpp. Implementation of linking the other way will need to wait for a cleanup of LinkFunctionProtos. Added: llvm/trunk/test/Linker/link-global-to-func.ll Modified: llvm/trunk/lib/Linker/LinkModules.cpp Modified: llvm/trunk/lib/Linker/LinkModules.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=53546&r1=53545&r2=53546&view=diff ============================================================================== --- llvm/trunk/lib/Linker/LinkModules.cpp (original) +++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Jul 14 01:49:45 2008 @@ -534,27 +534,23 @@ std::map &ValueMap, std::multimap &AppendingVars, std::string *Err) { + ValueSymbolTable &DestSymTab = Dest->getValueSymbolTable(); + // Loop over all of the globals in the src module, mapping them over as we go for (Module::const_global_iterator I = Src->global_begin(), E = Src->global_end(); I != E; ++I) { const GlobalVariable *SGV = I; GlobalValue *DGV = 0; - // Check to see if may have to link the global with the global - if (SGV->hasName() && !SGV->hasInternalLinkage()) { - DGV = Dest->getGlobalVariable(SGV->getName()); - if (DGV && DGV->getType() != SGV->getType()) - // If types don't agree due to opaque types, try to resolve them. - RecursiveResolveTypes(SGV->getType(), DGV->getType()); - } - - // Check to see if may have to link the global with the alias - if (!DGV && SGV->hasName() && !SGV->hasInternalLinkage()) { - DGV = Dest->getNamedAlias(SGV->getName()); - if (DGV && DGV->getType() != SGV->getType()) - // If types don't agree due to opaque types, try to resolve them. - RecursiveResolveTypes(SGV->getType(), DGV->getType()); - } + // Check to see if may have to link the global with the global, alias or + // function. + if (SGV->hasName() && !SGV->hasInternalLinkage()) + DGV = cast_or_null(DestSymTab.lookup(SGV->getNameStart(), + SGV->getNameEnd())); + + // If types don't agree due to opaque types, try to resolve them. + if (DGV && DGV->getType() != SGV->getType()) + RecursiveResolveTypes(SGV->getType(), DGV->getType()); if (DGV && DGV->hasInternalLinkage()) DGV = 0; @@ -571,7 +567,7 @@ if (!DGV) { // No linking to be performed, simply create an identical version of the // symbol over in the dest module... the initializer will be filled in - // later by LinkGlobalInits... + // later by LinkGlobalInits. GlobalVariable *NewDGV = new GlobalVariable(SGV->getType()->getElementType(), SGV->isConstant(), SGV->getLinkage(), /*init*/0, @@ -589,8 +585,8 @@ // Make sure to remember this mapping... ValueMap[SGV] = NewDGV; + // Keep track that this is an appending variable. if (SGV->hasAppendingLinkage()) - // Keep track that this is an appending variable... AppendingVars.insert(std::make_pair(SGV->getName(), NewDGV)); } else if (DGV->hasAppendingLinkage()) { // No linking is performed yet. Just insert a new copy of the global, and @@ -617,61 +613,64 @@ // SGV is global, but DGV is alias. The only valid mapping is when SGV is // external declaration, which is effectively a no-op. Also make sure // linkage calculation was correct. - if (SGV->isDeclaration() && !LinkFromSrc) { - // Make sure to remember this mapping... - ValueMap[SGV] = DGA; - } else + if (!SGV->isDeclaration() || LinkFromSrc) return Error(Err, "Global-Alias Collision on '" + SGV->getName() + "': symbol multiple defined"); - } else if (GlobalVariable *DGVar = dyn_cast(DGV)) { - // Otherwise, perform the global-global mapping as instructed by - // GetLinkageResult. - if (LinkFromSrc) { - // Propagate alignment, section, and visibility info. - CopyGVAttributes(DGVar, SGV); - - // If the types don't match, and if we are to link from the source, nuke - // DGV and create a new one of the appropriate type. - if (SGV->getType() != DGVar->getType()) { - GlobalVariable *NewDGV = - new GlobalVariable(SGV->getType()->getElementType(), - DGVar->isConstant(), DGVar->getLinkage(), - /*init*/0, DGVar->getName(), Dest, false, - SGV->getType()->getAddressSpace()); - CopyGVAttributes(NewDGV, DGVar); - DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewDGV, - DGVar->getType())); - // DGVar will conflict with NewDGV because they both had the same - // name. We must erase this now so ForceRenaming doesn't assert - // because DGV might not have internal linkage. - DGVar->eraseFromParent(); - - // If the symbol table renamed the global, but it is an externally - // visible symbol, DGV must be an existing global with internal - // linkage. Rename it. - if (NewDGV->getName() != SGV->getName() && - !NewDGV->hasInternalLinkage()) - ForceRenaming(NewDGV, SGV->getName()); - - DGVar = NewDGV; - } - - // Inherit const as appropriate - DGVar->setConstant(SGV->isConstant()); - // Set initializer to zero, so we can link the stuff later - DGVar->setInitializer(0); - } else { - // Special case for const propagation + // Make sure to remember this mapping. + ValueMap[SGV] = DGA; + } else if (LinkFromSrc) { + // If the types don't match, and if we are to link from the source, nuke + // DGV and create a new one of the appropriate type. Note that the thing + // we are replacing may be a function (if a prototype, weak, etc) or a + // global variable. + GlobalVariable *NewDGV = + new GlobalVariable(SGV->getType()->getElementType(), + SGV->isConstant(), SGV->getLinkage(), + /*init*/0, DGV->getName(), Dest, false, + SGV->getType()->getAddressSpace()); + + // Propagate alignment, section, and visibility info. + CopyGVAttributes(NewDGV, SGV); + DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewDGV, DGV->getType())); + + // DGV will conflict with NewDGV because they both had the same + // name. We must erase this now so ForceRenaming doesn't assert + // because DGV might not have internal linkage. + if (GlobalVariable *Var = dyn_cast(DGV)) + Var->eraseFromParent(); + else + cast(DGV)->eraseFromParent(); + DGV = NewDGV; + + // If the symbol table renamed the global, but it is an externally visible + // symbol, DGV must be an existing global with internal linkage. Rename. + if (NewDGV->getValueName() != SGV->getValueName() && + !NewDGV->hasInternalLinkage()) + ForceRenaming(NewDGV, SGV->getName()); + + // Inherit const as appropriate + NewDGV->setConstant(SGV->isConstant()); + + // Set calculated linkage + NewDGV->setLinkage(NewLinkage); + + // Make sure to remember this mapping... + ValueMap[SGV] = ConstantExpr::getBitCast(NewDGV, SGV->getType()); + } else { + // Not "link from source", keep the one in the DestModule and remap the + // input onto it. + + // Special case for const propagation. + if (GlobalVariable *DGVar = dyn_cast(DGV)) if (DGVar->isDeclaration() && SGV->isConstant() && !DGVar->isConstant()) DGVar->setConstant(true); - } - + // Set calculated linkage - DGVar->setLinkage(NewLinkage); - + DGV->setLinkage(NewLinkage); + // Make sure to remember this mapping... - ValueMap[SGV] = ConstantExpr::getBitCast(DGVar, SGV->getType()); + ValueMap[SGV] = ConstantExpr::getBitCast(DGV, SGV->getType()); } } return false; @@ -844,7 +843,6 @@ static bool LinkGlobalInits(Module *Dest, const Module *Src, std::map &ValueMap, std::string *Err) { - // Loop over all of the globals in the src module, mapping them over as we go for (Module::const_global_iterator I = Src->global_begin(), E = Src->global_end(); I != E; ++I) { @@ -889,27 +887,23 @@ static bool LinkFunctionProtos(Module *Dest, const Module *Src, std::map &ValueMap, std::string *Err) { + ValueSymbolTable &DestSymTab = Dest->getValueSymbolTable(); + // Loop over all of the functions in the src module, mapping them over for (Module::const_iterator I = Src->begin(), E = Src->end(); I != E; ++I) { const Function *SF = I; // SrcFunction - GlobalValue *DGV = 0; Value *MappedDF; - // If this function is internal or has no name, it doesn't participate in - // linkage. - if (SF->hasName() && !SF->hasInternalLinkage()) { - // Check to see if may have to link the function. - DGV = Dest->getFunction(SF->getName()); - } - - // Check to see if may have to link the function with the alias - if (!DGV && SF->hasName() && !SF->hasInternalLinkage()) { - DGV = Dest->getNamedAlias(SF->getName()); - if (DGV && DGV->getType() != SF->getType()) - // If types don't agree due to opaque types, try to resolve them. - RecursiveResolveTypes(SF->getType(), DGV->getType()); - } + // Check to see if may have to link the function with the global, alias or + // function. + if (SF->hasName() && !SF->hasInternalLinkage()) + DGV = cast_or_null(DestSymTab.lookup(SF->getNameStart(), + SF->getNameEnd())); + + // If types don't agree due to opaque types, try to resolve them. + if (DGV && DGV->getType() != SF->getType()) + RecursiveResolveTypes(SF->getType(), DGV->getType()); if (DGV && DGV->hasInternalLinkage()) DGV = 0; Added: llvm/trunk/test/Linker/link-global-to-func.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/link-global-to-func.ll?rev=53546&view=auto ============================================================================== --- llvm/trunk/test/Linker/link-global-to-func.ll (added) +++ llvm/trunk/test/Linker/link-global-to-func.ll Mon Jul 14 01:49:45 2008 @@ -0,0 +1,13 @@ +; RUN: llvm-as %s -o %t1.bc -f +; RUN: echo {declare void @__eprintf(i8*, i8*, i32, i8*) noreturn define void @foo() { tail call void @__eprintf( i8* undef, i8* undef, i32 4, i8* null ) noreturn nounwind unreachable }} | llvm-as -o %t2.bc -f +; RUN: llvm-link %t2.bc %t1.bc -o - | llvm-dis | grep __eprintf +; RN: llvm-link %t1.bc %t2.bc -o - | llvm-dis | grep __eprintf + +; rdar://6072702 + + at __eprintf = external global i8* ; [#uses=1] + +define i8* @test() { + %A = load i8** @__eprintf ; [#uses=1] + ret i8* %A +} From sabre at nondot.org Mon Jul 14 01:52:19 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 14 Jul 2008 06:52:19 -0000 Subject: [llvm-commits] [llvm] r53547 - /llvm/trunk/lib/Linker/LinkModules.cpp Message-ID: <200807140652.m6E6qJT1016146@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 14 01:52:19 2008 New Revision: 53547 URL: http://llvm.org/viewvc/llvm-project?rev=53547&view=rev Log: don't do any linkage, not even type resolution, of symbols that have internal linkage. Modified: llvm/trunk/lib/Linker/LinkModules.cpp Modified: llvm/trunk/lib/Linker/LinkModules.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=53547&r1=53546&r2=53547&view=diff ============================================================================== --- llvm/trunk/lib/Linker/LinkModules.cpp (original) +++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Jul 14 01:52:19 2008 @@ -548,13 +548,15 @@ DGV = cast_or_null(DestSymTab.lookup(SGV->getNameStart(), SGV->getNameEnd())); + // If we found a global with the same name in the dest module, but it has + // internal linkage, we are really not doing any linkage here. + if (DGV && DGV->hasInternalLinkage()) + DGV = 0; + // If types don't agree due to opaque types, try to resolve them. if (DGV && DGV->getType() != SGV->getType()) RecursiveResolveTypes(SGV->getType(), DGV->getType()); - if (DGV && DGV->hasInternalLinkage()) - DGV = 0; - assert((SGV->hasInitializer() || SGV->hasExternalWeakLinkage() || SGV->hasExternalLinkage() || SGV->hasDLLImportLinkage()) && "Global must either be external or have an initializer!"); @@ -901,13 +903,15 @@ DGV = cast_or_null(DestSymTab.lookup(SF->getNameStart(), SF->getNameEnd())); + // If we found a global with the same name in the dest module, but it has + // internal linkage, we are really not doing any linkage here. + if (DGV && DGV->hasInternalLinkage()) + DGV = 0; + // If types don't agree due to opaque types, try to resolve them. if (DGV && DGV->getType() != SF->getType()) RecursiveResolveTypes(SF->getType(), DGV->getType()); - if (DGV && DGV->hasInternalLinkage()) - DGV = 0; - // If there is no linkage to be performed, just bring over SF without // modifying it. if (DGV == 0) { From sabre at nondot.org Mon Jul 14 02:23:24 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 14 Jul 2008 07:23:24 -0000 Subject: [llvm-commits] [llvm] r53548 - in /llvm/trunk: lib/Linker/LinkModules.cpp test/Linker/2008-07-06-AliasWeakDest.ll test/Linker/link-global-to-func.ll test/Linker/link-messages.ll test/Linker/redefinition.ll Message-ID: <200807140723.m6E7NPfG017143@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 14 02:23:24 2008 New Revision: 53548 URL: http://llvm.org/viewvc/llvm-project?rev=53548&view=rev Log: Reimplement LinkFunctionProtos in terms of GetLinkageResult. This fixes the second half of link-global-to-func.ll and causes some minor changes in messages. There are two TODOs here. First, this causes a regression in 2008-07-06-AliasWeakDest.ll, which is now failing (so I xfailed it). Anton, I would really appreciate it if you could take a look at this. It should be a matter of adding proper alias support to GetLinkageResult, and was probably already a latent bug that would manifest with globals. The second todo is to reimplement LinkAlias in the same pattern as function and global linking. This should be pretty straight-forward for someone who knows aliases, but isn't a requirement for correctness. Modified: llvm/trunk/lib/Linker/LinkModules.cpp llvm/trunk/test/Linker/2008-07-06-AliasWeakDest.ll llvm/trunk/test/Linker/link-global-to-func.ll llvm/trunk/test/Linker/link-messages.ll llvm/trunk/test/Linker/redefinition.ll Modified: llvm/trunk/lib/Linker/LinkModules.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=53548&r1=53547&r2=53548&view=diff ============================================================================== --- llvm/trunk/lib/Linker/LinkModules.cpp (original) +++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Jul 14 02:23:24 2008 @@ -37,14 +37,6 @@ return true; } -// ToStr - Simple wrapper function to convert a type to a string. -static std::string ToStr(const Type *Ty, const Module *M) { - std::ostringstream OS; - WriteTypeSymbolic(OS, Ty, M); - return OS.str(); -} - -// // Function: ResolveTypes() // // Description: @@ -566,7 +558,7 @@ if (GetLinkageResult(DGV, SGV, NewLinkage, LinkFromSrc, Err)) return true; - if (!DGV) { + if (DGV == 0) { // No linking to be performed, simply create an identical version of the // symbol over in the dest module... the initializer will be filled in // later by LinkGlobalInits. @@ -581,16 +573,24 @@ // If the LLVM runtime renamed the global, but it is an externally visible // symbol, DGV must be an existing global with internal linkage. Rename // it. - if (NewDGV->getName() != SGV->getName() && !NewDGV->hasInternalLinkage()) + if (!NewDGV->hasInternalLinkage() && NewDGV->getName() != SGV->getName()) ForceRenaming(NewDGV, SGV->getName()); - // Make sure to remember this mapping... + // Make sure to remember this mapping. ValueMap[SGV] = NewDGV; // Keep track that this is an appending variable. if (SGV->hasAppendingLinkage()) AppendingVars.insert(std::make_pair(SGV->getName(), NewDGV)); - } else if (DGV->hasAppendingLinkage()) { + continue; + } + + // If the visibilities of the symbols disagree and the destination is a + // prototype, take the visibility of its input. + if (DGV->isDeclaration()) + DGV->setVisibility(SGV->getVisibility()); + + if (DGV->hasAppendingLinkage()) { // No linking is performed yet. Just insert a new copy of the global, and // keep track of the fact that it is an appending variable in the // AppendingVars map. The name is cleared out so that no linkage is @@ -611,25 +611,21 @@ // Keep track that this is an appending variable... AppendingVars.insert(std::make_pair(SGV->getName(), NewDGV)); - } else if (GlobalAlias *DGA = dyn_cast(DGV)) { - // SGV is global, but DGV is alias. The only valid mapping is when SGV is - // external declaration, which is effectively a no-op. Also make sure - // linkage calculation was correct. - if (!SGV->isDeclaration() || LinkFromSrc) + continue; + } + + if (LinkFromSrc) { + if (isa(DGV)) return Error(Err, "Global-Alias Collision on '" + SGV->getName() + "': symbol multiple defined"); - - // Make sure to remember this mapping. - ValueMap[SGV] = DGA; - } else if (LinkFromSrc) { + // If the types don't match, and if we are to link from the source, nuke // DGV and create a new one of the appropriate type. Note that the thing // we are replacing may be a function (if a prototype, weak, etc) or a // global variable. GlobalVariable *NewDGV = - new GlobalVariable(SGV->getType()->getElementType(), - SGV->isConstant(), SGV->getLinkage(), - /*init*/0, DGV->getName(), Dest, false, + new GlobalVariable(SGV->getType()->getElementType(), SGV->isConstant(), + NewLinkage, /*init*/0, DGV->getName(), Dest, false, SGV->getType()->getAddressSpace()); // Propagate alignment, section, and visibility info. @@ -647,33 +643,37 @@ // If the symbol table renamed the global, but it is an externally visible // symbol, DGV must be an existing global with internal linkage. Rename. - if (NewDGV->getValueName() != SGV->getValueName() && - !NewDGV->hasInternalLinkage()) + if (NewDGV->getName() != SGV->getName() && !NewDGV->hasInternalLinkage()) ForceRenaming(NewDGV, SGV->getName()); - // Inherit const as appropriate + // Inherit const as appropriate. NewDGV->setConstant(SGV->isConstant()); - // Set calculated linkage - NewDGV->setLinkage(NewLinkage); - - // Make sure to remember this mapping... - ValueMap[SGV] = ConstantExpr::getBitCast(NewDGV, SGV->getType()); - } else { - // Not "link from source", keep the one in the DestModule and remap the - // input onto it. - - // Special case for const propagation. - if (GlobalVariable *DGVar = dyn_cast(DGV)) - if (DGVar->isDeclaration() && SGV->isConstant() && !DGVar->isConstant()) - DGVar->setConstant(true); - - // Set calculated linkage - DGV->setLinkage(NewLinkage); - - // Make sure to remember this mapping... - ValueMap[SGV] = ConstantExpr::getBitCast(DGV, SGV->getType()); + // Make sure to remember this mapping. + ValueMap[SGV] = NewDGV; + continue; } + + // Not "link from source", keep the one in the DestModule and remap the + // input onto it. + + // Special case for const propagation. + if (GlobalVariable *DGVar = dyn_cast(DGV)) + if (DGVar->isDeclaration() && SGV->isConstant() && !DGVar->isConstant()) + DGVar->setConstant(true); + + // SGV is global, but DGV is alias. The only valid mapping is when SGV is + // external declaration, which is effectively a no-op. Also make sure + // linkage calculation was correct. + if (isa(DGV) && !SGV->isDeclaration()) + return Error(Err, "Global-Alias Collision on '" + SGV->getName() + + "': symbol multiple defined"); + + // Set calculated linkage + DGV->setLinkage(NewLinkage); + + // Make sure to remember this mapping... + ValueMap[SGV] = ConstantExpr::getBitCast(DGV, SGV->getType()); } return false; } @@ -895,7 +895,6 @@ for (Module::const_iterator I = Src->begin(), E = Src->end(); I != E; ++I) { const Function *SF = I; // SrcFunction GlobalValue *DGV = 0; - Value *MappedDF; // Check to see if may have to link the function with the global, alias or // function. @@ -912,6 +911,11 @@ if (DGV && DGV->getType() != SF->getType()) RecursiveResolveTypes(SF->getType(), DGV->getType()); + GlobalValue::LinkageTypes NewLinkage = GlobalValue::InternalLinkage; + bool LinkFromSrc = false; + if (GetLinkageResult(DGV, SF, NewLinkage, LinkFromSrc, Err)) + return true; + // If there is no linkage to be performed, just bring over SF without // modifying it. if (DGV == 0) { @@ -931,134 +935,65 @@ // ... and remember this mapping... ValueMap[SF] = NewDF; continue; - } else if (GlobalAlias *DGA = dyn_cast(DGV)) { - // SF is function, but DF is alias. - // The only valid mappings are: - // - SF is external declaration, which is effectively a no-op. - // - SF is weak, when we just need to throw SF out. - if (!SF->isDeclaration() && !SF->isWeakForLinker()) - return Error(Err, "Function-Alias Collision on '" + SF->getName() + - "': symbol multiple defined"); - - // Make sure to remember this mapping... - ValueMap[SF] = ConstantExpr::getBitCast(DGA, SF->getType()); - continue; - } - - Function* DF = cast(DGV); - // If types don't agree because of opaque, try to resolve them. - if (SF->getType() != DF->getType()) - RecursiveResolveTypes(SF->getType(), DF->getType()); - - // Check visibility, merging if a definition overrides a prototype. - if (SF->getVisibility() != DF->getVisibility()) { - // If one is a prototype, ignore its visibility. Prototypes are always - // overridden by the definition. - if (!SF->isDeclaration() && !DF->isDeclaration()) - return Error(Err, "Linking functions named '" + SF->getName() + - "': symbols have different visibilities!"); - - // Otherwise, replace the visibility of DF if DF is a prototype. - if (DF->isDeclaration()) - DF->setVisibility(SF->getVisibility()); - } - - if (DF->getType() != SF->getType()) { - if (DF->isDeclaration() && !SF->isDeclaration()) { - // We have a definition of the same name but different type in the - // source module. Copy the prototype to the destination and replace - // uses of the destination's prototype with the new prototype. - Function *NewDF = Function::Create(SF->getFunctionType(), - SF->getLinkage(), - SF->getName(), Dest); - CopyGVAttributes(NewDF, SF); - - // Any uses of DF need to change to NewDF, with cast - DF->replaceAllUsesWith(ConstantExpr::getBitCast(NewDF, DF->getType())); - - // DF will conflict with NewDF because they both had the same. We must - // erase this now so ForceRenaming doesn't assert because DF might - // not have internal linkage. - DF->eraseFromParent(); - - // If the symbol table renamed the function, but it is an externally - // visible symbol, DF must be an existing function with internal - // linkage. Rename it. - if (NewDF->getName() != SF->getName() && !NewDF->hasInternalLinkage()) - ForceRenaming(NewDF, SF->getName()); - - // Remember this mapping so uses in the source module get remapped - // later by RemapOperand. - ValueMap[SF] = NewDF; - continue; - } else { - // We have two functions of the same name but different type. Any use - // of the source must be mapped to the destination, with a cast. - MappedDF = ConstantExpr::getBitCast(DF, SF->getType()); - } - } else { - MappedDF = DF; } - if (SF->isDeclaration()) { - // If SF is a declaration or if both SF & DF are declarations, just link - // the declarations, we aren't adding anything. - if (SF->hasDLLImportLinkage()) { - if (DF->isDeclaration()) { - ValueMap[SF] = MappedDF; - DF->setLinkage(SF->getLinkage()); - } - } else { - ValueMap[SF] = MappedDF; - } - continue; - } + // If the visibilities of the symbols disagree and the destination is a + // prototype, take the visibility of its input. + if (DGV->isDeclaration()) + DGV->setVisibility(SF->getVisibility()); - // If DF is external but SF is not, link the external functions, update - // linkage qualifiers. - if (DF->isDeclaration() && !DF->hasDLLImportLinkage()) { - ValueMap.insert(std::make_pair(SF, MappedDF)); - DF->setLinkage(SF->getLinkage()); + if (LinkFromSrc) { + if (isa(DGV)) + return Error(Err, "Function-Alias Collision on '" + SF->getName() + + "': symbol multiple defined"); + + // We have a definition of the same name but different type in the + // source module. Copy the prototype to the destination and replace + // uses of the destination's prototype with the new prototype. + Function *NewDF = Function::Create(SF->getFunctionType(), NewLinkage, + SF->getName(), Dest); + CopyGVAttributes(NewDF, SF); + + // Any uses of DF need to change to NewDF, with cast + DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewDF, DGV->getType())); + + // DF will conflict with NewDF because they both had the same. We must + // erase this now so ForceRenaming doesn't assert because DF might + // not have internal linkage. + if (GlobalVariable *Var = dyn_cast(DGV)) + Var->eraseFromParent(); + else + cast(DGV)->eraseFromParent(); + + // If the symbol table renamed the function, but it is an externally + // visible symbol, DF must be an existing function with internal + // linkage. Rename it. + if (NewDF->getName() != SF->getName() && !NewDF->hasInternalLinkage()) + ForceRenaming(NewDF, SF->getName()); + + // Remember this mapping so uses in the source module get remapped + // later by RemapOperand. + ValueMap[SF] = NewDF; continue; } - // At this point we know that DF has LinkOnce, Weak, or External* linkage. - if (SF->isWeakForLinker()) { - ValueMap[SF] = MappedDF; - - // Linkonce+Weak = Weak - // *+External Weak = * - if ((DF->hasLinkOnceLinkage() && - (SF->hasWeakLinkage() || SF->hasCommonLinkage())) || - DF->hasExternalWeakLinkage()) - DF->setLinkage(SF->getLinkage()); - continue; - } + // Not "link from source", keep the one in the DestModule and remap the + // input onto it. - if (DF->isWeakForLinker()) { - // At this point we know that SF has LinkOnce or External* linkage. - ValueMap[SF] = MappedDF; - - // If the source function has stronger linkage than the destination, - // its body and linkage should override ours. - if (!SF->hasLinkOnceLinkage() && !SF->hasExternalWeakLinkage()) { - // Don't inherit linkonce & external weak linkage. - DF->setLinkage(SF->getLinkage()); - DF->deleteBody(); - } - continue; + if (isa(DGV)) { + // The only valid mappings are: + // - SF is external declaration, which is effectively a no-op. + // - SF is weak, when we just need to throw SF out. + if (!SF->isDeclaration()) + return Error(Err, "Function-Alias Collision on '" + SF->getName() + + "': symbol multiple defined"); } - - if (SF->getLinkage() != DF->getLinkage()) - return Error(Err, "Functions named '" + SF->getName() + - "' have different linkage specifiers!"); - - // The function is defined identically in both modules! - if (SF->hasExternalLinkage()) - return Error(Err, "Function '" + - ToStr(SF->getFunctionType(), Src) + "':\"" + - SF->getName() + "\" - Function is already defined!"); - assert(0 && "Unknown linkage configuration found!"); + + // Set calculated linkage + DGV->setLinkage(NewLinkage); + + // Make sure to remember this mapping. + ValueMap[SF] = ConstantExpr::getBitCast(DGV, SF->getType()); } return false; } Modified: llvm/trunk/test/Linker/2008-07-06-AliasWeakDest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2008-07-06-AliasWeakDest.ll?rev=53548&r1=53547&r2=53548&view=diff ============================================================================== --- llvm/trunk/test/Linker/2008-07-06-AliasWeakDest.ll (original) +++ llvm/trunk/test/Linker/2008-07-06-AliasWeakDest.ll Mon Jul 14 02:23:24 2008 @@ -4,6 +4,8 @@ ; RUN: llvm-link %t1.bc %t2.bc -f -o %t3.bc ; RUN: llvm-link %t2.bc %t1.bc -f -o %t4.bc +; XFAIL: * + target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" target triple = "i386-pc-linux-gnu" Modified: llvm/trunk/test/Linker/link-global-to-func.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/link-global-to-func.ll?rev=53548&r1=53547&r2=53548&view=diff ============================================================================== --- llvm/trunk/test/Linker/link-global-to-func.ll (original) +++ llvm/trunk/test/Linker/link-global-to-func.ll Mon Jul 14 02:23:24 2008 @@ -1,7 +1,7 @@ ; RUN: llvm-as %s -o %t1.bc -f ; RUN: echo {declare void @__eprintf(i8*, i8*, i32, i8*) noreturn define void @foo() { tail call void @__eprintf( i8* undef, i8* undef, i32 4, i8* null ) noreturn nounwind unreachable }} | llvm-as -o %t2.bc -f ; RUN: llvm-link %t2.bc %t1.bc -o - | llvm-dis | grep __eprintf -; RN: llvm-link %t1.bc %t2.bc -o - | llvm-dis | grep __eprintf +; RUN: llvm-link %t1.bc %t2.bc -o - | llvm-dis | grep __eprintf ; rdar://6072702 Modified: llvm/trunk/test/Linker/link-messages.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/link-messages.ll?rev=53548&r1=53547&r2=53548&view=diff ============================================================================== --- llvm/trunk/test/Linker/link-messages.ll (original) +++ llvm/trunk/test/Linker/link-messages.ll Mon Jul 14 02:23:24 2008 @@ -4,7 +4,7 @@ ; RUN: llvm-as %s -o %t.two.bc -f ; RUN: not llvm-ld -disable-opt -link-as-library %t.one.bc %t.two.bc \ ; RUN: -o %t.bc 2>%t.err -; RUN: grep "Function is already defined" %t.err +; RUN: grep "symbol multiply defined" %t.err define i32 @bar() { ret i32 0 Modified: llvm/trunk/test/Linker/redefinition.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/redefinition.ll?rev=53548&r1=53547&r2=53548&view=diff ============================================================================== --- llvm/trunk/test/Linker/redefinition.ll (original) +++ llvm/trunk/test/Linker/redefinition.ll Mon Jul 14 02:23:24 2008 @@ -4,7 +4,7 @@ ; RUN: llvm-as %s -o %t.foo2.bc -f ; RUN: echo {define void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc -f ; RUN: not llvm-link %t.foo1.bc %t.foo2.bc -o %t.bc |& \ -; RUN: grep {Function is already defined} +; RUN: grep {symbol multiply defined} ; RUN: not llvm-link %t.foo1.bc %t.foo3.bc -o %t.bc |& \ -; RUN: grep {Function is already defined} +; RUN: grep {symbol multiply defined} define void @foo() { ret void } From baldrick at free.fr Mon Jul 14 02:32:04 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Jul 2008 09:32:04 +0200 Subject: [llvm-commits] [llvm] r53534 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-07-13-DivZero.ll test/Transforms/InstCombine/udiv_select_to_select_shift.ll In-Reply-To: <200807140015.m6E0FroD004171@zion.cs.uiuc.edu> References: <200807140015.m6E0FroD004171@zion.cs.uiuc.edu> Message-ID: <200807140932.04483.baldrick@free.fr> Hi Chris, > + // If we found a call to a function, we can't assume it will return, so > + // information from below it cannot be propagated above it. > + if (isa(BBI) && !isa(BBI)) > + break; I guess you only really need to exit here if SI is zero. Ciao, Duncan. From baldrick at free.fr Mon Jul 14 02:59:28 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Jul 2008 07:59:28 -0000 Subject: [llvm-commits] [llvm] r53549 - /llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Message-ID: <200807140759.m6E7xSHw028573@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jul 14 02:59:28 2008 New Revision: 53549 URL: http://llvm.org/viewvc/llvm-project?rev=53549&view=rev Log: Revert r53540 - it does not compile. Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp?rev=53549&r1=53548&r2=53549&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InlineCost.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Mon Jul 14 02:59:28 2008 @@ -100,27 +100,9 @@ for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB) { for (BasicBlock::const_iterator II = BB->begin(), E = BB->end(); II != E; ++II) { + if (isa(II)) continue; // Debug intrinsics don't count. if (isa(II)) continue; // PHI nodes don't count. - // Special handling for calls. - if (isa(II) || isa(II)) { - if (isa(II)) - continue; // Debug intrinsics don't count as size. - - CallSite CS = CallSite::get(const_cast(&*II)); - - // If this function contains a call to setjmp or _setjmp, never inline - // it. This is a hack because we depend on the user marking their local - // variables as volatile if they are live across a setjmp call, and they - // probably won't do this in callers. - if (Function *F = CS.getCalledFunction()) - if (F->isDeclaration() && - (F->isName("setjmp") || F->isName("_setjmp"))) { - NeverInline = true; - return; - } - } - if (isa(II) || isa(II->getType())) ++NumVectorInsts; @@ -212,10 +194,6 @@ // If we haven't calculated this information yet, do so now. if (CalleeFI.NumBlocks == 0) CalleeFI.analyzeFunction(Callee); - - // If we should never inline this, return a huge cost. - if (CalleeFI.NeverInline) - return 2000000000; // Add to the inline quality for properties that make the call valuable to // inline. This includes factors that indicate that the result of inlining From bruno.cardoso at gmail.com Mon Jul 14 09:42:55 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 14 Jul 2008 14:42:55 -0000 Subject: [llvm-commits] [llvm] r53551 - in /llvm/trunk/lib/Target/Mips: MipsAsmPrinter.cpp MipsInstrInfo.cpp MipsInstrInfo.td MipsRegisterInfo.cpp MipsRegisterInfo.h MipsSubtarget.cpp MipsSubtarget.h MipsTargetAsmInfo.cpp MipsTargetMachine.cpp Message-ID: <200807141442.m6EEgtH1009388@zion.cs.uiuc.edu> Author: bruno Date: Mon Jul 14 09:42:54 2008 New Revision: 53551 URL: http://llvm.org/viewvc/llvm-project?rev=53551&view=rev Log: Added Subtarget support into RegisterInfo Added HasABICall and HasAbsoluteCall (equivalent to gcc -mabicall and -mno-shared). HasAbsoluteCall is not implemented but HasABICall is the default for o32 ABI. Now, both should help into a more accurate relocation types implementation. Added IsLinux is needed to choose between asm directives. Instruction name strings cleanup. AsmPrinter improved. Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp llvm/trunk/lib/Target/Mips/MipsInstrInfo.td llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp llvm/trunk/lib/Target/Mips/MipsSubtarget.h llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=53551&r1=53550&r2=53551&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Mon Jul 14 09:42:54 2008 @@ -15,6 +15,7 @@ #define DEBUG_TYPE "mips-asm-printer" #include "Mips.h" +#include "MipsSubtarget.h" #include "MipsInstrInfo.h" #include "MipsTargetMachine.h" #include "MipsMachineFunction.h" @@ -44,21 +45,19 @@ namespace { struct VISIBILITY_HIDDEN MipsAsmPrinter : public AsmPrinter { + + const MipsSubtarget *Subtarget; + MipsAsmPrinter(std::ostream &O, MipsTargetMachine &TM, const TargetAsmInfo *T): - AsmPrinter(O, TM, T) {} + AsmPrinter(O, TM, T) { + Subtarget = &TM.getSubtarget(); + } virtual const char *getPassName() const { return "Mips Assembly Printer"; } - enum SetDirectiveFlags { - REORDER, // enables instruction reordering. - NOREORDER, // disables instruction reordering. - MACRO, // enables GAS macros. - NOMACRO // disables GAS macros. - }; - void printOperand(const MachineInstr *MI, int opNum); void printMemOperand(const MachineInstr *MI, int opNum, const char *Modifier = 0); @@ -68,13 +67,13 @@ unsigned int getSavedRegsBitmask(bool isFloat, MachineFunction &MF); void printHex32(unsigned int Value); + const char *emitCurrentABIString(void); void emitFunctionStart(MachineFunction &MF); void emitFunctionEnd(MachineFunction &MF); void emitFrameDirective(MachineFunction &MF); void emitMaskDirective(MachineFunction &MF); void emitFMaskDirective(MachineFunction &MF); - void emitSetDirective(SetDirectiveFlags Flag); - + bool printInstruction(const MachineInstr *MI); // autogenerated. bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M); @@ -125,6 +124,10 @@ // //===----------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// +// Mask directives +//===----------------------------------------------------------------------===// + /// Mask directive for GPR void MipsAsmPrinter:: emitMaskDirective(MachineFunction &MF) @@ -159,37 +162,6 @@ O << ",0" << "\n"; } -/// Frame Directive -void MipsAsmPrinter:: -emitFrameDirective(MachineFunction &MF) -{ - const TargetRegisterInfo &RI = *TM.getRegisterInfo(); - - unsigned stackReg = RI.getFrameRegister(MF); - unsigned returnReg = RI.getRARegister(); - unsigned stackSize = MF.getFrameInfo()->getStackSize(); - - - O << "\t.frame\t" << "$" << LowercaseString(RI.get(stackReg).AsmName) - << "," << stackSize << "," - << "$" << LowercaseString(RI.get(returnReg).AsmName) - << "\n"; -} - -/// Emit Set directives. -void MipsAsmPrinter:: -emitSetDirective(SetDirectiveFlags Flag) -{ - O << "\t.set\t"; - switch(Flag) { - case REORDER: O << "reorder" << "\n"; break; - case NOREORDER: O << "noreorder" << "\n"; break; - case MACRO: O << "macro" << "\n"; break; - case NOMACRO: O << "nomacro" << "\n"; break; - default: break; - } -} - // Create a bitmask with all callee saved registers for CPU // or Floating Point registers. For CPU registers consider RA, // GP and FP for saving if necessary. @@ -231,6 +203,44 @@ O << std::dec; } +//===----------------------------------------------------------------------===// +// Frame and Set directives +//===----------------------------------------------------------------------===// + +/// Frame Directive +void MipsAsmPrinter:: +emitFrameDirective(MachineFunction &MF) +{ + const TargetRegisterInfo &RI = *TM.getRegisterInfo(); + + unsigned stackReg = RI.getFrameRegister(MF); + unsigned returnReg = RI.getRARegister(); + unsigned stackSize = MF.getFrameInfo()->getStackSize(); + + + O << "\t.frame\t" << "$" << LowercaseString(RI.get(stackReg).AsmName) + << "," << stackSize << "," + << "$" << LowercaseString(RI.get(returnReg).AsmName) + << "\n"; +} + +/// Emit Set directives. +const char * MipsAsmPrinter:: +emitCurrentABIString(void) +{ + switch(Subtarget->getTargetABI()) { + case MipsSubtarget::O32: return "abi32"; + case MipsSubtarget::O64: return "abiO64"; + case MipsSubtarget::N32: return "abiN32"; + case MipsSubtarget::N64: return "abi64"; + case MipsSubtarget::EABI: return "eabi32"; // TODO: handle eabi64 + default: break; + } + + assert(0 && "Unknown Mips ABI"); + return NULL; +} + /// Emit the directives used by GAS on the start of functions void MipsAsmPrinter:: emitFunctionStart(MachineFunction &MF) @@ -244,18 +254,16 @@ O << "\t.globl\t" << CurrentFnName << "\n"; O << "\t.ent\t" << CurrentFnName << "\n"; - O << "\t.type\t" << CurrentFnName << ", @function\n"; + + if ((TAI->hasDotTypeDotSizeDirective()) && Subtarget->isLinux()) + O << "\t.type\t" << CurrentFnName << ", @function\n"; + O << CurrentFnName << ":\n"; emitFrameDirective(MF); emitMaskDirective(MF); emitFMaskDirective(MF); - if (TM.getRelocationModel() == Reloc::Static) { - emitSetDirective(NOREORDER); - emitSetDirective(NOMACRO); - } - O << "\n"; } @@ -263,12 +271,15 @@ void MipsAsmPrinter:: emitFunctionEnd(MachineFunction &MF) { - if (TM.getRelocationModel() == Reloc::Static) { - emitSetDirective(MACRO); - emitSetDirective(REORDER); - } + // There are instruction for this macros, but they must + // always be at the function end, and we can't emit and + // break with BB logic. + O << "\t.set\tmacro\n"; + O << "\t.set\treorder\n"; O << "\t.end\t" << CurrentFnName << "\n"; + if (TAI->hasDotTypeDotSizeDirective() && !Subtarget->isLinux()) + O << "\t.size\t" << CurrentFnName << ", .-" << CurrentFnName << "\n"; } /// runOnMachineFunction - This uses the printMachineInstruction() @@ -441,6 +452,18 @@ doInitialization(Module &M) { Mang = new Mangler(M); + + // Tell the assembler which ABI we are using + O << "\t.section .mdebug." << emitCurrentABIString() << "\n"; + + // TODO: handle O64 ABI + if (Subtarget->isABI_EABI()) + O << "\t.section .gcc_compiled_long" << + (Subtarget->isGP32bit() ? "32" : "64") << "\n"; + + // return to previous section + O << "\t.previous" << "\n"; + return false; // success } @@ -548,8 +571,11 @@ } O << "\t.align " << Align << "\n"; - O << "\t.type " << name << ", at object\n"; - O << "\t.size " << name << "," << Size << "\n"; + + if (TAI->hasDotTypeDotSizeDirective()) { + O << "\t.type " << name << ", at object\n"; + O << "\t.size " << name << "," << Size << "\n"; + } O << name << ":\n"; EmitGlobalConstant(C); } Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp?rev=53551&r1=53550&r2=53551&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp Mon Jul 14 09:42:54 2008 @@ -11,8 +11,9 @@ // //===----------------------------------------------------------------------===// -#include "Mips.h" +//#include "Mips.h" #include "MipsInstrInfo.h" +#include "MipsTargetMachine.h" #include "llvm/ADT/STLExtras.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "MipsGenInstrInfo.inc" @@ -21,7 +22,7 @@ MipsInstrInfo::MipsInstrInfo(MipsTargetMachine &tm) : TargetInstrInfoImpl(MipsInsts, array_lengthof(MipsInsts)), - TM(tm), RI(*this) {} + TM(tm), RI(*TM.getSubtargetImpl(), *this) {} static bool isZeroImm(const MachineOperand &op) { return op.isImmediate() && op.getImm() == 0; Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=53551&r1=53550&r2=53551&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Mon Jul 14 09:42:54 2008 @@ -31,7 +31,8 @@ // Hi and Lo nodes are used to handle global addresses. Used on // MipsISelLowering to lower stuff like GlobalAddress, ExternalSymbol // static model. (nothing to do with Mips Registers Hi and Lo) -def MipsHi : SDNode<"MipsISD::Hi", SDTIntUnaryOp, [SDNPOutFlag]>; +//def MipsHi : SDNode<"MipsISD::Hi", SDTIntUnaryOp, [SDNPOutFlag]>; +def MipsHi : SDNode<"MipsISD::Hi", SDTIntUnaryOp>; def MipsLo : SDNode<"MipsISD::Lo", SDTIntUnaryOp>; // Return @@ -125,7 +126,7 @@ func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c), - !strconcat(instr_asm, " $dst, $b, $c"), + !strconcat(instr_asm, "\t$dst, $b, $c"), [(set CPURegs:$dst, (OpNode CPURegs:$b, CPURegs:$c))], itin>; let isCommutable = 1 in @@ -134,7 +135,7 @@ func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c), - !strconcat(instr_asm, " $dst, $b, $c"), + !strconcat(instr_asm, "\t$dst, $b, $c"), [], IIAlu>; // Arithmetic 2 register operands @@ -143,7 +144,7 @@ FI< op, (outs CPURegs:$dst), (ins CPURegs:$b, Od:$c), - !strconcat(instr_asm, " $dst, $b, $c"), + !strconcat(instr_asm, "\t$dst, $b, $c"), [(set CPURegs:$dst, (OpNode CPURegs:$b, imm_type:$c))], IIAlu>; // Arithmetic Multiply ADD/SUB @@ -153,7 +154,7 @@ func, (outs CPURegs:$rs), (ins CPURegs:$rt), - !strconcat(instr_asm, " $rs, $rt"), + !strconcat(instr_asm, "\t$rs, $rt"), [], IIImul>; // Logical @@ -162,14 +163,14 @@ func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c), - !strconcat(instr_asm, " $dst, $b, $c"), + !strconcat(instr_asm, "\t$dst, $b, $c"), [(set CPURegs:$dst, (OpNode CPURegs:$b, CPURegs:$c))], IIAlu>; class LogicI op, string instr_asm, SDNode OpNode>: FI< op, (outs CPURegs:$dst), (ins CPURegs:$b, uimm16:$c), - !strconcat(instr_asm, " $dst, $b, $c"), + !strconcat(instr_asm, "\t$dst, $b, $c"), [(set CPURegs:$dst, (OpNode CPURegs:$b, immZExt16:$c))], IIAlu>; class LogicNOR op, bits<6> func, string instr_asm>: @@ -177,7 +178,7 @@ func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c), - !strconcat(instr_asm, " $dst, $b, $c"), + !strconcat(instr_asm, "\t$dst, $b, $c"), [(set CPURegs:$dst, (not (or CPURegs:$b, CPURegs:$c)))], IIAlu>; // Shifts @@ -187,7 +188,7 @@ func, (outs CPURegs:$dst), (ins CPURegs:$b, shamt:$c), - !strconcat(instr_asm, " $dst, $b, $c"), + !strconcat(instr_asm, "\t$dst, $b, $c"), [(set CPURegs:$dst, (OpNode CPURegs:$b, immZExt5:$c))], IIAlu>; class LogicR_shift_reg func, string instr_asm, SDNode OpNode>: @@ -195,7 +196,7 @@ func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c), - !strconcat(instr_asm, " $dst, $b, $c"), + !strconcat(instr_asm, "\t$dst, $b, $c"), [(set CPURegs:$dst, (OpNode CPURegs:$b, CPURegs:$c))], IIAlu>; // Load Upper Imediate @@ -203,7 +204,7 @@ FI< op, (outs CPURegs:$dst), (ins uimm16:$imm), - !strconcat(instr_asm, " $dst, $imm"), + !strconcat(instr_asm, "\t$dst, $imm"), [], IIAlu>; // Memory Load/Store @@ -212,14 +213,14 @@ FI< op, (outs CPURegs:$dst), (ins mem:$addr), - !strconcat(instr_asm, " $dst, $addr"), + !strconcat(instr_asm, "\t$dst, $addr"), [(set CPURegs:$dst, (OpNode addr:$addr))], IILoad>; class StoreM op, string instr_asm, PatFrag OpNode>: FI< op, (outs), (ins CPURegs:$dst, mem:$addr), - !strconcat(instr_asm, " $dst, $addr"), + !strconcat(instr_asm, "\t$dst, $addr"), [(OpNode CPURegs:$dst, addr:$addr)], IIStore>; // Conditional Branch @@ -228,7 +229,7 @@ FI< op, (outs), (ins CPURegs:$a, CPURegs:$b, brtarget:$offset), - !strconcat(instr_asm, " $a, $b, $offset"), + !strconcat(instr_asm, "\t$a, $b, $offset"), [(brcond (cond_op CPURegs:$a, CPURegs:$b), bb:$offset)], IIBranch>; @@ -237,7 +238,7 @@ FI< op, (outs), (ins CPURegs:$src, brtarget:$offset), - !strconcat(instr_asm, " $src, $offset"), + !strconcat(instr_asm, "\t$src, $offset"), [(brcond (cond_op CPURegs:$src, 0), bb:$offset)], IIBranch>; } @@ -249,7 +250,7 @@ func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c), - !strconcat(instr_asm, " $dst, $b, $c"), + !strconcat(instr_asm, "\t$dst, $b, $c"), [(set CPURegs:$dst, (cond_op CPURegs:$b, CPURegs:$c))], IIAlu>; @@ -258,7 +259,7 @@ FI< op, (outs CPURegs:$dst), (ins CPURegs:$b, Od:$c), - !strconcat(instr_asm, " $dst, $b, $c"), + !strconcat(instr_asm, "\t$dst, $b, $c"), [(set CPURegs:$dst, (cond_op CPURegs:$b, imm_type:$c))], IIAlu>; @@ -268,7 +269,7 @@ FJ< op, (outs), (ins brtarget:$target), - !strconcat(instr_asm, " $target"), + !strconcat(instr_asm, "\t$target"), [(br bb:$target)], IIBranch>; let isBranch=1, isTerminator=1, isBarrier=1, rd=0, hasDelaySlot = 1 in @@ -277,7 +278,7 @@ func, (outs), (ins CPURegs:$target), - !strconcat(instr_asm, " $target"), + !strconcat(instr_asm, "\t$target"), [(brind CPURegs:$target)], IIBranch>; // Jump and Link (Call) @@ -289,7 +290,7 @@ FJ< op, (outs), (ins calltarget:$target), - !strconcat(instr_asm, " $target"), + !strconcat(instr_asm, "\t$target"), [(MipsJmpLink imm:$target)], IIBranch>; let rd=31 in @@ -298,14 +299,14 @@ func, (outs), (ins CPURegs:$rs), - !strconcat(instr_asm, " $rs"), + !strconcat(instr_asm, "\t$rs"), [(MipsJmpLink CPURegs:$rs)], IIBranch>; class BranchLink: FI< 0x1, (outs), (ins CPURegs:$rs, brtarget:$target), - !strconcat(instr_asm, " $rs, $target"), + !strconcat(instr_asm, "\t$rs, $target"), [], IIBranch>; } @@ -315,7 +316,7 @@ func, (outs), (ins CPURegs:$a, CPURegs:$b), - !strconcat(instr_asm, " $a, $b"), + !strconcat(instr_asm, "\t$a, $b"), [], itin>; // Move from Hi/Lo @@ -324,7 +325,7 @@ func, (outs CPURegs:$dst), (ins), - !strconcat(instr_asm, " $dst"), + !strconcat(instr_asm, "\t$dst"), [], IIHiLo>; // Count Leading Ones/Zeros in Word @@ -333,7 +334,7 @@ func, (outs CPURegs:$dst), (ins CPURegs:$src), - !strconcat(instr_asm, " $dst, $src"), + !strconcat(instr_asm, "\t$dst, $src"), [], IIAlu>; class EffectiveAddress : @@ -345,7 +346,7 @@ class SignExtInReg func, string instr_asm, ValueType vt>: FR< 0x3f, func, (outs CPURegs:$dst), (ins CPURegs:$src), - !strconcat(instr_asm, " $dst, $src"), + !strconcat(instr_asm, "\t$dst, $src"), [(set CPURegs:$dst, (sext_inreg CPURegs:$src, vt))], NoItinerary>; @@ -363,15 +364,19 @@ [(callseq_end imm:$amt1, imm:$amt2)]>; } +// Some assembly macros need to avoid pseudoinstructions and assembler +// automatic reodering, we should reorder ourselves. +def MACRO : MipsPseudo<(outs), (ins), ".set\tmacro", []>; +def REORDER : MipsPseudo<(outs), (ins), ".set\treorder", []>; +def NOMACRO : MipsPseudo<(outs), (ins), ".set\tnomacro", []>; +def NOREORDER : MipsPseudo<(outs), (ins), ".set\tnoreorder", []>; + // When handling PIC code the assembler needs .cpload and .cprestore // directives. If the real instructions corresponding these directives // are used, we have the same behavior, but get also a bunch of warnings // from the assembler. -def CPLOAD : MipsPseudo<(outs), (ins CPURegs:$reg), - ".set noreorder\n\t.cpload $reg\n\t.set reorder\n", - []>; -def CPRESTORE : MipsPseudo<(outs), (ins uimm16:$loc), - ".cprestore $loc\n", []>; +def CPLOAD : MipsPseudo<(outs), (ins CPURegs:$picreg), ".cpload\t$picreg", []>; +def CPRESTORE : MipsPseudo<(outs), (ins uimm16:$loc), ".cprestore\t$loc\n", []>; // The supported Mips ISAs dont have any instruction close to the SELECT_CC // operation. The solution is to create a Mips pseudo SELECT_CC instruction @@ -488,14 +493,14 @@ isBarrier=1, hasCtrlDep=1, rs=0, rt=0, shamt=0 in { def RET : FR <0x00, 0x02, (outs), (ins CPURegs:$target), - "jr $target", [(MipsRet CPURegs:$target)], IIBranch>; + "jr\t$target", [(MipsRet CPURegs:$target)], IIBranch>; } // FrameIndexes are legalized when they are operands from load/store // instructions. The same not happens for stack address copies, so an // add op with mem ComplexPattern is used and the stack address copy // can be matched. It's similar to Sparc LEA_ADDRi -def LEA_ADDiu : EffectiveAddress<"addiu $dst, ${addr:stackloc}">; +def LEA_ADDiu : EffectiveAddress<"addiu\t$dst, ${addr:stackloc}">; // Count Leading // CLO/CLZ are part of the newer MIPS32(tm) instruction Modified: llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp?rev=53551&r1=53550&r2=53551&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp Mon Jul 14 09:42:54 2008 @@ -14,6 +14,7 @@ #define DEBUG_TYPE "mips-reg-info" #include "Mips.h" +#include "MipsSubtarget.h" #include "MipsRegisterInfo.h" #include "MipsMachineFunction.h" #include "llvm/Constants.h" @@ -35,9 +36,10 @@ using namespace llvm; -MipsRegisterInfo::MipsRegisterInfo(const TargetInstrInfo &tii) +MipsRegisterInfo::MipsRegisterInfo(const MipsSubtarget &ST, + const TargetInstrInfo &tii) : MipsGenRegisterInfo(Mips::ADJCALLSTACKDOWN, Mips::ADJCALLSTACKUP), - TII(tii) {} + Subtarget(ST), TII(tii) {} /// getRegisterNumbering - Given the enum value for some register, e.g. /// Mips::RA, return the number that it corresponds to (e.g. 31). @@ -82,10 +84,10 @@ return 0; // Not reached } +unsigned MipsRegisterInfo::getPICCallReg(void) { return Mips::T9; } + //===----------------------------------------------------------------------===// -// // Callee Saved Registers methods -// //===----------------------------------------------------------------------===// /// Mips Callee Saved Registers @@ -306,9 +308,12 @@ // Update frame info MFI->setStackSize(NumBytes); - // PIC speficic function prologue - if (isPIC) - BuildMI(MBB, MBBI, TII.get(Mips::CPLOAD)).addReg(Mips::T9); + BuildMI(MBB, MBBI, TII.get(Mips::NOREORDER)); + + // TODO: check need from GP here. + if (isPIC && Subtarget.isABI_O32()) + BuildMI(MBB, MBBI, TII.get(Mips::CPLOAD)).addReg(getPICCallReg()); + BuildMI(MBB, MBBI, TII.get(Mips::NOMACRO)); // Adjust stack : addi sp, sp, (-imm) BuildMI(MBB, MBBI, TII.get(Mips::ADDiu), Mips::SP) @@ -334,9 +339,10 @@ } // PIC speficic function prologue - if ((isPIC) && (MFI->hasCalls())) + if ((isPIC) && (MFI->hasCalls())) { BuildMI(MBB, MBBI, TII.get(Mips::CPRESTORE)) .addImm(MipsFI->getGPStackOffset()); + } } void MipsRegisterInfo:: Modified: llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h?rev=53551&r1=53550&r2=53551&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h (original) +++ llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h Mon Jul 14 09:42:54 2008 @@ -14,23 +14,28 @@ #ifndef MIPSREGISTERINFO_H #define MIPSREGISTERINFO_H +#include "Mips.h" #include "llvm/Target/TargetRegisterInfo.h" #include "MipsGenRegisterInfo.h.inc" namespace llvm { - +class MipsSubtarget; class TargetInstrInfo; class Type; struct MipsRegisterInfo : public MipsGenRegisterInfo { + const MipsSubtarget &Subtarget; const TargetInstrInfo &TII; - MipsRegisterInfo(const TargetInstrInfo &tii); + MipsRegisterInfo(const MipsSubtarget &Subtarget, const TargetInstrInfo &tii); /// getRegisterNumbering - Given the enum value for some register, e.g. /// Mips::RA, return the number that it corresponds to (e.g. 31). static unsigned getRegisterNumbering(unsigned RegEnum); + /// Get PIC indirect call register + static unsigned getPICCallReg(void); + /// Code Generation virtual methods... const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const; Modified: llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp?rev=53551&r1=53550&r2=53551&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp Mon Jul 14 09:42:54 2008 @@ -15,23 +15,34 @@ #include "Mips.h" #include "MipsGenSubtarget.inc" #include "llvm/Module.h" +#include "llvm/Support/CommandLine.h" using namespace llvm; +cl::opt NotABICall("disable-mips-abicall", cl::Hidden, + cl::desc("Disable code for SVR4-style dynamic objects")); +cl::opt AbsoluteCall("enable-mips-absolute-call", cl::Hidden, + cl::desc("Enable absolute call within abicall")); + MipsSubtarget::MipsSubtarget(const TargetMachine &TM, const Module &M, const std::string &FS, bool little) : MipsArchVersion(Mips1), MipsABI(O32), IsLittle(little), IsSingleFloat(false), - IsFP64bit(false), IsGP64bit(false), HasVFPU(false), HasSEInReg(false) + IsFP64bit(false), IsGP64bit(false), HasVFPU(false), HasSEInReg(false), + HasABICall(true), HasAbsoluteCall(false), IsLinux(true) { std::string CPU = "mips1"; // Parse features string. ParseSubtargetFeatures(FS, CPU); + const std::string& TT = M.getTargetTriple(); + + // Is the target system Linux ? + if (TT.find("linux") == std::string::npos) + IsLinux = false; // When only the target triple is specified and is // a allegrex target, set the features. We also match // big and little endian allegrex cores (dont really // know if a big one exists) - const std::string& TT = M.getTargetTriple(); if (TT.find("mipsallegrex") != std::string::npos) { MipsABI = EABI; IsSingleFloat = true; @@ -39,4 +50,13 @@ HasVFPU = true; // Enables Allegrex Vector FPU (not supported yet) HasSEInReg = true; } + + // Abicall is the default for O32 ABI and is ignored + // for EABI. + if (NotABICall || isABI_EABI()) + HasABICall = false; + + // TODO: disable when handling 64 bit symbols in the future. + if (HasABICall && AbsoluteCall) + HasAbsoluteCall = true; } Modified: llvm/trunk/lib/Target/Mips/MipsSubtarget.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSubtarget.h?rev=53551&r1=53550&r2=53551&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsSubtarget.h (original) +++ llvm/trunk/lib/Target/Mips/MipsSubtarget.h Mon Jul 14 09:42:54 2008 @@ -24,16 +24,17 @@ class MipsSubtarget : public TargetSubtarget { +public: + enum MipsABIEnum { + O32, O64, N32, N64, EABI + }; + protected: enum MipsArchEnum { Mips1, Mips2, Mips3, Mips4, Mips32, Mips32r2, Mips64, Mips64r2 }; - enum MipsABIEnum { - O32, EABI - }; - // Mips architecture version MipsArchEnum MipsArchVersion; @@ -60,6 +61,16 @@ // HasSEInReg - Target has SEB and SEH (signext in register) instructions. bool HasSEInReg; + // IsABICall - Enable SRV4 code for SVR4-style dynamic objects + bool HasABICall; + + // HasAbsoluteCall - Enable code that is not fully position-independent. + // Only works with HasABICall enabled. + bool HasAbsoluteCall; + + // isLinux - Target system is Linux. Is false we consider ELFOS for now. + bool IsLinux; + InstrItineraryData InstrItins; public: @@ -67,6 +78,7 @@ /// Only O32 and EABI supported right now. bool isABI_EABI() const { return MipsABI == EABI; } bool isABI_O32() const { return MipsABI == O32; } + unsigned getTargetABI() const { return MipsABI; } /// This constructor initializes the data members to match that /// of the specified module. @@ -87,6 +99,9 @@ bool isNotSingleFloat() const { return !IsSingleFloat; }; bool hasVFPU() const { return HasVFPU; }; bool hasSEInReg() const { return HasSEInReg; }; + bool hasABICall() const { return HasABICall; }; + bool hasAbsoluteCall() const { return HasAbsoluteCall; }; + bool isLinux() const { return IsLinux; }; }; } // End llvm namespace Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp?rev=53551&r1=53550&r2=53551&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Mon Jul 14 09:42:54 2008 @@ -17,21 +17,23 @@ using namespace llvm; MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM) { - AlignmentIsInBytes = false; - Data16bitsDirective = "\t.half\t"; - Data32bitsDirective = "\t.word\t"; - PrivateGlobalPrefix = "$"; - JumpTableDataSection = "\t.rdata"; - CommentString = "#"; - ReadOnlySection = "\t.rdata"; - ZeroDirective = "\t.space\t"; - BSSSection = "\t.section\t.bss"; - LCOMMDirective = "\t.lcomm\t"; + + AlignmentIsInBytes = false; + COMMDirectiveTakesAlignment = true; + Data16bitsDirective = "\t.half\t"; + Data32bitsDirective = "\t.word\t"; + Data64bitsDirective = NULL; + PrivateGlobalPrefix = "$"; + JumpTableDataSection = "\t.rdata"; + CommentString = "#"; + ReadOnlySection = "\t.rdata"; + ZeroDirective = "\t.space\t"; + BSSSection = "\t.section\t.bss"; + LCOMMDirective = "\t.lcomm\t"; if (TM.getRelocationModel() == Reloc::Static) JumpTableDirective = "\t.word\t"; else JumpTableDirective = "\t.gpword\t"; - COMMDirectiveTakesAlignment = true; } Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp?rev=53551&r1=53550&r2=53551&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Mon Jul 14 09:42:54 2008 @@ -44,8 +44,12 @@ FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0), TLInfo(*this) { - if (getRelocationModel() != Reloc::Static) + // Abicall enables PIC by default + if (Subtarget.hasABICall() && (getRelocationModel() != Reloc::Static)) setRelocationModel(Reloc::PIC_); + + // TODO: create an option to enable long calls, like -mlong-calls, + // that would be our CodeModel::Large. It must not work with Abicall. if (getCodeModel() == CodeModel::Default) setCodeModel(CodeModel::Small); } From anton at korobeynikov.info Mon Jul 14 09:50:45 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 14 Jul 2008 18:50:45 +0400 Subject: [llvm-commits] [llvm] r53551 - in /llvm/trunk/lib/Target/Mips: MipsAsmPrinter.cpp MipsInstrInfo.cpp MipsInstrInfo.td MipsRegisterInfo.cpp MipsRegisterInfo.h MipsSubtarget.cpp MipsSubtarget.h MipsTargetAsmInfo.cpp MipsTargetMachine.cpp In-Reply-To: <200807141442.m6EEgtH1009388@zion.cs.uiuc.edu> References: <200807141442.m6EEgtH1009388@zion.cs.uiuc.edu> Message-ID: Hi, Bruno On Mon, Jul 14, 2008 at 6:42 PM, Bruno Cardoso Lopes wrote: > + ReadOnlySection = "\t.rdata"; > + ZeroDirective = "\t.space\t"; > + BSSSection = "\t.section\t.bss"; Just wondering: does MIPS use ELF file format by default? And if yes - do you need all those section flags? -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From bruno.cardoso at gmail.com Mon Jul 14 10:19:10 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 14 Jul 2008 12:19:10 -0300 Subject: [llvm-commits] [llvm] r53551 - in /llvm/trunk/lib/Target/Mips: MipsAsmPrinter.cpp MipsInstrInfo.cpp MipsInstrInfo.td MipsRegisterInfo.cpp MipsRegisterInfo.h MipsSubtarget.cpp MipsSubtarget.h MipsTargetAsmInfo.cpp MipsTargetMachine.cpp In-Reply-To: References: <200807141442.m6EEgtH1009388@zion.cs.uiuc.edu> Message-ID: <275e64e40807140819t28a8ea2dkc04573bf95527b44@mail.gmail.com> Hi Anton, On Mon, Jul 14, 2008 at 11:50 AM, Anton Korobeynikov wrote: > Hi, Bruno > > On Mon, Jul 14, 2008 at 6:42 PM, Bruno Cardoso Lopes > wrote: > >> + ReadOnlySection = "\t.rdata"; >> + ZeroDirective = "\t.space\t"; >> + BSSSection = "\t.section\t.bss"; > Just wondering: does MIPS use ELF file format by default? And if yes - yes. > do you need all those section flags? I think I do, gcc use those for mips by default, is there anything do you suggest? Thanks, -- Bruno Cardoso Lopes http://www.brunocardoso.cc "When faced with untenable alternatives, you should consider your imperative." From anton at korobeynikov.info Mon Jul 14 10:21:06 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 14 Jul 2008 19:21:06 +0400 Subject: [llvm-commits] [llvm] r53551 - in /llvm/trunk/lib/Target/Mips: MipsAsmPrinter.cpp MipsInstrInfo.cpp MipsInstrInfo.td MipsRegisterInfo.cpp MipsRegisterInfo.h MipsSubtarget.cpp MipsSubtarget.h MipsTargetAsmInfo.cpp MipsTargetMachine.cpp In-Reply-To: <275e64e40807140819t28a8ea2dkc04573bf95527b44@mail.gmail.com> References: <200807141442.m6EEgtH1009388@zion.cs.uiuc.edu> <275e64e40807140819t28a8ea2dkc04573bf95527b44@mail.gmail.com> Message-ID: <1AFFFCD8-A7B8-4B20-B9D8-7232B5C6CB10@korobeynikov.info> Hi, Bruno > Hi Anton, > > On Mon, Jul 14, 2008 at 11:50 AM, Anton Korobeynikov > wrote: >> Hi, Bruno >> >> On Mon, Jul 14, 2008 at 6:42 PM, Bruno Cardoso Lopes >> wrote: >> >>> + ReadOnlySection = "\t.rdata"; >>> + ZeroDirective = "\t.space\t"; >>> + BSSSection = "\t.section\t.bss"; >> Just wondering: does MIPS use ELF file format by default? And if >> yes - > > yes. > >> do you need all those section flags? > > I think I do, gcc use those for mips by default, is there anything > do you suggest? Ok, I just wanted to know. I'm preparing transition to new section printing stuff, so you'll obtain almost everything there 'for free' :) -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From bruno.cardoso at gmail.com Mon Jul 14 11:27:33 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 14 Jul 2008 13:27:33 -0300 Subject: [llvm-commits] [llvm] r53551 - in /llvm/trunk/lib/Target/Mips: MipsAsmPrinter.cpp MipsInstrInfo.cpp MipsInstrInfo.td MipsRegisterInfo.cpp MipsRegisterInfo.h MipsSubtarget.cpp MipsSubtarget.h MipsTargetAsmInfo.cpp MipsTargetMachine.cpp In-Reply-To: <1AFFFCD8-A7B8-4B20-B9D8-7232B5C6CB10@korobeynikov.info> References: <200807141442.m6EEgtH1009388@zion.cs.uiuc.edu> <275e64e40807140819t28a8ea2dkc04573bf95527b44@mail.gmail.com> <1AFFFCD8-A7B8-4B20-B9D8-7232B5C6CB10@korobeynikov.info> Message-ID: <275e64e40807140927s4d7a5cb9o4502d0ea1491866c@mail.gmail.com> > Ok, I just wanted to know. I'm preparing transition to new section > printing stuff, so you'll obtain almost everything there 'for free' :) nice! :) Thanks Anton, -- Bruno Cardoso Lopes http://www.brunocardoso.cc "When faced with untenable alternatives, you should consider your imperative." From baldrick at free.fr Mon Jul 14 12:15:46 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Jul 2008 17:15:46 -0000 Subject: [llvm-commits] [llvm] r53553 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeTypes.cpp LegalizeTypes.h Message-ID: <200807141715.m6EHFkNA014205@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jul 14 12:15:45 2008 New Revision: 53553 URL: http://llvm.org/viewvc/llvm-project?rev=53553&view=rev Log: Ignore TargetConstant with an illegal type. These are used for passing huge immediates in inline ASM from the front-end straight down to the ASM writer. Of course this is a hack, but it is simple, limited in scope, works in practice, and is what LegalizeDAG does. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=53553&r1=53552&r2=53553&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Mon Jul 14 12:15:45 2008 @@ -60,11 +60,12 @@ assert(N->getNodeId() == ReadyToProcess && "Node should be ready if on worklist!"); + if (IgnoreNodeResults(N)) + goto ScanOperands; + // Scan the values produced by the node, checking to see if any result // types are illegal. - unsigned i = 0; - unsigned NumResults = N->getNumValues(); - do { + for (unsigned i = 0, NumResults = N->getNumValues(); i < NumResults; ++i) { MVT ResultVT = N->getValueType(i); switch (getTypeAction(ResultVT)) { default: @@ -90,14 +91,19 @@ SplitVectorResult(N, i); goto NodeDone; } - } while (++i < NumResults); + } +ScanOperands: // Scan the operand list for the node, handling any nodes with operands that // are illegal. { unsigned NumOperands = N->getNumOperands(); bool NeedsRevisit = false; + unsigned i; for (i = 0; i != NumOperands; ++i) { + if (IgnoreNodeResults(N->getOperand(i).Val)) + continue; + MVT OpVT = N->getOperand(i).getValueType(); switch (getTypeAction(OpVT)) { default: @@ -187,15 +193,17 @@ bool Failed = false; // Check that all result types are legal. - for (unsigned i = 0, NumVals = I->getNumValues(); i < NumVals; ++i) - if (!isTypeLegal(I->getValueType(i))) { - cerr << "Result type " << i << " illegal!\n"; - Failed = true; - } + if (!IgnoreNodeResults(I)) + for (unsigned i = 0, NumVals = I->getNumValues(); i < NumVals; ++i) + if (!isTypeLegal(I->getValueType(i))) { + cerr << "Result type " << i << " illegal!\n"; + Failed = true; + } // Check that all operand types are legal. for (unsigned i = 0, NumOps = I->getNumOperands(); i < NumOps; ++i) - if (!isTypeLegal(I->getOperand(i).getValueType())) { + if (!IgnoreNodeResults(I->getOperand(i).Val) && + !isTypeLegal(I->getOperand(i).getValueType())) { cerr << "Operand type " << i << " illegal!\n"; Failed = true; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=53553&r1=53552&r2=53553&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Mon Jul 14 12:15:45 2008 @@ -105,6 +105,11 @@ return ValueTypeActions.getTypeAction(VT) == TargetLowering::Legal; } + /// IgnoreNodeResults - Pretend all of this node's results are legal. + bool IgnoreNodeResults(SDNode *N) const { + return N->getOpcode() == ISD::TargetConstant; + } + /// PromotedIntegers - For integer nodes that are below legal width, this map /// indicates what promoted value to use. DenseMap PromotedIntegers; From baldrick at free.fr Mon Jul 14 12:22:31 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Jul 2008 17:22:31 -0000 Subject: [llvm-commits] [llvm] r53554 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Message-ID: <200807141722.m6EHMVNI014419@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jul 14 12:22:31 2008 New Revision: 53554 URL: http://llvm.org/viewvc/llvm-project?rev=53554&view=rev Log: There should be no extending loads or truncating stores of one-element vectors. Also, neaten the handling of INSERT_VECTOR_ELT when the inserted type is larger than the vector element type. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=53554&r1=53553&r2=53554&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Mon Jul 14 12:22:31 2008 @@ -85,7 +85,7 @@ } SDOperand DAGTypeLegalizer::ScalarizeVecRes_LOAD(LoadSDNode *N) { - assert(ISD::isUNINDEXEDLoad(N) && "Indexed load during type legalization!"); + assert(ISD::isNormalLoad(N) && "Extending load of one-element vector?"); SDOperand Result = DAG.getLoad(N->getValueType(0).getVectorElementType(), N->getChain(), N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(), @@ -118,9 +118,9 @@ // so be sure to truncate it to the element type if necessary. SDOperand Op = N->getOperand(1); MVT EltVT = N->getValueType(0).getVectorElementType(); - if (Op.getValueType().bitsGT(EltVT)) + if (Op.getValueType() != EltVT) + // FIXME: Can this happen for floating point types? Op = DAG.getNode(ISD::TRUNCATE, EltVT, Op); - assert(Op.getValueType() == EltVT && "Invalid type for inserted value!"); return Op; } @@ -210,7 +210,7 @@ /// ScalarizeVecOp_STORE - If the value to store is a vector that needs to be /// scalarized, it must be <1 x ty>. Just store the element. SDOperand DAGTypeLegalizer::ScalarizeVecOp_STORE(StoreSDNode *N, unsigned OpNo){ - assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!"); + assert(ISD::isNormalStore(N) && "Truncating store of one-element vector?"); assert(OpNo == 1 && "Do not know how to scalarize this operand!"); return DAG.getStore(N->getChain(), GetScalarizedVector(N->getOperand(1)), N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(), From baldrick at free.fr Mon Jul 14 12:27:46 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Jul 2008 17:27:46 -0000 Subject: [llvm-commits] [llvm] r53555 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Message-ID: <200807141727.m6EHRkPw014572@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jul 14 12:27:46 2008 New Revision: 53555 URL: http://llvm.org/viewvc/llvm-project?rev=53555&view=rev Log: According to the docs, it is possible to have an extending load of a vector. Handle this case when splitting vector loads. I'm not completely sure what is supposed to happen, but I think it means hi should be set to undef. LegalizeDAG does not consider this case. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=53555&r1=53554&r2=53555&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Mon Jul 14 12:27:46 2008 @@ -304,21 +304,29 @@ bool isVolatile = LD->isVolatile(); Lo = DAG.getLoad(LoVT, Ch, Ptr, SV, SVOffset, isVolatile, Alignment); - unsigned IncrementSize = LoVT.getSizeInBits()/8; - Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr, - DAG.getIntPtrConstant(IncrementSize)); - SVOffset += IncrementSize; - Alignment = MinAlign(Alignment, IncrementSize); - Hi = DAG.getLoad(HiVT, Ch, Ptr, SV, SVOffset, isVolatile, Alignment); - - // Build a factor node to remember that this load is independent of the - // other one. - SDOperand TF = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1), - Hi.getValue(1)); + + if (LD->getExtensionType() == ISD::NON_EXTLOAD) { + unsigned IncrementSize = LoVT.getSizeInBits()/8; + Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr, + DAG.getIntPtrConstant(IncrementSize)); + SVOffset += IncrementSize; + Alignment = MinAlign(Alignment, IncrementSize); + Hi = DAG.getLoad(HiVT, Ch, Ptr, SV, SVOffset, isVolatile, Alignment); + + // Build a factor node to remember that this load is independent of the + // other one. + Ch = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1), + Hi.getValue(1)); + } else { + assert(LD->getExtensionType() == ISD::EXTLOAD && + "Unsupported vector extending load!"); + Hi = DAG.getNode(ISD::UNDEF, HiVT); + Ch = Lo.getValue(1); + } // Legalized the chain result - switch anything that used the old chain to // use the new one. - ReplaceValueWith(SDOperand(LD, 1), TF); + ReplaceValueWith(SDOperand(LD, 1), Ch); } void DAGTypeLegalizer::SplitVecRes_BUILD_PAIR(SDNode *N, SDOperand &Lo, From baldrick at free.fr Mon Jul 14 12:32:02 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Jul 2008 17:32:02 -0000 Subject: [llvm-commits] [llvm] r53556 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Message-ID: <200807141732.m6EHW23K014699@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jul 14 12:32:02 2008 New Revision: 53556 URL: http://llvm.org/viewvc/llvm-project?rev=53556&view=rev Log: An INSERT_VECTOR_ELT can insert a larger value than the vector element type. Don't forget to handle this when the insertion index is not a constant. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=53556&r1=53555&r2=53556&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Mon Jul 14 12:32:02 2008 @@ -360,13 +360,14 @@ // Spill the vector to the stack. MVT VecVT = Vec.getValueType(); + MVT EltVT = VecVT.getVectorElementType(); SDOperand StackPtr = DAG.CreateStackTemporary(VecVT); SDOperand Store = DAG.getStore(DAG.getEntryNode(), Vec, StackPtr, NULL, 0); - // Store the new element. - SDOperand EltPtr = GetVectorElementPointer(StackPtr, - VecVT.getVectorElementType(), Idx); - Store = DAG.getStore(Store, Elt, EltPtr, NULL, 0); + // Store the new element. This may be larger than the vector element type, + // so use a truncating store. + SDOperand EltPtr = GetVectorElementPointer(StackPtr, EltVT, Idx); + Store = DAG.getTruncStore(Store, Elt, EltPtr, NULL, 0, EltVT); // Reload the vector from the stack. SDOperand Load = DAG.getLoad(VecVT, Store, StackPtr, NULL, 0); From sabre at nondot.org Mon Jul 14 12:32:59 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 14 Jul 2008 17:32:59 -0000 Subject: [llvm-commits] [llvm] r53557 - in /llvm/trunk: include/llvm/Transforms/Utils/InlineCost.h lib/Transforms/Utils/InlineCost.cpp Message-ID: <200807141732.m6EHWxFI014738@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 14 12:32:59 2008 New Revision: 53557 URL: http://llvm.org/viewvc/llvm-project?rev=53557&view=rev Log: Reapply r53540, now with the matching header! Modified: llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Modified: llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h?rev=53557&r1=53556&r2=53557&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h Mon Jul 14 12:32:59 2008 @@ -38,6 +38,10 @@ // FunctionInfo - For each function, calculate the size of it in blocks and // instructions. struct FunctionInfo { + /// NeverInline - True if this callee should never be inlined into a + /// caller. + bool NeverInline; + /// NumInsts, NumBlocks - Keep track of how large each function is, which /// is used to estimate the code size cost of inlining it. unsigned NumInsts, NumBlocks; @@ -53,7 +57,8 @@ /// entry here. std::vector ArgumentWeights; - FunctionInfo() : NumInsts(0), NumBlocks(0), NumVectorInsts(0) {} + FunctionInfo() : NeverInline(false), NumInsts(0), NumBlocks(0), + NumVectorInsts(0) {} /// analyzeFunction - Fill in the current structure with information /// gleaned from the specified function. Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp?rev=53557&r1=53556&r2=53557&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InlineCost.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Mon Jul 14 12:32:59 2008 @@ -100,9 +100,27 @@ for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB) { for (BasicBlock::const_iterator II = BB->begin(), E = BB->end(); II != E; ++II) { - if (isa(II)) continue; // Debug intrinsics don't count. if (isa(II)) continue; // PHI nodes don't count. + // Special handling for calls. + if (isa(II) || isa(II)) { + if (isa(II)) + continue; // Debug intrinsics don't count as size. + + CallSite CS = CallSite::get(const_cast(&*II)); + + // If this function contains a call to setjmp or _setjmp, never inline + // it. This is a hack because we depend on the user marking their local + // variables as volatile if they are live across a setjmp call, and they + // probably won't do this in callers. + if (Function *F = CS.getCalledFunction()) + if (F->isDeclaration() && + (F->isName("setjmp") || F->isName("_setjmp"))) { + NeverInline = true; + return; + } + } + if (isa(II) || isa(II->getType())) ++NumVectorInsts; @@ -194,6 +212,10 @@ // If we haven't calculated this information yet, do so now. if (CalleeFI.NumBlocks == 0) CalleeFI.analyzeFunction(Callee); + + // If we should never inline this, return a huge cost. + if (CalleeFI.NeverInline) + return 2000000000; // Add to the inline quality for properties that make the call valuable to // inline. This includes factors that indicate that the result of inlining From baldrick at free.fr Mon Jul 14 12:33:37 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Jul 2008 17:33:37 -0000 Subject: [llvm-commits] [llvm] r53558 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Message-ID: <200807141733.m6EHXcna014763@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jul 14 12:33:37 2008 New Revision: 53558 URL: http://llvm.org/viewvc/llvm-project?rev=53558&view=rev Log: Tighten up some checks. Fix FPOWI splitting for non-power-of-two vectors. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=53558&r1=53557&r2=53558&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Mon Jul 14 12:33:37 2008 @@ -430,7 +430,7 @@ void DAGTypeLegalizer::SplitVecRes_CONCAT_VECTORS(SDNode *N, SDOperand &Lo, SDOperand &Hi) { - // FIXME: Handle non-power-of-two vectors? + assert(!(N->getNumOperands() & 1) && "Unsupported CONCAT_VECTORS"); unsigned NumSubvectors = N->getNumOperands() / 2; if (NumSubvectors == 1) { Lo = N->getOperand(0); @@ -530,7 +530,7 @@ SDOperand &Hi) { GetSplitVector(N->getOperand(0), Lo, Hi); Lo = DAG.getNode(ISD::FPOWI, Lo.getValueType(), Lo, N->getOperand(1)); - Hi = DAG.getNode(ISD::FPOWI, Lo.getValueType(), Hi, N->getOperand(1)); + Hi = DAG.getNode(ISD::FPOWI, Hi.getValueType(), Hi, N->getOperand(1)); } @@ -588,7 +588,7 @@ } SDOperand DAGTypeLegalizer::SplitVecOp_STORE(StoreSDNode *N, unsigned OpNo) { - assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!"); + assert(ISD::isNormalStore(N) && "Truncating store of vector?"); assert(OpNo == 1 && "Can only split the stored value"); SDOperand Ch = N->getChain(); From baldrick at free.fr Mon Jul 14 12:34:19 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Jul 2008 17:34:19 -0000 Subject: [llvm-commits] [llvm] r53559 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Message-ID: <200807141734.m6EHYJQT014794@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jul 14 12:34:19 2008 New Revision: 53559 URL: http://llvm.org/viewvc/llvm-project?rev=53559&view=rev Log: I don't think BUILD_PAIR can have a vector result. Remove support for this. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=53559&r1=53558&r2=53559&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Mon Jul 14 12:34:19 2008 @@ -248,7 +248,6 @@ case ISD::LOAD: SplitVecRes_LOAD(cast(N), Lo, Hi); break; - case ISD::BUILD_PAIR: SplitVecRes_BUILD_PAIR(N, Lo, Hi); break; case ISD::INSERT_VECTOR_ELT:SplitVecRes_INSERT_VECTOR_ELT(N, Lo, Hi); break; case ISD::VECTOR_SHUFFLE: SplitVecRes_VECTOR_SHUFFLE(N, Lo, Hi); break; case ISD::BUILD_VECTOR: SplitVecRes_BUILD_VECTOR(N, Lo, Hi); break; @@ -329,17 +328,6 @@ ReplaceValueWith(SDOperand(LD, 1), Ch); } -void DAGTypeLegalizer::SplitVecRes_BUILD_PAIR(SDNode *N, SDOperand &Lo, - SDOperand &Hi) { -#ifndef NDEBUG - MVT LoVT, HiVT; - GetSplitDestVTs(N->getValueType(0), LoVT, HiVT); - assert(LoVT == HiVT && "Non-power-of-two vectors not supported!"); -#endif - Lo = N->getOperand(0); - Hi = N->getOperand(1); -} - void DAGTypeLegalizer::SplitVecRes_INSERT_VECTOR_ELT(SDNode *N, SDOperand &Lo, SDOperand &Hi) { SDOperand Vec = N->getOperand(0); From gohman at apple.com Mon Jul 14 12:43:27 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Jul 2008 17:43:27 -0000 Subject: [llvm-commits] [llvm] r53561 - /llvm/trunk/tools/bugpoint/Miscompilation.cpp Message-ID: <200807141743.m6EHhRs5015095@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 14 12:43:27 2008 New Revision: 53561 URL: http://llvm.org/viewvc/llvm-project?rev=53561&view=rev Log: Reformat this message to fit in 80 cols. Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=53561&r1=53560&r2=53561&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original) +++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Mon Jul 14 12:43:27 2008 @@ -841,10 +841,10 @@ if ((void*)cbe == (void*)Interpreter) { std::string Result = executeProgramWithCBE("bugpoint.cbe.out"); std::cout << "\n*** The C backend cannot match the reference diff, but it " - << "is used as the 'known good'\n code generator, so I can't" - << " debug it. Perhaps you have a front-end problem?\n As a" - << " sanity check, I left the result of executing the program " - << "with the C backend\n in this file for you: '" + << "is used as the\n 'known good' code generator, so I can't" + << " debug it. Perhaps you have a\n front-end problem? As a" + << " sanity check, I left the result of executing the\n " + << "program with the C backend in this file for you: '" << Result << "'.\n"; return true; } From gohman at apple.com Mon Jul 14 12:45:47 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Jul 2008 17:45:47 -0000 Subject: [llvm-commits] [llvm] r53562 - /llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp Message-ID: <200807141745.m6EHjlRh015173@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 14 12:45:47 2008 New Revision: 53562 URL: http://llvm.org/viewvc/llvm-project?rev=53562&view=rev Log: Fix edito in the PseudoSourceValue name list. Modified: llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp Modified: llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp?rev=53562&r1=53561&r2=53562&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp (original) +++ llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp Mon Jul 14 12:45:47 2008 @@ -32,7 +32,7 @@ static const char *const PSVNames[] = { "Stack", "GOT", - "JumpTable" + "JumpTable", "ConstantPool" }; From gohman at apple.com Mon Jul 14 12:51:25 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Jul 2008 17:51:25 -0000 Subject: [llvm-commits] [llvm] r53563 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Message-ID: <200807141751.m6EHpPUi015338@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 14 12:51:24 2008 New Revision: 53563 URL: http://llvm.org/viewvc/llvm-project?rev=53563&view=rev Log: Improve debug output for MemOperandSDNode. PseudoSourceValue nodes don't have value names, so use print instead of getName() to get a useful string. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=53563&r1=53562&r2=53563&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Mon Jul 14 12:51:24 2008 @@ -155,10 +155,13 @@ else Op += ""; } else if (const MemOperandSDNode *M = dyn_cast(Node)) { - if (M->MO.getValue()) - Op += "<" + M->MO.getValue()->getName() + ":" + itostr(M->MO.getOffset()) + ">"; - else - Op += "MO.getOffset()) + ">"; + if (M->MO.getValue()) { + std::ostringstream SS; + M->MO.getValue()->print(SS); + Op += "<" + SS.str() + "+" + itostr(M->MO.getOffset()) + ">"; + } else { + Op += "<(unknown)+" + itostr(M->MO.getOffset()) + ">"; + } } else if (const ARG_FLAGSSDNode *N = dyn_cast(Node)) { Op = Op + " AF=" + N->getArgFlags().getArgFlagsString(); } else if (const VTSDNode *N = dyn_cast(Node)) { From gohman at apple.com Mon Jul 14 12:55:01 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Jul 2008 17:55:01 -0000 Subject: [llvm-commits] [llvm] r53564 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200807141755.m6EHt1OQ015450@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 14 12:55:01 2008 New Revision: 53564 URL: http://llvm.org/viewvc/llvm-project?rev=53564&view=rev Log: Fix uninitialized use of the Changed variable. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=53564&r1=53563&r2=53564&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Jul 14 12:55:01 2008 @@ -1747,6 +1747,7 @@ SE = &getAnalysis(); TD = &getAnalysis(); UIntPtrTy = TD->getIntPtrType(); + Changed = false; // Find all uses of induction variables in this loop, and catagorize // them by stride. Start by finding all of the PHI nodes in the header for @@ -1831,6 +1832,7 @@ SE->deleteValueFromRecords(PN); PN->replaceAllUsesWith(UndefValue::get(PN->getType())); DeadInsts.insert(PN); + Changed = true; break; } } From sabre at nondot.org Mon Jul 14 13:06:32 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 14 Jul 2008 18:06:32 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53566 - in /llvm-gcc-4.2/trunk/gcc/cp: cp-tree.h decl2.c lex.c pt.c Message-ID: <200807141806.m6EI6XgA015859@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 14 13:06:32 2008 New Revision: 53566 URL: http://llvm.org/viewvc/llvm-project?rev=53566&view=rev Log: reapply Rafael's patch that I reverted, which is GPL2. His commit message: port http://gcc.gnu.org/viewcvs?view=rev&revision=127716 2007-08-22 Jason Merrill PR c++/29365 * pt.c (outermost_tinst_level): New function. * lex.c (in_main_input_context): New function. * cp-tree.h: Declare it. * decl2.c (constrain_class_visibility): Use it to avoid warning about uses of the anonymous namespace in the main input file. http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080707/064926.html Modified: llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h llvm-gcc-4.2/trunk/gcc/cp/decl2.c llvm-gcc-4.2/trunk/gcc/cp/lex.c llvm-gcc-4.2/trunk/gcc/cp/pt.c Modified: llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h?rev=53566&r1=53565&r2=53566&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h (original) +++ llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h Mon Jul 14 13:06:32 2008 @@ -4122,6 +4122,7 @@ extern void yyhook (int); extern bool cxx_init (void); extern void cxx_finish (void); +extern bool in_main_input_context (void); /* in method.c */ extern void init_method (void); @@ -4204,6 +4205,7 @@ extern bool reregister_specialization (tree, tree, tree); extern tree fold_non_dependent_expr (tree); extern bool explicit_class_specialization_p (tree); +extern tree outermost_tinst_level (void); /* in repo.c */ extern void init_repo (void); Modified: llvm-gcc-4.2/trunk/gcc/cp/decl2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl2.c?rev=53566&r1=53565&r2=53566&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/decl2.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/decl2.c Mon Jul 14 13:06:32 2008 @@ -1879,9 +1879,12 @@ int subvis = type_visibility (ftype); if (subvis == VISIBILITY_ANON) - warning (0, "\ + { + if (!in_main_input_context ()) + warning (0, "\ %qT has a field %qD whose type uses the anonymous namespace", type, t); + } else if (IS_AGGR_TYPE (ftype) && vis < VISIBILITY_HIDDEN && subvis >= VISIBILITY_HIDDEN) @@ -1896,9 +1899,12 @@ int subvis = type_visibility (TREE_TYPE (t)); if (subvis == VISIBILITY_ANON) - warning (0, "\ + { + if (!in_main_input_context()) + warning (0, "\ %qT has a base %qT whose type uses the anonymous namespace", type, TREE_TYPE (t)); + } else if (vis < VISIBILITY_HIDDEN && subvis >= VISIBILITY_HIDDEN) warning (OPT_Wattributes, "\ Modified: llvm-gcc-4.2/trunk/gcc/cp/lex.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/lex.c?rev=53566&r1=53565&r2=53566&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/lex.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/lex.c Mon Jul 14 13:06:32 2008 @@ -877,3 +877,18 @@ return t; } + +/* Returns true if we are currently in the main source file, or in a + template instantiation started from the main source file. */ + +bool +in_main_input_context (void) +{ + tree tl = outermost_tinst_level(); + + if (tl) + return strcmp (main_input_filename, + LOCATION_FILE (TINST_LOCATION (tl))) == 0; + else + return strcmp (main_input_filename, input_filename) == 0; +} Modified: llvm-gcc-4.2/trunk/gcc/cp/pt.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/pt.c?rev=53566&r1=53565&r2=53566&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/pt.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/pt.c Mon Jul 14 13:06:32 2008 @@ -5288,6 +5288,15 @@ pop_tinst_level (); } +/* Returns the TINST_LEVEL which gives the original instantiation + context. */ + +tree +outermost_tinst_level (void) +{ + return tree_last (current_tinst_level); +} + /* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL. ARGS is the vector of template arguments, as for tsubst. From clattner at apple.com Mon Jul 14 13:09:17 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 14 Jul 2008 11:09:17 -0700 Subject: [llvm-commits] [llvm] r53534 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-07-13-DivZero.ll test/Transforms/InstCombine/udiv_select_to_select_shift.ll In-Reply-To: <200807140932.04483.baldrick@free.fr> References: <200807140015.m6E0FroD004171@zion.cs.uiuc.edu> <200807140932.04483.baldrick@free.fr> Message-ID: <5CDF57FA-B3FC-4E57-9E73-21BEF7BC3B9C@apple.com> On Jul 14, 2008, at 12:32 AM, Duncan Sands wrote: > Hi Chris, > >> + // If we found a call to a function, we can't assume it will >> return, so >> + // information from below it cannot be propagated above it. >> + if (isa(BBI) && !isa(BBI)) >> + break; > > I guess you only really need to exit here if SI is zero. What do you mean? -Chris From gohman at apple.com Mon Jul 14 13:19:32 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Jul 2008 18:19:32 -0000 Subject: [llvm-commits] [llvm] r53567 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h include/llvm/CodeGen/SelectionDAGISel.h include/llvm/Support/Timer.h lib/CodeGen/SelectionDAG/ScheduleDAG.cpp lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Support/Timer.cpp Message-ID: <200807141819.m6EIJXwI016251@zion.cs.uiuc.edu> Author: djg Date: Mon Jul 14 13:19:29 2008 New Revision: 53567 URL: http://llvm.org/viewvc/llvm-project?rev=53567&view=rev Log: Reapply 53476 and 53480, with a fix so that it properly updates the BB member to the current basic block after emitting instructions. Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h llvm/trunk/include/llvm/Support/Timer.h llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Support/Timer.cpp Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=53567&r1=53566&r2=53567&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Mon Jul 14 13:19:29 2008 @@ -265,7 +265,7 @@ /// Run - perform scheduling. /// - MachineBasicBlock *Run(); + void Run(); /// isPassiveNode - Return true if the node is a non-scheduled leaf. /// @@ -336,7 +336,7 @@ /// void EmitNoop(); - void EmitSchedule(); + MachineBasicBlock *EmitSchedule(); void dumpSchedule() const; Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=53567&r1=53566&r2=53567&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Mon Jul 14 13:19:29 2008 @@ -30,6 +30,7 @@ class FunctionLoweringInfo; class HazardRecognizer; class CollectorMetadata; + class ScheduleDAG; /// SelectionDAGISel - This is the common base class used for SelectionDAG-based /// pattern-matching instruction selectors. @@ -191,9 +192,9 @@ void ComputeLiveOutVRegInfo(SelectionDAG &DAG); - /// Pick a safe ordering and emit instructions for each target node in the + /// Pick a safe ordering for instructions for each target node in the /// graph. - void ScheduleAndEmitDAG(SelectionDAG &DAG); + ScheduleDAG *Schedule(SelectionDAG &DAG); /// SwitchCases - Vector of CaseBlock structures used to communicate /// SwitchInst code generation information. Modified: llvm/trunk/include/llvm/Support/Timer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Timer.h?rev=53567&r1=53566&r2=53567&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Timer.h (original) +++ llvm/trunk/include/llvm/Support/Timer.h Mon Jul 14 13:19:29 2008 @@ -132,6 +132,8 @@ /// struct NamedRegionTimer : public TimeRegion { explicit NamedRegionTimer(const std::string &Name); + explicit NamedRegionTimer(const std::string &Name, + const std::string &GroupName); }; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=53567&r1=53566&r2=53567&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Mon Jul 14 13:19:29 2008 @@ -1082,7 +1082,7 @@ } /// EmitSchedule - Emit the machine code in scheduled order. -void ScheduleDAG::EmitSchedule() { +MachineBasicBlock *ScheduleDAG::EmitSchedule() { bool isEntryBB = &MF->front() == BB; if (isEntryBB && !SchedLiveInCopies) { @@ -1118,6 +1118,8 @@ if (isEntryBB && SchedLiveInCopies) EmitLiveInCopies(MF->begin()); + + return BB; } /// dump - dump the schedule. @@ -1133,9 +1135,12 @@ /// Run - perform scheduling. /// -MachineBasicBlock *ScheduleDAG::Run() { +void ScheduleDAG::Run() { Schedule(); - return BB; + + DOUT << "*** Final schedule ***\n"; + DEBUG(dumpSchedule()); + DOUT << "\n"; } /// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp?rev=53567&r1=53566&r2=53567&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Mon Jul 14 13:19:29 2008 @@ -99,13 +99,6 @@ ListScheduleTopDown(); AvailableQueue->releaseState(); - - DOUT << "*** Final schedule ***\n"; - DEBUG(dumpSchedule()); - DOUT << "\n"; - - // Emit in scheduled order - EmitSchedule(); } //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=53567&r1=53566&r2=53567&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Mon Jul 14 13:19:29 2008 @@ -204,13 +204,6 @@ if (!Fast) CommuteNodesToReducePressure(); - - DOUT << "*** Final schedule ***\n"; - DEBUG(dumpSchedule()); - DOUT << "\n"; - - // Emit in scheduled order - EmitSchedule(); } /// CommuteNodesToReducePressure - If a node is two-address and commutable, and Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=53567&r1=53566&r2=53567&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Jul 14 13:19:29 2008 @@ -5284,10 +5284,11 @@ void SelectionDAGISel::CodeGenAndEmitDAG(SelectionDAG &DAG) { DOUT << "Lowered selection DAG:\n"; DEBUG(DAG.dump()); + std::string GroupName = "Instruction Selection and Scheduling"; // Run the DAG combiner in pre-legalize mode. if (TimePassesIsEnabled) { - NamedRegionTimer T("DAG Combining 1"); + NamedRegionTimer T("DAG Combining 1", GroupName); DAG.Combine(false, *AA); } else { DAG.Combine(false, *AA); @@ -5304,7 +5305,7 @@ } if (TimePassesIsEnabled) { - NamedRegionTimer T("DAG Legalization"); + NamedRegionTimer T("DAG Legalization", GroupName); DAG.Legalize(); } else { DAG.Legalize(); @@ -5315,7 +5316,7 @@ // Run the DAG combiner in post-legalize mode. if (TimePassesIsEnabled) { - NamedRegionTimer T("DAG Combining 2"); + NamedRegionTimer T("DAG Combining 2", GroupName); DAG.Combine(true, *AA); } else { DAG.Combine(true, *AA); @@ -5332,24 +5333,41 @@ // Third, instruction select all of the operations to machine code, adding the // code to the MachineBasicBlock. if (TimePassesIsEnabled) { - NamedRegionTimer T("Instruction Selection"); + NamedRegionTimer T("Instruction Selection", GroupName); InstructionSelect(DAG); } else { InstructionSelect(DAG); } + // Schedule machine code. + ScheduleDAG *Scheduler; + if (TimePassesIsEnabled) { + NamedRegionTimer T("Instruction Scheduling", GroupName); + Scheduler = Schedule(DAG); + } else { + Scheduler = Schedule(DAG); + } + // Emit machine code to BB. This can change 'BB' to the last block being // inserted into. if (TimePassesIsEnabled) { - NamedRegionTimer T("Instruction Scheduling"); - ScheduleAndEmitDAG(DAG); + NamedRegionTimer T("Instruction Creation", GroupName); + BB = Scheduler->EmitSchedule(); + } else { + BB = Scheduler->EmitSchedule(); + } + + // Free the scheduler state. + if (TimePassesIsEnabled) { + NamedRegionTimer T("Instruction Scheduling Cleanup", GroupName); + delete Scheduler; } else { - ScheduleAndEmitDAG(DAG); + delete Scheduler; } // Perform target specific isel post processing. if (TimePassesIsEnabled) { - NamedRegionTimer T("Instruction Selection Post Processing"); + NamedRegionTimer T("Instruction Selection Post Processing", GroupName); InstructionSelectPostProcessing(DAG); } else { InstructionSelectPostProcessing(DAG); @@ -5597,10 +5615,10 @@ } -//===----------------------------------------------------------------------===// -/// ScheduleAndEmitDAG - Pick a safe ordering and emit instructions for each +/// Schedule - Pick a safe ordering for instructions for each /// target node in the graph. -void SelectionDAGISel::ScheduleAndEmitDAG(SelectionDAG &DAG) { +/// +ScheduleDAG *SelectionDAGISel::Schedule(SelectionDAG &DAG) { if (ViewSchedDAGs) DAG.viewGraph(); RegisterScheduler::FunctionPassCtor Ctor = RegisterScheduler::getDefault(); @@ -5610,12 +5628,11 @@ RegisterScheduler::setDefault(Ctor); } - ScheduleDAG *SL = Ctor(this, &DAG, BB, FastISel); - BB = SL->Run(); - - if (ViewSUnitDAGs) SL->viewGraph(); + ScheduleDAG *Scheduler = Ctor(this, &DAG, BB, FastISel); + Scheduler->Run(); - delete SL; + if (ViewSUnitDAGs) Scheduler->viewGraph(); + return Scheduler; } Modified: llvm/trunk/lib/Support/Timer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Timer.cpp?rev=53567&r1=53566&r2=53567&view=diff ============================================================================== --- llvm/trunk/lib/Support/Timer.cpp (original) +++ llvm/trunk/lib/Support/Timer.cpp Mon Jul 14 13:19:29 2008 @@ -182,19 +182,51 @@ // NamedRegionTimer Implementation //===----------------------------------------------------------------------===// -static ManagedStatic > NamedTimers; +namespace { + +typedef std::map Name2Timer; +typedef std::map > Name2Pair; + +} + +static ManagedStatic NamedTimers; + +static ManagedStatic NamedGroupedTimers; static Timer &getNamedRegionTimer(const std::string &Name) { - std::map::iterator I = NamedTimers->find(Name); + Name2Timer::iterator I = NamedTimers->find(Name); if (I != NamedTimers->end()) return I->second; return NamedTimers->insert(I, std::make_pair(Name, Timer(Name)))->second; } +static Timer &getNamedRegionTimer(const std::string &Name, + const std::string &GroupName) { + + Name2Pair::iterator I = NamedGroupedTimers->find(GroupName); + if (I == NamedGroupedTimers->end()) { + TimerGroup TG(GroupName); + std::pair Pair(TG, Name2Timer()); + I = NamedGroupedTimers->insert(I, std::make_pair(GroupName, Pair)); + } + + Name2Timer::iterator J = I->second.second.find(Name); + if (J == I->second.second.end()) + J = I->second.second.insert(J, + std::make_pair(Name, + Timer(Name, + I->second.first))); + + return J->second; +} + NamedRegionTimer::NamedRegionTimer(const std::string &Name) : TimeRegion(getNamedRegionTimer(Name)) {} +NamedRegionTimer::NamedRegionTimer(const std::string &Name, + const std::string &GroupName) + : TimeRegion(getNamedRegionTimer(Name, GroupName)) {} //===----------------------------------------------------------------------===// // TimerGroup Implementation From evan.cheng at apple.com Mon Jul 14 13:24:08 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 14 Jul 2008 11:24:08 -0700 Subject: [llvm-commits] Setting alignment when creating temporary patch In-Reply-To: <49DDC12F-6E7C-44ED-BA68-7682C57C5B63@apple.com> References: <49DDC12F-6E7C-44ED-BA68-7682C57C5B63@apple.com> Message-ID: <2B9294FA-B239-40F9-BF77-3CB0BA547F4A@apple.com> Looks good. Thanks! Evan On Jul 12, 2008, at 6:41 PM, Mon P Wang wrote: > Hi, > > I looked at uses of CreateStackTemporary to see if there were any > other possible issues with alignment like in EmitStackConvert. The > only case that I saw was the case of a BIT_CONVERT when the convert > from a scalar or a vector to a vector. > > -- Mon Ping > > > --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (revision 53520) > +++ lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (working copy) > @@ -5464,7 +5464,6 @@ > MVT DestVT) { > if (Op0.getValueType() == MVT::i32) { > // simple 32-bit [signed|unsigned] integer to float/double > expansion > - > // Get the stack frame index of a 8 byte buffer. > SDOperand StackSlot = DAG.CreateStackTemporary(MVT::f64); > > @@ -7015,7 +7014,9 @@ > // The input is a scalar or single-element vector. > // Lower to a store/load so that it can be split. > // FIXME: this could be improved probably. > - SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType()); > + unsigned LdAlign = TLI.getTargetData()->getPrefTypeAlignment( > + > Op.getValueType().getTypeForMVT()); > + SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType(), > LdAlign); > int FI = cast(Ptr.Val)->getIndex(); > > SDOperand St = DAG.getStore(DAG.getEntryNode(), > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Mon Jul 14 13:24:32 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 14 Jul 2008 18:24:32 -0000 Subject: [llvm-commits] [llvm] r53568 - in /llvm/branches/Apple: Tak/ Xcode-3.1/ Message-ID: <200807141824.m6EIOWWL016397@zion.cs.uiuc.edu> Author: void Date: Mon Jul 14 13:24:31 2008 New Revision: 53568 URL: http://llvm.org/viewvc/llvm-project?rev=53568&view=rev Log: Renaming Tak to Xcode-3.1. Added: llvm/branches/Apple/Xcode-3.1/ - copied from r53567, llvm/branches/Apple/Tak/ Removed: llvm/branches/Apple/Tak/ From isanbard at gmail.com Mon Jul 14 13:25:25 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 14 Jul 2008 18:25:25 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53569 - in /llvm-gcc-4.2/branches/Apple: Tak/ Xcode-3.1/ Message-ID: <200807141825.m6EIPPvW016429@zion.cs.uiuc.edu> Author: void Date: Mon Jul 14 13:25:25 2008 New Revision: 53569 URL: http://llvm.org/viewvc/llvm-project?rev=53569&view=rev Log: Renaming Tak to Xcode-3.1. Added: llvm-gcc-4.2/branches/Apple/Xcode-3.1/ - copied from r53568, llvm-gcc-4.2/branches/Apple/Tak/ Removed: llvm-gcc-4.2/branches/Apple/Tak/ From isanbard at gmail.com Mon Jul 14 13:37:30 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 14 Jul 2008 18:37:30 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53570 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Message-ID: <200807141837.m6EIbUf9016972@zion.cs.uiuc.edu> Author: void Date: Mon Jul 14 13:37:29 2008 New Revision: 53570 URL: http://llvm.org/viewvc/llvm-project?rev=53570&view=rev Log: Fix how the alignment for bitfields is calculated. For instance, in this situation: typedef unsigned long NSUInteger; @interface NSData { int x; } - (NSUInteger)length; @end @interface NSConcreteData : NSData { unsigned int _inline:1; } @end We were generating: L_OBJC_$_INSTANCE_VARIABLES_NSConcreteData: ## L_OBJC_$_INSTANCE_VARIABLES_NSConcreteData .long 32 ## 0x20 .long 1 ## 0x1 .quad _OBJC_IVAR_$_NSConcreteData._inline .quad L_OBJC_METH_VAR_NAME_0 .quad L_OBJC_METH_VAR_TYPE_0 .space 4 .long 1 ## 0x1 the ".space 4" should be ".long 2" Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=53570&r1=53569&r2=53570&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Mon Jul 14 13:37:29 2008 @@ -10617,7 +10617,10 @@ /* Set alignment */ /* APPLE LOCAL radar 5724385 */ - val = TYPE_ALIGN_UNIT (TREE_TYPE (field_decl)); + val = TYPE_ALIGN_UNIT ( + DECL_BIT_FIELD_TYPE (field_decl) ? DECL_BIT_FIELD_TYPE (field_decl) : + TREE_TYPE (field_decl)); + /* APPLE LOCAL end radar 5724385 */ val = exact_log2 (val); ivar = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, val), ivar); From gohman at apple.com Mon Jul 14 13:37:54 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Jul 2008 11:37:54 -0700 Subject: [llvm-commits] [llvm] r53508 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect1.ll test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect2.ll In-Reply-To: <200807120741.m6C7fWYG015242@zion.cs.uiuc.edu> References: <200807120741.m6C7fWYG015242@zion.cs.uiuc.edu> Message-ID: On Jul 12, 2008, at 12:41 AM, Nick Lewycky wrote: > Author: nicholas > Date: Sat Jul 12 02:41:32 2008 > New Revision: 53508 > > URL: http://llvm.org/viewvc/llvm-project?rev=53508&view=rev > Log: > Stop creating extraneous smax/umax in SCEV. This removes a > regression where we > started complicating many loops ('for' loops, in fact). Cool! > > > Added: > llvm/trunk/test/Analysis/ScalarEvolution/2008-07-12- > UnneededSelect1.ll > llvm/trunk/test/Analysis/ScalarEvolution/2008-07-12- > UnneededSelect2.ll > Modified: > llvm/trunk/lib/Analysis/ScalarEvolution.cpp > llvm/trunk/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll > > Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=53508&r1=53507&r2=53508&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) > +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sat Jul 12 02:41:32 > 2008 > @@ -1431,6 +1431,10 @@ > SCEVHandle HowManyLessThans(SCEV *LHS, SCEV *RHS, const Loop *L, > bool isSigned); > > + /// executesAtLeastOnce - Test whether entry to the loop is > protected by > + /// a conditional between LHS and RHS. > + bool executesAtLeastOnce(const Loop *L, bool isSigned, SCEV > *LHS, SCEV *RHS); > + > /// getConstantEvolutionLoopExitValue - If we know that the > specified Phi is > /// in the header of its containing loop, we know the loop > executes a > /// constant number of times, and the PHI node is just a > recurrence > @@ -2612,6 +2616,70 @@ > return UnknownValue; > } > > +/// executesAtLeastOnce - Test whether entry to the loop is > protected by > +/// a conditional between LHS and RHS. > +bool ScalarEvolutionsImpl::executesAtLeastOnce(const Loop *L, bool > isSigned, > + SCEV *LHS, SCEV > *RHS) { > + BasicBlock *Preheader = L->getLoopPreheader(); > + BasicBlock *PreheaderDest = L->getHeader(); > + if (Preheader == 0) return false; > + > + BranchInst *LoopEntryPredicate = > + dyn_cast(Preheader->getTerminator()); > + if (!LoopEntryPredicate) return false; > + > + // This might be a critical edge broken out. If the loop > preheader ends in > + // an unconditional branch to the loop, check to see if the > preheader has a > + // single predecessor, and if so, look for its terminator. > + while (LoopEntryPredicate->isUnconditional()) { > + PreheaderDest = Preheader; > + Preheader = Preheader->getSinglePredecessor(); > + if (!Preheader) return false; // Multiple preds. > + > + LoopEntryPredicate = > + dyn_cast(Preheader->getTerminator()); > + if (!LoopEntryPredicate) return false; > + } > + > + ICmpInst *ICI = dyn_cast(LoopEntryPredicate- > >getCondition()); > + if (!ICI) return false; > + > + // Now that we found a conditional branch that dominates the > loop, check to > + // see if it is the comparison we are looking for. > + Value *PreCondLHS = ICI->getOperand(0); > + Value *PreCondRHS = ICI->getOperand(1); > + ICmpInst::Predicate Cond; > + if (LoopEntryPredicate->getSuccessor(0) == PreheaderDest) > + Cond = ICI->getPredicate(); > + else > + Cond = ICI->getInversePredicate(); > + > + switch (Cond) { > + case ICmpInst::ICMP_UGT: > + if (isSigned) return false; > + std::swap(PreCondLHS, PreCondRHS); > + Cond = ICmpInst::ICMP_ULT; > + break; > + case ICmpInst::ICMP_SGT: > + if (!isSigned) return false; > + std::swap(PreCondLHS, PreCondRHS); > + Cond = ICmpInst::ICMP_SLT; > + break; > + case ICmpInst::ICMP_ULT: > + if (isSigned) return false; > + break; > + case ICmpInst::ICMP_SLT: > + if (!isSigned) return false; > + break; > + default: > + return false; > + } > + > + if (!PreCondLHS->getType()->isInteger()) return false; This check looks redundant; a ICMP_[SU][LG]T that's used by a conditional branch will always have integer operands. Can you make this an assert instead? > > + > + return LHS == getSCEV(PreCondLHS) && RHS == getSCEV(PreCondRHS); > +} > + > /// HowManyLessThans - Return the number of times a backedge > containing the > /// specified less-than comparison will execute. If not computable, > return > /// UnknownValue. > @@ -2640,12 +2708,17 @@ > > // Then, we get the value of the LHS in the first iteration in > which the > // above condition doesn't hold. This equals to max(m,n). This comment is now stale. Can you update it to reflect the new logic? Thanks, Dan > > - SCEVHandle End = isSigned ? SE.getSMaxExpr(RHS, Start) > - : SE.getUMaxExpr(RHS, Start); > - > - // Finally, we subtract these two values to get the number of > times the > - // backedge is executed: max(m,n)-n. > > - return SE.getMinusSCEV(End, Start); > + if (executesAtLeastOnce(L, isSigned, > + SE.getMinusSCEV(AddRec->getOperand(0), > One), RHS)) > + return SE.getMinusSCEV(RHS, Start); > + else { > + SCEVHandle End = isSigned ? SE.getSMaxExpr(RHS, Start) > + : SE.getUMaxExpr(RHS, Start); > + > + // Finally, we subtract these two values to get the number of > times the > + // backedge is executed: max(m,n)-n. > + return SE.getMinusSCEV(End, Start); > + } > } From sabre at nondot.org Mon Jul 14 13:46:17 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 14 Jul 2008 18:46:17 -0000 Subject: [llvm-commits] [llvm] r53571 - in /llvm/trunk/win32: Analysis/ Archive/ AsmParser/ Bitcode/ CBackend/ CodeGen/ Configure/ ExecutionEngine/ Fibonacci/ Linker/ Support/ System/ TableGen/ Target/ Transforms/ VMCore/ bugpoint/ llc/ lli/ llvm-ar/ llvm-as/ llvm-bcanalyzer/ llvm-dis/ llvm-ld/ llvm-link/ llvm-nm/ llvm-prof/ llvm-ranlib/ opt/ x86/ Message-ID: <200807141846.m6EIkHIe017379@zion.cs.uiuc.edu> Author: lattner Date: Mon Jul 14 13:46:16 2008 New Revision: 53571 URL: http://llvm.org/viewvc/llvm-project?rev=53571&view=rev Log: This replaces all $(SolutionDir) macros with $(ProjectDir)..\ Patch by Nicolas Capens! Modified: llvm/trunk/win32/Analysis/Analysis.vcproj llvm/trunk/win32/Archive/Archive.vcproj llvm/trunk/win32/AsmParser/AsmParser.vcproj llvm/trunk/win32/Bitcode/Bitcode.vcproj llvm/trunk/win32/CBackend/CBackend.vcproj llvm/trunk/win32/CodeGen/CodeGen.vcproj llvm/trunk/win32/Configure/Configure.vcproj llvm/trunk/win32/ExecutionEngine/ExecutionEngine.vcproj llvm/trunk/win32/Fibonacci/Fibonacci.vcproj llvm/trunk/win32/Linker/Linker.vcproj llvm/trunk/win32/Support/Support.vcproj llvm/trunk/win32/System/System.vcproj llvm/trunk/win32/TableGen/TableGen.vcproj llvm/trunk/win32/Target/Target.vcproj llvm/trunk/win32/Transforms/Transforms.vcproj llvm/trunk/win32/VMCore/VMCore.vcproj llvm/trunk/win32/bugpoint/bugpoint.vcproj llvm/trunk/win32/llc/llc.vcproj llvm/trunk/win32/lli/lli.vcproj llvm/trunk/win32/llvm-ar/llvm-ar.vcproj llvm/trunk/win32/llvm-as/llvm-as.vcproj llvm/trunk/win32/llvm-bcanalyzer/llvm-bcanalyzer.vcproj llvm/trunk/win32/llvm-dis/llvm-dis.vcproj llvm/trunk/win32/llvm-ld/llvm-ld.vcproj llvm/trunk/win32/llvm-link/llvm-link.vcproj llvm/trunk/win32/llvm-nm/llvm-nm.vcproj llvm/trunk/win32/llvm-prof/llvm-prof.vcproj llvm/trunk/win32/llvm-ranlib/llvm-ranlib.vcproj llvm/trunk/win32/opt/opt.vcproj llvm/trunk/win32/x86/x86.vcproj Modified: llvm/trunk/win32/Analysis/Analysis.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/Analysis/Analysis.vcproj?rev=53571&r1=53570&r2=53571&view=diff ============================================================================== --- llvm/trunk/win32/Analysis/Analysis.vcproj (original) +++ llvm/trunk/win32/Analysis/Analysis.vcproj Mon Jul 14 13:46:16 2008 @@ -19,7 +19,7 @@ @@ -203,9 +203,9 @@ > @@ -218,7 +218,7 @@ > @@ -228,7 +228,7 @@ > @@ -242,7 +242,7 @@ > @@ -252,7 +252,7 @@ > @@ -266,7 +266,7 @@ > @@ -276,7 +276,7 @@ > @@ -290,7 +290,7 @@ > @@ -300,7 +300,7 @@ > Modified: llvm/trunk/win32/ExecutionEngine/ExecutionEngine.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/ExecutionEngine/ExecutionEngine.vcproj?rev=53571&r1=53570&r2=53571&view=diff ============================================================================== --- llvm/trunk/win32/ExecutionEngine/ExecutionEngine.vcproj (original) +++ llvm/trunk/win32/ExecutionEngine/ExecutionEngine.vcproj Mon Jul 14 13:46:16 2008 @@ -19,7 +19,7 @@ Modified: llvm/trunk/win32/bugpoint/bugpoint.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/bugpoint/bugpoint.vcproj?rev=53571&r1=53570&r2=53571&view=diff ============================================================================== --- llvm/trunk/win32/bugpoint/bugpoint.vcproj (original) +++ llvm/trunk/win32/bugpoint/bugpoint.vcproj Mon Jul 14 13:46:16 2008 @@ -19,7 +19,7 @@ @@ -325,7 +325,7 @@ @@ -336,7 +336,7 @@ @@ -347,7 +347,7 @@ From dalej at apple.com Mon Jul 14 15:15:34 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 14 Jul 2008 20:15:34 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> Author: johannes Date: Mon Jul 14 15:15:32 2008 New Revision: 53572 URL: http://llvm.org/viewvc/llvm-project?rev=53572&view=rev Log: Fix code generation for bitfields in ObjC2. Fixes objc.dg/bitfield-1.m obj-c++.dg/bitfield-2.mm (in 64-bit mode). Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=53572&r1=53571&r2=53572&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jul 14 15:15:32 2008 @@ -5753,6 +5753,12 @@ } else { Value *Offset = Emit(field_offset, 0); + // For ObjC2, we may have a base class field that should not be taken into + // account here, as it is already in Offset. The ObjC FE figures this out. + tree field_bit_offset = objc_v2_bitfield_ivar_bitpos(exp); + if (field_bit_offset) { + BitStart = (unsigned)getINTEGER_CSTVal(field_bit_offset); + } // Here BitStart gives the offset of the field in bits from field_offset. // Incorporate as much of it as possible into the pointer computation. unsigned ByteOffset = BitStart/8; From clattner at apple.com Mon Jul 14 17:08:44 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 14 Jul 2008 15:08:44 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> Message-ID: On Jul 14, 2008, at 1:15 PM, Dale Johannesen wrote: > Author: johannes > Date: Mon Jul 14 15:15:32 2008 > New Revision: 53572 > > URL: http://llvm.org/viewvc/llvm-project?rev=53572&view=rev > Log: > Fix code generation for bitfields in ObjC2. Fixes > objc.dg/bitfield-1.m > obj-c++.dg/bitfield-2.mm > (in 64-bit mode). Hey Dale, Does this build if you configure with --enable-languages=c (i.e., no objc support)? -Chris > > > > Modified: > llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp > > Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=53572&r1=53571&r2=53572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) > +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jul 14 15:15:32 2008 > @@ -5753,6 +5753,12 @@ > } else { > Value *Offset = Emit(field_offset, 0); > > + // For ObjC2, we may have a base class field that should not be > taken into > + // account here, as it is already in Offset. The ObjC FE > figures this out. > + tree field_bit_offset = objc_v2_bitfield_ivar_bitpos(exp); > + if (field_bit_offset) { > + BitStart = (unsigned)getINTEGER_CSTVal(field_bit_offset); > + } > // Here BitStart gives the offset of the field in bits from > field_offset. > // Incorporate as much of it as possible into the pointer > computation. > unsigned ByteOffset = BitStart/8; > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dalej at apple.com Mon Jul 14 17:12:07 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 14 Jul 2008 15:12:07 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> Message-ID: <1677BB2F-C7C7-44F1-8709-857F68D22151@apple.com> On Jul 14, 2008, at 3:08 PMPDT, Chris Lattner wrote: > > On Jul 14, 2008, at 1:15 PM, Dale Johannesen wrote: > >> Author: johannes >> Date: Mon Jul 14 15:15:32 2008 >> New Revision: 53572 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=53572&view=rev >> Log: >> Fix code generation for bitfields in ObjC2. Fixes >> objc.dg/bitfield-1.m >> obj-c++.dg/bitfield-2.mm >> (in 64-bit mode). > > Hey Dale, > > Does this build if you configure with --enable-languages=c (i.e., no > objc support)? > > -Chris Yes, see stub-objc.c. There are other references in expr.c. >> Modified: >> llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp >> >> Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=53572&r1=53571&r2=53572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) >> +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jul 14 15:15:32 2008 >> @@ -5753,6 +5753,12 @@ >> } else { >> Value *Offset = Emit(field_offset, 0); >> >> + // For ObjC2, we may have a base class field that should not be >> taken into >> + // account here, as it is already in Offset. The ObjC FE >> figures this out. >> + tree field_bit_offset = objc_v2_bitfield_ivar_bitpos(exp); >> + if (field_bit_offset) { >> + BitStart = (unsigned)getINTEGER_CSTVal(field_bit_offset); >> + } >> // Here BitStart gives the offset of the field in bits from >> field_offset. >> // Incorporate as much of it as possible into the pointer >> computation. >> unsigned ByteOffset = BitStart/8; >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Mon Jul 14 17:29:15 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 14 Jul 2008 22:29:15 -0000 Subject: [llvm-commits] [llvm] r53574 - /llvm/trunk/tools/opt/opt.cpp Message-ID: <200807142229.m6EMTFGA024896@zion.cs.uiuc.edu> Author: evancheng Date: Mon Jul 14 17:29:15 2008 New Revision: 53574 URL: http://llvm.org/viewvc/llvm-project?rev=53574&view=rev Log: Goodbye tail duplication (for good this time). Modified: llvm/trunk/tools/opt/opt.cpp Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=53574&r1=53573&r2=53574&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Mon Jul 14 17:29:15 2008 @@ -264,7 +264,6 @@ addPass(PM, createFunctionInliningPass()); // Inline small functions addPass(PM, createArgumentPromotionPass()); // Scalarize uninlined fn args - addPass(PM, createTailDuplicationPass()); // Simplify cfg by copying code addPass(PM, createSimplifyLibCallsPass()); // Library Call Optimizations addPass(PM, createInstructionCombiningPass()); // Cleanup for scalarrepl. addPass(PM, createJumpThreadingPass()); // Thread jumps. From dpatel at apple.com Mon Jul 14 18:57:54 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Jul 2008 23:57:54 -0000 Subject: [llvm-commits] [llvm] r53579 - /llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp Message-ID: <200807142357.m6ENvsb3029733@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jul 14 18:57:54 2008 New Revision: 53579 URL: http://llvm.org/viewvc/llvm-project?rev=53579&view=rev Log: LinkOnce definitions have default scope, like weak definitions. Otherwise, the linker may not be able to match LinkOnce definition from one module with an exteranl reference from other module. Modified: llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp Modified: llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp?rev=53579&r1=53578&r2=53579&view=diff ============================================================================== --- llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp (original) +++ llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp Mon Jul 14 18:57:54 2008 @@ -224,7 +224,8 @@ // set scope part if ( def->hasHiddenVisibility() ) attr |= LTO_SYMBOL_SCOPE_HIDDEN; - else if ( def->hasExternalLinkage() || def->hasWeakLinkage() ) + else if ( def->hasExternalLinkage() || def->hasWeakLinkage() + || def->hasLinkOnceLinkage() ) attr |= LTO_SYMBOL_SCOPE_DEFAULT; else attr |= LTO_SYMBOL_SCOPE_INTERNAL; From dpatel at apple.com Mon Jul 14 19:00:11 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Jul 2008 00:00:11 -0000 Subject: [llvm-commits] [llvm] r53580 - /llvm/trunk/tools/lto/LTOModule.cpp Message-ID: <200807150000.m6F00BRS029816@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jul 14 19:00:11 2008 New Revision: 53580 URL: http://llvm.org/viewvc/llvm-project?rev=53580&view=rev Log: LinkOnce definitions have default scope, like weak definitions. Otherwise, the linker may not be able to match LinkOnce definition from one module with an exteranl reference from other module. Modified: llvm/trunk/tools/lto/LTOModule.cpp Modified: llvm/trunk/tools/lto/LTOModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOModule.cpp?rev=53580&r1=53579&r2=53580&view=diff ============================================================================== --- llvm/trunk/tools/lto/LTOModule.cpp (original) +++ llvm/trunk/tools/lto/LTOModule.cpp Mon Jul 14 19:00:11 2008 @@ -224,7 +224,8 @@ // set scope part if ( def->hasHiddenVisibility() ) attr |= LTO_SYMBOL_SCOPE_HIDDEN; - else if ( def->hasExternalLinkage() || def->hasWeakLinkage() ) + else if ( def->hasExternalLinkage() || def->hasWeakLinkage() + || def->hasLinkOnceLinkage() ) attr |= LTO_SYMBOL_SCOPE_DEFAULT; else attr |= LTO_SYMBOL_SCOPE_INTERNAL; From dpatel at apple.com Mon Jul 14 19:00:48 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Jul 2008 00:00:48 -0000 Subject: [llvm-commits] [llvm] r53581 - /llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp Message-ID: <200807150000.m6F00mN3029844@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jul 14 19:00:48 2008 New Revision: 53581 URL: http://llvm.org/viewvc/llvm-project?rev=53581&view=rev Log: Undo prev. check from Gaz branch. Modified: llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp Modified: llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp?rev=53581&r1=53580&r2=53581&view=diff ============================================================================== --- llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp (original) +++ llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp Mon Jul 14 19:00:48 2008 @@ -224,8 +224,7 @@ // set scope part if ( def->hasHiddenVisibility() ) attr |= LTO_SYMBOL_SCOPE_HIDDEN; - else if ( def->hasExternalLinkage() || def->hasWeakLinkage() - || def->hasLinkOnceLinkage() ) + else if ( def->hasExternalLinkage() || def->hasWeakLinkage() ) attr |= LTO_SYMBOL_SCOPE_DEFAULT; else attr |= LTO_SYMBOL_SCOPE_INTERNAL; From evan.cheng at apple.com Mon Jul 14 19:06:17 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 15 Jul 2008 00:06:17 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53582 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm-linker-hack.cpp Message-ID: <200807150006.m6F06HoD030005@zion.cs.uiuc.edu> Author: evancheng Date: Mon Jul 14 19:06:17 2008 New Revision: 53582 URL: http://llvm.org/viewvc/llvm-project?rev=53582&view=rev Log: Disable tail duplication for good. Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=53582&r1=53581&r2=53582&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Jul 14 19:06:17 2008 @@ -380,8 +380,6 @@ PM->add(createFunctionInliningPass()); // Inline small functions if (optimize > 2) PM->add(createArgumentPromotionPass()); // Scalarize uninlined fn args - if (!optimize_size) - PM->add(createTailDuplicationPass()); // Simplify cfg by copying code if (!lang_hooks.flag_no_builtin()) PM->add(createSimplifyLibCallsPass()); // Library Call Optimizations PM->add(createInstructionCombiningPass()); // Cleanup for scalarrepl. Modified: llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp?rev=53582&r1=53581&r2=53582&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp Mon Jul 14 19:06:17 2008 @@ -71,7 +71,6 @@ llvm::createPredicateSimplifierPass(); llvm::createCondPropagationPass(); llvm::createGlobalOptimizerPass(); - llvm::createTailDuplicationPass(); llvm::createJumpThreadingPass(); llvm::createFunctionInliningPass(); llvm::createRaiseAllocationsPass(); From dalej at apple.com Mon Jul 14 19:37:10 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 15 Jul 2008 00:37:10 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53583 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Message-ID: <200807150037.m6F0bA0W030852@zion.cs.uiuc.edu> Author: johannes Date: Mon Jul 14 19:37:09 2008 New Revision: 53583 URL: http://llvm.org/viewvc/llvm-project?rev=53583&view=rev Log: YA missing-ObjC-metadata-at-O0 bug. This one only affects ObjC2. Fixes: objc/execute/bycopy-3.m objc/execute/formal_protocol-5.m objc/execute/protocol-isEqual-2.m objc/execute/protocol-isEqual-3.m objc.dg/lookup-1.m objc.dg/proto-qual-1.m in 64-bit mode. Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=53583&r1=53582&r2=53583&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Mon Jul 14 19:37:09 2008 @@ -12041,6 +12041,11 @@ /* APPLE LOCAL end radar 4695109 */ expr = convert (objc_protocol_type, build_fold_addr_expr (expr)); finish_var_decl (decl, expr); +#ifdef ENABLE_LLVM + /* At -O0, we may have emitted references to the decl earlier. */ + if (!optimize) + reset_initializer_llvm(decl); +#endif } } From bruno.cardoso at gmail.com Mon Jul 14 21:03:36 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 15 Jul 2008 02:03:36 -0000 Subject: [llvm-commits] [llvm] r53585 - in /llvm/trunk/lib/Target/Mips: MipsAsmPrinter.cpp MipsISelLowering.cpp MipsRegisterInfo.cpp MipsTargetAsmInfo.cpp MipsTargetMachine.cpp Message-ID: <200807150203.m6F23atE000864@zion.cs.uiuc.edu> Author: bruno Date: Mon Jul 14 21:03:36 2008 New Revision: 53585 URL: http://llvm.org/viewvc/llvm-project?rev=53585&view=rev Log: Fixed call stack alignment. Improved AsmPrinter alignment issues. Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=53585&r1=53584&r2=53585&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Mon Jul 14 21:03:36 2008 @@ -486,9 +486,24 @@ O << "\n\n"; std::string name = Mang->getValueName(I); - Constant *C = I->getInitializer(); - unsigned Size = TD->getABITypeSize(C->getType()); - unsigned Align = TD->getPreferredAlignmentLog(I); + Constant *C = I->getInitializer(); + const Type *CTy = C->getType(); + unsigned Size = TD->getABITypeSize(CTy); + bool printSizeAndType = true; + + // A data structure or array is aligned in memory to the largest + // alignment boundary required by any data type inside it (this matches + // the Preferred Type Alignment). For integral types, the alignment is + // the type size. + //unsigned Align = TD->getPreferredAlignmentLog(I); + //unsigned Align = TD->getPrefTypeAlignment(C->getType()); + unsigned Align; + if (CTy->getTypeID() == Type::IntegerTyID || + CTy->getTypeID() == Type::VoidTyID) { + assert(!(Size & (Size-1)) && "Alignment is not a power of two!"); + Align = Log2_32(Size); + } else + Align = TD->getPreferredTypeAlignmentShift(CTy); // Is this correct ? if (C->isNullValue() && (I->hasLinkOnceLinkage() || @@ -549,10 +564,20 @@ else if (!I->isConstant()) SwitchToDataSection(TAI->getDataSection(), I); else { - // Read-only data. - if (TAI->getReadOnlySection()) + // Read-only data. We have two possible scenary here + // 1) Readonly section for strings (char arrays). + // 2) for other types. + if (TAI->getReadOnlySection()) { + const ConstantArray *CVA = dyn_cast(C); + if (CVA && CVA->isString()) { + std::string SectionName = "\t.section\t.rodata.str1.4," + "\"aMS\", at progbits,1"; + SwitchToDataSection(SectionName.c_str()); + printSizeAndType = false; + break; + } SwitchToDataSection(TAI->getReadOnlySection(), I); - else + } else SwitchToDataSection(TAI->getDataSection(), I); } } @@ -568,17 +593,18 @@ abort(); default: assert(0 && "Unknown linkage type!"); - } + } - O << "\t.align " << Align << "\n"; + if (Align) + O << "\t.align " << Align << "\n"; - if (TAI->hasDotTypeDotSizeDirective()) { + if (TAI->hasDotTypeDotSizeDirective() && printSizeAndType) { O << "\t.type " << name << ", at object\n"; O << "\t.size " << name << "," << Size << "\n"; } O << name << ":\n"; EmitGlobalConstant(C); - } + } } O << "\n"; Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=53585&r1=53584&r2=53585&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Mon Jul 14 21:03:36 2008 @@ -370,10 +370,12 @@ SmallVector ArgLocs; CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs); - // To meet ABI, Mips must always allocate 16 bytes on + // To meet O32 ABI, Mips must always allocate 16 bytes on // the stack (even if less than 4 are used as arguments) - int VTsize = MVT(MVT::i32).getSizeInBits()/8; - MFI->CreateFixedObject(VTsize, (VTsize*3)); + if (Subtarget->isABI_O32()) { + int VTsize = MVT(MVT::i32).getSizeInBits()/8; + MFI->CreateFixedObject(VTsize, (VTsize*3)); + } CCInfo.AnalyzeCallOperands(Op.Val, CC_Mips); Modified: llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp?rev=53585&r1=53584&r2=53585&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp Mon Jul 14 21:03:36 2008 @@ -267,7 +267,7 @@ #endif // No need to allocate space on the stack. - if (NumBytes == 0) return; + if (NumBytes == 0 && !MFI->hasCalls()) return; int FPOffset, RAOffset; @@ -389,7 +389,8 @@ processFunctionBeforeFrameFinalized(MachineFunction &MF) const { // Set the SPOffset on the FI where GP must be saved/loaded. MachineFrameInfo *MFI = MF.getFrameInfo(); - if (MFI->hasCalls()) { + bool isPIC = (MF.getTarget().getRelocationModel() == Reloc::PIC_); + if (MFI->hasCalls() && isPIC) { MipsFunctionInfo *MipsFI = MF.getInfo(); #ifndef NDEBUG DOUT << "processFunctionBeforeFrameFinalized\n"; Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp?rev=53585&r1=53584&r2=53585&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Mon Jul 14 21:03:36 2008 @@ -31,7 +31,7 @@ BSSSection = "\t.section\t.bss"; LCOMMDirective = "\t.lcomm\t"; - if (TM.getRelocationModel() == Reloc::Static) + if (!TM.getSubtarget().hasABICall()) JumpTableDirective = "\t.word\t"; else JumpTableDirective = "\t.gpword\t"; Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp?rev=53585&r1=53584&r2=53585&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Mon Jul 14 21:03:36 2008 @@ -38,8 +38,8 @@ MipsTargetMachine:: MipsTargetMachine(const Module &M, const std::string &FS, bool isLittle=false): Subtarget(*this, M, FS, isLittle), - DataLayout(isLittle ? std::string("e-p:32:32:32") : - std::string("E-p:32:32:32")), + DataLayout(isLittle ? std::string("e-p:32:32:32-i8:8:32-i16:16:32") : + std::string("E-p:32:32:32-i8:8:32-i16:16:32")), InstrInfo(*this), FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0), TLInfo(*this) From nicholas at mxc.ca Mon Jul 14 22:40:27 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 15 Jul 2008 03:40:27 -0000 Subject: [llvm-commits] [llvm] r53586 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <200807150340.m6F3eSEE003543@zion.cs.uiuc.edu> Author: nicholas Date: Mon Jul 14 22:40:27 2008 New Revision: 53586 URL: http://llvm.org/viewvc/llvm-project?rev=53586&view=rev Log: Fix up comments. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=53586&r1=53585&r2=53586&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Jul 14 22:40:27 2008 @@ -2675,7 +2675,7 @@ return false; } - if (!PreCondLHS->getType()->isInteger()) return false; + if (PreCondLHS->getType()->isInteger()) return false; return LHS == getSCEV(PreCondLHS) && RHS == getSCEV(PreCondRHS); } @@ -2706,12 +2706,14 @@ // First, we get the value of the LHS in the first iteration: n SCEVHandle Start = AddRec->getOperand(0); - // Then, we get the value of the LHS in the first iteration in which the - // above condition doesn't hold. This equals to max(m,n). if (executesAtLeastOnce(L, isSigned, - SE.getMinusSCEV(AddRec->getOperand(0), One), RHS)) + SE.getMinusSCEV(AddRec->getOperand(0), One), RHS)) { + // Since we know that the condition is true in order to enter the loop, + // we know that it will run exactly m-n times. return SE.getMinusSCEV(RHS, Start); - else { + } else { + // Then, we get the value of the LHS in the first iteration in which the + // above condition doesn't hold. This equals to max(m,n). SCEVHandle End = isSigned ? SE.getSMaxExpr(RHS, Start) : SE.getUMaxExpr(RHS, Start); From nicholas at mxc.ca Mon Jul 14 22:40:48 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 14 Jul 2008 20:40:48 -0700 Subject: [llvm-commits] [llvm] r53508 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect1.ll test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect2.ll In-Reply-To: References: <200807120741.m6C7fWYG015242@zion.cs.uiuc.edu> Message-ID: <487C1C40.2030901@mxc.ca> Dan Gohman wrote: > On Jul 12, 2008, at 12:41 AM, Nick Lewycky wrote: >> + if (!PreCondLHS->getType()->isInteger()) return false; > > This check looks redundant; a ICMP_[SU][LG]T that's used by a > conditional > branch will always have integer operands. Can you make this an assert > instead? No, it could be a icmp between two pointers. >> + >> + return LHS == getSCEV(PreCondLHS) && RHS == getSCEV(PreCondRHS); >> +} >> + >> /// HowManyLessThans - Return the number of times a backedge >> containing the >> /// specified less-than comparison will execute. If not computable, >> return >> /// UnknownValue. >> @@ -2640,12 +2708,17 @@ >> >> // Then, we get the value of the LHS in the first iteration in >> which the >> // above condition doesn't hold. This equals to max(m,n). > > This comment is now stale. Can you update it to reflect the > new logic? Done! Nick From nicholas at mxc.ca Mon Jul 14 22:47:44 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 15 Jul 2008 03:47:44 -0000 Subject: [llvm-commits] [llvm] r53587 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <200807150347.m6F3liYh003784@zion.cs.uiuc.edu> Author: nicholas Date: Mon Jul 14 22:47:44 2008 New Revision: 53587 URL: http://llvm.org/viewvc/llvm-project?rev=53587&view=rev Log: Correct this inversion! I swear that didn't show up in svn diff... Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=53587&r1=53586&r2=53587&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Jul 14 22:47:44 2008 @@ -2675,7 +2675,7 @@ return false; } - if (PreCondLHS->getType()->isInteger()) return false; + if (!PreCondLHS->getType()->isInteger()) return false; return LHS == getSCEV(PreCondLHS) && RHS == getSCEV(PreCondRHS); } From wangmp at apple.com Tue Jul 15 00:28:35 2008 From: wangmp at apple.com (Mon P Wang) Date: Tue, 15 Jul 2008 05:28:35 -0000 Subject: [llvm-commits] [llvm] r53590 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200807150528.m6F5SZHP007003@zion.cs.uiuc.edu> Author: wangmp Date: Tue Jul 15 00:28:34 2008 New Revision: 53590 URL: http://llvm.org/viewvc/llvm-project?rev=53590&view=rev Log: Fixed potential bug if the source and target of a bit convert have different alignment Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=53590&r1=53589&r2=53590&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Jul 15 00:28:34 2008 @@ -7015,7 +7015,9 @@ // The input is a scalar or single-element vector. // Lower to a store/load so that it can be split. // FIXME: this could be improved probably. - SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType()); + unsigned LdAlign = TLI.getTargetData()->getPrefTypeAlignment( + Op.getValueType().getTypeForMVT()); + SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType(), LdAlign); int FI = cast(Ptr.Val)->getIndex(); SDOperand St = DAG.getStore(DAG.getEntryNode(), From clattner at apple.com Tue Jul 15 01:35:41 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 14 Jul 2008 23:35:41 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <1677BB2F-C7C7-44F1-8709-857F68D22151@apple.com> References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> <1677BB2F-C7C7-44F1-8709-857F68D22151@apple.com> Message-ID: <46A9E161-9B4E-41DE-9540-04E24D180B3A@apple.com> On Jul 14, 2008, at 3:12 PM, Dale Johannesen wrote: >> Does this build if you configure with --enable-languages=c (i.e., no >> objc support)? >> >> -Chris > > Yes, see stub-objc.c. There are other references in expr.c. excellent! -Chris From anton at korobeynikov.info Mon Jul 14 13:46:35 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 14 Jul 2008 22:46:35 +0400 Subject: [llvm-commits] [LLVMdev] Spilled variables using unaligned moves In-Reply-To: References: <000301c8e5c0$0c63d590$252b80b0$@net> Message-ID: Hello, Evan > This is on Windows / Cygwin? I think the dynamic stack pointer re- > alignment doesn't happen until post- register allocation. Actually it's split into two parts. One is just small hook at pre-RA level, which determines, whether stack realignment is really needed, and if yes - "reserves" it during RA. The biggest part runs indeed at post-RA phase, but it just realigns stack and translates 'virtual offsets' into real ones. For aligned variables virtual offsets should be already aligned at this stage. ---- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From baldrick at free.fr Tue Jul 15 02:34:16 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Jul 2008 09:34:16 +0200 Subject: [llvm-commits] [llvm] r53534 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-07-13-DivZero.ll test/Transforms/InstCombine/udiv_select_to_select_shift.ll In-Reply-To: <5CDF57FA-B3FC-4E57-9E73-21BEF7BC3B9C@apple.com> References: <200807140015.m6E0FroD004171@zion.cs.uiuc.edu> <200807140932.04483.baldrick@free.fr> <5CDF57FA-B3FC-4E57-9E73-21BEF7BC3B9C@apple.com> Message-ID: <200807150934.16714.baldrick@free.fr> > >> + // If we found a call to a function, we can't assume it will > >> return, so > >> + // information from below it cannot be propagated above it. > >> + if (isa(BBI) && !isa(BBI)) > >> + break; > > > > I guess you only really need to exit here if SI is zero. Sorry, I confused SI with the original instruction I. What I meant was that you always transform uses as long as they are below the original DivRem in the basic block; if they come before the DivRem then you have to be careful about calls that do not return. Ciao, Duncan. From baldrick at free.fr Tue Jul 15 02:39:33 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Jul 2008 09:39:33 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> Message-ID: <200807150939.33980.baldrick@free.fr> Hi Dale, > + // For ObjC2, we may have a base class field that should not be taken into > + // account here, as it is already in Offset. The ObjC FE figures this out. > + tree field_bit_offset = objc_v2_bitfield_ivar_bitpos(exp); > + if (field_bit_offset) { > + BitStart = (unsigned)getINTEGER_CSTVal(field_bit_offset); > + } > // Here BitStart gives the offset of the field in bits from field_offset. > // Incorporate as much of it as possible into the pointer computation. > unsigned ByteOffset = BitStart/8; I didn't understand from your description what is going on here. Can you please explain some more. Thanks, Duncan. From baldrick at free.fr Tue Jul 15 02:42:09 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Jul 2008 09:42:09 +0200 Subject: [llvm-commits] [llvm] r53586 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp In-Reply-To: <200807150340.m6F3eSEE003543@zion.cs.uiuc.edu> References: <200807150340.m6F3eSEE003543@zion.cs.uiuc.edu> Message-ID: <200807150942.09544.baldrick@free.fr> Hi Nick, > Fix up comments. ... > - if (!PreCondLHS->getType()->isInteger()) return false; > + if (PreCondLHS->getType()->isInteger()) return false; This doesn't look like a comment. Ciao, Duncan. From matthijs at stdin.nl Tue Jul 15 04:11:17 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 09:11:17 -0000 Subject: [llvm-commits] [llvm] r53601 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200807150911.m6F9BIkN027481@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 04:11:16 2008 New Revision: 53601 URL: http://llvm.org/viewvc/llvm-project?rev=53601&view=rev Log: Let DAE keep a list of live functions, instead of simply marking all arguments and return values live for those functions. This doesn't change anything yet, but prepares for the coming commits. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=53601&r1=53600&r2=53601&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jul 15 04:11:16 2008 @@ -110,9 +110,12 @@ UseMap Uses; typedef std::set LiveSet; + typedef std::set LiveFuncSet; /// This set contains all values that have been determined to be live. LiveSet LiveValues; + /// This set contains all values that are cannot be changed in any way. + LiveFuncSet LiveFunctions; typedef SmallVector UseVector; @@ -291,8 +294,8 @@ /// live, it adds Use to the MaybeLiveUses argument. Returns the determined /// liveness of Use. DAE::Liveness DAE::MarkIfNotLive(RetOrArg Use, UseVector &MaybeLiveUses) { - // We're live if our use is already marked as live. - if (LiveValues.count(Use)) + // We're live if our use or its Function is already marked as live. + if (LiveFunctions.count(Use.F) || LiveValues.count(Use)) return Live; // We're maybe live otherwise, but remember that we must become live if @@ -530,18 +533,23 @@ /// values (according to Uses) live as well. void DAE::MarkLive(const Function &F) { DOUT << "DAE - Intrinsically live fn: " << F.getName() << "\n"; + // Mark the function as live. + LiveFunctions.insert(&F); // Mark all arguments as live. for (unsigned i = 0, e = F.arg_size(); i != e; ++i) - MarkLive(CreateArg(&F, i)); + PropagateLiveness(CreateArg(&F, i)); // Mark all return values as live. for (unsigned i = 0, e = NumRetVals(&F); i != e; ++i) - MarkLive(CreateRet(&F, i)); + PropagateLiveness(CreateRet(&F, i)); } /// MarkLive - Mark the given return value or argument as live. Additionally, /// mark any values that are used by this value (according to Uses) live as /// well. void DAE::MarkLive(const RetOrArg &RA) { + if (LiveFunctions.count(RA.F)) + return; // Function was already marked Live. + if (!LiveValues.insert(RA).second) return; // We were already marked Live. @@ -571,8 +579,8 @@ // the function to not have these arguments and return values. // bool DAE::RemoveDeadStuffFromFunction(Function *F) { - // Quick exit path for external functions - if (!F->hasInternalLinkage() && (!ShouldHackArguments() || F->isIntrinsic())) + // Don't modify fully live functions + if (LiveFunctions.count(F)) return false; // Start by computing a new prototype for the function, which is the same as From matthijs at stdin.nl Tue Jul 15 03:53:36 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 08:53:36 -0000 Subject: [llvm-commits] [llvm] r53598 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200807150853.m6F8rbId024059@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 03:53:36 2008 New Revision: 53598 URL: http://llvm.org/viewvc/llvm-project?rev=53598&view=rev Log: Simplify debug code by using RetOrArg::getDescription(). Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=53598&r1=53597&r2=53598&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jul 15 03:53:36 2008 @@ -544,12 +544,7 @@ if (!LiveValues.insert(RA).second) return; // We were already marked Live. - if (RA.IsArg) - DOUT << "DAE - Marking argument " << RA.Idx << " to function " - << RA.F->getNameStart() << " live\n"; - else - DOUT << "DAE - Marking return value " << RA.Idx << " of function " - << RA.F->getNameStart() << " live\n"; + DOUT << "DAE - Marking " << RA.getDescription() << " live\n"; // We don't use upper_bound (or equal_range) here, because our recursive call // to ourselves is likely to cause the upper_bound (which is the first value From matthijs at stdin.nl Tue Jul 15 04:00:17 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 09:00:17 -0000 Subject: [llvm-commits] [llvm] r53600 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200807150900.m6F90I4s024352@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 04:00:17 2008 New Revision: 53600 URL: http://llvm.org/viewvc/llvm-project?rev=53600&view=rev Log: Split DAE::MarkLive into MarkLive and PropagateLiveness. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=53600&r1=53599&r2=53600&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jul 15 04:00:17 2008 @@ -134,6 +134,7 @@ const UseVector &MaybeLiveUses); void MarkLive(const RetOrArg &RA); void MarkLive(const Function &F); + void PropagateLiveness(const RetOrArg &RA); bool RemoveDeadStuffFromFunction(Function *F); bool DeleteDeadVarargs(Function &Fn); }; @@ -545,7 +546,12 @@ return; // We were already marked Live. DOUT << "DAE - Marking " << RA.getDescription() << " live\n"; + PropagateLiveness(RA); +} +/// PropagateLiveness - Given that RA is a live value, propagate it's liveness +/// to any other values it uses (according to Uses). +void DAE::PropagateLiveness(const RetOrArg &RA) { // We don't use upper_bound (or equal_range) here, because our recursive call // to ourselves is likely to cause the upper_bound (which is the first value // not belonging to RA) to become erased and the iterator invalidated. From matthijs at stdin.nl Tue Jul 15 03:56:49 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 08:56:49 -0000 Subject: [llvm-commits] [llvm] r53599 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200807150856.m6F8unag024163@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 03:56:49 2008 New Revision: 53599 URL: http://llvm.org/viewvc/llvm-project?rev=53599&view=rev Log: Pass around const RetOrArg references instead of copying values. Also, mark RetOrArg::getDescription() as const. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=53599&r1=53598&r2=53599&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jul 15 03:56:49 2008 @@ -70,7 +70,7 @@ return F == O.F && Idx == O.Idx && IsArg == O.IsArg; } - std::string getDescription() { + std::string getDescription() const { return std::string((IsArg ? "Argument #" : "Return value #")) + utostr(Idx) + " of function " + F->getName(); } @@ -132,7 +132,7 @@ void SurveyFunction(Function &F); void MarkValue(const RetOrArg &RA, Liveness L, const UseVector &MaybeLiveUses); - void MarkLive(RetOrArg RA); + void MarkLive(const RetOrArg &RA); void MarkLive(const Function &F); bool RemoveDeadStuffFromFunction(Function *F); bool DeleteDeadVarargs(Function &Fn); @@ -540,7 +540,7 @@ /// MarkLive - Mark the given return value or argument as live. Additionally, /// mark any values that are used by this value (according to Uses) live as /// well. -void DAE::MarkLive(RetOrArg RA) { +void DAE::MarkLive(const RetOrArg &RA) { if (!LiveValues.insert(RA).second) return; // We were already marked Live. From matthijs at stdin.nl Tue Jul 15 03:45:13 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 08:45:13 -0000 Subject: [llvm-commits] [llvm] r53591 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200807150845.m6F8jDVE023682@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 03:45:12 2008 New Revision: 53591 URL: http://llvm.org/viewvc/llvm-project?rev=53591&view=rev Log: Move the deadargelim code for intrinsically alive functions into its own method, to slightly simplify control flow. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=53591&r1=53590&r2=53591&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jul 15 03:45:12 2008 @@ -133,6 +133,7 @@ void MarkValue(const RetOrArg &RA, Liveness L, const UseVector &MaybeLiveUses); void MarkLive(RetOrArg RA); + void MarkLive(const Function &F); bool RemoveDeadStuffFromFunction(Function *F); bool DeleteDeadVarargs(Function &Fn); }; @@ -397,7 +398,6 @@ // well as arguments to functions which have their "address taken". // void DAE::SurveyFunction(Function &F) { - bool FunctionIntrinsicallyLive = false; unsigned RetCount = NumRetVals(&F); // Assume all return values are dead typedef SmallVector RetVals; @@ -414,14 +414,15 @@ if (RI->getNumOperands() != 0 && RI->getOperand(0)->getType() != F.getFunctionType()->getReturnType()) { // We don't support old style multiple return values. - FunctionIntrinsicallyLive = true; - break; + MarkLive(F); + return; } - if (!F.hasInternalLinkage() && (!ShouldHackArguments() || F.isIntrinsic())) - FunctionIntrinsicallyLive = true; + if (!F.hasInternalLinkage() && (!ShouldHackArguments() || F.isIntrinsic())) { + MarkLive(F); + return; + } - if (!FunctionIntrinsicallyLive) { DOUT << "DAE - Inspecting callers for fn: " << F.getName() << "\n"; // Keep track of the number of live retvals, so we can skip checks once all // of them turn out to be live. @@ -432,16 +433,16 @@ // If the function is PASSED IN as an argument, its address has been // taken. if (I.getOperandNo() != 0) { - FunctionIntrinsicallyLive = true; - break; + MarkLive(F); + return; } // If this use is anything other than a call site, the function is alive. CallSite CS = CallSite::get(*I); Instruction *TheCall = CS.getInstruction(); if (!TheCall) { // Not a direct call site? - FunctionIntrinsicallyLive = true; - break; + MarkLive(F); + return; } // If we end up here, we are looking at a direct call to our function. @@ -480,19 +481,6 @@ } } } - } - if (FunctionIntrinsicallyLive) { - DOUT << "DAE - Intrinsically live fn: " << F.getName() << "\n"; - // Mark all arguments as live. - unsigned i = 0; - for (unsigned i = 0, e = F.arg_size(); i != e; ++i) - MarkLive(CreateArg(&F, i)); - // Mark all return values as live. - i = 0; - for (unsigned i = 0; i != RetCount; ++i) - MarkLive(CreateRet(&F, i)); - return; - } // Now we've inspected all callers, record the liveness of our return values. for (unsigned i = 0; i != RetCount; ++i) @@ -535,6 +523,20 @@ } } +/// MarkLive - Mark the given Function as alive, meaning that it cannot be +/// changed in any way. Additionally, +/// mark any values that are used as this function's parameters or by its return +/// values (according to Uses) live as well. +void DAE::MarkLive(const Function &F) { + DOUT << "DAE - Intrinsically live fn: " << F.getName() << "\n"; + // Mark all arguments as live. + for (unsigned i = 0, e = F.arg_size(); i != e; ++i) + MarkLive(CreateArg(&F, i)); + // Mark all return values as live. + for (unsigned i = 0, e = NumRetVals(&F); i != e; ++i) + MarkLive(CreateRet(&F, i)); +} + /// MarkLive - Mark the given return value or argument as live. Additionally, /// mark any values that are used by this value (according to Uses) live as /// well. From matthijs at stdin.nl Tue Jul 15 03:47:32 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 08:47:32 -0000 Subject: [llvm-commits] [llvm] r53592 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200807150847.m6F8lWR6023786@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 03:47:32 2008 New Revision: 53592 URL: http://llvm.org/viewvc/llvm-project?rev=53592&view=rev Log: Fix indentation (intentionally left out of the previous commit). Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=53592&r1=53591&r2=53592&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jul 15 03:47:32 2008 @@ -423,64 +423,64 @@ return; } - DOUT << "DAE - Inspecting callers for fn: " << F.getName() << "\n"; - // Keep track of the number of live retvals, so we can skip checks once all - // of them turn out to be live. - unsigned NumLiveRetVals = 0; - const Type *STy = dyn_cast(F.getReturnType()); - // Loop all uses of the function. - for (Value::use_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) { - // If the function is PASSED IN as an argument, its address has been - // taken. - if (I.getOperandNo() != 0) { - MarkLive(F); - return; - } + DOUT << "DAE - Inspecting callers for fn: " << F.getName() << "\n"; + // Keep track of the number of live retvals, so we can skip checks once all + // of them turn out to be live. + unsigned NumLiveRetVals = 0; + const Type *STy = dyn_cast(F.getReturnType()); + // Loop all uses of the function. + for (Value::use_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) { + // If the function is PASSED IN as an argument, its address has been + // taken. + if (I.getOperandNo() != 0) { + MarkLive(F); + return; + } - // If this use is anything other than a call site, the function is alive. - CallSite CS = CallSite::get(*I); - Instruction *TheCall = CS.getInstruction(); - if (!TheCall) { // Not a direct call site? - MarkLive(F); - return; - } + // If this use is anything other than a call site, the function is alive. + CallSite CS = CallSite::get(*I); + Instruction *TheCall = CS.getInstruction(); + if (!TheCall) { // Not a direct call site? + MarkLive(F); + return; + } - // If we end up here, we are looking at a direct call to our function. + // If we end up here, we are looking at a direct call to our function. - // Now, check how our return value(s) is/are used in this caller. Don't - // bother checking return values if all of them are live already. - if (NumLiveRetVals != RetCount) { - if (STy) { - // Check all uses of the return value. - for (Value::use_iterator I = TheCall->use_begin(), - E = TheCall->use_end(); I != E; ++I) { - ExtractValueInst *Ext = dyn_cast(*I); - if (Ext && Ext->hasIndices()) { - // This use uses a part of our return value, survey the uses of - // that part and store the results for this index only. - unsigned Idx = *Ext->idx_begin(); - if (RetValLiveness[Idx] != Live) { - RetValLiveness[Idx] = SurveyUses(Ext, MaybeLiveRetUses[Idx]); - if (RetValLiveness[Idx] == Live) - NumLiveRetVals++; - } - } else { - // Used by something else than extractvalue. Mark all return - // values as live. - for (unsigned i = 0; i != RetCount; ++i ) - RetValLiveness[i] = Live; - NumLiveRetVals = RetCount; - break; + // Now, check how our return value(s) is/are used in this caller. Don't + // bother checking return values if all of them are live already. + if (NumLiveRetVals != RetCount) { + if (STy) { + // Check all uses of the return value. + for (Value::use_iterator I = TheCall->use_begin(), + E = TheCall->use_end(); I != E; ++I) { + ExtractValueInst *Ext = dyn_cast(*I); + if (Ext && Ext->hasIndices()) { + // This use uses a part of our return value, survey the uses of + // that part and store the results for this index only. + unsigned Idx = *Ext->idx_begin(); + if (RetValLiveness[Idx] != Live) { + RetValLiveness[Idx] = SurveyUses(Ext, MaybeLiveRetUses[Idx]); + if (RetValLiveness[Idx] == Live) + NumLiveRetVals++; } - } - } else { - // Single return value - RetValLiveness[0] = SurveyUses(TheCall, MaybeLiveRetUses[0]); - if (RetValLiveness[0] == Live) + } else { + // Used by something else than extractvalue. Mark all return + // values as live. + for (unsigned i = 0; i != RetCount; ++i ) + RetValLiveness[i] = Live; NumLiveRetVals = RetCount; + break; + } } + } else { + // Single return value + RetValLiveness[0] = SurveyUses(TheCall, MaybeLiveRetUses[0]); + if (RetValLiveness[0] == Live) + NumLiveRetVals = RetCount; } } + } // Now we've inspected all callers, record the liveness of our return values. for (unsigned i = 0; i != RetCount; ++i) From baldrick at free.fr Tue Jul 15 05:12:35 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Jul 2008 10:12:35 -0000 Subject: [llvm-commits] [llvm] r53602 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Message-ID: <200807151012.m6FACaA0030778@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jul 15 05:12:34 2008 New Revision: 53602 URL: http://llvm.org/viewvc/llvm-project?rev=53602&view=rev Log: Reorder the integer promotion methods alphabetically. No change in functionality. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=53602&r1=53601&r2=53602&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Tue Jul 15 05:12:34 2008 @@ -53,19 +53,31 @@ #endif assert(0 && "Do not know how to promote this operator!"); abort(); - case ISD::UNDEF: Result = PromoteIntRes_UNDEF(N); break; - case ISD::Constant: Result = PromoteIntRes_Constant(N); break; - + case ISD::BIT_CONVERT: Result = PromoteIntRes_BIT_CONVERT(N); break; + case ISD::BUILD_PAIR: Result = PromoteIntRes_BUILD_PAIR(N); break; + case ISD::Constant: Result = PromoteIntRes_Constant(N); break; + case ISD::CTLZ: Result = PromoteIntRes_CTLZ(N); break; + case ISD::CTPOP: Result = PromoteIntRes_CTPOP(N); break; + case ISD::CTTZ: Result = PromoteIntRes_CTTZ(N); break; + case ISD::EXTRACT_VECTOR_ELT: + Result = PromoteIntRes_EXTRACT_VECTOR_ELT(N); break; + case ISD::LOAD: Result = PromoteIntRes_LOAD(cast(N));break; + case ISD::SELECT: Result = PromoteIntRes_SELECT(N); break; + case ISD::SELECT_CC: Result = PromoteIntRes_SELECT_CC(N); break; + case ISD::SETCC: Result = PromoteIntRes_SETCC(N); break; + case ISD::SHL: Result = PromoteIntRes_SHL(N); break; + case ISD::SRA: Result = PromoteIntRes_SRA(N); break; + case ISD::SRL: Result = PromoteIntRes_SRL(N); break; case ISD::TRUNCATE: Result = PromoteIntRes_TRUNCATE(N); break; + case ISD::UNDEF: Result = PromoteIntRes_UNDEF(N); break; + case ISD::VAARG: Result = PromoteIntRes_VAARG(N); break; + case ISD::SIGN_EXTEND: case ISD::ZERO_EXTEND: case ISD::ANY_EXTEND: Result = PromoteIntRes_INT_EXTEND(N); break; + case ISD::FP_TO_SINT: - case ISD::FP_TO_UINT: Result = PromoteIntRes_FP_TO_XINT(N); break; - case ISD::SETCC: Result = PromoteIntRes_SETCC(N); break; - case ISD::LOAD: Result = PromoteIntRes_LOAD(cast(N)); break; - case ISD::BUILD_PAIR: Result = PromoteIntRes_BUILD_PAIR(N); break; - case ISD::BIT_CONVERT: Result = PromoteIntRes_BIT_CONVERT(N); break; + case ISD::FP_TO_UINT: Result = PromoteIntRes_FP_TO_XINT(N); break; case ISD::AND: case ISD::OR: @@ -79,23 +91,6 @@ case ISD::UDIV: case ISD::UREM: Result = PromoteIntRes_UDIV(N); break; - - case ISD::SHL: Result = PromoteIntRes_SHL(N); break; - case ISD::SRA: Result = PromoteIntRes_SRA(N); break; - case ISD::SRL: Result = PromoteIntRes_SRL(N); break; - - case ISD::SELECT: Result = PromoteIntRes_SELECT(N); break; - case ISD::SELECT_CC: Result = PromoteIntRes_SELECT_CC(N); break; - - case ISD::CTLZ: Result = PromoteIntRes_CTLZ(N); break; - case ISD::CTPOP: Result = PromoteIntRes_CTPOP(N); break; - case ISD::CTTZ: Result = PromoteIntRes_CTTZ(N); break; - - case ISD::EXTRACT_VECTOR_ELT: - Result = PromoteIntRes_EXTRACT_VECTOR_ELT(N); - break; - - case ISD::VAARG : Result = PromoteIntRes_VAARG(N); break; } // If Result is null, the sub-method took care of registering the result. @@ -103,121 +98,6 @@ SetPromotedInteger(SDOperand(N, ResNo), Result); } -SDOperand DAGTypeLegalizer::PromoteIntRes_UNDEF(SDNode *N) { - return DAG.getNode(ISD::UNDEF, TLI.getTypeToTransformTo(N->getValueType(0))); -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_Constant(SDNode *N) { - MVT VT = N->getValueType(0); - // Zero extend things like i1, sign extend everything else. It shouldn't - // matter in theory which one we pick, but this tends to give better code? - unsigned Opc = VT.isByteSized() ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND; - SDOperand Result = DAG.getNode(Opc, TLI.getTypeToTransformTo(VT), - SDOperand(N, 0)); - assert(isa(Result) && "Didn't constant fold ext?"); - return Result; -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_TRUNCATE(SDNode *N) { - SDOperand Res; - - switch (getTypeAction(N->getOperand(0).getValueType())) { - default: assert(0 && "Unknown type action!"); - case Legal: - case ExpandInteger: - Res = N->getOperand(0); - break; - case PromoteInteger: - Res = GetPromotedInteger(N->getOperand(0)); - break; - } - - MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); - assert(Res.getValueType().getSizeInBits() >= NVT.getSizeInBits() && - "Truncation doesn't make sense!"); - if (Res.getValueType() == NVT) - return Res; - - // Truncate to NVT instead of VT - return DAG.getNode(ISD::TRUNCATE, NVT, Res); -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_INT_EXTEND(SDNode *N) { - MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); - - if (getTypeAction(N->getOperand(0).getValueType()) == PromoteInteger) { - SDOperand Res = GetPromotedInteger(N->getOperand(0)); - assert(Res.getValueType().getSizeInBits() <= NVT.getSizeInBits() && - "Extension doesn't make sense!"); - - // If the result and operand types are the same after promotion, simplify - // to an in-register extension. - if (NVT == Res.getValueType()) { - // The high bits are not guaranteed to be anything. Insert an extend. - if (N->getOpcode() == ISD::SIGN_EXTEND) - return DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Res, - DAG.getValueType(N->getOperand(0).getValueType())); - if (N->getOpcode() == ISD::ZERO_EXTEND) - return DAG.getZeroExtendInReg(Res, N->getOperand(0).getValueType()); - assert(N->getOpcode() == ISD::ANY_EXTEND && "Unknown integer extension!"); - return Res; - } - } - - // Otherwise, just extend the original operand all the way to the larger type. - return DAG.getNode(N->getOpcode(), NVT, N->getOperand(0)); -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_FP_TO_XINT(SDNode *N) { - unsigned NewOpc = N->getOpcode(); - MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); - - // If we're promoting a UINT to a larger size, check to see if the new node - // will be legal. If it isn't, check to see if FP_TO_SINT is legal, since - // we can use that instead. This allows us to generate better code for - // FP_TO_UINT for small destination sizes on targets where FP_TO_UINT is not - // legal, such as PowerPC. - if (N->getOpcode() == ISD::FP_TO_UINT) { - if (!TLI.isOperationLegal(ISD::FP_TO_UINT, NVT) && - (TLI.isOperationLegal(ISD::FP_TO_SINT, NVT) || - TLI.getOperationAction(ISD::FP_TO_SINT, NVT)==TargetLowering::Custom)) - NewOpc = ISD::FP_TO_SINT; - } - - return DAG.getNode(NewOpc, NVT, N->getOperand(0)); -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_SETCC(SDNode *N) { - assert(isTypeLegal(TLI.getSetCCResultType(N->getOperand(0))) - && "SetCC type is not legal??"); - return DAG.getNode(ISD::SETCC, TLI.getSetCCResultType(N->getOperand(0)), - N->getOperand(0), N->getOperand(1), N->getOperand(2)); -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_LOAD(LoadSDNode *N) { - assert(ISD::isUNINDEXEDLoad(N) && "Indexed load during type legalization!"); - MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); - ISD::LoadExtType ExtType = - ISD::isNON_EXTLoad(N) ? ISD::EXTLOAD : N->getExtensionType(); - SDOperand Res = DAG.getExtLoad(ExtType, NVT, N->getChain(), N->getBasePtr(), - N->getSrcValue(), N->getSrcValueOffset(), - N->getMemoryVT(), N->isVolatile(), - N->getAlignment()); - - // Legalized the chain result - switch anything that used the old chain to - // use the new one. - ReplaceValueWith(SDOperand(N, 1), Res.getValue(1)); - return Res; -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_BUILD_PAIR(SDNode *N) { - // The pair element type may be legal, or may not promote to the same type as - // the result, for example i14 = BUILD_PAIR (i7, i7). Handle all cases. - return DAG.getNode(ISD::ANY_EXTEND, - TLI.getTypeToTransformTo(N->getValueType(0)), - JoinIntegers(N->getOperand(0), N->getOperand(1))); -} - SDOperand DAGTypeLegalizer::PromoteIntRes_BIT_CONVERT(SDNode *N) { SDOperand InOp = N->getOperand(0); MVT InVT = InOp.getValueType(); @@ -268,72 +148,23 @@ return PromoteIntRes_LOAD(cast(Op.Val)); } -SDOperand DAGTypeLegalizer::PromoteIntRes_SimpleIntBinOp(SDNode *N) { - // The input may have strange things in the top bits of the registers, but - // these operations don't care. They may have weird bits going out, but - // that too is okay if they are integer operations. - SDOperand LHS = GetPromotedInteger(N->getOperand(0)); - SDOperand RHS = GetPromotedInteger(N->getOperand(1)); - return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS); -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_SDIV(SDNode *N) { - // Sign extend the input. - SDOperand LHS = GetPromotedInteger(N->getOperand(0)); - SDOperand RHS = GetPromotedInteger(N->getOperand(1)); - MVT VT = N->getValueType(0); - LHS = DAG.getNode(ISD::SIGN_EXTEND_INREG, LHS.getValueType(), LHS, - DAG.getValueType(VT)); - RHS = DAG.getNode(ISD::SIGN_EXTEND_INREG, RHS.getValueType(), RHS, - DAG.getValueType(VT)); - - return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS); -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_UDIV(SDNode *N) { - // Zero extend the input. - SDOperand LHS = GetPromotedInteger(N->getOperand(0)); - SDOperand RHS = GetPromotedInteger(N->getOperand(1)); - MVT VT = N->getValueType(0); - LHS = DAG.getZeroExtendInReg(LHS, VT); - RHS = DAG.getZeroExtendInReg(RHS, VT); - - return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS); -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_SHL(SDNode *N) { - return DAG.getNode(ISD::SHL, TLI.getTypeToTransformTo(N->getValueType(0)), - GetPromotedInteger(N->getOperand(0)), N->getOperand(1)); -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_SRA(SDNode *N) { - // The input value must be properly sign extended. - MVT VT = N->getValueType(0); - MVT NVT = TLI.getTypeToTransformTo(VT); - SDOperand Res = GetPromotedInteger(N->getOperand(0)); - Res = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Res, DAG.getValueType(VT)); - return DAG.getNode(ISD::SRA, NVT, Res, N->getOperand(1)); +SDOperand DAGTypeLegalizer::PromoteIntRes_BUILD_PAIR(SDNode *N) { + // The pair element type may be legal, or may not promote to the same type as + // the result, for example i14 = BUILD_PAIR (i7, i7). Handle all cases. + return DAG.getNode(ISD::ANY_EXTEND, + TLI.getTypeToTransformTo(N->getValueType(0)), + JoinIntegers(N->getOperand(0), N->getOperand(1))); } -SDOperand DAGTypeLegalizer::PromoteIntRes_SRL(SDNode *N) { - // The input value must be properly zero extended. +SDOperand DAGTypeLegalizer::PromoteIntRes_Constant(SDNode *N) { MVT VT = N->getValueType(0); - MVT NVT = TLI.getTypeToTransformTo(VT); - SDOperand Res = ZExtPromotedInteger(N->getOperand(0)); - return DAG.getNode(ISD::SRL, NVT, Res, N->getOperand(1)); -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_SELECT(SDNode *N) { - SDOperand LHS = GetPromotedInteger(N->getOperand(1)); - SDOperand RHS = GetPromotedInteger(N->getOperand(2)); - return DAG.getNode(ISD::SELECT, LHS.getValueType(), N->getOperand(0),LHS,RHS); -} - -SDOperand DAGTypeLegalizer::PromoteIntRes_SELECT_CC(SDNode *N) { - SDOperand LHS = GetPromotedInteger(N->getOperand(2)); - SDOperand RHS = GetPromotedInteger(N->getOperand(3)); - return DAG.getNode(ISD::SELECT_CC, LHS.getValueType(), N->getOperand(0), - N->getOperand(1), LHS, RHS, N->getOperand(4)); + // Zero extend things like i1, sign extend everything else. It shouldn't + // matter in theory which one we pick, but this tends to give better code? + unsigned Opc = VT.isByteSized() ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND; + SDOperand Result = DAG.getNode(Opc, TLI.getTypeToTransformTo(VT), + SDOperand(N, 0)); + assert(isa(Result) && "Didn't constant fold ext?"); + return Result; } SDOperand DAGTypeLegalizer::PromoteIntRes_CTLZ(SDNode *N) { @@ -414,42 +245,206 @@ return DAG.getNode(ISD::SELECT, NewVT, Odd, Hi, Lo); } -SDOperand DAGTypeLegalizer::PromoteIntRes_VAARG(SDNode *N) { - SDOperand Chain = N->getOperand(0); // Get the chain. - SDOperand Ptr = N->getOperand(1); // Get the pointer. - MVT VT = N->getValueType(0); - - const Value *V = cast(N->getOperand(2))->getValue(); - SDOperand VAList = DAG.getLoad(TLI.getPointerTy(), Chain, Ptr, V, 0); - - // Increment the arg pointer, VAList, to the next vaarg - // FIXME: should the ABI size be used for the increment? Think of - // x86 long double (10 bytes long, but aligned on 4 or 8 bytes) or - // integers of unusual size (such MVT::i1, which gives an increment - // of zero here!). - unsigned Increment = VT.getSizeInBits() / 8; - SDOperand Tmp = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList, - DAG.getConstant(Increment, TLI.getPointerTy())); - - // Store the incremented VAList to the pointer. - Tmp = DAG.getStore(VAList.getValue(1), Tmp, Ptr, V, 0); +SDOperand DAGTypeLegalizer::PromoteIntRes_FP_TO_XINT(SDNode *N) { + unsigned NewOpc = N->getOpcode(); + MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); - // Load the actual argument out of the arg pointer VAList. - Tmp = DAG.getExtLoad(ISD::EXTLOAD, TLI.getTypeToTransformTo(VT), Tmp, - VAList, NULL, 0, VT); + // If we're promoting a UINT to a larger size, check to see if the new node + // will be legal. If it isn't, check to see if FP_TO_SINT is legal, since + // we can use that instead. This allows us to generate better code for + // FP_TO_UINT for small destination sizes on targets where FP_TO_UINT is not + // legal, such as PowerPC. + if (N->getOpcode() == ISD::FP_TO_UINT) { + if (!TLI.isOperationLegal(ISD::FP_TO_UINT, NVT) && + (TLI.isOperationLegal(ISD::FP_TO_SINT, NVT) || + TLI.getOperationAction(ISD::FP_TO_SINT, NVT)==TargetLowering::Custom)) + NewOpc = ISD::FP_TO_SINT; + } - // Legalized the chain result - switch anything that used the old chain to - // use the new one. - ReplaceValueWith(SDOperand(N, 1), Tmp.getValue(1)); - return Tmp; + return DAG.getNode(NewOpc, NVT, N->getOperand(0)); } +SDOperand DAGTypeLegalizer::PromoteIntRes_INT_EXTEND(SDNode *N) { + MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); -//===----------------------------------------------------------------------===// -// Integer Operand Promotion -//===----------------------------------------------------------------------===// + if (getTypeAction(N->getOperand(0).getValueType()) == PromoteInteger) { + SDOperand Res = GetPromotedInteger(N->getOperand(0)); + assert(Res.getValueType().getSizeInBits() <= NVT.getSizeInBits() && + "Extension doesn't make sense!"); -/// PromoteIntegerOperand - This method is called when the specified operand of + // If the result and operand types are the same after promotion, simplify + // to an in-register extension. + if (NVT == Res.getValueType()) { + // The high bits are not guaranteed to be anything. Insert an extend. + if (N->getOpcode() == ISD::SIGN_EXTEND) + return DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Res, + DAG.getValueType(N->getOperand(0).getValueType())); + if (N->getOpcode() == ISD::ZERO_EXTEND) + return DAG.getZeroExtendInReg(Res, N->getOperand(0).getValueType()); + assert(N->getOpcode() == ISD::ANY_EXTEND && "Unknown integer extension!"); + return Res; + } + } + + // Otherwise, just extend the original operand all the way to the larger type. + return DAG.getNode(N->getOpcode(), NVT, N->getOperand(0)); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_LOAD(LoadSDNode *N) { + assert(ISD::isUNINDEXEDLoad(N) && "Indexed load during type legalization!"); + MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + ISD::LoadExtType ExtType = + ISD::isNON_EXTLoad(N) ? ISD::EXTLOAD : N->getExtensionType(); + SDOperand Res = DAG.getExtLoad(ExtType, NVT, N->getChain(), N->getBasePtr(), + N->getSrcValue(), N->getSrcValueOffset(), + N->getMemoryVT(), N->isVolatile(), + N->getAlignment()); + + // Legalized the chain result - switch anything that used the old chain to + // use the new one. + ReplaceValueWith(SDOperand(N, 1), Res.getValue(1)); + return Res; +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_SDIV(SDNode *N) { + // Sign extend the input. + SDOperand LHS = GetPromotedInteger(N->getOperand(0)); + SDOperand RHS = GetPromotedInteger(N->getOperand(1)); + MVT VT = N->getValueType(0); + LHS = DAG.getNode(ISD::SIGN_EXTEND_INREG, LHS.getValueType(), LHS, + DAG.getValueType(VT)); + RHS = DAG.getNode(ISD::SIGN_EXTEND_INREG, RHS.getValueType(), RHS, + DAG.getValueType(VT)); + + return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_SELECT(SDNode *N) { + SDOperand LHS = GetPromotedInteger(N->getOperand(1)); + SDOperand RHS = GetPromotedInteger(N->getOperand(2)); + return DAG.getNode(ISD::SELECT, LHS.getValueType(), N->getOperand(0),LHS,RHS); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_SELECT_CC(SDNode *N) { + SDOperand LHS = GetPromotedInteger(N->getOperand(2)); + SDOperand RHS = GetPromotedInteger(N->getOperand(3)); + return DAG.getNode(ISD::SELECT_CC, LHS.getValueType(), N->getOperand(0), + N->getOperand(1), LHS, RHS, N->getOperand(4)); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_SETCC(SDNode *N) { + assert(isTypeLegal(TLI.getSetCCResultType(N->getOperand(0))) + && "SetCC type is not legal??"); + return DAG.getNode(ISD::SETCC, TLI.getSetCCResultType(N->getOperand(0)), + N->getOperand(0), N->getOperand(1), N->getOperand(2)); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_SHL(SDNode *N) { + return DAG.getNode(ISD::SHL, TLI.getTypeToTransformTo(N->getValueType(0)), + GetPromotedInteger(N->getOperand(0)), N->getOperand(1)); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_SimpleIntBinOp(SDNode *N) { + // The input may have strange things in the top bits of the registers, but + // these operations don't care. They may have weird bits going out, but + // that too is okay if they are integer operations. + SDOperand LHS = GetPromotedInteger(N->getOperand(0)); + SDOperand RHS = GetPromotedInteger(N->getOperand(1)); + return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_SRA(SDNode *N) { + // The input value must be properly sign extended. + MVT VT = N->getValueType(0); + MVT NVT = TLI.getTypeToTransformTo(VT); + SDOperand Res = GetPromotedInteger(N->getOperand(0)); + Res = DAG.getNode(ISD::SIGN_EXTEND_INREG, NVT, Res, DAG.getValueType(VT)); + return DAG.getNode(ISD::SRA, NVT, Res, N->getOperand(1)); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_SRL(SDNode *N) { + // The input value must be properly zero extended. + MVT VT = N->getValueType(0); + MVT NVT = TLI.getTypeToTransformTo(VT); + SDOperand Res = ZExtPromotedInteger(N->getOperand(0)); + return DAG.getNode(ISD::SRL, NVT, Res, N->getOperand(1)); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_TRUNCATE(SDNode *N) { + SDOperand Res; + + switch (getTypeAction(N->getOperand(0).getValueType())) { + default: assert(0 && "Unknown type action!"); + case Legal: + case ExpandInteger: + Res = N->getOperand(0); + break; + case PromoteInteger: + Res = GetPromotedInteger(N->getOperand(0)); + break; + } + + MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + assert(Res.getValueType().getSizeInBits() >= NVT.getSizeInBits() && + "Truncation doesn't make sense!"); + if (Res.getValueType() == NVT) + return Res; + + // Truncate to NVT instead of VT + return DAG.getNode(ISD::TRUNCATE, NVT, Res); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_UDIV(SDNode *N) { + // Zero extend the input. + SDOperand LHS = GetPromotedInteger(N->getOperand(0)); + SDOperand RHS = GetPromotedInteger(N->getOperand(1)); + MVT VT = N->getValueType(0); + LHS = DAG.getZeroExtendInReg(LHS, VT); + RHS = DAG.getZeroExtendInReg(RHS, VT); + + return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_UNDEF(SDNode *N) { + return DAG.getNode(ISD::UNDEF, TLI.getTypeToTransformTo(N->getValueType(0))); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_VAARG(SDNode *N) { + SDOperand Chain = N->getOperand(0); // Get the chain. + SDOperand Ptr = N->getOperand(1); // Get the pointer. + MVT VT = N->getValueType(0); + + const Value *V = cast(N->getOperand(2))->getValue(); + SDOperand VAList = DAG.getLoad(TLI.getPointerTy(), Chain, Ptr, V, 0); + + // Increment the arg pointer, VAList, to the next vaarg + // FIXME: should the ABI size be used for the increment? Think of + // x86 long double (10 bytes long, but aligned on 4 or 8 bytes) or + // integers of unusual size (such MVT::i1, which gives an increment + // of zero here!). + unsigned Increment = VT.getSizeInBits() / 8; + SDOperand Tmp = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList, + DAG.getConstant(Increment, TLI.getPointerTy())); + + // Store the incremented VAList to the pointer. + Tmp = DAG.getStore(VAList.getValue(1), Tmp, Ptr, V, 0); + + // Load the actual argument out of the arg pointer VAList. + Tmp = DAG.getExtLoad(ISD::EXTLOAD, TLI.getTypeToTransformTo(VT), Tmp, + VAList, NULL, 0, VT); + + // Legalized the chain result - switch anything that used the old chain to + // use the new one. + ReplaceValueWith(SDOperand(N, 1), Tmp.getValue(1)); + return Tmp; +} + + +//===----------------------------------------------------------------------===// +// Integer Operand Promotion +//===----------------------------------------------------------------------===// + +/// PromoteIntegerOperand - This method is called when the specified operand of /// the specified node is found to need promotion. At this point, all of the /// result types of the node are known to be legal, but other operands of the /// node may need promotion or expansion as well as the specified one. @@ -471,31 +466,27 @@ assert(0 && "Do not know how to promote this operator's operand!"); abort(); - case ISD::ANY_EXTEND: Res = PromoteIntOp_ANY_EXTEND(N); break; - case ISD::ZERO_EXTEND: Res = PromoteIntOp_ZERO_EXTEND(N); break; - case ISD::SIGN_EXTEND: Res = PromoteIntOp_SIGN_EXTEND(N); break; - case ISD::TRUNCATE: Res = PromoteIntOp_TRUNCATE(N); break; - case ISD::FP_EXTEND: Res = PromoteIntOp_FP_EXTEND(N); break; - case ISD::FP_ROUND: Res = PromoteIntOp_FP_ROUND(N); break; - case ISD::SINT_TO_FP: - case ISD::UINT_TO_FP: Res = PromoteIntOp_INT_TO_FP(N); break; - case ISD::BUILD_PAIR: Res = PromoteIntOp_BUILD_PAIR(N); break; - - case ISD::BRCOND: Res = PromoteIntOp_BRCOND(N, OpNo); break; - case ISD::BR_CC: Res = PromoteIntOp_BR_CC(N, OpNo); break; - case ISD::SELECT: Res = PromoteIntOp_SELECT(N, OpNo); break; - case ISD::SELECT_CC: Res = PromoteIntOp_SELECT_CC(N, OpNo); break; - case ISD::SETCC: Res = PromoteIntOp_SETCC(N, OpNo); break; - - case ISD::STORE: Res = PromoteIntOp_STORE(cast(N), - OpNo); break; - + case ISD::ANY_EXTEND: Res = PromoteIntOp_ANY_EXTEND(N); break; + case ISD::BR_CC: Res = PromoteIntOp_BR_CC(N, OpNo); break; + case ISD::BRCOND: Res = PromoteIntOp_BRCOND(N, OpNo); break; + case ISD::BUILD_PAIR: Res = PromoteIntOp_BUILD_PAIR(N); break; case ISD::BUILD_VECTOR: Res = PromoteIntOp_BUILD_VECTOR(N); break; + case ISD::FP_EXTEND: Res = PromoteIntOp_FP_EXTEND(N); break; + case ISD::FP_ROUND: Res = PromoteIntOp_FP_ROUND(N); break; case ISD::INSERT_VECTOR_ELT: - Res = PromoteIntOp_INSERT_VECTOR_ELT(N, OpNo); - break; + Res = PromoteIntOp_INSERT_VECTOR_ELT(N, OpNo);break; + case ISD::MEMBARRIER: Res = PromoteIntOp_MEMBARRIER(N); break; + case ISD::SELECT: Res = PromoteIntOp_SELECT(N, OpNo); break; + case ISD::SELECT_CC: Res = PromoteIntOp_SELECT_CC(N, OpNo); break; + case ISD::SETCC: Res = PromoteIntOp_SETCC(N, OpNo); break; + case ISD::SIGN_EXTEND: Res = PromoteIntOp_SIGN_EXTEND(N); break; + case ISD::STORE: Res = PromoteIntOp_STORE(cast(N), + OpNo); break; + case ISD::TRUNCATE: Res = PromoteIntOp_TRUNCATE(N); break; + case ISD::ZERO_EXTEND: Res = PromoteIntOp_ZERO_EXTEND(N); break; - case ISD::MEMBARRIER: Res = PromoteIntOp_MEMBARRIER(N); break; + case ISD::SINT_TO_FP: + case ISD::UINT_TO_FP: Res = PromoteIntOp_INT_TO_FP(N); break; } } @@ -517,134 +508,6 @@ return false; } -SDOperand DAGTypeLegalizer::PromoteIntOp_ANY_EXTEND(SDNode *N) { - SDOperand Op = GetPromotedInteger(N->getOperand(0)); - return DAG.getNode(ISD::ANY_EXTEND, N->getValueType(0), Op); -} - -SDOperand DAGTypeLegalizer::PromoteIntOp_ZERO_EXTEND(SDNode *N) { - SDOperand Op = GetPromotedInteger(N->getOperand(0)); - Op = DAG.getNode(ISD::ANY_EXTEND, N->getValueType(0), Op); - return DAG.getZeroExtendInReg(Op, N->getOperand(0).getValueType()); -} - -SDOperand DAGTypeLegalizer::PromoteIntOp_SIGN_EXTEND(SDNode *N) { - SDOperand Op = GetPromotedInteger(N->getOperand(0)); - Op = DAG.getNode(ISD::ANY_EXTEND, N->getValueType(0), Op); - return DAG.getNode(ISD::SIGN_EXTEND_INREG, Op.getValueType(), - Op, DAG.getValueType(N->getOperand(0).getValueType())); -} - -SDOperand DAGTypeLegalizer::PromoteIntOp_TRUNCATE(SDNode *N) { - SDOperand Op = GetPromotedInteger(N->getOperand(0)); - return DAG.getNode(ISD::TRUNCATE, N->getValueType(0), Op); -} - -SDOperand DAGTypeLegalizer::PromoteIntOp_FP_EXTEND(SDNode *N) { - SDOperand Op = GetPromotedInteger(N->getOperand(0)); - return DAG.getNode(ISD::FP_EXTEND, N->getValueType(0), Op); -} - -SDOperand DAGTypeLegalizer::PromoteIntOp_FP_ROUND(SDNode *N) { - SDOperand Op = GetPromotedInteger(N->getOperand(0)); - return DAG.getNode(ISD::FP_ROUND, N->getValueType(0), Op, - DAG.getIntPtrConstant(0)); -} - -SDOperand DAGTypeLegalizer::PromoteIntOp_INT_TO_FP(SDNode *N) { - SDOperand In = GetPromotedInteger(N->getOperand(0)); - MVT OpVT = N->getOperand(0).getValueType(); - if (N->getOpcode() == ISD::UINT_TO_FP) - In = DAG.getZeroExtendInReg(In, OpVT); - else - In = DAG.getNode(ISD::SIGN_EXTEND_INREG, In.getValueType(), - In, DAG.getValueType(OpVT)); - - return DAG.UpdateNodeOperands(SDOperand(N, 0), In); -} - -SDOperand DAGTypeLegalizer::PromoteIntOp_BUILD_PAIR(SDNode *N) { - // Since the result type is legal, the operands must promote to it. - MVT OVT = N->getOperand(0).getValueType(); - SDOperand Lo = GetPromotedInteger(N->getOperand(0)); - SDOperand Hi = GetPromotedInteger(N->getOperand(1)); - assert(Lo.getValueType() == N->getValueType(0) && "Operand over promoted?"); - - Lo = DAG.getZeroExtendInReg(Lo, OVT); - Hi = DAG.getNode(ISD::SHL, N->getValueType(0), Hi, - DAG.getConstant(OVT.getSizeInBits(), - TLI.getShiftAmountTy())); - return DAG.getNode(ISD::OR, N->getValueType(0), Lo, Hi); -} - -SDOperand DAGTypeLegalizer::PromoteIntOp_SELECT(SDNode *N, unsigned OpNo) { - assert(OpNo == 0 && "Only know how to promote condition"); - SDOperand Cond = GetPromotedInteger(N->getOperand(0)); // Promote condition. - - // The top bits of the promoted condition are not necessarily zero, ensure - // that the value is properly zero extended. - unsigned BitWidth = Cond.getValueSizeInBits(); - if (!DAG.MaskedValueIsZero(Cond, - APInt::getHighBitsSet(BitWidth, BitWidth-1))) - Cond = DAG.getZeroExtendInReg(Cond, MVT::i1); - - // The chain (Op#0) and basic block destination (Op#2) are always legal types. - return DAG.UpdateNodeOperands(SDOperand(N, 0), Cond, N->getOperand(1), - N->getOperand(2)); -} - -SDOperand DAGTypeLegalizer::PromoteIntOp_BRCOND(SDNode *N, unsigned OpNo) { - assert(OpNo == 1 && "only know how to promote condition"); - SDOperand Cond = GetPromotedInteger(N->getOperand(1)); // Promote condition. - - // The top bits of the promoted condition are not necessarily zero, ensure - // that the value is properly zero extended. - unsigned BitWidth = Cond.getValueSizeInBits(); - if (!DAG.MaskedValueIsZero(Cond, - APInt::getHighBitsSet(BitWidth, BitWidth-1))) - Cond = DAG.getZeroExtendInReg(Cond, MVT::i1); - - // The chain (Op#0) and basic block destination (Op#2) are always legal types. - return DAG.UpdateNodeOperands(SDOperand(N, 0), N->getOperand(0), Cond, - N->getOperand(2)); -} - -SDOperand DAGTypeLegalizer::PromoteIntOp_BR_CC(SDNode *N, unsigned OpNo) { - assert(OpNo == 2 && "Don't know how to promote this operand!"); - - SDOperand LHS = N->getOperand(2); - SDOperand RHS = N->getOperand(3); - PromoteSetCCOperands(LHS, RHS, cast(N->getOperand(1))->get()); - - // The chain (Op#0), CC (#1) and basic block destination (Op#4) are always - // legal types. - return DAG.UpdateNodeOperands(SDOperand(N, 0), N->getOperand(0), - N->getOperand(1), LHS, RHS, N->getOperand(4)); -} - -SDOperand DAGTypeLegalizer::PromoteIntOp_SELECT_CC(SDNode *N, unsigned OpNo) { - assert(OpNo == 0 && "Don't know how to promote this operand!"); - - SDOperand LHS = N->getOperand(0); - SDOperand RHS = N->getOperand(1); - PromoteSetCCOperands(LHS, RHS, cast(N->getOperand(4))->get()); - - // The CC (#4) and the possible return values (#2 and #3) have legal types. - return DAG.UpdateNodeOperands(SDOperand(N, 0), LHS, RHS, N->getOperand(2), - N->getOperand(3), N->getOperand(4)); -} - -SDOperand DAGTypeLegalizer::PromoteIntOp_SETCC(SDNode *N, unsigned OpNo) { - assert(OpNo == 0 && "Don't know how to promote this operand!"); - - SDOperand LHS = N->getOperand(0); - SDOperand RHS = N->getOperand(1); - PromoteSetCCOperands(LHS, RHS, cast(N->getOperand(2))->get()); - - // The CC (#2) is always legal. - return DAG.UpdateNodeOperands(SDOperand(N, 0), LHS, RHS, N->getOperand(2)); -} - /// PromoteSetCCOperands - Promote the operands of a comparison. This code is /// shared among BR_CC, SELECT_CC, and SETCC handlers. void DAGTypeLegalizer::PromoteSetCCOperands(SDOperand &NewLHS,SDOperand &NewRHS, @@ -685,21 +548,52 @@ } } -SDOperand DAGTypeLegalizer::PromoteIntOp_STORE(StoreSDNode *N, unsigned OpNo){ - assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!"); - SDOperand Ch = N->getChain(), Ptr = N->getBasePtr(); - int SVOffset = N->getSrcValueOffset(); - unsigned Alignment = N->getAlignment(); - bool isVolatile = N->isVolatile(); +SDOperand DAGTypeLegalizer::PromoteIntOp_ANY_EXTEND(SDNode *N) { + SDOperand Op = GetPromotedInteger(N->getOperand(0)); + return DAG.getNode(ISD::ANY_EXTEND, N->getValueType(0), Op); +} - SDOperand Val = GetPromotedInteger(N->getValue()); // Get promoted value. +SDOperand DAGTypeLegalizer::PromoteIntOp_BR_CC(SDNode *N, unsigned OpNo) { + assert(OpNo == 2 && "Don't know how to promote this operand!"); - assert(!N->isTruncatingStore() && "Cannot promote this store operand!"); + SDOperand LHS = N->getOperand(2); + SDOperand RHS = N->getOperand(3); + PromoteSetCCOperands(LHS, RHS, cast(N->getOperand(1))->get()); - // Truncate the value and store the result. - return DAG.getTruncStore(Ch, Val, Ptr, N->getSrcValue(), - SVOffset, N->getMemoryVT(), - isVolatile, Alignment); + // The chain (Op#0), CC (#1) and basic block destination (Op#4) are always + // legal types. + return DAG.UpdateNodeOperands(SDOperand(N, 0), N->getOperand(0), + N->getOperand(1), LHS, RHS, N->getOperand(4)); +} + +SDOperand DAGTypeLegalizer::PromoteIntOp_BRCOND(SDNode *N, unsigned OpNo) { + assert(OpNo == 1 && "only know how to promote condition"); + SDOperand Cond = GetPromotedInteger(N->getOperand(1)); // Promote condition. + + // The top bits of the promoted condition are not necessarily zero, ensure + // that the value is properly zero extended. + unsigned BitWidth = Cond.getValueSizeInBits(); + if (!DAG.MaskedValueIsZero(Cond, + APInt::getHighBitsSet(BitWidth, BitWidth-1))) + Cond = DAG.getZeroExtendInReg(Cond, MVT::i1); + + // The chain (Op#0) and basic block destination (Op#2) are always legal types. + return DAG.UpdateNodeOperands(SDOperand(N, 0), N->getOperand(0), Cond, + N->getOperand(2)); +} + +SDOperand DAGTypeLegalizer::PromoteIntOp_BUILD_PAIR(SDNode *N) { + // Since the result type is legal, the operands must promote to it. + MVT OVT = N->getOperand(0).getValueType(); + SDOperand Lo = GetPromotedInteger(N->getOperand(0)); + SDOperand Hi = GetPromotedInteger(N->getOperand(1)); + assert(Lo.getValueType() == N->getValueType(0) && "Operand over promoted?"); + + Lo = DAG.getZeroExtendInReg(Lo, OVT); + Hi = DAG.getNode(ISD::SHL, N->getValueType(0), Hi, + DAG.getConstant(OVT.getSizeInBits(), + TLI.getShiftAmountTy())); + return DAG.getNode(ISD::OR, N->getValueType(0), Lo, Hi); } SDOperand DAGTypeLegalizer::PromoteIntOp_BUILD_VECTOR(SDNode *N) { @@ -736,6 +630,17 @@ return DAG.getNode(ISD::BIT_CONVERT, VecVT, NewVec); } +SDOperand DAGTypeLegalizer::PromoteIntOp_FP_EXTEND(SDNode *N) { + SDOperand Op = GetPromotedInteger(N->getOperand(0)); + return DAG.getNode(ISD::FP_EXTEND, N->getValueType(0), Op); +} + +SDOperand DAGTypeLegalizer::PromoteIntOp_FP_ROUND(SDNode *N) { + SDOperand Op = GetPromotedInteger(N->getOperand(0)); + return DAG.getNode(ISD::FP_ROUND, N->getValueType(0), Op, + DAG.getIntPtrConstant(0)); +} + SDOperand DAGTypeLegalizer::PromoteIntOp_INSERT_VECTOR_ELT(SDNode *N, unsigned OpNo) { if (OpNo == 1) { @@ -760,6 +665,18 @@ N->getOperand(1), Idx); } +SDOperand DAGTypeLegalizer::PromoteIntOp_INT_TO_FP(SDNode *N) { + SDOperand In = GetPromotedInteger(N->getOperand(0)); + MVT OpVT = N->getOperand(0).getValueType(); + if (N->getOpcode() == ISD::UINT_TO_FP) + In = DAG.getZeroExtendInReg(In, OpVT); + else + In = DAG.getNode(ISD::SIGN_EXTEND_INREG, In.getValueType(), + In, DAG.getValueType(OpVT)); + + return DAG.UpdateNodeOperands(SDOperand(N, 0), In); +} + SDOperand DAGTypeLegalizer::PromoteIntOp_MEMBARRIER(SDNode *N) { SDOperand NewOps[6]; NewOps[0] = N->getOperand(0); @@ -771,6 +688,80 @@ array_lengthof(NewOps)); } +SDOperand DAGTypeLegalizer::PromoteIntOp_SELECT(SDNode *N, unsigned OpNo) { + assert(OpNo == 0 && "Only know how to promote condition"); + SDOperand Cond = GetPromotedInteger(N->getOperand(0)); // Promote condition. + + // The top bits of the promoted condition are not necessarily zero, ensure + // that the value is properly zero extended. + unsigned BitWidth = Cond.getValueSizeInBits(); + if (!DAG.MaskedValueIsZero(Cond, + APInt::getHighBitsSet(BitWidth, BitWidth-1))) + Cond = DAG.getZeroExtendInReg(Cond, MVT::i1); + + // The chain (Op#0) and basic block destination (Op#2) are always legal types. + return DAG.UpdateNodeOperands(SDOperand(N, 0), Cond, N->getOperand(1), + N->getOperand(2)); +} + +SDOperand DAGTypeLegalizer::PromoteIntOp_SELECT_CC(SDNode *N, unsigned OpNo) { + assert(OpNo == 0 && "Don't know how to promote this operand!"); + + SDOperand LHS = N->getOperand(0); + SDOperand RHS = N->getOperand(1); + PromoteSetCCOperands(LHS, RHS, cast(N->getOperand(4))->get()); + + // The CC (#4) and the possible return values (#2 and #3) have legal types. + return DAG.UpdateNodeOperands(SDOperand(N, 0), LHS, RHS, N->getOperand(2), + N->getOperand(3), N->getOperand(4)); +} + +SDOperand DAGTypeLegalizer::PromoteIntOp_SETCC(SDNode *N, unsigned OpNo) { + assert(OpNo == 0 && "Don't know how to promote this operand!"); + + SDOperand LHS = N->getOperand(0); + SDOperand RHS = N->getOperand(1); + PromoteSetCCOperands(LHS, RHS, cast(N->getOperand(2))->get()); + + // The CC (#2) is always legal. + return DAG.UpdateNodeOperands(SDOperand(N, 0), LHS, RHS, N->getOperand(2)); +} + +SDOperand DAGTypeLegalizer::PromoteIntOp_SIGN_EXTEND(SDNode *N) { + SDOperand Op = GetPromotedInteger(N->getOperand(0)); + Op = DAG.getNode(ISD::ANY_EXTEND, N->getValueType(0), Op); + return DAG.getNode(ISD::SIGN_EXTEND_INREG, Op.getValueType(), + Op, DAG.getValueType(N->getOperand(0).getValueType())); +} + +SDOperand DAGTypeLegalizer::PromoteIntOp_STORE(StoreSDNode *N, unsigned OpNo){ + assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!"); + SDOperand Ch = N->getChain(), Ptr = N->getBasePtr(); + int SVOffset = N->getSrcValueOffset(); + unsigned Alignment = N->getAlignment(); + bool isVolatile = N->isVolatile(); + + SDOperand Val = GetPromotedInteger(N->getValue()); // Get promoted value. + + assert(!N->isTruncatingStore() && "Cannot promote this store operand!"); + + // Truncate the value and store the result. + return DAG.getTruncStore(Ch, Val, Ptr, N->getSrcValue(), + SVOffset, N->getMemoryVT(), + isVolatile, Alignment); +} + +SDOperand DAGTypeLegalizer::PromoteIntOp_TRUNCATE(SDNode *N) { + SDOperand Op = GetPromotedInteger(N->getOperand(0)); + return DAG.getNode(ISD::TRUNCATE, N->getValueType(0), Op); +} + +SDOperand DAGTypeLegalizer::PromoteIntOp_ZERO_EXTEND(SDNode *N) { + SDOperand Op = GetPromotedInteger(N->getOperand(0)); + Op = DAG.getNode(ISD::ANY_EXTEND, N->getValueType(0), Op); + return DAG.getZeroExtendInReg(Op, N->getOperand(0).getValueType()); +} + //===----------------------------------------------------------------------===// // Integer Result Expansion From baldrick at free.fr Tue Jul 15 05:14:24 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Jul 2008 10:14:24 -0000 Subject: [llvm-commits] [llvm] r53603 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h test/CodeGen/PowerPC/2008-07-15-SignExtendInreg.ll Message-ID: <200807151014.m6FAEObI030841@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jul 15 05:14:24 2008 New Revision: 53603 URL: http://llvm.org/viewvc/llvm-project?rev=53603&view=rev Log: LegalizeTypes support for promotion of SIGN_EXTEND_INREG. Added: llvm/trunk/test/CodeGen/PowerPC/2008-07-15-SignExtendInreg.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=53603&r1=53602&r2=53603&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Tue Jul 15 05:14:24 2008 @@ -66,6 +66,8 @@ case ISD::SELECT_CC: Result = PromoteIntRes_SELECT_CC(N); break; case ISD::SETCC: Result = PromoteIntRes_SETCC(N); break; case ISD::SHL: Result = PromoteIntRes_SHL(N); break; + case ISD::SIGN_EXTEND_INREG: + Result = PromoteIntRes_SIGN_EXTEND_INREG(N); break; case ISD::SRA: Result = PromoteIntRes_SRA(N); break; case ISD::SRL: Result = PromoteIntRes_SRL(N); break; case ISD::TRUNCATE: Result = PromoteIntRes_TRUNCATE(N); break; @@ -344,6 +346,12 @@ GetPromotedInteger(N->getOperand(0)), N->getOperand(1)); } +SDOperand DAGTypeLegalizer::PromoteIntRes_SIGN_EXTEND_INREG(SDNode *N) { + SDOperand Op = GetPromotedInteger(N->getOperand(0)); + return DAG.getNode(ISD::SIGN_EXTEND_INREG, Op.getValueType(), Op, + N->getOperand(1)); +} + SDOperand DAGTypeLegalizer::PromoteIntRes_SimpleIntBinOp(SDNode *N) { // The input may have strange things in the top bits of the registers, but // these operations don't care. They may have weird bits going out, but Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=53603&r1=53602&r2=53603&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Tue Jul 15 05:14:24 2008 @@ -228,6 +228,7 @@ SDOperand PromoteIntRes_SETCC(SDNode *N); SDOperand PromoteIntRes_SHL(SDNode *N); SDOperand PromoteIntRes_SimpleIntBinOp(SDNode *N); + SDOperand PromoteIntRes_SIGN_EXTEND_INREG(SDNode *N); SDOperand PromoteIntRes_SRA(SDNode *N); SDOperand PromoteIntRes_SRL(SDNode *N); SDOperand PromoteIntRes_TRUNCATE(SDNode *N); Added: llvm/trunk/test/CodeGen/PowerPC/2008-07-15-SignExtendInreg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2008-07-15-SignExtendInreg.ll?rev=53603&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/2008-07-15-SignExtendInreg.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/2008-07-15-SignExtendInreg.ll Tue Jul 15 05:14:24 2008 @@ -0,0 +1,17 @@ +; RUN: llvm-as < %s | llc +target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128" +target triple = "powerpc-apple-darwin9" + +define i16 @t(i16* %dct) signext nounwind { +entry: + load i16* null, align 2 ; :0 [#uses=2] + lshr i16 %0, 11 ; :1 [#uses=0] + trunc i16 %0 to i8 ; :2 [#uses=1] + sext i8 %2 to i16 ; :3 [#uses=1] + add i16 0, %3 ; :4 [#uses=1] + sext i16 %4 to i32 ; :5 [#uses=1] + %dcval.0.in = shl i32 %5, 0 ; [#uses=1] + %dcval.0 = trunc i32 %dcval.0.in to i16 ; [#uses=1] + store i16 %dcval.0, i16* %dct, align 2 + ret i16 0 +} From baldrick at free.fr Tue Jul 15 05:18:23 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Jul 2008 10:18:23 -0000 Subject: [llvm-commits] [llvm] r53604 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h test/CodeGen/PowerPC/2008-07-15-Bswap.ll Message-ID: <200807151018.m6FAINsF030963@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jul 15 05:18:22 2008 New Revision: 53604 URL: http://llvm.org/viewvc/llvm-project?rev=53604&view=rev Log: LegalizeTypes support for promotion of bswap. In LegalizeDAG the value is zero-extended to the new type before byte swapping. It doesn't matter how the extension is done since the new bits are shifted off anyway after the swap, so extend by any old rubbish bits. This results in the final assembler for the testcase being one line shorter. Added: llvm/trunk/test/CodeGen/PowerPC/2008-07-15-Bswap.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=53604&r1=53603&r2=53604&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Tue Jul 15 05:18:22 2008 @@ -54,6 +54,7 @@ assert(0 && "Do not know how to promote this operator!"); abort(); case ISD::BIT_CONVERT: Result = PromoteIntRes_BIT_CONVERT(N); break; + case ISD::BSWAP: Result = PromoteIntRes_BSWAP(N); break; case ISD::BUILD_PAIR: Result = PromoteIntRes_BUILD_PAIR(N); break; case ISD::Constant: Result = PromoteIntRes_Constant(N); break; case ISD::CTLZ: Result = PromoteIntRes_CTLZ(N); break; @@ -150,6 +151,16 @@ return PromoteIntRes_LOAD(cast(Op.Val)); } +SDOperand DAGTypeLegalizer::PromoteIntRes_BSWAP(SDNode *N) { + SDOperand Op = GetPromotedInteger(N->getOperand(0)); + MVT OVT = N->getValueType(0); + MVT NVT = Op.getValueType(); + + unsigned DiffBits = NVT.getSizeInBits() - OVT.getSizeInBits(); + return DAG.getNode(ISD::SRL, NVT, DAG.getNode(ISD::BSWAP, NVT, Op), + DAG.getConstant(DiffBits, TLI.getShiftAmountTy())); +} + SDOperand DAGTypeLegalizer::PromoteIntRes_BUILD_PAIR(SDNode *N) { // The pair element type may be legal, or may not promote to the same type as // the result, for example i14 = BUILD_PAIR (i7, i7). Handle all cases. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=53604&r1=53603&r2=53604&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Tue Jul 15 05:18:22 2008 @@ -213,6 +213,7 @@ // Integer Result Promotion. void PromoteIntegerResult(SDNode *N, unsigned ResNo); SDOperand PromoteIntRes_BIT_CONVERT(SDNode *N); + SDOperand PromoteIntRes_BSWAP(SDNode *N); SDOperand PromoteIntRes_BUILD_PAIR(SDNode *N); SDOperand PromoteIntRes_Constant(SDNode *N); SDOperand PromoteIntRes_CTLZ(SDNode *N); Added: llvm/trunk/test/CodeGen/PowerPC/2008-07-15-Bswap.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2008-07-15-Bswap.ll?rev=53604&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/2008-07-15-Bswap.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/2008-07-15-Bswap.ll Tue Jul 15 05:18:22 2008 @@ -0,0 +1,386 @@ +; RUN: llvm-as < %s | llc +target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128" +target triple = "powerpc-apple-darwin9" + %struct.BiPartSrcDescriptor = type <{ %"struct.BiPartSrcDescriptor::$_105" }> + %"struct.BiPartSrcDescriptor::$_105" = type { %struct.BiPartSrcDescriptor_NO_VECTOR_ALIGNMENT_size_is_16 } + %struct.BiPartSrcDescriptor_NO_VECTOR_ALIGNMENT_size_is_16 = type { [2 x %struct.MotionVectors], [2 x i8], %struct.Map4x4ToPartIdx, [2 x i8], i8, i8 } + %struct.Condv = type opaque + %struct.DHBFLayerId = type { i8 } + %struct.DecodeComplexityInfo = type { i32, i32, i32, i32, %"struct.DecodeComplexityInfo::IntraStats", %"struct.DecodeComplexityInfo::InterStats" } + %"struct.DecodeComplexityInfo::InterStats" = type { i32, i32, i32, i32, [5 x i32], [3 x i32], [4 x [4 x i32]], [4 x i32], i32, %struct.MotionVectors, %struct.MotionVectors } + %"struct.DecodeComplexityInfo::IntraStats" = type { i32, i32, i32, [5 x i32], [3 x i32], [4 x i32], [3 x i32] } + %struct.DecodeComplexityOptions = type { i8, i8, i32, double, i8, float, i8, float, i8, i8, i8, i8, i8 } + %struct.DescriptorAllocator = type { %struct.Mutex*, %struct.Mutex*, i8**, i32, i32, i8**, i32, i32, i8**, i32, i32 } + %struct.DetailsFromSliceType = type <{ i8 }> + %struct.FlatnessAnalysis = type { i16, i16, i32, i32*, i8*, [512 x i32], [256 x i32] } + %struct.Frame = type <{ i8, i8, i8, i8, i8, [3 x i8], i32, i32, %struct.Mutex*, %struct.Condv*, [8 x i8], %struct.FramePixels, %struct.FrameMotionVectorCache, %struct.FrameIndex, i32, i8*, i8*, i8*, i8*, i16*, %struct.FlatnessAnalysis, %struct.NoiseAnalysis, %struct.VisualActivity, %struct.FrameMotionInfo, %struct.FrameMotionAnalysis, %struct.FrameDataRateParameters, %struct.FrameEncoderTags, %struct.DecodeComplexityInfo, %struct.DecodeComplexityOptions, %struct.MotionInfoFor16x16_FasterSP*, [1 x i32] }> + %struct.FrameDataRateParameters = type { i32, float, i8, i8 } + %struct.FrameEncoderTags = type { i8, i8, i32, i8, i8, float } + %struct.FrameIndex = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i32, i32, %struct.Frame*, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, %struct.DHBFLayerId } + %struct.FrameMotionAnalysis = type { i32, i32, i32, %struct.MoEstMotion16x16*, %struct.MbAnalysis*, i32, i32, i16, i16, i32, i32, i32, i32, i8, i8 } + %struct.FrameMotionInfo = type { i32, i32, %struct.MoEstMbMotionInfo*, i32, i32, i32, i32, i32 } + %struct.FrameMotionVectorCache = type <{ %struct.ThreadAllocator**, i32, i32, i32, %struct.BiPartSrcDescriptor, %struct.BiPartSrcDescriptor, %struct.BiPartSrcDescriptor, [3 x %struct.BiPartSrcDescriptor*], %struct.BiPartSrcDescriptor** }> + %struct.FramePixels = type <{ i8, i8, i8, i8, i8, i8, i8, i8, i8*, i8*, i32, [4 x i8*], [4 x i8*], [2 x [4 x i32]], [2 x [4 x i32]], %struct.PixelData, %struct.InterpolationCache*, %struct.InterpolationCache*, %struct.InterpolationCache*, [16 x i16], [16 x i16], [12 x i8], %"struct.PortableSInt32Array<4>", %"struct.PortableSInt32Array<8>", %struct.ICOffsetArraysY, %struct.UVSrcOffsetEtcX_Struct*, i32*, i32*, [3 x i32] }> + %struct.ICOffsetArraysY = type { [21 x i32], [21 x i32], [4 x [21 x i32]] } + %struct.InterpolationCache = type opaque + %struct.LoopFilterInfo = type { %struct.BiPartSrcDescriptor**, i32, i32, i32, i32, i32*, i32, %"struct.LoopFilterInfo::SliceInfoStruct"*, i32, %struct.Mutex*, i16*, %struct.FramePixels*, i8*, i8*, i8*, i8*, i8*, %struct.PerMacroblockBoundaryStrengths*, %struct.Mutex*, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8*, i8*, i8, void (i8*, i8*, i32, i32, i32, i32, i32, i8*, i32)*, void (i8*, i8*, i32, i32, i32, i32, i32, i8*, i32, i8*)*, i32 } + %"struct.LoopFilterInfo::SliceInfoStruct" = type { %"struct.LoopFilterInfo::SliceInfoStruct::LFDisableStats", i8, i8, i8, i8, [17 x %struct.Frame*], [17 x %struct.Frame*] } + %"struct.LoopFilterInfo::SliceInfoStruct::LFDisableStats" = type { i32, i32 } + %struct.LoopFilterParam = type { i32, %struct.LoopFilterInfo*, %struct.FramePixels*, %struct.FrameMotionVectorCache* } + %struct.Map4x4ToPartIdx = type { i16 } + %struct.MbAnalysis = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, %struct.RdCost, %struct.RdCost, i32 } + %struct.MoEstMbMotionInfo = type { i32, i32, i32, i32, [16 x %struct.MoEstPartMotionInfo] } + %struct.MoEstMotion16x16 = type { [2 x i8], [2 x %struct.MotionVectors], i8, [3 x %struct.MoEstPredCost] } + %struct.MoEstPartMotionInfo = type { i32, %struct.PartGeom, i32, i32, [2 x %struct.MotionVectors], [2 x i8], i16 } + %struct.MoEstPredCost = type { i32, i16, i16 } + %struct.MotionInfoFor16x16_FasterSP = type { [2 x %struct.MotionVectors], [2 x i8], i8, [2 x i32], i32, i32 } + %struct.MotionVectors = type { %"struct.MotionVectors::$_103" } + %"struct.MotionVectors::$_103" = type { i32 } + %struct.Mutex = type opaque + %struct.NoiseAnalysis = type { i16, i16, i32, i8*, i8*, i8*, [512 x i32] } + %struct.PartGeom = type { %struct.Map4x4ToPartIdx } + %struct.PerMacroblockBoundaryStrengths = type { [16 x i8], [16 x i8], [4 x i8], [4 x i8], [2 x i32] } + %struct.PixelData = type { i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8 } + %"struct.PortableSInt32Array<4>" = type { [4 x i32] } + %"struct.PortableSInt32Array<8>" = type { [8 x i32] } + %struct.RdCost = type { i32, i32, i32, double } + %struct.ThreadAllocator = type { %struct.DescriptorAllocator*, %struct.BiPartSrcDescriptor*, [256 x %struct.BiPartSrcDescriptor*], i32, i32, i32 } + %struct.ThreadedBatch = type opaque + %struct.UVSrcOffsetEtcX_Struct = type <{ i16 }> + %struct.VisualActivity = type { i16, i16, i32, i32, i32*, i32*, i32, i32, i32*, i32, i32, i32, i32, i32, i8*, i32, [2 x i32], i32, i32, i32, i16*, i16, i16, i16, i16, float, i8*, i32*, i32, i32, i8 } + at _ZL33table_8_14_indexA_to_alpha_scalar = external constant [64 x i8] ; <[64 x i8]*> [#uses=0] + at _ZL32table_8_14_indexB_to_beta_scalar = external constant [64 x i8] ; <[64 x i8]*> [#uses=0] + at _ZL34table_8_15_indexA_bS_to_tc0_scalar = external constant [64 x [4 x i8]] ; <[64 x [4 x i8]]*> [#uses=0] + at gkDummy = external global i32 ; [#uses=0] + at gkDetailsFromSliceTypeArray = external constant [10 x %struct.DetailsFromSliceType] ; <[10 x %struct.DetailsFromSliceType]*> [#uses=0] + +declare i32 @_Z20LoopFilter_ConstructP14LoopFilterInfojj(%struct.LoopFilterInfo*, i32, i32) + +declare i32 @_Z25LF_Threading2_assert_doneP14LoopFilterInfo(%struct.LoopFilterInfo*) nounwind + +declare i32 @_Z54S_CalcIfLargeMVDeltaForBMbBothPredictionsFromSameFramePK19BiPartSrcDescriptorS1_ijj(%struct.BiPartSrcDescriptor*, %struct.BiPartSrcDescriptor*, i32, i32, i32) nounwind + +declare void @_Z30LoopFilter_Internal_FilterLumaPhiiiiii(i8*, i32, i32, i32, i32, i32, i32) nounwind + +declare void @_Z33LoopFilter_Internal_FilterChromaVPhiiiiiiiiii(i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32) nounwind + +declare void @_Z33LoopFilter_Internal_FilterChromaHPhiiiiii(i8*, i32, i32, i32, i32, i32, i32) nounwind + +declare void @_Z42LoopFilter_Internal_filter_macroblock_lumaPK14LoopFilterInfoPhS2_iiiPK30PerMacroblockBoundaryStrengthsjj(%struct.LoopFilterInfo*, i8*, i8*, i32, i32, i32, %struct.PerMacroblockBoundaryStrengths*, i32, i32) nounwind + +declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind + +declare i32 @_Z40LoopFilter_Internal_FilterLumaPlaneMBAFFPK14LoopFilterInfojjj(%struct.LoopFilterInfo*, i32, i32, i32) nounwind + +declare void @_Z18LoopFilter_DestroyP14LoopFilterInfo(%struct.LoopFilterInfo*) + +declare void @MutexDispose(%struct.Mutex*) + +declare void @_ZdaPv(i8*) nounwind + +declare void @jvtDisposePTRVectorAligned(i8*) + +declare void @jvtDisposePTR(i8*) + +declare void @jvtDisposePTRMemAligned(i8*) + +declare void @_Z31LoopFilter_Internal_ResetTablesP14LoopFilterInfo(%struct.LoopFilterInfo*) nounwind + +declare void @llvm.memset.i32(i8*, i8, i32, i32) nounwind + +define i32 @_Z60LoopFilter_Internal_CalculateBoundaryStrengths_MbaffFramePicPK14LoopFilterInfoP22FrameMotionVectorCachejj(%struct.LoopFilterInfo* %lfiPtr, %struct.FrameMotionVectorCache* %frameMotionVectorCachePtr, i32 %mbY_min, i32 %mbY_maxPlus1) nounwind { +entry: + icmp ult i32 %mbY_min, %mbY_maxPlus1 ; :0 [#uses=1] + br i1 %0, label %bb16, label %bb642 + +bb16: ; preds = %entry + bitcast %struct.PerMacroblockBoundaryStrengths* null to i32* ; :1 [#uses=3] + getelementptr i32* %1, i32 1 ; :2 [#uses=0] + getelementptr i32* %1, i32 2 ; :3 [#uses=0] + getelementptr i32* %1, i32 3 ; :4 [#uses=0] + bitcast [16 x i8]* null to i32* ; :5 [#uses=3] + getelementptr i32* %5, i32 1 ; :6 [#uses=0] + getelementptr i32* %5, i32 2 ; :7 [#uses=0] + getelementptr i32* %5, i32 3 ; :8 [#uses=0] + icmp eq i32 0, 0 ; :9 [#uses=0] + lshr i32 0, 30 ; :10 [#uses=0] + and i32 0, 268435455 ; :11 [#uses=0] + lshr i32 0, 28 ; :12 [#uses=1] + and i32 %12, 3 ; :13 [#uses=0] + and i32 0, 1 ; :14 [#uses=1] + icmp eq i32 %14, 0 ; :15 [#uses=0] + zext i8 0 to i32 ; :16 [#uses=1] + %.not656 = icmp ne i32 0, 0 ; [#uses=1] + icmp eq i8 0, 0 ; :17 [#uses=0] + trunc i32 0 to i8 ; :18 [#uses=2] + add i32 0, 1 ; :19 [#uses=1] + %.not658 = icmp ne i32 0, 0 ; [#uses=1] + and i32 0, 268369920 ; :20 [#uses=1] + icmp eq i32 %20, 268369920 ; :21 [#uses=2] + getelementptr %struct.PerMacroblockBoundaryStrengths* null, i32 0, i32 2 ; <[4 x i8]*>:22 [#uses=1] + getelementptr %struct.PerMacroblockBoundaryStrengths* null, i32 0, i32 2, i32 0 ; :23 [#uses=0] + and i32 0, -2 ; :24 [#uses=1] + add i32 %24, -1 ; :25 [#uses=0] + bitcast [4 x i8]* %22 to i32* ; :26 [#uses=3] + getelementptr i32* %26, i32 1 ; :27 [#uses=0] + getelementptr i32* %26, i32 2 ; :28 [#uses=0] + getelementptr i32* %26, i32 3 ; :29 [#uses=0] + br label %bb144 + +bb144: ; preds = %bb395, %bb16 + %idxEachField11.0773 = phi i32 [ 0, %bb16 ], [ %162, %bb395 ] ; [#uses=3] + %mbYLeft.2776 = phi i32 [ 0, %bb16 ], [ %mbYLeft.2776, %bb395 ] ; [#uses=3] + %mbXYLeft.2775 = phi i32 [ 0, %bb16 ], [ %mbXYLeft.2775, %bb395 ] ; [#uses=1] + %mixedModeLeftEdgeOfMbFlag.2774 = phi i32 [ 0, %bb16 ], [ 0, %bb395 ] ; [#uses=0] + %mbIndexLeft.2772 = phi i32 [ 0, %bb16 ], [ %mbIndexLeft.2772, %bb395 ] ; [#uses=2] + %boundaryStrengthsV.1771 = phi i8* [ null, %bb16 ], [ %158, %bb395 ] ; [#uses=2] + %numEdgesToTest.1770 = phi i32 [ 4, %bb16 ], [ %numEdgesToTest.2, %bb395 ] ; [#uses=1] + icmp eq i32 %idxEachField11.0773, 0 ; :30 [#uses=0] + getelementptr %struct.BiPartSrcDescriptor** null, i32 %mbIndexLeft.2772 ; <%struct.BiPartSrcDescriptor**>:31 [#uses=1] + load %struct.BiPartSrcDescriptor** %31, align 4 ; <%struct.BiPartSrcDescriptor*>:32 [#uses=0] + %fMacroblockHasNonZeroBS.4 = select i1 %21, i32 1, i32 0 ; [#uses=1] + %numEdgesToTest.2 = select i1 %21, i32 1, i32 %numEdgesToTest.1770 ; [#uses=2] + store i8 32, i8* %boundaryStrengthsV.1771, align 1 + br label %labelContinueEdgesLoopV + +bb200: ; preds = %labelContinueEdgesLoopV + lshr i32 %159, 28 ; :33 [#uses=2] + and i32 %160, %16 ; :34 [#uses=1] + icmp eq i32 %34, 0 ; :35 [#uses=0] + icmp eq i32 %160, 0 ; :36 [#uses=3] + zext i1 %36 to i32 ; :37 [#uses=1] + or i32 %37, -1 ; :38 [#uses=1] + or i32 %38, %33 ; :39 [#uses=1] + icmp eq i32 %39, 0 ; :40 [#uses=1] + br i1 %40, label %bb205, label %bb206 + +bb205: ; preds = %bb200 + store i8 32, i8* %158, align 1 + br label %labelContinueEdgesLoopV + +bb206: ; preds = %bb200 + icmp eq i32 %33, 15 ; :41 [#uses=1] + br i1 %41, label %labelContinueEdgesLoopV, label %bb210.preheader + +bb210.preheader: ; preds = %bb206 + add i32 %160, 0 ; :42 [#uses=2] + %bothcond657 = and i1 %36, %.not656 ; [#uses=0] + shl i32 %idxEachField11.0773, 1 ; :43 [#uses=1] + add i32 %43, 0 ; :44 [#uses=0] + shl i32 %mbYLeft.2776, 2 ; :45 [#uses=0] + add i32 %42, -1 ; :46 [#uses=1] + icmp eq i32 0, 0 ; :47 [#uses=1] + %brmerge689.not = and i1 %47, false ; [#uses=0] + %bothcond659 = and i1 %36, %.not658 ; [#uses=0] + shl i32 %mbYLeft.2776, 1 ; :48 [#uses=1] + or i32 %48, 0 ; :49 [#uses=1] + shl i32 %49, 1 ; :50 [#uses=0] + add i32 0, 0 ; :51 [#uses=2] + mul i32 %51, 0 ; :52 [#uses=1] + add i32 %52, %42 ; :53 [#uses=1] + mul i32 %51, 0 ; :54 [#uses=1] + add i32 %46, %54 ; :55 [#uses=1] + getelementptr %struct.BiPartSrcDescriptor** null, i32 %53 ; <%struct.BiPartSrcDescriptor**>:56 [#uses=1] + load %struct.BiPartSrcDescriptor** %56, align 4 ; <%struct.BiPartSrcDescriptor*>:57 [#uses=7] + getelementptr %struct.BiPartSrcDescriptor** null, i32 %55 ; <%struct.BiPartSrcDescriptor**>:58 [#uses=1] + load %struct.BiPartSrcDescriptor** %58, align 4 ; <%struct.BiPartSrcDescriptor*>:59 [#uses=5] + icmp slt i32 %159, 0 ; :60 [#uses=0] + icmp eq %struct.BiPartSrcDescriptor* %57, %59 ; :61 [#uses=0] + bitcast %struct.BiPartSrcDescriptor* %57 to i16* ; :62 [#uses=5] + load i16* %62, align 2 ; :63 [#uses=2] + getelementptr i16* %62, i32 1 ; :64 [#uses=1] + load i16* %64, align 2 ; :65 [#uses=2] + getelementptr i16* %62, i32 2 ; :66 [#uses=1] + load i16* %66, align 2 ; :67 [#uses=2] + getelementptr i16* %62, i32 3 ; :68 [#uses=1] + load i16* %68, align 2 ; :69 [#uses=2] + getelementptr i16* %62, i32 6 ; :70 [#uses=1] + load i16* %70, align 2 ; :71 [#uses=2] + bitcast %struct.BiPartSrcDescriptor* %59 to i16* ; :72 [#uses=5] + load i16* %72, align 2 ; :73 [#uses=2] + getelementptr i16* %72, i32 1 ; :74 [#uses=1] + load i16* %74, align 2 ; :75 [#uses=2] + getelementptr i16* %72, i32 2 ; :76 [#uses=1] + load i16* %76, align 2 ; :77 [#uses=2] + getelementptr i16* %72, i32 3 ; :78 [#uses=1] + load i16* %78, align 2 ; :79 [#uses=2] + getelementptr i16* %72, i32 6 ; :80 [#uses=1] + load i16* %80, align 2 ; :81 [#uses=2] + sub i16 %63, %73 ; :82 [#uses=3] + sub i16 %65, %75 ; :83 [#uses=3] + sub i16 %67, %77 ; :84 [#uses=3] + sub i16 %69, %79 ; :85 [#uses=3] + sub i16 %71, %81 ; :86 [#uses=3] + sub i16 0, %82 ; :87 [#uses=1] + icmp slt i16 %82, 0 ; :88 [#uses=1] + %. = select i1 %88, i16 %87, i16 %82 ; [#uses=1] + sub i16 0, %83 ; :89 [#uses=1] + icmp slt i16 %83, 0 ; :90 [#uses=1] + %.660 = select i1 %90, i16 %89, i16 %83 ; [#uses=1] + sub i16 0, %84 ; :91 [#uses=1] + icmp slt i16 %84, 0 ; :92 [#uses=1] + %.661 = select i1 %92, i16 %91, i16 %84 ; [#uses=1] + sub i16 0, %85 ; :93 [#uses=1] + icmp slt i16 %85, 0 ; :94 [#uses=1] + %.662 = select i1 %94, i16 %93, i16 %85 ; [#uses=1] + sub i16 0, %86 ; :95 [#uses=1] + icmp slt i16 %86, 0 ; :96 [#uses=1] + %.663 = select i1 %96, i16 %95, i16 %86 ; [#uses=1] + getelementptr %struct.BiPartSrcDescriptor* %57, i32 0, i32 0, i32 0, i32 1, i32 0 ; :97 [#uses=1] + load i8* %97, align 1 ; :98 [#uses=1] + zext i8 %98 to i32 ; :99 [#uses=1] + getelementptr %struct.BiPartSrcDescriptor* %57, i32 0, i32 0, i32 0, i32 1, i32 1 ; :100 [#uses=1] + load i8* %100, align 1 ; :101 [#uses=1] + zext i8 %101 to i32 ; :102 [#uses=1] + getelementptr %struct.BiPartSrcDescriptor* %57, i32 0, i32 0, i32 0, i32 3, i32 0 ; :103 [#uses=1] + load i8* %103, align 1 ; :104 [#uses=2] + zext i8 %104 to i32 ; :105 [#uses=1] + getelementptr %struct.BiPartSrcDescriptor* %59, i32 0, i32 0, i32 0, i32 3, i32 0 ; :106 [#uses=1] + load i8* %106, align 1 ; :107 [#uses=2] + zext i8 %107 to i32 ; :108 [#uses=1] + getelementptr %struct.BiPartSrcDescriptor* %57, i32 0, i32 0, i32 0, i32 3, i32 1 ; :109 [#uses=1] + load i8* %109, align 1 ; :110 [#uses=1] + zext i8 %110 to i32 ; :111 [#uses=1] + getelementptr %struct.BiPartSrcDescriptor* %59, i32 0, i32 0, i32 0, i32 3, i32 1 ; :112 [#uses=1] + load i8* %112, align 1 ; :113 [#uses=1] + zext i8 %113 to i32 ; :114 [#uses=1] + lshr i32 %99, 4 ; :115 [#uses=1] + and i32 %115, 2 ; :116 [#uses=1] + lshr i32 %102, 5 ; :117 [#uses=1] + or i32 %116, %117 ; :118 [#uses=3] + icmp eq i32 %118, 0 ; :119 [#uses=0] + icmp eq i32 %118, 1 ; :120 [#uses=1] + br i1 %120, label %bb297, label %bb298 + +bb297: ; preds = %bb210.preheader + br label %bb298 + +bb298: ; preds = %bb297, %bb210.preheader + %vu8Mask_0.1 = phi i8 [ -1, %bb297 ], [ 0, %bb210.preheader ] ; [#uses=1] + %vu8Mask_1.1 = phi i8 [ -1, %bb297 ], [ 0, %bb210.preheader ] ; [#uses=1] + %vu8Mask_2.1 = phi i8 [ -1, %bb297 ], [ 0, %bb210.preheader ] ; [#uses=0] + %vu8Mask_3.1 = phi i8 [ -1, %bb297 ], [ 0, %bb210.preheader ] ; [#uses=1] + %vu8Mask_4.1 = phi i8 [ 0, %bb297 ], [ 0, %bb210.preheader ] ; [#uses=0] + %vu8Mask_5.1 = phi i8 [ 0, %bb297 ], [ 0, %bb210.preheader ] ; [#uses=1] + %vu8Mask_6.1 = phi i8 [ 0, %bb297 ], [ 0, %bb210.preheader ] ; [#uses=0] + %vu8Mask_7.1 = phi i8 [ 0, %bb297 ], [ 0, %bb210.preheader ] ; [#uses=1] + %vu8Mask_12.1 = phi i8 [ -1, %bb297 ], [ 0, %bb210.preheader ] ; [#uses=0] + %vu8Mask_13.1 = phi i8 [ -1, %bb297 ], [ 0, %bb210.preheader ] ; [#uses=0] + icmp eq i32 %118, 2 ; :121 [#uses=0] + and i8 %vu8Mask_1.1, 3 ; :122 [#uses=0] + and i8 %vu8Mask_5.1, 3 ; :123 [#uses=0] + and i8 %vu8Mask_3.1, %18 ; :124 [#uses=0] + and i8 %vu8Mask_7.1, %18 ; :125 [#uses=0] + icmp eq i8 %104, %107 ; :126 [#uses=1] + br i1 %126, label %bb328, label %bb303 + +bb303: ; preds = %bb298 + call i16 @llvm.bswap.i16( i16 %81 ) ; :127 [#uses=1] + sub i16 %63, %77 ; :128 [#uses=3] + sub i16 %65, %79 ; :129 [#uses=3] + sub i16 %67, %73 ; :130 [#uses=3] + sub i16 %69, %75 ; :131 [#uses=3] + sub i16 %71, %127 ; :132 [#uses=3] + sub i16 0, %128 ; :133 [#uses=1] + icmp slt i16 %128, 0 ; :134 [#uses=1] + %.673 = select i1 %134, i16 %133, i16 %128 ; [#uses=1] + sub i16 0, %129 ; :135 [#uses=1] + icmp slt i16 %129, 0 ; :136 [#uses=1] + %.674 = select i1 %136, i16 %135, i16 %129 ; [#uses=1] + sub i16 0, %130 ; :137 [#uses=1] + icmp slt i16 %130, 0 ; :138 [#uses=1] + %.675 = select i1 %138, i16 %137, i16 %130 ; [#uses=1] + sub i16 0, %131 ; :139 [#uses=1] + icmp slt i16 %131, 0 ; :140 [#uses=1] + %.676 = select i1 %140, i16 %139, i16 %131 ; [#uses=1] + sub i16 0, %132 ; :141 [#uses=1] + icmp slt i16 %132, 0 ; :142 [#uses=1] + %.677 = select i1 %142, i16 %141, i16 %132 ; [#uses=1] + br label %bb328 + +bb328: ; preds = %bb303, %bb298 + %vu16Delta_0.0 = phi i16 [ %.673, %bb303 ], [ %., %bb298 ] ; [#uses=1] + %vu16Delta_1.0 = phi i16 [ %.674, %bb303 ], [ %.660, %bb298 ] ; [#uses=0] + %vu16Delta_2.0 = phi i16 [ %.675, %bb303 ], [ %.661, %bb298 ] ; [#uses=0] + %vu16Delta_3.0 = phi i16 [ %.676, %bb303 ], [ %.662, %bb298 ] ; [#uses=0] + %vu16Delta_6.0 = phi i16 [ %.677, %bb303 ], [ %.663, %bb298 ] ; [#uses=0] + lshr i16 %vu16Delta_0.0, 8 ; :143 [#uses=1] + trunc i16 %143 to i8 ; :144 [#uses=1] + and i8 %144, %vu8Mask_0.1 ; :145 [#uses=1] + icmp eq i8 %145, 0 ; :146 [#uses=0] + sub i32 %105, %114 ; :147 [#uses=1] + sub i32 %111, %108 ; :148 [#uses=1] + or i32 %147, %148 ; :149 [#uses=1] + icmp eq i32 %149, 0 ; :150 [#uses=0] + call i32 @_Z54S_CalcIfLargeMVDeltaForBMbBothPredictionsFromSameFramePK19BiPartSrcDescriptorS1_ijj( %struct.BiPartSrcDescriptor* %57, %struct.BiPartSrcDescriptor* %59, i32 %19, i32 0, i32 0 ) nounwind ; :151 [#uses=0] + unreachable + +labelContinueEdgesLoopV: ; preds = %bb206, %bb205, %bb144 + %fEdgeHasNonZeroBS.0 = phi i32 [ 0, %bb205 ], [ 0, %bb144 ], [ 1, %bb206 ] ; [#uses=2] + %fMacroblockHasNonZeroBS.6 = phi i32 [ %152, %bb205 ], [ %fMacroblockHasNonZeroBS.4, %bb144 ], [ %152, %bb206 ] ; [#uses=1] + %ixEdge.1 = phi i32 [ %160, %bb205 ], [ 0, %bb144 ], [ %160, %bb206 ] ; [#uses=1] + %bfNZ12.2 = phi i32 [ %159, %bb205 ], [ 0, %bb144 ], [ %159, %bb206 ] ; [#uses=1] + %boundaryStrengthsV.3 = phi i8* [ %158, %bb205 ], [ %boundaryStrengthsV.1771, %bb144 ], [ %158, %bb206 ] ; [#uses=3] + or i32 %fMacroblockHasNonZeroBS.6, %fEdgeHasNonZeroBS.0 ; :152 [#uses=2] + load i8* %boundaryStrengthsV.3, align 1 ; :153 [#uses=1] + trunc i32 %fEdgeHasNonZeroBS.0 to i8 ; :154 [#uses=1] + shl i8 %154, 5 ; :155 [#uses=1] + xor i8 %155, 32 ; :156 [#uses=1] + or i8 %153, %156 ; :157 [#uses=1] + store i8 %157, i8* %boundaryStrengthsV.3, align 1 + getelementptr i8* %boundaryStrengthsV.3, i32 4 ; :158 [#uses=4] + shl i32 %bfNZ12.2, 4 ; :159 [#uses=4] + add i32 %ixEdge.1, 1 ; :160 [#uses=6] + icmp ult i32 %160, %numEdgesToTest.2 ; :161 [#uses=1] + br i1 %161, label %bb200, label %bb395 + +bb395: ; preds = %labelContinueEdgesLoopV + add i32 %idxEachField11.0773, 1 ; :162 [#uses=2] + icmp ugt i32 %162, 0 ; :163 [#uses=1] + br i1 %163, label %bb398, label %bb144 + +bb398: ; preds = %bb395 + call void asm sideeffect "dcbt $0, $1", "b%,r,~{memory}"( i32 19, i32* null ) nounwind + unreachable + +bb642: ; preds = %entry + ret i32 0 +} + +declare i16 @llvm.bswap.i16(i16) nounwind readnone + +declare i8* @jvtNewPtrVectorAligned(i32) + +declare i8* @jvtNewPtr(i32) + +declare i8* @jvtNewPtrMemAligned(i32) + +declare %struct.Mutex* @MutexNew() + +declare i8* @_Znam(i32) + +declare i32 @_Z24LoopFilter_FilterMbGroupP14LoopFilterInfoP11FramePixelsP22FrameMotionVectorCacheP19ThreadedBatchStructjjij(%struct.LoopFilterInfo*, %struct.FramePixels*, %struct.FrameMotionVectorCache*, %struct.ThreadedBatch*, i32, i32, i32, i32) + +declare void @MutexLock(%struct.Mutex*) + +declare void @MutexUnlock(%struct.Mutex*) + +declare i32 @_Z35LoopFilter_Internal_FilterLumaPlanePK14LoopFilterInfojjjjj(%struct.LoopFilterInfo*, i32, i32, i32, i32, i32) + +declare i32 @_Z37LoopFilter_Internal_FilterChromaPlanePK14LoopFilterInfojjjjj(%struct.LoopFilterInfo*, i32, i32, i32, i32, i32) + +declare void @_Z44LoopFilter_Internal_filter_macroblock_chromaPK14LoopFilterInfoPhS2_iiiPK30PerMacroblockBoundaryStrengthsjj(%struct.LoopFilterInfo*, i8*, i8*, i32, i32, i32, %struct.PerMacroblockBoundaryStrengths*, i32, i32) nounwind + +declare i32 @_Z42LoopFilter_Internal_FilterChromaPlaneMBAFFPK14LoopFilterInfojjj(%struct.LoopFilterInfo*, i32, i32, i32) nounwind + +declare i32 @_Z26LF_Threading2_ProcessTasksP14LoopFilterInfoP11FramePixelsP22FrameMotionVectorCacheij(%struct.LoopFilterInfo*, %struct.FramePixels*, %struct.FrameMotionVectorCache*, i32, i32) + +declare i32 @_Z46LoopFilter_Internal_CalculateBoundaryStrengthsPK14LoopFilterInfoP22FrameMotionVectorCachejj(%struct.LoopFilterInfo*, %struct.FrameMotionVectorCache*, i32, i32) + +declare i32 @_Z44LoopFilter_Internal_FilterLumaChromaPlane_PPP14LoopFilterInfojjjjj(%struct.LoopFilterInfo*, i32, i32, i32, i32, i32) + +declare i32 @_Z22LoopFilter_FilterFrameP14LoopFilterInfoP11FramePixelsP22FrameMotionVectorCacheP19ThreadedBatchStructij(%struct.LoopFilterInfo*, %struct.FramePixels*, %struct.FrameMotionVectorCache*, %struct.ThreadedBatch*, i32, i32) + +declare void @_Z34LF_Threading2_ProcessTasks_WrapperPv(i8*) + +declare void @llvm.memset.i64(i8*, i8, i64, i32) nounwind From matthijs at stdin.nl Tue Jul 15 08:15:21 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 13:15:21 -0000 Subject: [llvm-commits] [llvm] r53605 - /llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll Message-ID: <200807151315.m6FDFLp3004066@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 08:15:10 2008 New Revision: 53605 URL: http://llvm.org/viewvc/llvm-project?rev=53605&view=rev Log: Fix typo. Modified: llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll Modified: llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll?rev=53605&r1=53604&r2=53605&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll (original) +++ llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll Tue Jul 15 08:15:10 2008 @@ -5,7 +5,7 @@ ; Check if the pass doesn't modify anything that doesn't need changing. We feed ; an unused argument to each function to lure it into changing _something_ about -; the function and then changing to much. +; the function and then changing too much. ; This checks if the struct retval isn't changed into a void From matthijs at stdin.nl Tue Jul 15 08:36:10 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 13:36:10 -0000 Subject: [llvm-commits] [llvm] r53606 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200807151336.m6FDaAWk004746@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 08:36:06 2008 New Revision: 53606 URL: http://llvm.org/viewvc/llvm-project?rev=53606&view=rev Log: Make DeadArgElim keep liveness of the return value as a whole in addition to only the liveness of partial return values (for functions returning a struct). This is more explicit to prevent unwanted changes in the return value. In particular, deadargelim now canonicalizes a function returning {i32} to returning i32 and {} to void, if the struct returned is not used in its entirety, but only the single element is used. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=53606&r1=53605&r2=53606&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jul 15 08:36:06 2008 @@ -47,12 +47,14 @@ /// Struct that represents (part of) either a return value or a function /// argument. Used so that arguments and return values can be used - /// interchangably. + /// interchangably. Idx == -1 means the entire return value, while other + /// indices mean the corresponding element in the struct return type (if + /// any). struct RetOrArg { - RetOrArg(const Function* F, unsigned Idx, bool IsArg) : F(F), Idx(Idx), + RetOrArg(const Function* F, signed Idx, bool IsArg) : F(F), Idx(Idx), IsArg(IsArg) {} const Function *F; - unsigned Idx; + signed Idx; bool IsArg; /// Make RetOrArg comparable, so we can put it into a map. @@ -71,8 +73,10 @@ } std::string getDescription() const { - return std::string((IsArg ? "Argument #" : "Return value #")) - + utostr(Idx) + " of function " + F->getName(); + return std::string((!IsArg && Idx != -1 ? "partial " : "")) + + (IsArg ? "argument #" : "return value") + + (!IsArg && Idx == -1 ? "" : " #" + utostr(Idx)) + + " of function " + F->getName(); } }; @@ -84,11 +88,11 @@ enum Liveness { Live, MaybeLive }; /// Convenience wrapper - RetOrArg CreateRet(const Function *F, unsigned Idx) { + RetOrArg CreateRet(const Function *F, signed Idx) { return RetOrArg(F, Idx, false); } /// Convenience wrapper - RetOrArg CreateArg(const Function *F, unsigned Idx) { + RetOrArg CreateArg(const Function *F, signed Idx) { return RetOrArg(F, Idx, true); } @@ -129,7 +133,7 @@ private: Liveness MarkIfNotLive(RetOrArg Use, UseVector &MaybeLiveUses); Liveness SurveyUse(Value::use_iterator U, UseVector &MaybeLiveUses, - unsigned RetValNum = 0); + signed RetValNum = -1); Liveness SurveyUses(Value *V, UseVector &MaybeLiveUses); void SurveyFunction(Function &F); @@ -278,18 +282,6 @@ return true; } -/// Convenience function that returns the number of return values. It returns 0 -/// for void functions and 1 for functions not returning a struct. It returns -/// the number of struct elements for functions returning a struct. -static unsigned NumRetVals(const Function *F) { - if (F->getReturnType() == Type::VoidTy) - return 0; - else if (const StructType *STy = dyn_cast(F->getReturnType())) - return STy->getNumElements(); - else - return 1; -} - /// MarkIfNotLive - This checks Use for liveness in LiveValues. If Use is not /// live, it adds Use to the MaybeLiveUses argument. Returns the determined /// liveness of Use. @@ -304,16 +296,15 @@ return MaybeLive; } - /// SurveyUse - This looks at a single use of an argument or return value /// and determines if it should be alive or not. Adds this use to MaybeLiveUses /// if it causes the used value to become MaybeAlive. /// /// RetValNum is the return value number to use when this use is used in a /// return instruction. This is used in the recursion, you should always leave -/// it at 0. +/// it at -1. DAE::Liveness DAE::SurveyUse(Value::use_iterator U, UseVector &MaybeLiveUses, - unsigned RetValNum) { + signed RetValNum) { Value *V = *U; if (ReturnInst *RI = dyn_cast(V)) { // The value is returned from a function. It's only live when the @@ -402,16 +393,23 @@ // well as arguments to functions which have their "address taken". // void DAE::SurveyFunction(Function &F) { - unsigned RetCount = NumRetVals(&F); + const StructType *STy = dyn_cast(F.getFunctionType()->getReturnType()); + // Store the number of partial return values, which we only have if the return + // type is a struct. + unsigned PartialRetVals = (STy ? STy->getNumElements() : 0); // Assume all return values are dead typedef SmallVector RetVals; - RetVals RetValLiveness(RetCount, MaybeLive); + // Allocate one slot for the entire return value (index 0) and one for each + // partial return value. + RetVals RetValLiveness(PartialRetVals + 1, MaybeLive); typedef SmallVector RetUses; // These vectors map each return value to the uses that make it MaybeLive, so // we can add those to the Uses map if the return value really turns out to be - // MaybeLive. Initialized to a list of RetCount empty lists. - RetUses MaybeLiveRetUses(RetCount); + // MaybeLive. + // Allocate one slot for the entire return value (index 0) and one for each + // partial return value. + RetUses MaybeLiveRetUses(PartialRetVals + 1); for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) if (ReturnInst *RI = dyn_cast(BB->getTerminator())) @@ -428,10 +426,6 @@ } DOUT << "DAE - Inspecting callers for fn: " << F.getName() << "\n"; - // Keep track of the number of live retvals, so we can skip checks once all - // of them turn out to be live. - unsigned NumLiveRetVals = 0; - const Type *STy = dyn_cast(F.getReturnType()); // Loop all uses of the function. for (Value::use_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) { // If the function is PASSED IN as an argument, its address has been @@ -452,43 +446,42 @@ // If we end up here, we are looking at a direct call to our function. // Now, check how our return value(s) is/are used in this caller. Don't - // bother checking return values if all of them are live already. - if (NumLiveRetVals != RetCount) { - if (STy) { - // Check all uses of the return value. - for (Value::use_iterator I = TheCall->use_begin(), - E = TheCall->use_end(); I != E; ++I) { - ExtractValueInst *Ext = dyn_cast(*I); - if (Ext && Ext->hasIndices()) { - // This use uses a part of our return value, survey the uses of - // that part and store the results for this index only. - unsigned Idx = *Ext->idx_begin(); - if (RetValLiveness[Idx] != Live) { - RetValLiveness[Idx] = SurveyUses(Ext, MaybeLiveRetUses[Idx]); - if (RetValLiveness[Idx] == Live) - NumLiveRetVals++; - } - } else { - // Used by something else than extractvalue. Mark all return - // values as live. - for (unsigned i = 0; i != RetCount; ++i ) - RetValLiveness[i] = Live; - NumLiveRetVals = RetCount; - break; + // bother checking return values if the entire value is live already. + if (RetValLiveness[0] != Live) { + // Check all uses of the return value. + for (Value::use_iterator I = TheCall->use_begin(), + E = TheCall->use_end(); I != E; ++I) { + ExtractValueInst *Ext = dyn_cast(*I); + if (Ext && Ext->hasIndices()) { + // This use uses a part of our return value, survey the uses of + // that part and store the results for this index only. + unsigned Idx = *Ext->idx_begin(); + // + 1 to skip the "entire retval" index (0) + Liveness &IsLive = RetValLiveness[Idx + 1]; + if (IsLive != Live) { + // Don't bother checking if this retval was already live + // Survey all uses of the extractvalue + // + 1 to skip the "entire retval" index (0) + IsLive = SurveyUses(Ext, MaybeLiveRetUses[Idx + 1]); } + } else { + // Survey this use + RetValLiveness[0] = SurveyUse(I, MaybeLiveRetUses[0]); + if (RetValLiveness[0] == Live) + break; } - } else { - // Single return value - RetValLiveness[0] = SurveyUses(TheCall, MaybeLiveRetUses[0]); - if (RetValLiveness[0] == Live) - NumLiveRetVals = RetCount; } } } // Now we've inspected all callers, record the liveness of our return values. - for (unsigned i = 0; i != RetCount; ++i) - MarkValue(CreateRet(&F, i), RetValLiveness[i], MaybeLiveRetUses[i]); + MarkValue(CreateRet(&F, -1), RetValLiveness[0], MaybeLiveRetUses[0]); + if (RetValLiveness[0] != Live) + // If the entire retval (0) is Live, MarkValue will have marked all other retvals live + // as well, so we can skip this. + for (unsigned i = 0; i != PartialRetVals; ++i) + // + 1 to skip the "entire retval" index (0) + MarkValue(CreateRet(&F, i), RetValLiveness[i + 1], MaybeLiveRetUses[i + 1]); DOUT << "DAE - Inspecting args for fn: " << F.getName() << "\n"; @@ -539,8 +532,11 @@ for (unsigned i = 0, e = F.arg_size(); i != e; ++i) PropagateLiveness(CreateArg(&F, i)); // Mark all return values as live. - for (unsigned i = 0, e = NumRetVals(&F); i != e; ++i) - PropagateLiveness(CreateRet(&F, i)); + const Type *RTy = F.getFunctionType()->getReturnType(); + if (const StructType *STy = dyn_cast(RTy)) + for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) + PropagateLiveness(CreateRet(&F, i)); + PropagateLiveness(CreateRet(&F, -1)); } /// MarkLive - Mark the given return value or argument as live. Additionally, @@ -555,6 +551,16 @@ DOUT << "DAE - Marking " << RA.getDescription() << " live\n"; PropagateLiveness(RA); + + if (!RA.IsArg && RA.Idx == -1) { + // Entire return value live? + const Type *RTy = RA.F->getFunctionType()->getReturnType(); + if (const StructType *STy = dyn_cast(RTy)) + // And the function returns a struct? + for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) + // Mark all partial return values live as well then + MarkLive(CreateRet(RA.F, i)); + } } /// PropagateLiveness - Given that RA is a live value, propagate it's liveness @@ -599,20 +605,20 @@ // Find out the new return value. const Type *RetTy = FTy->getReturnType(); + const StructType *STy = dyn_cast(RetTy); + const unsigned PartialRetVals = (STy ? STy->getNumElements() : 0); const Type *NRetTy = NULL; - unsigned RetCount = NumRetVals(F); - // Explicitly track if anything changed, for debugging. - bool Changed = false; - // -1 means unused, other numbers are the new index - SmallVector NewRetIdxs(RetCount, -1); + // -1 means unused, other numbers are the new index. Initialized to -1 for + // every partial return value we have. + SmallVector NewRetIdxs(PartialRetVals, -1); std::vector RetTypes; - if (RetTy == Type::VoidTy) { - NRetTy = Type::VoidTy; + if (LiveValues.count(CreateRet(F, -1))) { + // If the entire return value is live, leave it unchanged. + NRetTy = RetTy; } else { - const StructType *STy = dyn_cast(RetTy); - if (STy) - // Look at each of the original return values individually. - for (unsigned i = 0; i != RetCount; ++i) { + if (STy) { + // Look at each of the partial return values individually. + for (unsigned i = 0; i != PartialRetVals; ++i) { RetOrArg Ret = CreateRet(F, i); if (LiveValues.erase(Ret)) { RetTypes.push_back(STy->getElementType(i)); @@ -621,25 +627,20 @@ ++NumRetValsEliminated; DOUT << "DAE - Removing return value " << i << " from " << F->getNameStart() << "\n"; - Changed = true; + // We remove the value by not adding anything to RetTypes. } } - else - // We used to return a single value. - if (LiveValues.erase(CreateRet(F, 0))) { - RetTypes.push_back(RetTy); - NewRetIdxs[0] = 0; - } else { - DOUT << "DAE - Removing return value from " << F->getNameStart() - << "\n"; - ++NumRetValsEliminated; - Changed = true; - } - if (RetTypes.size() > 1 || (STy && STy->getNumElements()==RetTypes.size())) - // More than one return type? Return a struct with them. Also, if we used - // to return a struct and didn't change the number of return values, - // return a struct again. This prevents changing {something} into - // something and {} into void. + } else if (RetTy != Type::VoidTy) { + // We used to return a single value, which is now dead (already checked in + // the if above) + DOUT << "DAE - Removing return value from " << F->getNameStart() + << "\n"; + ++NumRetValsEliminated; + // We remove the value by not adding anything to RetTypes. + } + + if (RetTypes.size() > 1) + // More than one return type? Return a struct with them. // Make the new struct packed if we used to return a packed struct // already. NRetTy = StructType::get(RetTypes, STy->isPacked()); @@ -648,7 +649,7 @@ // return a struct with that simple value before. NRetTy = RetTypes.front(); else if (RetTypes.size() == 0) - // No return types? Make it void, but only if we didn't use to return {}. + // No return types? Make it void. NRetTy = Type::VoidTy; } @@ -688,7 +689,6 @@ ++NumArgumentsEliminated; DOUT << "DAE - Removing argument " << i << " (" << I->getNameStart() << ") from " << F->getNameStart() << "\n"; - Changed = true; } } @@ -714,11 +714,6 @@ if (NFTy == FTy) return false; - // The function type is only allowed to be different if we actually left out - // an argument or return value. - assert(Changed && "Function type changed while no arguments or return values" - "were removed!"); - // Create the new function body and insert it into the module... Function *NF = Function::Create(NFTy, F->getLinkage()); NF->copyAttributesFrom(F); @@ -803,39 +798,42 @@ "void. The old return type must have" "been a struct!"); // The original return value was a struct, update all uses (which are - // all extractvalue instructions). + // all extractvalue instructions, or uses that are unused themselves). for (Value::use_iterator I = Call->use_begin(), E = Call->use_end(); I != E;) { - assert(isa(*I) && "Return value not only used by" - "extractvalue?"); - ExtractValueInst *EV = cast(*I); - // Increment now, since we're about to throw away this use. - ++I; - assert(EV->hasIndices() && "Return value used by extractvalue without" - "indices?"); - unsigned Idx = *EV->idx_begin(); - if (NewRetIdxs[Idx] != -1) { - if (RetTypes.size() > 1) { - // We're still returning a struct, create a new extractvalue - // instruction with the first index updated - std::vector NewIdxs(EV->idx_begin(), EV->idx_end()); - NewIdxs[0] = NewRetIdxs[Idx]; - Value *NEV = ExtractValueInst::Create(New, NewIdxs.begin(), - NewIdxs.end(), "retval", - EV); - EV->replaceAllUsesWith(NEV); - EV->eraseFromParent(); + if (ExtractValueInst *EV = dyn_cast(*I)) { + // Increment now, since we're about to throw away this use. + ++I; + assert(EV->hasIndices() && "Return value used by extractvalue without" + "indices?"); + unsigned Idx = *EV->idx_begin(); + if (NewRetIdxs[Idx] != -1) { + if (RetTypes.size() > 1) { + // We're still returning a struct, create a new extractvalue + // instruction with the first index updated + std::vector NewIdxs(EV->idx_begin(), EV->idx_end()); + NewIdxs[0] = NewRetIdxs[Idx]; + Value *NEV = ExtractValueInst::Create(New, NewIdxs.begin(), + NewIdxs.end(), "retval", + EV); + EV->replaceAllUsesWith(NEV); + EV->eraseFromParent(); + } else { + // We are now only returning a simple value, remove the + // extractvalue. + EV->replaceAllUsesWith(New); + EV->eraseFromParent(); + } } else { - // We are now only returning a simple value, remove the - // extractvalue. - EV->replaceAllUsesWith(New); + // Value unused, replace uses by null for now, they will get removed + // later on. + EV->replaceAllUsesWith(Constant::getNullValue(EV->getType())); EV->eraseFromParent(); } } else { - // Value unused, replace uses by null for now, they will get removed - // later on. - EV->replaceAllUsesWith(Constant::getNullValue(EV->getType())); - EV->eraseFromParent(); + // Not an extractvalue, so this use will become dead soon. Just + // replace it with null. + I.getUse().set(Constant::getNullValue(I.getUse().get()->getType())); } } New->takeName(Call); @@ -888,7 +886,7 @@ Value *OldRet = RI->getOperand(0); // Start out building up our return value from undef RetVal = llvm::UndefValue::get(NRetTy); - for (unsigned i = 0; i != RetCount; ++i) + for (unsigned i = 0; i != PartialRetVals; ++i) if (NewRetIdxs[i] != -1) { ExtractValueInst *EV = ExtractValueInst::Create(OldRet, i, "oldret", RI); From matthijs at stdin.nl Tue Jul 15 08:39:09 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 13:39:09 -0000 Subject: [llvm-commits] [llvm] r53607 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200807151339.m6FDd97k004840@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 08:39:08 2008 New Revision: 53607 URL: http://llvm.org/viewvc/llvm-project?rev=53607&view=rev Log: Don't use isa when we can reuse a previous dyn_cast. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=53607&r1=53606&r2=53607&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jul 15 08:39:08 2008 @@ -794,9 +794,8 @@ // Replace by null for now. Call->replaceAllUsesWith(Constant::getNullValue(Call->getType())); } else { - assert(isa(RetTy) && "Return type changed, but not into a" - "void. The old return type must have" - "been a struct!"); + assert(STy && "Return type changed, but not into a void. The old " + "return type must have been a struct!"); // The original return value was a struct, update all uses (which are // all extractvalue instructions, or uses that are unused themselves). for (Value::use_iterator I = Call->use_begin(), E = Call->use_end(); From matthijs at stdin.nl Tue Jul 15 09:03:12 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 14:03:12 -0000 Subject: [llvm-commits] [llvm] r53608 - in /llvm/trunk: lib/Transforms/IPO/DeadArgumentElimination.cpp test/Transforms/DeadArgElim/multdeadretval.ll Message-ID: <200807151403.m6FE3CBv005741@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 09:03:10 2008 New Revision: 53608 URL: http://llvm.org/viewvc/llvm-project?rev=53608&view=rev Log: Make deadargelim a bit less smart, so it doesn't choke on nested structs as return values that are still (partially) live. Instead of updating all uses of a call instruction after removing some elements, it now just rebuilds the original struct (With undef gaps where the unused values were) and leaves it to instcombine to clean this up. The added testcase still fails currently, but this is due to instcombine which isn't good enough yet. I will fix that part next. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=53608&r1=53607&r2=53608&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jul 15 09:03:10 2008 @@ -796,45 +796,28 @@ } else { assert(STy && "Return type changed, but not into a void. The old " "return type must have been a struct!"); - // The original return value was a struct, update all uses (which are - // all extractvalue instructions, or uses that are unused themselves). - for (Value::use_iterator I = Call->use_begin(), E = Call->use_end(); - I != E;) { - if (ExtractValueInst *EV = dyn_cast(*I)) { - // Increment now, since we're about to throw away this use. - ++I; - assert(EV->hasIndices() && "Return value used by extractvalue without" - "indices?"); - unsigned Idx = *EV->idx_begin(); - if (NewRetIdxs[Idx] != -1) { - if (RetTypes.size() > 1) { - // We're still returning a struct, create a new extractvalue - // instruction with the first index updated - std::vector NewIdxs(EV->idx_begin(), EV->idx_end()); - NewIdxs[0] = NewRetIdxs[Idx]; - Value *NEV = ExtractValueInst::Create(New, NewIdxs.begin(), - NewIdxs.end(), "retval", - EV); - EV->replaceAllUsesWith(NEV); - EV->eraseFromParent(); - } else { - // We are now only returning a simple value, remove the - // extractvalue. - EV->replaceAllUsesWith(New); - EV->eraseFromParent(); - } - } else { - // Value unused, replace uses by null for now, they will get removed - // later on. - EV->replaceAllUsesWith(Constant::getNullValue(EV->getType())); - EV->eraseFromParent(); - } - } else { - // Not an extractvalue, so this use will become dead soon. Just - // replace it with null. - I.getUse().set(Constant::getNullValue(I.getUse().get()->getType())); + // We used to return a struct. Instead of doing smart stuff with all the + // uses of this struct, we will just rebuild it using + // extract/insertvalue chaining and let instcombine clean that up. + // + // Start out building up our return value from undef + Value *RetVal = llvm::UndefValue::get(RetTy); + for (unsigned i = 0; i != PartialRetVals; ++i) + if (NewRetIdxs[i] != -1) { + Value *V; + if (RetTypes.size() > 1) + // We are still returning a struct, so extract the value from our + // return value + V = ExtractValueInst::Create(New, NewRetIdxs[i], "newret", Call); + else + // We are now returning a single element, so just insert that + V = New; + // Insert the value at the old position + RetVal = InsertValueInst::Create(RetVal, V, i, "oldret", Call); } - } + // Now, replace all uses of the old call instruction with the return + // struct we built + Call->replaceAllUsesWith(RetVal); New->takeName(Call); } } Modified: llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll?rev=53608&r1=53607&r2=53608&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll (original) +++ llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll Tue Jul 15 09:03:10 2008 @@ -38,6 +38,14 @@ ret {i32, i32, i16} %C } +; Nested return values +define internal {{i32}, {i16, i16}} @test6() { + %A = insertvalue {{i32}, {i16, i16}} undef, i32 1, 0, 0 + %B = insertvalue {{i32}, {i16, i16}} %A, i16 2, 1, 0 + %C = insertvalue {{i32}, {i16, i16}} %B, i16 3, 1, 1 + ret {{i32}, {i16, i16}} %C +} + define i32 @main() { %ret = call {i32, i16} @test2() ; [#uses=1] %LIVE = extractvalue {i32, i16} %ret, 0 @@ -51,5 +59,10 @@ %DEAD2 = extractvalue { i32, i32, i16} %ret1, 2 %V = add i32 %LIVE3, %LIVE4 %W = add i32 %Z, %V - ret i32 %W + %ret2 = call { { i32 }, { i16, i16 } } @test6 () + %LIVE5 = extractvalue { { i32 }, { i16, i16 } } %ret2, 0, 0 + %DEAD3 = extractvalue { { i32 }, { i16, i16 } } %ret2, 1, 0 + %DEAD4 = extractvalue { { i32 }, { i16, i16 } } %ret2, 1, 1 + %Q = add i32 %W, %LIVE5 + ret i32 %Q } From matthijs at stdin.nl Tue Jul 15 09:39:37 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 14:39:37 -0000 Subject: [llvm-commits] [llvm] r53609 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200807151439.m6FEdbS8007014@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 09:39:36 2008 New Revision: 53609 URL: http://llvm.org/viewvc/llvm-project?rev=53609&view=rev Log: Revert r53606. It turns out that explicitely tracking the liveness of the return value as a whole in deadargelim is really not needed now that we simply rebuild the old return value and actually prevents some canonicalization from taking place. This revert stops deadargelim from changing {i32} into i32 for now, but I'll fix that next. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=53609&r1=53608&r2=53609&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jul 15 09:39:36 2008 @@ -47,14 +47,12 @@ /// Struct that represents (part of) either a return value or a function /// argument. Used so that arguments and return values can be used - /// interchangably. Idx == -1 means the entire return value, while other - /// indices mean the corresponding element in the struct return type (if - /// any). + /// interchangably. struct RetOrArg { - RetOrArg(const Function* F, signed Idx, bool IsArg) : F(F), Idx(Idx), + RetOrArg(const Function* F, unsigned Idx, bool IsArg) : F(F), Idx(Idx), IsArg(IsArg) {} const Function *F; - signed Idx; + unsigned Idx; bool IsArg; /// Make RetOrArg comparable, so we can put it into a map. @@ -73,10 +71,8 @@ } std::string getDescription() const { - return std::string((!IsArg && Idx != -1 ? "partial " : "")) - + (IsArg ? "argument #" : "return value") - + (!IsArg && Idx == -1 ? "" : " #" + utostr(Idx)) - + " of function " + F->getName(); + return std::string((IsArg ? "Argument #" : "Return value #")) + + utostr(Idx) + " of function " + F->getName(); } }; @@ -88,11 +84,11 @@ enum Liveness { Live, MaybeLive }; /// Convenience wrapper - RetOrArg CreateRet(const Function *F, signed Idx) { + RetOrArg CreateRet(const Function *F, unsigned Idx) { return RetOrArg(F, Idx, false); } /// Convenience wrapper - RetOrArg CreateArg(const Function *F, signed Idx) { + RetOrArg CreateArg(const Function *F, unsigned Idx) { return RetOrArg(F, Idx, true); } @@ -133,7 +129,7 @@ private: Liveness MarkIfNotLive(RetOrArg Use, UseVector &MaybeLiveUses); Liveness SurveyUse(Value::use_iterator U, UseVector &MaybeLiveUses, - signed RetValNum = -1); + unsigned RetValNum = 0); Liveness SurveyUses(Value *V, UseVector &MaybeLiveUses); void SurveyFunction(Function &F); @@ -282,6 +278,18 @@ return true; } +/// Convenience function that returns the number of return values. It returns 0 +/// for void functions and 1 for functions not returning a struct. It returns +/// the number of struct elements for functions returning a struct. +static unsigned NumRetVals(const Function *F) { + if (F->getReturnType() == Type::VoidTy) + return 0; + else if (const StructType *STy = dyn_cast(F->getReturnType())) + return STy->getNumElements(); + else + return 1; +} + /// MarkIfNotLive - This checks Use for liveness in LiveValues. If Use is not /// live, it adds Use to the MaybeLiveUses argument. Returns the determined /// liveness of Use. @@ -296,15 +304,16 @@ return MaybeLive; } + /// SurveyUse - This looks at a single use of an argument or return value /// and determines if it should be alive or not. Adds this use to MaybeLiveUses /// if it causes the used value to become MaybeAlive. /// /// RetValNum is the return value number to use when this use is used in a /// return instruction. This is used in the recursion, you should always leave -/// it at -1. +/// it at 0. DAE::Liveness DAE::SurveyUse(Value::use_iterator U, UseVector &MaybeLiveUses, - signed RetValNum) { + unsigned RetValNum) { Value *V = *U; if (ReturnInst *RI = dyn_cast(V)) { // The value is returned from a function. It's only live when the @@ -393,23 +402,16 @@ // well as arguments to functions which have their "address taken". // void DAE::SurveyFunction(Function &F) { - const StructType *STy = dyn_cast(F.getFunctionType()->getReturnType()); - // Store the number of partial return values, which we only have if the return - // type is a struct. - unsigned PartialRetVals = (STy ? STy->getNumElements() : 0); + unsigned RetCount = NumRetVals(&F); // Assume all return values are dead typedef SmallVector RetVals; - // Allocate one slot for the entire return value (index 0) and one for each - // partial return value. - RetVals RetValLiveness(PartialRetVals + 1, MaybeLive); + RetVals RetValLiveness(RetCount, MaybeLive); typedef SmallVector RetUses; // These vectors map each return value to the uses that make it MaybeLive, so // we can add those to the Uses map if the return value really turns out to be - // MaybeLive. - // Allocate one slot for the entire return value (index 0) and one for each - // partial return value. - RetUses MaybeLiveRetUses(PartialRetVals + 1); + // MaybeLive. Initialized to a list of RetCount empty lists. + RetUses MaybeLiveRetUses(RetCount); for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) if (ReturnInst *RI = dyn_cast(BB->getTerminator())) @@ -426,6 +428,10 @@ } DOUT << "DAE - Inspecting callers for fn: " << F.getName() << "\n"; + // Keep track of the number of live retvals, so we can skip checks once all + // of them turn out to be live. + unsigned NumLiveRetVals = 0; + const Type *STy = dyn_cast(F.getReturnType()); // Loop all uses of the function. for (Value::use_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) { // If the function is PASSED IN as an argument, its address has been @@ -446,42 +452,43 @@ // If we end up here, we are looking at a direct call to our function. // Now, check how our return value(s) is/are used in this caller. Don't - // bother checking return values if the entire value is live already. - if (RetValLiveness[0] != Live) { - // Check all uses of the return value. - for (Value::use_iterator I = TheCall->use_begin(), - E = TheCall->use_end(); I != E; ++I) { - ExtractValueInst *Ext = dyn_cast(*I); - if (Ext && Ext->hasIndices()) { - // This use uses a part of our return value, survey the uses of - // that part and store the results for this index only. - unsigned Idx = *Ext->idx_begin(); - // + 1 to skip the "entire retval" index (0) - Liveness &IsLive = RetValLiveness[Idx + 1]; - if (IsLive != Live) { - // Don't bother checking if this retval was already live - // Survey all uses of the extractvalue - // + 1 to skip the "entire retval" index (0) - IsLive = SurveyUses(Ext, MaybeLiveRetUses[Idx + 1]); - } - } else { - // Survey this use - RetValLiveness[0] = SurveyUse(I, MaybeLiveRetUses[0]); - if (RetValLiveness[0] == Live) + // bother checking return values if all of them are live already. + if (NumLiveRetVals != RetCount) { + if (STy) { + // Check all uses of the return value. + for (Value::use_iterator I = TheCall->use_begin(), + E = TheCall->use_end(); I != E; ++I) { + ExtractValueInst *Ext = dyn_cast(*I); + if (Ext && Ext->hasIndices()) { + // This use uses a part of our return value, survey the uses of + // that part and store the results for this index only. + unsigned Idx = *Ext->idx_begin(); + if (RetValLiveness[Idx] != Live) { + RetValLiveness[Idx] = SurveyUses(Ext, MaybeLiveRetUses[Idx]); + if (RetValLiveness[Idx] == Live) + NumLiveRetVals++; + } + } else { + // Used by something else than extractvalue. Mark all return + // values as live. + for (unsigned i = 0; i != RetCount; ++i ) + RetValLiveness[i] = Live; + NumLiveRetVals = RetCount; break; + } } + } else { + // Single return value + RetValLiveness[0] = SurveyUses(TheCall, MaybeLiveRetUses[0]); + if (RetValLiveness[0] == Live) + NumLiveRetVals = RetCount; } } } // Now we've inspected all callers, record the liveness of our return values. - MarkValue(CreateRet(&F, -1), RetValLiveness[0], MaybeLiveRetUses[0]); - if (RetValLiveness[0] != Live) - // If the entire retval (0) is Live, MarkValue will have marked all other retvals live - // as well, so we can skip this. - for (unsigned i = 0; i != PartialRetVals; ++i) - // + 1 to skip the "entire retval" index (0) - MarkValue(CreateRet(&F, i), RetValLiveness[i + 1], MaybeLiveRetUses[i + 1]); + for (unsigned i = 0; i != RetCount; ++i) + MarkValue(CreateRet(&F, i), RetValLiveness[i], MaybeLiveRetUses[i]); DOUT << "DAE - Inspecting args for fn: " << F.getName() << "\n"; @@ -532,11 +539,8 @@ for (unsigned i = 0, e = F.arg_size(); i != e; ++i) PropagateLiveness(CreateArg(&F, i)); // Mark all return values as live. - const Type *RTy = F.getFunctionType()->getReturnType(); - if (const StructType *STy = dyn_cast(RTy)) - for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) - PropagateLiveness(CreateRet(&F, i)); - PropagateLiveness(CreateRet(&F, -1)); + for (unsigned i = 0, e = NumRetVals(&F); i != e; ++i) + PropagateLiveness(CreateRet(&F, i)); } /// MarkLive - Mark the given return value or argument as live. Additionally, @@ -551,16 +555,6 @@ DOUT << "DAE - Marking " << RA.getDescription() << " live\n"; PropagateLiveness(RA); - - if (!RA.IsArg && RA.Idx == -1) { - // Entire return value live? - const Type *RTy = RA.F->getFunctionType()->getReturnType(); - if (const StructType *STy = dyn_cast(RTy)) - // And the function returns a struct? - for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) - // Mark all partial return values live as well then - MarkLive(CreateRet(RA.F, i)); - } } /// PropagateLiveness - Given that RA is a live value, propagate it's liveness @@ -605,20 +599,20 @@ // Find out the new return value. const Type *RetTy = FTy->getReturnType(); - const StructType *STy = dyn_cast(RetTy); - const unsigned PartialRetVals = (STy ? STy->getNumElements() : 0); const Type *NRetTy = NULL; - // -1 means unused, other numbers are the new index. Initialized to -1 for - // every partial return value we have. - SmallVector NewRetIdxs(PartialRetVals, -1); + unsigned RetCount = NumRetVals(F); + // Explicitly track if anything changed, for debugging. + bool Changed = false; + // -1 means unused, other numbers are the new index + SmallVector NewRetIdxs(RetCount, -1); std::vector RetTypes; - if (LiveValues.count(CreateRet(F, -1))) { - // If the entire return value is live, leave it unchanged. - NRetTy = RetTy; + if (RetTy == Type::VoidTy) { + NRetTy = Type::VoidTy; } else { - if (STy) { - // Look at each of the partial return values individually. - for (unsigned i = 0; i != PartialRetVals; ++i) { + const StructType *STy = dyn_cast(RetTy); + if (STy) + // Look at each of the original return values individually. + for (unsigned i = 0; i != RetCount; ++i) { RetOrArg Ret = CreateRet(F, i); if (LiveValues.erase(Ret)) { RetTypes.push_back(STy->getElementType(i)); @@ -627,20 +621,25 @@ ++NumRetValsEliminated; DOUT << "DAE - Removing return value " << i << " from " << F->getNameStart() << "\n"; - // We remove the value by not adding anything to RetTypes. + Changed = true; } } - } else if (RetTy != Type::VoidTy) { - // We used to return a single value, which is now dead (already checked in - // the if above) - DOUT << "DAE - Removing return value from " << F->getNameStart() - << "\n"; - ++NumRetValsEliminated; - // We remove the value by not adding anything to RetTypes. - } - - if (RetTypes.size() > 1) - // More than one return type? Return a struct with them. + else + // We used to return a single value. + if (LiveValues.erase(CreateRet(F, 0))) { + RetTypes.push_back(RetTy); + NewRetIdxs[0] = 0; + } else { + DOUT << "DAE - Removing return value from " << F->getNameStart() + << "\n"; + ++NumRetValsEliminated; + Changed = true; + } + if (RetTypes.size() > 1 || (STy && STy->getNumElements()==RetTypes.size())) + // More than one return type? Return a struct with them. Also, if we used + // to return a struct and didn't change the number of return values, + // return a struct again. This prevents changing {something} into + // something and {} into void. // Make the new struct packed if we used to return a packed struct // already. NRetTy = StructType::get(RetTypes, STy->isPacked()); @@ -649,7 +648,7 @@ // return a struct with that simple value before. NRetTy = RetTypes.front(); else if (RetTypes.size() == 0) - // No return types? Make it void. + // No return types? Make it void, but only if we didn't use to return {}. NRetTy = Type::VoidTy; } @@ -689,6 +688,7 @@ ++NumArgumentsEliminated; DOUT << "DAE - Removing argument " << i << " (" << I->getNameStart() << ") from " << F->getNameStart() << "\n"; + Changed = true; } } @@ -714,6 +714,11 @@ if (NFTy == FTy) return false; + // The function type is only allowed to be different if we actually left out + // an argument or return value. + assert(Changed && "Function type changed while no arguments or return values" + "were removed!"); + // Create the new function body and insert it into the module... Function *NF = Function::Create(NFTy, F->getLinkage()); NF->copyAttributesFrom(F); @@ -794,15 +799,16 @@ // Replace by null for now. Call->replaceAllUsesWith(Constant::getNullValue(Call->getType())); } else { - assert(STy && "Return type changed, but not into a void. The old " - "return type must have been a struct!"); + assert(isa(RetTy) && "Return type changed, but not into a" + "void. The old return type must have" + "been a struct!"); // We used to return a struct. Instead of doing smart stuff with all the // uses of this struct, we will just rebuild it using // extract/insertvalue chaining and let instcombine clean that up. // // Start out building up our return value from undef Value *RetVal = llvm::UndefValue::get(RetTy); - for (unsigned i = 0; i != PartialRetVals; ++i) + for (unsigned i = 0; i != RetCount; ++i) if (NewRetIdxs[i] != -1) { Value *V; if (RetTypes.size() > 1) @@ -868,7 +874,7 @@ Value *OldRet = RI->getOperand(0); // Start out building up our return value from undef RetVal = llvm::UndefValue::get(NRetTy); - for (unsigned i = 0; i != PartialRetVals; ++i) + for (unsigned i = 0; i != RetCount; ++i) if (NewRetIdxs[i] != -1) { ExtractValueInst *EV = ExtractValueInst::Create(OldRet, i, "oldret", RI); From matthijs at stdin.nl Tue Jul 15 09:42:31 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 14:42:31 -0000 Subject: [llvm-commits] [llvm] r53610 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200807151442.m6FEgVni007128@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 09:42:31 2008 New Revision: 53610 URL: http://llvm.org/viewvc/llvm-project?rev=53610&view=rev Log: Allow deadargelim to change return types even though now values were dead. This again canonicalizes {i32} into i32 and {} into void. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=53610&r1=53609&r2=53610&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jul 15 09:42:31 2008 @@ -601,8 +601,6 @@ const Type *RetTy = FTy->getReturnType(); const Type *NRetTy = NULL; unsigned RetCount = NumRetVals(F); - // Explicitly track if anything changed, for debugging. - bool Changed = false; // -1 means unused, other numbers are the new index SmallVector NewRetIdxs(RetCount, -1); std::vector RetTypes; @@ -621,7 +619,6 @@ ++NumRetValsEliminated; DOUT << "DAE - Removing return value " << i << " from " << F->getNameStart() << "\n"; - Changed = true; } } else @@ -633,9 +630,8 @@ DOUT << "DAE - Removing return value from " << F->getNameStart() << "\n"; ++NumRetValsEliminated; - Changed = true; } - if (RetTypes.size() > 1 || (STy && STy->getNumElements()==RetTypes.size())) + if (RetTypes.size() > 1) // More than one return type? Return a struct with them. Also, if we used // to return a struct and didn't change the number of return values, // return a struct again. This prevents changing {something} into @@ -688,7 +684,6 @@ ++NumArgumentsEliminated; DOUT << "DAE - Removing argument " << i << " (" << I->getNameStart() << ") from " << F->getNameStart() << "\n"; - Changed = true; } } @@ -714,11 +709,6 @@ if (NFTy == FTy) return false; - // The function type is only allowed to be different if we actually left out - // an argument or return value. - assert(Changed && "Function type changed while no arguments or return values" - "were removed!"); - // Create the new function body and insert it into the module... Function *NF = Function::Create(NFTy, F->getLinkage()); NF->copyAttributesFrom(F); From matthijs at stdin.nl Tue Jul 15 09:42:58 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 14:42:58 -0000 Subject: [llvm-commits] [llvm] r53611 - /llvm/trunk/test/Transforms/DeadArgElim/canon.ll Message-ID: <200807151442.m6FEgxvM007166@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 09:42:58 2008 New Revision: 53611 URL: http://llvm.org/viewvc/llvm-project?rev=53611&view=rev Log: Add a testcase for the canonicalizations now performed by deadargelim. Added: llvm/trunk/test/Transforms/DeadArgElim/canon.ll Added: llvm/trunk/test/Transforms/DeadArgElim/canon.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadArgElim/canon.ll?rev=53611&view=auto ============================================================================== --- llvm/trunk/test/Transforms/DeadArgElim/canon.ll (added) +++ llvm/trunk/test/Transforms/DeadArgElim/canon.ll Tue Jul 15 09:42:58 2008 @@ -0,0 +1,24 @@ +; This test shows a few canonicalizations made by deadargelim +; RUN: llvm-as < %s | opt -deadargelim | llvm-dis > %t +; This test should remove {} and replace it with void +; RUN: cat %t | grep {define internal void @test} +; This test shouls replace the {i32} return value with just i32 +; RUN: cat %t | grep {define internal i32 @test2} + +define internal {} @test() { + ret {} undef +} + +define internal {i32} @test2() { + ret {i32} undef; +} + +define void @caller() { + call {} @test() + %X = call {i32} @test2(); + %Y = extractvalue {i32} %X, 0 + call void @user(i32 %Y, {i32} %X) + ret void +} + +declare void @user(i32, {i32}) From matthijs at stdin.nl Tue Jul 15 09:47:54 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 16:47:54 +0200 Subject: [llvm-commits] [llvm] r52537 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp In-Reply-To: <192117C6-9780-4C96-9F1F-E055FFC033FE@apple.com> References: <200806201516.m5KFGkRv024435@zion.cs.uiuc.edu> <20080702161624.GI7287@katherina.student.utwente.nl> <192117C6-9780-4C96-9F1F-E055FFC033FE@apple.com> Message-ID: <20080715144754.GD26592@katherina.student.utwente.nl> Hi Chris, > I still think it would be preferable to lower this into: > > %S = call i32 @foo() > %t = insertvalue {i32} undef, 0, i32 %S > call void @bar({ i32 } %t) > > This is not an "optimization" by itself persay, but it *is* a > canonicalization, and it is useful to have canonical forms for code. I've restructured the code a bit and it now does exactly this. This is mainly due to making deadargelim less smart: Instead of trying to replace all extractvalue instructions that use the result of a function, it now simply rebuilds the old struct that was returned (with undef gaps wherever the unused values were). This allows instcombine to turn the result into the above. > > However, I'm not really sure this is worth the effort. Perhaps this > > should be done in a different pass, really? > Why in a different pass? Because I didn't think I could fit it into deadargelim elegantly. But it worked out after all :-) Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080715/a91a4888/attachment.bin From matthijs at stdin.nl Tue Jul 15 09:57:01 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 14:57:01 -0000 Subject: [llvm-commits] [llvm] r53612 - /llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll Message-ID: <200807151457.m6FEv1If008127@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 09:57:01 2008 New Revision: 53612 URL: http://llvm.org/viewvc/llvm-project?rev=53612&view=rev Log: Remove a few tests which no longer hold for deadargelim (since it is now allowed to canonicalize return values). Add a test that checks if return value and function attributes are not removed. Modified: llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll Modified: llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll?rev=53612&r1=53611&r2=53612&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll (original) +++ llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll Tue Jul 15 09:57:01 2008 @@ -1,21 +1,14 @@ ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis > %t -; RUN: cat %t | grep {define internal \{ \} @test} -; RUN: cat %t | grep {define internal \{ i32 \} @test} +; RUN: cat %t | grep {define internal i32 @test1() zeroext nounwind} ; RUN: cat %t | grep {define internal \<\{ i32, i32 \}\> @test} ; Check if the pass doesn't modify anything that doesn't need changing. We feed ; an unused argument to each function to lure it into changing _something_ about ; the function and then changing too much. - -; This checks if the struct retval isn't changed into a void -define internal { } @test(i32 %DEADARG1) { - ret { } { } -} - -; This checks if the struct retval isn't removed -define internal {i32} @test1(i32 %DEADARG1) { - ret { i32 } { i32 1 } +; This checks if the return value attributes are not removed +define internal i32 @test1(i32 %DEADARG1) nounwind zeroext{ + ret i32 1 } ; This checks if the struct doesn't get non-packed @@ -24,13 +17,12 @@ } ; We use this external function to make sure the return values don't become dead -declare void @user({ }, { i32 }, <{ i32, i32 }>) +declare void @user(i32, <{ i32, i32 }>) define void @caller() { - %A = call { } @test(i32 0) - %B = call { i32 } @test1(i32 1) + %B = call i32 @test1(i32 1) %C = call <{ i32, i32 }> @test2(i32 2) - call void @user({ } %A, { i32 } %B, <{ i32, i32 }> %C) + call void @user(i32 %B, <{ i32, i32 }> %C) ret void } From baldrick at free.fr Tue Jul 15 10:02:44 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Jul 2008 15:02:44 -0000 Subject: [llvm-commits] [llvm] r53613 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h test/CodeGen/PowerPC/2008-07-15-Fabs.ll Message-ID: <200807151502.m6FF2iuk008429@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jul 15 10:02:44 2008 New Revision: 53613 URL: http://llvm.org/viewvc/llvm-project?rev=53613&view=rev Log: LegalizeTypes support for fabs on ppc long double. Added: llvm/trunk/test/CodeGen/PowerPC/2008-07-15-Fabs.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp?rev=53613&r1=53612&r2=53613&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Tue Jul 15 10:02:44 2008 @@ -759,6 +759,7 @@ case ISD::EXTRACT_VECTOR_ELT: ExpandRes_EXTRACT_VECTOR_ELT(N, Lo, Hi); break; case ISD::ConstantFP: ExpandFloatRes_ConstantFP(N, Lo, Hi); break; + case ISD::FABS: ExpandFloatRes_FABS(N, Lo, Hi); break; case ISD::FADD: ExpandFloatRes_FADD(N, Lo, Hi); break; case ISD::FDIV: ExpandFloatRes_FDIV(N, Lo, Hi); break; case ISD::FMUL: ExpandFloatRes_FMUL(N, Lo, Hi); break; @@ -799,6 +800,19 @@ Lo = Call.getOperand(0); Hi = Call.getOperand(1); } +void DAGTypeLegalizer::ExpandFloatRes_FABS(SDNode *N, SDOperand &Lo, + SDOperand &Hi) { + assert(N->getValueType(0) == MVT::ppcf128 && + "Logic only correct for ppcf128!"); + SDOperand Tmp; + GetExpandedFloat(N->getOperand(0), Lo, Tmp); + Hi = DAG.getNode(ISD::FABS, Tmp.getValueType(), Tmp); + // Lo = Hi==fabs(Hi) ? Lo : -Lo; + Lo = DAG.getNode(ISD::SELECT_CC, Lo.getValueType(), Tmp, Hi, Lo, + DAG.getNode(ISD::FNEG, Lo.getValueType(), Lo), + DAG.getCondCode(ISD::SETEQ)); +} + void DAGTypeLegalizer::ExpandFloatRes_FDIV(SDNode *N, SDOperand &Lo, SDOperand &Hi) { SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=53613&r1=53612&r2=53613&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Tue Jul 15 10:02:44 2008 @@ -367,6 +367,7 @@ // Float Result Expansion. void ExpandFloatResult(SDNode *N, unsigned ResNo); void ExpandFloatRes_ConstantFP(SDNode *N, SDOperand &Lo, SDOperand &Hi); + void ExpandFloatRes_FABS (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandFloatRes_FADD (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandFloatRes_FDIV (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandFloatRes_FMUL (SDNode *N, SDOperand &Lo, SDOperand &Hi); Added: llvm/trunk/test/CodeGen/PowerPC/2008-07-15-Fabs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2008-07-15-Fabs.ll?rev=53613&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/2008-07-15-Fabs.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/2008-07-15-Fabs.ll Tue Jul 15 10:02:44 2008 @@ -0,0 +1,19 @@ +; RUN: llvm-as < %s | llc +target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128" +target triple = "powerpc-apple-darwin9" + +define hidden i256 @__divtc3(ppc_fp128 %a, ppc_fp128 %b, ppc_fp128 %c, ppc_fp128 %d) nounwind readnone { +entry: + call ppc_fp128 @fabsl( ppc_fp128 %d ) nounwind readnone ; :0 [#uses=1] + fcmp olt ppc_fp128 0xM00000000000000000000000000000000, %0 ; :1 [#uses=1] + %.pn106 = select i1 %1, ppc_fp128 %a, ppc_fp128 0xM00000000000000000000000000000000 ; [#uses=1] + %.pn = sub ppc_fp128 0xM00000000000000000000000000000000, %.pn106 ; [#uses=1] + %y.0 = fdiv ppc_fp128 %.pn, 0xM00000000000000000000000000000000 ; [#uses=1] + mul ppc_fp128 %y.0, 0xM3FF00000000000000000000000000000 ; :2 [#uses=1] + add ppc_fp128 %2, mul (ppc_fp128 0xM00000000000000000000000000000000, ppc_fp128 0xM00000000000000000000000000000000) ; :3 [#uses=1] + %tmpi = add ppc_fp128 %3, 0xM00000000000000000000000000000000 ; [#uses=1] + store ppc_fp128 %tmpi, ppc_fp128* null, align 16 + ret i256 0 +} + +declare ppc_fp128 @fabsl(ppc_fp128) nounwind readnone From matthijs at stdin.nl Tue Jul 15 11:05:11 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 16:05:11 -0000 Subject: [llvm-commits] [llvm] r53614 - /llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll Message-ID: <200807151605.m6FG5BdT011205@zion.cs.uiuc.edu> Author: matthijs Date: Tue Jul 15 11:05:09 2008 New Revision: 53614 URL: http://llvm.org/viewvc/llvm-project?rev=53614&view=rev Log: XFAIL the multdeadretval test for now, I will be fixing instcombine to make it work again tomorrow. Modified: llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll Modified: llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll?rev=53614&r1=53613&r2=53614&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll (original) +++ llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll Tue Jul 15 11:05:09 2008 @@ -3,6 +3,7 @@ ; run instcombine to fold insert/extractvalue chains and we run dce to clean up ; any remaining dead stuff. ; RUN: llvm-as < %s | opt -deadargelim -instcombine -dce | llvm-dis | not grep i16 +; XFAIL: * define internal {i16, i32} @test(i16 %DEADARG) { %A = insertvalue {i16,i32} undef, i16 1, 0 From matthijs at stdin.nl Tue Jul 15 11:10:33 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 15 Jul 2008 18:10:33 +0200 Subject: [llvm-commits] [llvm] r52537 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp In-Reply-To: <20080715144754.GD26592@katherina.student.utwente.nl> References: <200806201516.m5KFGkRv024435@zion.cs.uiuc.edu> <20080702161624.GI7287@katherina.student.utwente.nl> <192117C6-9780-4C96-9F1F-E055FFC033FE@apple.com> <20080715144754.GD26592@katherina.student.utwente.nl> Message-ID: <20080715161033.GE26592@katherina.student.utwente.nl> Hi all, as you might have noticed, I've restructed the deadargelim pass a bit more. It should be really done by now. All changes are committed I'm currently running it against the test suite. Could someone (Evan?) perhaps see if the SPEC tests still work properly? Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080715/b69be2ac/attachment.bin From resistor at mac.com Tue Jul 15 11:28:06 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 15 Jul 2008 16:28:06 -0000 Subject: [llvm-commits] [llvm] r53615 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200807151628.m6FGS7iu012294@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 15 11:28:06 2008 New Revision: 53615 URL: http://llvm.org/viewvc/llvm-project?rev=53615&view=rev Log: Have GVN do a pre-pass over the CFG that folds away unconditional branches where possible. This allows local PRE to be more aggressive. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=53615&r1=53614&r2=53615&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue Jul 15 11:28:06 2008 @@ -41,6 +41,7 @@ STATISTIC(NumGVNInstr, "Number of instructions deleted"); STATISTIC(NumGVNLoad, "Number of loads deleted"); STATISTIC(NumGVNPRE, "Number of instructions PRE'd"); +STATISTIC(NumGVNBlocks, "Number of blocks merged"); static cl::opt EnablePRE("enable-pre", cl::init(false), cl::Hidden); @@ -749,6 +750,7 @@ bool isSafeReplacement(PHINode* p, Instruction* inst); bool performPRE(Function& F); Value* lookupNumber(BasicBlock* BB, uint32_t num); + bool mergeBlockIntoPredecessor(BasicBlock* BB); }; char GVN::ID = 0; @@ -1324,12 +1326,71 @@ return changed; } -// GVN::iterateOnFunction - Executes one iteration of GVN +// mergeBlockIntoPredecessor - If this block is the only successor +// of its predecessor, and the edge is non-critical, +// fold it into that predecessor. +bool GVN::mergeBlockIntoPredecessor(BasicBlock* BB) { + // Can't merge the entry block. + if (pred_begin(BB) == pred_end(BB)) return false; + // Can't merge if there are multiple preds. + if (++pred_begin(BB) != pred_end(BB)) return false; + + BasicBlock* PredBB = *pred_begin(BB); + + // Can't merge if the edge is critical. + if (PredBB->getTerminator()->getNumSuccessors() != 1) return false; + + // Begin by getting rid of unneeded PHIs. + while (PHINode *PN = dyn_cast(&BB->front())) { + PN->replaceAllUsesWith(PN->getIncomingValue(0)); + BB->getInstList().pop_front(); // Delete the phi node... + } + + // Delete the unconditional branch from the predecessor... + PredBB->getInstList().pop_back(); + + // Move all definitions in the successor to the predecessor... + PredBB->getInstList().splice(PredBB->end(), BB->getInstList()); + + // Make all PHI nodes that referred to BB now refer to Pred as their + // source... + BB->replaceAllUsesWith(PredBB); + + // Finally, erase the old block and update dominator info. + DominatorTree& DT = getAnalysis(); + DomTreeNode* DTN = DT[BB]; + DomTreeNode* PredDTN = DT[PredBB]; + + if (DTN) { + SmallPtrSet Children(DTN->begin(), DTN->end()); + for (SmallPtrSet::iterator DI = Children.begin(), + DE = Children.end(); DI != DE; ++DI) + DT.changeImmediateDominator(*DI, PredDTN); + + DT.eraseNode(BB); + } + + BB->eraseFromParent(); + + NumGVNBlocks++; + return true; +} + +// iterateOnFunction - Executes one iteration of GVN bool GVN::iterateOnFunction(Function &F) { // Clean out global sets from any previous functions VN.clear(); phiMap.clear(); + // Merge unconditional branches, allowing PRE to catch more + // optimization opportunities. + bool mergedBlocks = false; + for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ) { + BasicBlock* BB = FI; + ++FI; + mergedBlocks |= mergeBlockIntoPredecessor(BB); + } + for (DenseMap::iterator I = localAvail.begin(), E = localAvail.end(); I != E; ++I) delete I->second; @@ -1346,5 +1407,5 @@ if (EnablePRE) changed |= performPRE(F); - return changed; + return changed || mergedBlocks; } From resistor at mac.com Tue Jul 15 11:28:23 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 15 Jul 2008 16:28:23 -0000 Subject: [llvm-commits] [llvm] r53616 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200807151628.m6FGSN6G012313@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 15 11:28:23 2008 New Revision: 53616 URL: http://llvm.org/viewvc/llvm-project?rev=53616&view=rev Log: Enable local PRE by default. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=53616&r1=53615&r2=53616&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue Jul 15 11:28:23 2008 @@ -44,7 +44,7 @@ STATISTIC(NumGVNBlocks, "Number of blocks merged"); static cl::opt EnablePRE("enable-pre", - cl::init(false), cl::Hidden); + cl::init(true), cl::Hidden); //===----------------------------------------------------------------------===// // ValueTable Class From clattner at apple.com Tue Jul 15 11:55:43 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 15 Jul 2008 09:55:43 -0700 Subject: [llvm-commits] [llvm] r53534 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-07-13-DivZero.ll test/Transforms/InstCombine/udiv_select_to_select_shift.ll In-Reply-To: <200807150934.16714.baldrick@free.fr> References: <200807140015.m6E0FroD004171@zion.cs.uiuc.edu> <200807140932.04483.baldrick@free.fr> <5CDF57FA-B3FC-4E57-9E73-21BEF7BC3B9C@apple.com> <200807150934.16714.baldrick@free.fr> Message-ID: On Jul 15, 2008, at 12:34 AM, Duncan Sands wrote: >>>> + // If we found a call to a function, we can't assume it will >>>> return, so >>>> + // information from below it cannot be propagated above it. >>>> + if (isa(BBI) && !isa(BBI)) >>>> + break; >>> >>> I guess you only really need to exit here if SI is zero. > > Sorry, I confused SI with the original instruction I. Ok > What I meant > was that you always transform uses as long as they are below the > original DivRem in the basic block; if they come before the DivRem > then you have to be careful about calls that do not return. I'm still not following. The loop does a backwards walk from the div/ rem up, simplifying instructions as it goes. If it find a call to a function that might not return, it stops simplifying. Is there some way the loop can be made cleaner? -Chris From clattner at apple.com Tue Jul 15 11:59:49 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 15 Jul 2008 09:59:49 -0700 Subject: [llvm-commits] [llvm] r53615 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp In-Reply-To: <200807151628.m6FGS7iu012294@zion.cs.uiuc.edu> References: <200807151628.m6FGS7iu012294@zion.cs.uiuc.edu> Message-ID: On Jul 15, 2008, at 9:28 AM, Owen Anderson wrote: > +// mergeBlockIntoPredecessor - If this block is the only successor > +// of its predecessor, and the edge is non-critical, > +// fold it into that predecessor. > +bool GVN::mergeBlockIntoPredecessor(BasicBlock* BB) { Hey Owen, Can you move this to transform utils? -Chris > > + // Can't merge the entry block. > + if (pred_begin(BB) == pred_end(BB)) return false; > + // Can't merge if there are multiple preds. > + if (++pred_begin(BB) != pred_end(BB)) return false; > + > + BasicBlock* PredBB = *pred_begin(BB); > + > + // Can't merge if the edge is critical. > + if (PredBB->getTerminator()->getNumSuccessors() != 1) return false; > + > + // Begin by getting rid of unneeded PHIs. > + while (PHINode *PN = dyn_cast(&BB->front())) { > + PN->replaceAllUsesWith(PN->getIncomingValue(0)); > + BB->getInstList().pop_front(); // Delete the phi node... > + } > + > + // Delete the unconditional branch from the predecessor... > + PredBB->getInstList().pop_back(); > + > + // Move all definitions in the successor to the predecessor... > + PredBB->getInstList().splice(PredBB->end(), BB->getInstList()); > + > + // Make all PHI nodes that referred to BB now refer to Pred as > their > + // source... > + BB->replaceAllUsesWith(PredBB); > + > + // Finally, erase the old block and update dominator info. > + DominatorTree& DT = getAnalysis(); > + DomTreeNode* DTN = DT[BB]; > + DomTreeNode* PredDTN = DT[PredBB]; > + > + if (DTN) { > + SmallPtrSet Children(DTN->begin(), DTN->end()); > + for (SmallPtrSet::iterator DI = > Children.begin(), > + DE = Children.end(); DI != DE; ++DI) > + DT.changeImmediateDominator(*DI, PredDTN); > + > + DT.eraseNode(BB); > + } > + > + BB->eraseFromParent(); > + > + NumGVNBlocks++; > + return true; > +} > + > +// iterateOnFunction - Executes one iteration of GVN > bool GVN::iterateOnFunction(Function &F) { > // Clean out global sets from any previous functions > VN.clear(); > phiMap.clear(); > > + // Merge unconditional branches, allowing PRE to catch more > + // optimization opportunities. > + bool mergedBlocks = false; > + for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ) { > + BasicBlock* BB = FI; > + ++FI; > + mergedBlocks |= mergeBlockIntoPredecessor(BB); > + } > + > for (DenseMap::iterator > I = localAvail.begin(), E = localAvail.end(); I != E; ++I) > delete I->second; > @@ -1346,5 +1407,5 @@ > if (EnablePRE) > changed |= performPRE(F); > > - return changed; > + return changed || mergedBlocks; > } > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dalej at apple.com Tue Jul 15 12:40:44 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 15 Jul 2008 10:40:44 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200807150939.33980.baldrick@free.fr> References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> <200807150939.33980.baldrick@free.fr> Message-ID: On Jul 15, 2008, at 12:39 AMPDT, Duncan Sands wrote: > >> + // For ObjC2, we may have a base class field that should not >> be taken into >> + // account here, as it is already in Offset. The ObjC FE >> figures this out. >> + tree field_bit_offset = objc_v2_bitfield_ivar_bitpos(exp); >> + if (field_bit_offset) { >> + BitStart = (unsigned)getINTEGER_CSTVal(field_bit_offset); >> + } >> // Here BitStart gives the offset of the field in bits from >> field_offset. >> // Incorporate as much of it as possible into the pointer >> computation. >> unsigned ByteOffset = BitStart/8; > > I didn't understand from your description what is going on here. > Can you > please explain some more. I'll try. Bitfields are referenced by an offset in bytes relative to the beginning of the object, + an offset in bits relative to the byte offset. In ObjC V2 the byte offset can change at runtime, so is loaded from memory rather than computed at compile time. The value loaded from memory includes the value you would normally get at compile time, so you don't want to add that in twice. There is analogous code in non-llvm-gcc's get_inner_reference. (The comment about a base class is wrong, I'll fix that.) From kremenek at apple.com Tue Jul 15 12:54:38 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Jul 2008 17:54:38 -0000 Subject: [llvm-commits] [llvm] r53622 - /llvm/tags/checker/checker-61/ Message-ID: <200807151754.m6FHscHE015845@zion.cs.uiuc.edu> Author: kremenek Date: Tue Jul 15 12:54:38 2008 New Revision: 53622 URL: http://llvm.org/viewvc/llvm-project?rev=53622&view=rev Log: Tagging checker-61. Added: llvm/tags/checker/checker-61/ - copied from r53621, llvm/trunk/ From dalej at apple.com Tue Jul 15 12:57:24 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 15 Jul 2008 17:57:24 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53624 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200807151757.m6FHvPAv015942@zion.cs.uiuc.edu> Author: johannes Date: Tue Jul 15 12:57:24 2008 New Revision: 53624 URL: http://llvm.org/viewvc/llvm-project?rev=53624&view=rev Log: Improve comment on my last checkin. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=53624&r1=53623&r2=53624&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Jul 15 12:57:24 2008 @@ -5753,8 +5753,11 @@ } else { Value *Offset = Emit(field_offset, 0); - // For ObjC2, we may have a base class field that should not be taken into - // account here, as it is already in Offset. The ObjC FE figures this out. + // For ObjC2, the offset of the field is loaded from memory (it can + // change at runtime), and the initial value in memory includes the + // value that would normally be computed at compile time; we don't + // want to add this in twice. The ObjC FE figures out the value we + // actually should add at compile time (usually 0). tree field_bit_offset = objc_v2_bitfield_ivar_bitpos(exp); if (field_bit_offset) { BitStart = (unsigned)getINTEGER_CSTVal(field_bit_offset); From kremenek at apple.com Tue Jul 15 12:58:24 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Jul 2008 17:58:24 -0000 Subject: [llvm-commits] [llvm] r53625 - /llvm/tags/checker/checker-61/ Message-ID: <200807151758.m6FHwOTq015978@zion.cs.uiuc.edu> Author: kremenek Date: Tue Jul 15 12:58:24 2008 New Revision: 53625 URL: http://llvm.org/viewvc/llvm-project?rev=53625&view=rev Log: Removing checker-61. Removed: llvm/tags/checker/checker-61/ From resistor at mac.com Tue Jul 15 12:59:02 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 15 Jul 2008 17:59:02 -0000 Subject: [llvm-commits] [llvm] r53627 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200807151759.m6FHx2pQ016026@zion.cs.uiuc.edu> Author: resistor Date: Tue Jul 15 12:59:02 2008 New Revision: 53627 URL: http://llvm.org/viewvc/llvm-project?rev=53627&view=rev Log: Revert this, as it seems to still be broken. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=53627&r1=53626&r2=53627&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue Jul 15 12:59:02 2008 @@ -44,7 +44,7 @@ STATISTIC(NumGVNBlocks, "Number of blocks merged"); static cl::opt EnablePRE("enable-pre", - cl::init(true), cl::Hidden); + cl::init(false), cl::Hidden); //===----------------------------------------------------------------------===// // ValueTable Class From kremenek at apple.com Tue Jul 15 13:06:49 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Jul 2008 18:06:49 -0000 Subject: [llvm-commits] [llvm] r53629 - /llvm/tags/checker/checker-61/ Message-ID: <200807151806.m6FI6nXB016272@zion.cs.uiuc.edu> Author: kremenek Date: Tue Jul 15 13:06:48 2008 New Revision: 53629 URL: http://llvm.org/viewvc/llvm-project?rev=53629&view=rev Log: Tagging checker-61. Added: llvm/tags/checker/checker-61/ - copied from r53628, llvm/trunk/ From gohman at apple.com Tue Jul 15 13:18:54 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Jul 2008 18:18:54 -0000 Subject: [llvm-commits] [llvm] r53632 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200807151818.m6FIIt3b016696@zion.cs.uiuc.edu> Author: djg Date: Tue Jul 15 13:18:54 2008 New Revision: 53632 URL: http://llvm.org/viewvc/llvm-project?rev=53632&view=rev Log: Don't sort SDNodes by their addresses in SelectionDAG::dump. Instead, just use the AllNodes order, which is at least relatively stable across runs. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=53632&r1=53631&r2=53632&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Jul 15 13:18:54 2008 @@ -4973,16 +4973,12 @@ void SelectionDAG::dump() const { cerr << "SelectionDAG has " << AllNodes.size() << " nodes:"; - std::vector Nodes; - for (allnodes_const_iterator I = allnodes_begin(), E = allnodes_end(); - I != E; ++I) - Nodes.push_back(I); - std::sort(Nodes.begin(), Nodes.end()); - - for (unsigned i = 0, e = Nodes.size(); i != e; ++i) { - if (!Nodes[i]->hasOneUse() && Nodes[i] != getRoot().Val) - DumpNodes(Nodes[i], 2, this); + for (allnodes_const_iterator I = allnodes_begin(), E = allnodes_end(); + I != E; ++I) { + const SDNode *N = I; + if (!N->hasOneUse() && N != getRoot().Val) + DumpNodes(N, 2, this); } if (getRoot().Val) DumpNodes(getRoot().Val, 2, this); From kremenek at apple.com Tue Jul 15 13:27:24 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Jul 2008 18:27:24 -0000 Subject: [llvm-commits] [llvm] r53633 - /llvm/tags/checker/checker-61/ Message-ID: <200807151827.m6FIROGM016961@zion.cs.uiuc.edu> Author: kremenek Date: Tue Jul 15 13:27:24 2008 New Revision: 53633 URL: http://llvm.org/viewvc/llvm-project?rev=53633&view=rev Log: Removing checker-61. Removed: llvm/tags/checker/checker-61/ From gohman at apple.com Tue Jul 15 13:29:33 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Jul 2008 18:29:33 -0000 Subject: [llvm-commits] [llvm] r53636 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200807151829.m6FITXM0017058@zion.cs.uiuc.edu> Author: djg Date: Tue Jul 15 13:29:32 2008 New Revision: 53636 URL: http://llvm.org/viewvc/llvm-project?rev=53636&view=rev Log: SelectionDAG::AssignNodeIds is unused. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=53636&r1=53635&r2=53636&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Tue Jul 15 13:29:32 2008 @@ -565,10 +565,6 @@ void ReplaceAllUsesOfValueWith(SDOperand From, SDOperand To, DAGUpdateListener *UpdateListener = 0); - /// AssignNodeIds - Assign a unique node id for each node in the DAG based on - /// their allnodes order. It returns the maximum id. - unsigned AssignNodeIds(); - /// AssignTopologicalOrder - Assign a unique node id for each node in the DAG /// based on their topological order. It returns the maximum id and a vector /// of the SDNodes* in assigned order by reference. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=53636&r1=53635&r2=53636&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Jul 15 13:29:32 2008 @@ -4228,17 +4228,6 @@ } } -/// AssignNodeIds - Assign a unique node id for each node in the DAG based on -/// their allnodes order. It returns the maximum id. -unsigned SelectionDAG::AssignNodeIds() { - unsigned Id = 0; - for (allnodes_iterator I = allnodes_begin(), E = allnodes_end(); I != E; ++I){ - SDNode *N = I; - N->setNodeId(Id++); - } - return Id; -} - /// AssignTopologicalOrder - Assign a unique node id for each node in the DAG /// based on their topological order. It returns the maximum id and a vector /// of the SDNodes* in assigned order by reference. From kremenek at apple.com Tue Jul 15 13:30:08 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Jul 2008 18:30:08 -0000 Subject: [llvm-commits] [llvm] r53637 - /llvm/tags/checker/checker-61/ Message-ID: <200807151830.m6FIU80k017086@zion.cs.uiuc.edu> Author: kremenek Date: Tue Jul 15 13:30:08 2008 New Revision: 53637 URL: http://llvm.org/viewvc/llvm-project?rev=53637&view=rev Log: Tagging checker-61. Added: llvm/tags/checker/checker-61/ - copied from r53636, llvm/trunk/ From gohman at apple.com Tue Jul 15 13:37:51 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Jul 2008 18:37:51 -0000 Subject: [llvm-commits] [llvm] r53639 - /llvm/trunk/lib/Target/TargetAsmInfo.cpp Message-ID: <200807151837.m6FIbpDp017320@zion.cs.uiuc.edu> Author: djg Date: Tue Jul 15 13:37:51 2008 New Revision: 53639 URL: http://llvm.org/viewvc/llvm-project?rev=53639&view=rev Log: TargetAsmInfo::SectionForGlobal showed up in a profile. Simplify it a little. Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=53639&r1=53638&r2=53639&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Tue Jul 15 13:37:51 2008 @@ -273,15 +273,13 @@ S = SelectSectionForGlobal(GV); } - std::string Name = S->Name; + if (!S->isNamed()) + return S->Name; // If section is named we need to switch into it via special '.section' // directive and also append funky flags. Otherwise - section name is just // some magic assembler directive. - if (S->isNamed()) - Name = getSwitchToSectionDirective() + Name + PrintSectionFlags(S->Flags); - - return Name; + return getSwitchToSectionDirective() + S->Name + PrintSectionFlags(S->Flags); } // Lame default implementation. Calculate the section name for global. From baldrick at free.fr Tue Jul 15 13:49:59 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Jul 2008 20:49:59 +0200 Subject: [llvm-commits] [llvm] r53534 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-07-13-DivZero.ll test/Transforms/InstCombine/udiv_select_to_select_shift.ll In-Reply-To: References: <200807140015.m6E0FroD004171@zion.cs.uiuc.edu> <200807150934.16714.baldrick@free.fr> Message-ID: <200807152049.59887.baldrick@free.fr> Hi Chris, > > What I meant > > was that you always transform uses as long as they are below the > > original DivRem in the basic block; if they come before the DivRem > > then you have to be careful about calls that do not return. > > I'm still not following. The loop does a backwards walk from the div/ > rem up, simplifying instructions as it goes. If it find a call to a > function that might not return, it stops simplifying. Is there some > way the loop can be made cleaner? I didn't notice that you started at the div/rem. Then what about uses between the div/rem and the end of the BB - can't they be simplified too (without worrying about calls that don't return)? Ciao, Duncan. From dpatel at apple.com Tue Jul 15 15:47:58 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Jul 2008 20:47:58 -0000 Subject: [llvm-commits] [llvm] r53641 - /llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp Message-ID: <200807152047.m6FKlwGs023005@zion.cs.uiuc.edu> Author: dpatel Date: Tue Jul 15 15:47:58 2008 New Revision: 53641 URL: http://llvm.org/viewvc/llvm-project?rev=53641&view=rev Log: LinkOnce definitions have default scope, like weak definitions. Otherwise, the linker may not be able to match LinkOnce definition from one module with an exteranl reference from other module. Modified: llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp Modified: llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp?rev=53641&r1=53640&r2=53641&view=diff ============================================================================== --- llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp (original) +++ llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp Tue Jul 15 15:47:58 2008 @@ -224,7 +224,8 @@ // set scope part if ( def->hasHiddenVisibility() ) attr |= LTO_SYMBOL_SCOPE_HIDDEN; - else if ( def->hasExternalLinkage() || def->hasWeakLinkage() ) + else if ( def->hasExternalLinkage() || def->hasWeakLinkage() + || def->hasLinkOnceLinkage() ) attr |= LTO_SYMBOL_SCOPE_DEFAULT; else attr |= LTO_SYMBOL_SCOPE_INTERNAL; From baldrick at free.fr Tue Jul 15 16:00:27 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Jul 2008 23:00:27 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> <200807150939.33980.baldrick@free.fr> Message-ID: <200807152300.27489.baldrick@free.fr> Hi Dale, > >> + // For ObjC2, we may have a base class field that should not > >> be taken into > >> + // account here, as it is already in Offset. The ObjC FE > >> figures this out. > >> + tree field_bit_offset = objc_v2_bitfield_ivar_bitpos(exp); > >> + if (field_bit_offset) { > >> + BitStart = (unsigned)getINTEGER_CSTVal(field_bit_offset); > >> + } > >> // Here BitStart gives the offset of the field in bits from > >> field_offset. > >> // Incorporate as much of it as possible into the pointer > >> computation. > >> unsigned ByteOffset = BitStart/8; > > > > I didn't understand from your description what is going on here. > > Can you > > please explain some more. > > I'll try. Bitfields are referenced by an offset in bytes relative to > the beginning of the > object, + an offset in bits relative to the byte offset. In ObjC V2 > the byte offset > can change at runtime, so is loaded from memory rather than computed > at compile > time. The value loaded from memory includes the value you would > normally get > at compile time, so you don't want to add that in twice. There is > analogous code > in non-llvm-gcc's get_inner_reference. > (The comment about a base class is wrong, I'll fix that.) thanks for the explanation. However llvm-gcc already supports variable byte-offsets, i.e. where the value of the byte offset depends on the value of some variable, the content of a memory location etc. Ada does this for example. So why does ObjC2 need something special here? Ciao, Duncan. From dalej at apple.com Tue Jul 15 16:14:44 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 15 Jul 2008 14:14:44 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200807152300.27489.baldrick@free.fr> References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> <200807150939.33980.baldrick@free.fr> <200807152300.27489.baldrick@free.fr> Message-ID: On Jul 15, 2008, at 2:00 PMPDT, Duncan Sands wrote: > Hi Dale, > >>>> + // For ObjC2, we may have a base class field that should not >>>> be taken into >>>> + // account here, as it is already in Offset. The ObjC FE >>>> figures this out. >>>> + tree field_bit_offset = objc_v2_bitfield_ivar_bitpos(exp); >>>> + if (field_bit_offset) { >>>> + BitStart = (unsigned)getINTEGER_CSTVal(field_bit_offset); >>>> + } >>>> // Here BitStart gives the offset of the field in bits from >>>> field_offset. >>>> // Incorporate as much of it as possible into the pointer >>>> computation. >>>> unsigned ByteOffset = BitStart/8; >>> >>> I didn't understand from your description what is going on here. >>> Can you >>> please explain some more. >> >> I'll try. Bitfields are referenced by an offset in bytes relative to >> the beginning of the >> object, + an offset in bits relative to the byte offset. In ObjC V2 >> the byte offset >> can change at runtime, so is loaded from memory rather than computed >> at compile >> time. The value loaded from memory includes the value you would >> normally get >> at compile time, so you don't want to add that in twice. There is >> analogous code >> in non-llvm-gcc's get_inner_reference. >> (The comment about a base class is wrong, I'll fix that.) > > thanks for the explanation. However llvm-gcc already supports > variable byte-offsets, i.e. where the value of the byte offset > depends on the value of some variable, the content of a memory > location etc. Ada does this for example. So why does ObjC2 > need something special here? Presumably the ObjC FE trees do not look like the Ada trees. I don't know what the Ada trees look like. In ObjC, the offset is actually there twice in the tree in effect , and the user needs to compensate at some stage. Don't ask me why, I didn't write it:) From criswell at uiuc.edu Tue Jul 15 17:04:53 2008 From: criswell at uiuc.edu (John Criswell) Date: Tue, 15 Jul 2008 22:04:53 -0000 Subject: [llvm-commits] [poolalloc] r53643 - /poolalloc/branches/SVA/lib/DSA/Local.cpp Message-ID: <200807152204.m6FM4sFC025433@zion.cs.uiuc.edu> Author: criswell Date: Tue Jul 15 17:04:53 2008 New Revision: 53643 URL: http://llvm.org/viewvc/llvm-project?rev=53643&view=rev Log: Changed the pseudo allocator (pseudo_alloc()) to return a pointer to the allocated memory just like the other heap allocators. Modified: poolalloc/branches/SVA/lib/DSA/Local.cpp Modified: poolalloc/branches/SVA/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/lib/DSA/Local.cpp?rev=53643&r1=53642&r2=53643&view=diff ============================================================================== --- poolalloc/branches/SVA/lib/DSA/Local.cpp (original) +++ poolalloc/branches/SVA/lib/DSA/Local.cpp Tue Jul 15 17:04:53 2008 @@ -348,7 +348,7 @@ } else if (Constant *C = dyn_cast(V)) { if (ConstantExpr *CE = dyn_cast(C)) { std::set sources; - if (getSourcePointerValues(CE, sources)) { + if (getSourcePointerValues(CE, sources)) { NH = createNode(); for (std::set::iterator ii = sources.begin(), ee = sources.end(); ii != ee; ++ii) @@ -1510,10 +1510,7 @@ // allocation functions if (AllocList.end() != std::find(AllocList.begin(), AllocList.end(), F->getName())) { DSNodeHandle RetNH; - if (F->getName() == "pseudo_alloc") - RetNH = getValueDest(**CS.arg_begin()); - else - RetNH = getValueDest(*CS.getInstruction()); + RetNH = getValueDest(*CS.getInstruction()); RetNH.getNode()->setHeapNodeMarker()->setModifiedMarker(); RetNH.getNode()->getMP()->addCallSite(CS); return; From kremenek at apple.com Tue Jul 15 18:18:55 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Jul 2008 23:18:55 -0000 Subject: [llvm-commits] [llvm] r53650 - /llvm/tags/checker/checker-62/ Message-ID: <200807152318.m6FNItLn028031@zion.cs.uiuc.edu> Author: kremenek Date: Tue Jul 15 18:18:55 2008 New Revision: 53650 URL: http://llvm.org/viewvc/llvm-project?rev=53650&view=rev Log: Tagging checker-62. Added: llvm/tags/checker/checker-62/ - copied from r53649, llvm/trunk/ From kremenek at apple.com Tue Jul 15 18:35:37 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Jul 2008 23:35:37 -0000 Subject: [llvm-commits] [llvm] r53652 - /llvm/tags/checker/checker-62/ Message-ID: <200807152335.m6FNZbT5028539@zion.cs.uiuc.edu> Author: kremenek Date: Tue Jul 15 18:35:36 2008 New Revision: 53652 URL: http://llvm.org/viewvc/llvm-project?rev=53652&view=rev Log: Removing checker-62. Removed: llvm/tags/checker/checker-62/ From kremenek at apple.com Tue Jul 15 18:41:45 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Jul 2008 23:41:45 -0000 Subject: [llvm-commits] [llvm] r53655 - /llvm/tags/checker/checker-62/ Message-ID: <200807152341.m6FNfjll028748@zion.cs.uiuc.edu> Author: kremenek Date: Tue Jul 15 18:41:45 2008 New Revision: 53655 URL: http://llvm.org/viewvc/llvm-project?rev=53655&view=rev Log: Tagging checker-62. Added: llvm/tags/checker/checker-62/ - copied from r53654, llvm/trunk/ From kremenek at apple.com Tue Jul 15 19:17:21 2008 From: kremenek at apple.com (Ted Kremenek) Date: Wed, 16 Jul 2008 00:17:21 -0000 Subject: [llvm-commits] [llvm] r53657 - /llvm/tags/checker/checker-62/ Message-ID: <200807160017.m6G0HLSq029914@zion.cs.uiuc.edu> Author: kremenek Date: Tue Jul 15 19:17:20 2008 New Revision: 53657 URL: http://llvm.org/viewvc/llvm-project?rev=53657&view=rev Log: Removing checker-62. Removed: llvm/tags/checker/checker-62/ From evan.cheng at apple.com Tue Jul 15 20:33:09 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Jul 2008 01:33:09 -0000 Subject: [llvm-commits] [llvm] r53660 - /llvm/trunk/lib/Target/X86/X86JITInfo.cpp Message-ID: <200807160133.m6G1X9Z4032081@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 15 20:33:08 2008 New Revision: 53660 URL: http://llvm.org/viewvc/llvm-project?rev=53660&view=rev Log: X86-64 PIC jump table values are different from x86-32 cases, they are dest - table base. Modified: llvm/trunk/lib/Target/X86/X86JITInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86JITInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86JITInfo.cpp?rev=53660&r1=53659&r2=53660&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86JITInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86JITInfo.cpp Tue Jul 15 20:33:08 2008 @@ -463,7 +463,11 @@ /// getPICJumpTableEntry - Returns the value of the jumptable entry for the /// specific basic block. intptr_t X86JITInfo::getPICJumpTableEntry(intptr_t BB, intptr_t Entry) { +#if defined(X86_64_JIT) + return BB - Entry; +#else return BB - PICBase; +#endif } /// relocate - Before the JIT can run a block of code that has been emitted, From evan.cheng at apple.com Tue Jul 15 20:34:02 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Jul 2008 01:34:02 -0000 Subject: [llvm-commits] [llvm] r53661 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp Message-ID: <200807160134.m6G1Y23I032120@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jul 15 20:34:02 2008 New Revision: 53661 URL: http://llvm.org/viewvc/llvm-project?rev=53661&view=rev Log: x86-64 PIC JIT fixes: do not generate the extra load for external GV's. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86Subtarget.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=53661&r1=53660&r2=53661&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jul 15 20:34:02 2008 @@ -1677,15 +1677,11 @@ if (GlobalAddressSDNode *G = dyn_cast(Callee)) { // We should use extra load for direct calls to dllimported functions in // non-JIT mode. - if ((IsTailCall || !Is64Bit || - getTargetMachine().getCodeModel() != CodeModel::Large) - && !Subtarget->GVRequiresExtraLoad(G->getGlobal(), - getTargetMachine(), true)) + if (!Subtarget->GVRequiresExtraLoad(G->getGlobal(), + getTargetMachine(), true)) Callee = DAG.getTargetGlobalAddress(G->getGlobal(), getPointerTy()); } else if (ExternalSymbolSDNode *S = dyn_cast(Callee)) { - if (IsTailCall || !Is64Bit || - getTargetMachine().getCodeModel() != CodeModel::Large) - Callee = DAG.getTargetExternalSymbol(S->getSymbol(), getPointerTy()); + Callee = DAG.getTargetExternalSymbol(S->getSymbol(), getPointerTy()); } else if (IsTailCall) { unsigned Opc = Is64Bit ? X86::R9 : X86::ECX; Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=53661&r1=53660&r2=53661&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original) +++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Tue Jul 15 20:34:02 2008 @@ -37,7 +37,8 @@ bool isDirectCall) const { // FIXME: PIC - if (TM.getRelocationModel() != Reloc::Static) { + if (TM.getRelocationModel() != Reloc::Static && + TM.getCodeModel() != CodeModel::Large) { if (isTargetDarwin()) { return (!isDirectCall && (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || From kremenek at apple.com Tue Jul 15 21:30:26 2008 From: kremenek at apple.com (Ted Kremenek) Date: Wed, 16 Jul 2008 02:30:26 -0000 Subject: [llvm-commits] [llvm] r53662 - /llvm/tags/checker/checker-62/ Message-ID: <200807160230.m6G2UQi9001345@zion.cs.uiuc.edu> Author: kremenek Date: Tue Jul 15 21:30:26 2008 New Revision: 53662 URL: http://llvm.org/viewvc/llvm-project?rev=53662&view=rev Log: Tagging checker-62. Added: llvm/tags/checker/checker-62/ - copied from r53661, llvm/trunk/ From evan.cheng at apple.com Wed Jul 16 02:01:49 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Jul 2008 00:01:49 -0700 Subject: [llvm-commits] [LLVMdev] Spilled variables using unaligned moves In-Reply-To: References: <000301c8e5c0$0c63d590$252b80b0$@net> Message-ID: Ok. The issue is in X86InstrInfo.cpp: void X86InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, int FrameIdx, const TargetRegisterClass *RC) const{ unsigned Opc = getLoadRegOpcode(RC, RI.getStackAlignment()); addFrameReference(BuildMI(MBB, MI, get(Opc), DestReg), FrameIdx); } static unsigned getLoadRegOpcode(const TargetRegisterClass *RC, unsigned StackAlign) { ... } else if (RC == &X86::VR128RegClass) { // FIXME: Use movaps once we are capable of selectively // aligning functions that spill SSE registers on 16-byte boundaries. Opc = StackAlign >= 16 ? X86::MOVAPSrm : X86::MOVUPSrm; ... } So we just need to teach it to use MOVAPSrm if stack ptr is going to be realigned. Anton, I am not familiar with the realignment code. But is it now always safe to spill with MOVAPSrm since stack ptr is always realigned? Is it done for all subtargets? Evan On Jul 14, 2008, at 11:46 AM, Anton Korobeynikov wrote: > Hello, Evan > >> This is on Windows / Cygwin? I think the dynamic stack pointer re- >> alignment doesn't happen until post- register allocation. > Actually it's split into two parts. One is just small hook at pre-RA > level, which determines, whether stack realignment is really needed, > and if yes - "reserves" it during RA. > > The biggest part runs indeed at post-RA phase, but it just realigns > stack and translates 'virtual offsets' into real ones. For aligned > variables virtual offsets should be already aligned at this stage. > > ---- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State > University > From evan.cheng at apple.com Wed Jul 16 02:28:15 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Jul 2008 07:28:15 -0000 Subject: [llvm-commits] [llvm] r53666 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll Message-ID: <200807160728.m6G7SFCj010093@zion.cs.uiuc.edu> Author: evancheng Date: Wed Jul 16 02:28:14 2008 New Revision: 53666 URL: http://llvm.org/viewvc/llvm-project?rev=53666&view=rev Log: Fix PR2296. Do not transform x86_sse2_storel_dq into a full-width store. Added: llvm/trunk/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=53666&r1=53665&r2=53666&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul 16 02:28:14 2008 @@ -8646,7 +8646,6 @@ case Intrinsic::x86_sse_storeu_ps: case Intrinsic::x86_sse2_storeu_pd: case Intrinsic::x86_sse2_storeu_dq: - case Intrinsic::x86_sse2_storel_dq: // Turn X86 storeu -> store if the pointer is known aligned. if (GetOrEnforceKnownAlignment(II->getOperand(1), 16) >= 16) { const Type *OpPtrTy = Added: llvm/trunk/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll?rev=53666&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll Wed Jul 16 02:28:14 2008 @@ -0,0 +1,13 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {store } +; PR2296 + + at G = common global double 0.000000e+00, align 16 + +define void @x(<2 x i64> %y) nounwind { +entry: + bitcast <2 x i64> %y to <4 x i32> + call void @llvm.x86.sse2.storel.dq( i8* bitcast (double* @G to i8*), <4 x i32> %0 ) nounwind + ret void +} + +declare void @llvm.x86.sse2.storel.dq(i8*, <4 x i32>) nounwind From baldrick at free.fr Wed Jul 16 02:51:36 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 07:51:36 -0000 Subject: [llvm-commits] [test-suite] r53668 - /test-suite/trunk/Makefile.programs Message-ID: <200807160751.m6G7pawN018401@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jul 16 02:51:36 2008 New Revision: 53668 URL: http://llvm.org/viewvc/llvm-project?rev=53668&view=rev Log: Stop LLCBETA from using LegalizeTypes - it didn't catch anything. Modified: test-suite/trunk/Makefile.programs Modified: test-suite/trunk/Makefile.programs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=53668&r1=53667&r2=53668&view=diff ============================================================================== --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Wed Jul 16 02:51:36 2008 @@ -243,7 +243,6 @@ ifeq ($(ARCH),THUMB) LLCBETAOPTION := --enable-thumb-reg-scavenging endif -LLCBETAOPTION += --enable-legalize-types print-llcbeta-option: @echo $(LLCBETAOPTION) From baldrick at free.fr Wed Jul 16 03:09:49 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 08:09:49 -0000 Subject: [llvm-commits] [llvm] r53669 - /llvm/trunk/test/CodeGen/PowerPC/atomic-1.ll Message-ID: <200807160809.m6G89nCZ021701@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jul 16 03:09:48 2008 New Revision: 53669 URL: http://llvm.org/viewvc/llvm-project?rev=53669&view=rev Log: The atomic.cmp.swap promotion logic is wrong: it simply does the atomic.cmp.swap on the larger type, which means it blows away whatever is sitting in the bytes just after the memory location, i.e. causes a buffer overflow. This really requires target specific code, which is why LegalizeTypes doesn't try to handle this case generically. The existing (wrong) code in LegalizeDAG will go away automatically once the type legalization code is removed from LegalizeDAG so I'm leaving it there for the moment. Meanwhile, don't test for this feature. Modified: llvm/trunk/test/CodeGen/PowerPC/atomic-1.ll Modified: llvm/trunk/test/CodeGen/PowerPC/atomic-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/atomic-1.ll?rev=53669&r1=53668&r2=53669&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/atomic-1.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/atomic-1.ll Wed Jul 16 03:09:48 2008 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -march=ppc32 | grep lwarx | count 4 -; RUN: llvm-as < %s | llc -march=ppc32 | grep stwcx. | count 4 +; RUN: llvm-as < %s | llc -march=ppc32 | grep lwarx | count 3 +; RUN: llvm-as < %s | llc -march=ppc32 | grep stwcx. | count 3 define i32 @exchange_and_add(i32* %mem, i32 %val) nounwind { %tmp = call i32 @llvm.atomic.load.add.i32( i32* %mem, i32 %val ) @@ -11,11 +11,6 @@ ret i32 %tmp } -define i16 @exchange_and_cmp16(i16* %mem) nounwind { - %tmp = call i16 @llvm.atomic.cmp.swap.i16( i16* %mem, i16 0, i16 1 ) - ret i16 %tmp -} - define i32 @exchange(i32* %mem, i32 %val) nounwind { %tmp = call i32 @llvm.atomic.swap.i32( i32* %mem, i32 1 ) ret i32 %tmp @@ -23,5 +18,4 @@ declare i32 @llvm.atomic.load.add.i32(i32*, i32) nounwind declare i32 @llvm.atomic.cmp.swap.i32(i32*, i32, i32) nounwind -declare i16 @llvm.atomic.cmp.swap.i16(i16*, i16, i16) nounwind declare i32 @llvm.atomic.swap.i32(i32*, i32) nounwind From anton at korobeynikov.info Wed Jul 16 03:57:38 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Wed, 16 Jul 2008 12:57:38 +0400 Subject: [llvm-commits] [LLVMdev] Spilled variables using unaligned moves In-Reply-To: References: <000301c8e5c0$0c63d590$252b80b0$@net> Message-ID: <131B2DF7-1DD4-42B2-8139-7E1091A47EF1@korobeynikov.info> Hello, Evan > So we just need to teach it to use MOVAPSrm if stack ptr is going to > be realigned. Anton, I am not familiar with the realignment code. > But is it now always safe to spill with MOVAPSrm since stack ptr is > always realigned? Yes, it seems safe if stack realignment is not explicitely disabled (there is special command line option for this). > Is it done for all subtargets? Yes, it's done in target-independent part of prologue / epilogue inserter. The only target specific parts are setups of stack alignment values itself. Thanks for nailing down this issue - I'll take care of it soon. --- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From matthijs at stdin.nl Wed Jul 16 05:47:36 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Wed, 16 Jul 2008 10:47:36 -0000 Subject: [llvm-commits] [llvm] r53670 - /llvm/trunk/lib/Analysis/ValueTracking.cpp Message-ID: <200807161047.m6GAlalb027328@zion.cs.uiuc.edu> Author: matthijs Date: Wed Jul 16 05:47:35 2008 New Revision: 53670 URL: http://llvm.org/viewvc/llvm-project?rev=53670&view=rev Log: Don't use ++idx_begin when I actually mean idx_begin + 1, especially since we also use *idx_begin in the same expression, giving unpredictable results. This fixes this bug: http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-July/015877.html Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=53670&r1=53669&r2=53670&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ValueTracking.cpp (original) +++ llvm/trunk/lib/Analysis/ValueTracking.cpp Wed Jul 16 05:47:35 2008 @@ -864,7 +864,7 @@ else if (Constant *C = dyn_cast(V)) { if (isa(C) || isa(C)) // Recursively process this constant - return FindInsertedValue(C->getOperand(*idx_begin), ++idx_begin, idx_end, + return FindInsertedValue(C->getOperand(*idx_begin), idx_begin + 1, idx_end, InsertBefore); } else if (InsertValueInst *I = dyn_cast(V)) { // Loop the indices for the insertvalue instruction in parallel with the From baldrick at free.fr Wed Jul 16 06:36:52 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 11:36:52 -0000 Subject: [llvm-commits] [llvm] r53671 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll Message-ID: <200807161136.m6GBartC028784@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jul 16 06:36:51 2008 New Revision: 53671 URL: http://llvm.org/viewvc/llvm-project?rev=53671&view=rev Log: Turn on LegalizeTypes by default. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=53671&r1=53670&r2=53671&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jul 16 06:36:51 2008 @@ -52,7 +52,7 @@ static cl::opt EnableValueProp("enable-value-prop", cl::Hidden); static cl::opt -EnableLegalizeTypes("enable-legalize-types", cl::Hidden); +DisableLegalizeTypes("disable-legalize-types", cl::Hidden); #ifndef NDEBUG @@ -5296,14 +5296,16 @@ DOUT << "Optimized lowered selection DAG:\n"; DEBUG(DAG.dump()); - + // Second step, hack on the DAG until it only uses operations and types that // the target supports. - if (EnableLegalizeTypes) {// Enable this some day. + if (!DisableLegalizeTypes) {// Remove this some day. DAG.LegalizeTypes(); + DOUT << "Type legalized selection DAG:\n"; + DEBUG(DAG.dump()); // TODO: enable a dag combine pass here. } - + if (TimePassesIsEnabled) { NamedRegionTimer T("DAG Legalization", GroupName); DAG.Legalize(); Modified: llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll?rev=53671&r1=53670&r2=53671&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll (original) +++ llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll Wed Jul 16 06:36:51 2008 @@ -1,6 +1,4 @@ ; RUN: llvm-as < %s | llc -o - -; XFAIL: * -; Un-XFAIL this once LegalizeDAGTypes is turned on. target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" target triple = "i686-pc-linux-gnu" From baldrick at free.fr Wed Jul 16 06:41:33 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 11:41:33 -0000 Subject: [llvm-commits] [llvm] r53672 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeFloatTypes.cpp LegalizeIntegerTypes.cpp LegalizeVectorTypes.cpp Message-ID: <200807161141.m6GBfX7v028923@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jul 16 06:41:33 2008 New Revision: 53672 URL: http://llvm.org/viewvc/llvm-project?rev=53672&view=rev Log: Reorder methods alphabetically. No functionality change. While this is not a wonderful organizing principle, it does make it easy to find routines, and clear where to insert new ones. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp?rev=53672&r1=53671&r2=53672&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Wed Jul 16 06:41:33 2008 @@ -59,19 +59,18 @@ case ISD::ConstantFP: R = SoftenFloatRes_ConstantFP(cast(N)); break; + case ISD::FADD: R = SoftenFloatRes_FADD(N); break; case ISD::FCOPYSIGN: R = SoftenFloatRes_FCOPYSIGN(N); break; + case ISD::FMUL: R = SoftenFloatRes_FMUL(N); break; case ISD::FP_EXTEND: R = SoftenFloatRes_FP_EXTEND(N); break; case ISD::FP_ROUND: R = SoftenFloatRes_FP_ROUND(N); break; + case ISD::FPOWI: R = SoftenFloatRes_FPOWI(N); break; + case ISD::FSUB: R = SoftenFloatRes_FSUB(N); break; case ISD::LOAD: R = SoftenFloatRes_LOAD(N); break; case ISD::SELECT: R = SoftenFloatRes_SELECT(N); break; case ISD::SELECT_CC: R = SoftenFloatRes_SELECT_CC(N); break; case ISD::SINT_TO_FP: R = SoftenFloatRes_SINT_TO_FP(N); break; case ISD::UINT_TO_FP: R = SoftenFloatRes_UINT_TO_FP(N); break; - - case ISD::FADD: R = SoftenFloatRes_FADD(N); break; - case ISD::FMUL: R = SoftenFloatRes_FMUL(N); break; - case ISD::FPOWI: R = SoftenFloatRes_FPOWI(N); break; - case ISD::FSUB: R = SoftenFloatRes_FSUB(N); break; } // If R is null, the sub-method took care of registering the result. @@ -385,13 +384,12 @@ abort(); case ISD::BIT_CONVERT: Res = SoftenFloatOp_BIT_CONVERT(N); break; - - case ISD::BR_CC: Res = SoftenFloatOp_BR_CC(N); break; - case ISD::FP_TO_SINT: Res = SoftenFloatOp_FP_TO_SINT(N); break; - case ISD::FP_TO_UINT: Res = SoftenFloatOp_FP_TO_UINT(N); break; - case ISD::SELECT_CC: Res = SoftenFloatOp_SELECT_CC(N); break; - case ISD::SETCC: Res = SoftenFloatOp_SETCC(N); break; - case ISD::STORE: Res = SoftenFloatOp_STORE(N, OpNo); break; + case ISD::BR_CC: Res = SoftenFloatOp_BR_CC(N); break; + case ISD::FP_TO_SINT: Res = SoftenFloatOp_FP_TO_SINT(N); break; + case ISD::FP_TO_UINT: Res = SoftenFloatOp_FP_TO_UINT(N); break; + case ISD::SELECT_CC: Res = SoftenFloatOp_SELECT_CC(N); break; + case ISD::SETCC: Res = SoftenFloatOp_SETCC(N); break; + case ISD::STORE: Res = SoftenFloatOp_STORE(N, OpNo); break; } // If the result is null, the sub-method took care of registering results etc. @@ -983,17 +981,14 @@ case ISD::BUILD_VECTOR: Res = ExpandOp_BUILD_VECTOR(N); break; case ISD::EXTRACT_ELEMENT: Res = ExpandOp_EXTRACT_ELEMENT(N); break; - case ISD::BR_CC: Res = ExpandFloatOp_BR_CC(N); break; - case ISD::SELECT_CC: Res = ExpandFloatOp_SELECT_CC(N); break; - case ISD::SETCC: Res = ExpandFloatOp_SETCC(N); break; - + case ISD::BR_CC: Res = ExpandFloatOp_BR_CC(N); break; case ISD::FP_ROUND: Res = ExpandFloatOp_FP_ROUND(N); break; case ISD::FP_TO_SINT: Res = ExpandFloatOp_FP_TO_SINT(N); break; case ISD::FP_TO_UINT: Res = ExpandFloatOp_FP_TO_UINT(N); break; - - case ISD::STORE: - Res = ExpandFloatOp_STORE(cast(N), OpNo); - break; + case ISD::SELECT_CC: Res = ExpandFloatOp_SELECT_CC(N); break; + case ISD::SETCC: Res = ExpandFloatOp_SETCC(N); break; + case ISD::STORE: Res = ExpandFloatOp_STORE(cast(N), + OpNo); break; } } @@ -1062,39 +1057,34 @@ N->getOperand(4)); } -SDOperand DAGTypeLegalizer::ExpandFloatOp_SELECT_CC(SDNode *N) { - SDOperand NewLHS = N->getOperand(0), NewRHS = N->getOperand(1); - ISD::CondCode CCCode = cast(N->getOperand(4))->get(); - FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode); - - // If ExpandSetCCOperands returned a scalar, we need to compare the result - // against zero to select between true and false values. - if (NewRHS.Val == 0) { - NewRHS = DAG.getConstant(0, NewLHS.getValueType()); - CCCode = ISD::SETNE; - } - - // Update N to have the operands specified. - return DAG.UpdateNodeOperands(SDOperand(N, 0), NewLHS, NewRHS, - N->getOperand(2), N->getOperand(3), - DAG.getCondCode(CCCode)); +SDOperand DAGTypeLegalizer::ExpandFloatOp_FP_ROUND(SDNode *N) { + assert(N->getOperand(0).getValueType() == MVT::ppcf128 && + "Logic only correct for ppcf128!"); + SDOperand Lo, Hi; + GetExpandedFloat(N->getOperand(0), Lo, Hi); + // Round it the rest of the way (e.g. to f32) if needed. + return DAG.getNode(ISD::FP_ROUND, N->getValueType(0), Hi, N->getOperand(1)); } -SDOperand DAGTypeLegalizer::ExpandFloatOp_SETCC(SDNode *N) { - SDOperand NewLHS = N->getOperand(0), NewRHS = N->getOperand(1); - ISD::CondCode CCCode = cast(N->getOperand(2))->get(); - FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode); +SDOperand DAGTypeLegalizer::ExpandFloatOp_FP_TO_SINT(SDNode *N) { + assert(N->getOperand(0).getValueType() == MVT::ppcf128 && + "Unsupported FP_TO_SINT!"); - // If ExpandSetCCOperands returned a scalar, use it. - if (NewRHS.Val == 0) { - assert(NewLHS.getValueType() == N->getValueType(0) && - "Unexpected setcc expansion!"); - return NewLHS; + RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; + switch (N->getValueType(0).getSimpleVT()) { + default: + assert(false && "Unsupported FP_TO_SINT!"); + case MVT::i32: + LC = RTLIB::FPTOSINT_PPCF128_I32; + case MVT::i64: + LC = RTLIB::FPTOSINT_PPCF128_I64; + break; + case MVT::i128: + LC = RTLIB::FPTOSINT_PPCF128_I64; + break; } - // Otherwise, update N to have the operands specified. - return DAG.UpdateNodeOperands(SDOperand(N, 0), NewLHS, NewRHS, - DAG.getCondCode(CCCode)); + return MakeLibCall(LC, N->getValueType(0), &N->getOperand(0), 1, false); } SDOperand DAGTypeLegalizer::ExpandFloatOp_FP_TO_UINT(SDNode *N) { @@ -1119,34 +1109,39 @@ return MakeLibCall(LC, N->getValueType(0), &N->getOperand(0), 1, false); } -SDOperand DAGTypeLegalizer::ExpandFloatOp_FP_TO_SINT(SDNode *N) { - assert(N->getOperand(0).getValueType() == MVT::ppcf128 && - "Unsupported FP_TO_SINT!"); +SDOperand DAGTypeLegalizer::ExpandFloatOp_SELECT_CC(SDNode *N) { + SDOperand NewLHS = N->getOperand(0), NewRHS = N->getOperand(1); + ISD::CondCode CCCode = cast(N->getOperand(4))->get(); + FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode); - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - switch (N->getValueType(0).getSimpleVT()) { - default: - assert(false && "Unsupported FP_TO_SINT!"); - case MVT::i32: - LC = RTLIB::FPTOSINT_PPCF128_I32; - case MVT::i64: - LC = RTLIB::FPTOSINT_PPCF128_I64; - break; - case MVT::i128: - LC = RTLIB::FPTOSINT_PPCF128_I64; - break; + // If ExpandSetCCOperands returned a scalar, we need to compare the result + // against zero to select between true and false values. + if (NewRHS.Val == 0) { + NewRHS = DAG.getConstant(0, NewLHS.getValueType()); + CCCode = ISD::SETNE; } - return MakeLibCall(LC, N->getValueType(0), &N->getOperand(0), 1, false); + // Update N to have the operands specified. + return DAG.UpdateNodeOperands(SDOperand(N, 0), NewLHS, NewRHS, + N->getOperand(2), N->getOperand(3), + DAG.getCondCode(CCCode)); } -SDOperand DAGTypeLegalizer::ExpandFloatOp_FP_ROUND(SDNode *N) { - assert(N->getOperand(0).getValueType() == MVT::ppcf128 && - "Logic only correct for ppcf128!"); - SDOperand Lo, Hi; - GetExpandedFloat(N->getOperand(0), Lo, Hi); - // Round it the rest of the way (e.g. to f32) if needed. - return DAG.getNode(ISD::FP_ROUND, N->getValueType(0), Hi, N->getOperand(1)); +SDOperand DAGTypeLegalizer::ExpandFloatOp_SETCC(SDNode *N) { + SDOperand NewLHS = N->getOperand(0), NewRHS = N->getOperand(1); + ISD::CondCode CCCode = cast(N->getOperand(2))->get(); + FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode); + + // If ExpandSetCCOperands returned a scalar, use it. + if (NewRHS.Val == 0) { + assert(NewLHS.getValueType() == N->getValueType(0) && + "Unexpected setcc expansion!"); + return NewLHS; + } + + // Otherwise, update N to have the operands specified. + return DAG.UpdateNodeOperands(SDOperand(N, 0), NewLHS, NewRHS, + DAG.getCondCode(CCCode)); } SDOperand DAGTypeLegalizer::ExpandFloatOp_STORE(SDNode *N, unsigned OpNo) { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=53672&r1=53671&r2=53672&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Wed Jul 16 06:41:33 2008 @@ -826,39 +826,42 @@ case ISD::EXTRACT_ELEMENT: ExpandRes_EXTRACT_ELEMENT(N, Lo, Hi); break; case ISD::EXTRACT_VECTOR_ELT: ExpandRes_EXTRACT_VECTOR_ELT(N, Lo, Hi); break; - case ISD::Constant: ExpandIntRes_Constant(N, Lo, Hi); break; case ISD::ANY_EXTEND: ExpandIntRes_ANY_EXTEND(N, Lo, Hi); break; - case ISD::ZERO_EXTEND: ExpandIntRes_ZERO_EXTEND(N, Lo, Hi); break; - case ISD::SIGN_EXTEND: ExpandIntRes_SIGN_EXTEND(N, Lo, Hi); break; case ISD::AssertZext: ExpandIntRes_AssertZext(N, Lo, Hi); break; - case ISD::TRUNCATE: ExpandIntRes_TRUNCATE(N, Lo, Hi); break; - case ISD::SIGN_EXTEND_INREG: ExpandIntRes_SIGN_EXTEND_INREG(N, Lo, Hi); break; + case ISD::BSWAP: ExpandIntRes_BSWAP(N, Lo, Hi); break; + case ISD::Constant: ExpandIntRes_Constant(N, Lo, Hi); break; + case ISD::CTLZ: ExpandIntRes_CTLZ(N, Lo, Hi); break; + case ISD::CTPOP: ExpandIntRes_CTPOP(N, Lo, Hi); break; + case ISD::CTTZ: ExpandIntRes_CTTZ(N, Lo, Hi); break; case ISD::FP_TO_SINT: ExpandIntRes_FP_TO_SINT(N, Lo, Hi); break; case ISD::FP_TO_UINT: ExpandIntRes_FP_TO_UINT(N, Lo, Hi); break; case ISD::LOAD: ExpandIntRes_LOAD(cast(N), Lo, Hi); break; + case ISD::MUL: ExpandIntRes_MUL(N, Lo, Hi); break; + case ISD::SDIV: ExpandIntRes_SDIV(N, Lo, Hi); break; + case ISD::SIGN_EXTEND: ExpandIntRes_SIGN_EXTEND(N, Lo, Hi); break; + case ISD::SIGN_EXTEND_INREG: ExpandIntRes_SIGN_EXTEND_INREG(N, Lo, Hi); break; + case ISD::SREM: ExpandIntRes_SREM(N, Lo, Hi); break; + case ISD::TRUNCATE: ExpandIntRes_TRUNCATE(N, Lo, Hi); break; + case ISD::UDIV: ExpandIntRes_UDIV(N, Lo, Hi); break; + case ISD::UREM: ExpandIntRes_UREM(N, Lo, Hi); break; + case ISD::ZERO_EXTEND: ExpandIntRes_ZERO_EXTEND(N, Lo, Hi); break; case ISD::AND: case ISD::OR: - case ISD::XOR: ExpandIntRes_Logical(N, Lo, Hi); break; - case ISD::BSWAP: ExpandIntRes_BSWAP(N, Lo, Hi); break; + case ISD::XOR: ExpandIntRes_Logical(N, Lo, Hi); break; + case ISD::ADD: - case ISD::SUB: ExpandIntRes_ADDSUB(N, Lo, Hi); break; + case ISD::SUB: ExpandIntRes_ADDSUB(N, Lo, Hi); break; + case ISD::ADDC: - case ISD::SUBC: ExpandIntRes_ADDSUBC(N, Lo, Hi); break; + case ISD::SUBC: ExpandIntRes_ADDSUBC(N, Lo, Hi); break; + case ISD::ADDE: - case ISD::SUBE: ExpandIntRes_ADDSUBE(N, Lo, Hi); break; - case ISD::MUL: ExpandIntRes_MUL(N, Lo, Hi); break; - case ISD::SDIV: ExpandIntRes_SDIV(N, Lo, Hi); break; - case ISD::SREM: ExpandIntRes_SREM(N, Lo, Hi); break; - case ISD::UDIV: ExpandIntRes_UDIV(N, Lo, Hi); break; - case ISD::UREM: ExpandIntRes_UREM(N, Lo, Hi); break; + case ISD::SUBE: ExpandIntRes_ADDSUBE(N, Lo, Hi); break; + case ISD::SHL: case ISD::SRA: - case ISD::SRL: ExpandIntRes_Shift(N, Lo, Hi); break; - - case ISD::CTLZ: ExpandIntRes_CTLZ(N, Lo, Hi); break; - case ISD::CTPOP: ExpandIntRes_CTPOP(N, Lo, Hi); break; - case ISD::CTTZ: ExpandIntRes_CTTZ(N, Lo, Hi); break; + case ISD::SRL: ExpandIntRes_Shift(N, Lo, Hi); break; } // If Lo/Hi is null, the sub-method took care of registering results etc. @@ -866,151 +869,342 @@ SetExpandedInteger(SDOperand(N, ResNo), Lo, Hi); } -void DAGTypeLegalizer::ExpandIntRes_Constant(SDNode *N, +/// ExpandShiftByConstant - N is a shift by a value that needs to be expanded, +/// and the shift amount is a constant 'Amt'. Expand the operation. +void DAGTypeLegalizer::ExpandShiftByConstant(SDNode *N, unsigned Amt, SDOperand &Lo, SDOperand &Hi) { - MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); - unsigned NBitWidth = NVT.getSizeInBits(); - const APInt &Cst = cast(N)->getAPIntValue(); - Lo = DAG.getConstant(APInt(Cst).trunc(NBitWidth), NVT); - Hi = DAG.getConstant(Cst.lshr(NBitWidth).trunc(NBitWidth), NVT); -} + // Expand the incoming operand to be shifted, so that we have its parts + SDOperand InL, InH; + GetExpandedInteger(N->getOperand(0), InL, InH); -void DAGTypeLegalizer::ExpandIntRes_ANY_EXTEND(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); - SDOperand Op = N->getOperand(0); - if (Op.getValueType().bitsLE(NVT)) { - // The low part is any extension of the input (which degenerates to a copy). - Lo = DAG.getNode(ISD::ANY_EXTEND, NVT, Op); - Hi = DAG.getNode(ISD::UNDEF, NVT); // The high part is undefined. - } else { - // For example, extension of an i48 to an i64. The operand type necessarily - // promotes to the result type, so will end up being expanded too. - assert(getTypeAction(Op.getValueType()) == PromoteInteger && - "Only know how to promote this result!"); - SDOperand Res = GetPromotedInteger(Op); - assert(Res.getValueType() == N->getValueType(0) && - "Operand over promoted?"); - // Split the promoted operand. This will simplify when it is expanded. - SplitInteger(Res, Lo, Hi); - } -} + MVT NVT = InL.getValueType(); + unsigned VTBits = N->getValueType(0).getSizeInBits(); + unsigned NVTBits = NVT.getSizeInBits(); + MVT ShTy = N->getOperand(1).getValueType(); -void DAGTypeLegalizer::ExpandIntRes_ZERO_EXTEND(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); - SDOperand Op = N->getOperand(0); - if (Op.getValueType().bitsLE(NVT)) { - // The low part is zero extension of the input (which degenerates to a copy). - Lo = DAG.getNode(ISD::ZERO_EXTEND, NVT, N->getOperand(0)); - Hi = DAG.getConstant(0, NVT); // The high part is just a zero. - } else { - // For example, extension of an i48 to an i64. The operand type necessarily - // promotes to the result type, so will end up being expanded too. - assert(getTypeAction(Op.getValueType()) == PromoteInteger && - "Only know how to promote this result!"); - SDOperand Res = GetPromotedInteger(Op); - assert(Res.getValueType() == N->getValueType(0) && - "Operand over promoted?"); - // Split the promoted operand. This will simplify when it is expanded. - SplitInteger(Res, Lo, Hi); - unsigned ExcessBits = - Op.getValueType().getSizeInBits() - NVT.getSizeInBits(); - Hi = DAG.getZeroExtendInReg(Hi, MVT::getIntegerVT(ExcessBits)); + if (N->getOpcode() == ISD::SHL) { + if (Amt > VTBits) { + Lo = Hi = DAG.getConstant(0, NVT); + } else if (Amt > NVTBits) { + Lo = DAG.getConstant(0, NVT); + Hi = DAG.getNode(ISD::SHL, NVT, InL, DAG.getConstant(Amt-NVTBits,ShTy)); + } else if (Amt == NVTBits) { + Lo = DAG.getConstant(0, NVT); + Hi = InL; + } else if (Amt == 1) { + // Emit this X << 1 as X+X. + SDVTList VTList = DAG.getVTList(NVT, MVT::Flag); + SDOperand LoOps[2] = { InL, InL }; + Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); + SDOperand HiOps[3] = { InH, InH, Lo.getValue(1) }; + Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3); + } else { + Lo = DAG.getNode(ISD::SHL, NVT, InL, DAG.getConstant(Amt, ShTy)); + Hi = DAG.getNode(ISD::OR, NVT, + DAG.getNode(ISD::SHL, NVT, InH, + DAG.getConstant(Amt, ShTy)), + DAG.getNode(ISD::SRL, NVT, InL, + DAG.getConstant(NVTBits-Amt, ShTy))); + } + return; } -} -void DAGTypeLegalizer::ExpandIntRes_SIGN_EXTEND(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); - SDOperand Op = N->getOperand(0); - if (Op.getValueType().bitsLE(NVT)) { - // The low part is sign extension of the input (which degenerates to a copy). - Lo = DAG.getNode(ISD::SIGN_EXTEND, NVT, N->getOperand(0)); - // The high part is obtained by SRA'ing all but one of the bits of low part. - unsigned LoSize = NVT.getSizeInBits(); - Hi = DAG.getNode(ISD::SRA, NVT, Lo, - DAG.getConstant(LoSize-1, TLI.getShiftAmountTy())); - } else { - // For example, extension of an i48 to an i64. The operand type necessarily - // promotes to the result type, so will end up being expanded too. - assert(getTypeAction(Op.getValueType()) == PromoteInteger && - "Only know how to promote this result!"); - SDOperand Res = GetPromotedInteger(Op); - assert(Res.getValueType() == N->getValueType(0) && - "Operand over promoted?"); - // Split the promoted operand. This will simplify when it is expanded. - SplitInteger(Res, Lo, Hi); - unsigned ExcessBits = - Op.getValueType().getSizeInBits() - NVT.getSizeInBits(); - Hi = DAG.getNode(ISD::SIGN_EXTEND_INREG, Hi.getValueType(), Hi, - DAG.getValueType(MVT::getIntegerVT(ExcessBits))); + if (N->getOpcode() == ISD::SRL) { + if (Amt > VTBits) { + Lo = DAG.getConstant(0, NVT); + Hi = DAG.getConstant(0, NVT); + } else if (Amt > NVTBits) { + Lo = DAG.getNode(ISD::SRL, NVT, InH, DAG.getConstant(Amt-NVTBits,ShTy)); + Hi = DAG.getConstant(0, NVT); + } else if (Amt == NVTBits) { + Lo = InH; + Hi = DAG.getConstant(0, NVT); + } else { + Lo = DAG.getNode(ISD::OR, NVT, + DAG.getNode(ISD::SRL, NVT, InL, + DAG.getConstant(Amt, ShTy)), + DAG.getNode(ISD::SHL, NVT, InH, + DAG.getConstant(NVTBits-Amt, ShTy))); + Hi = DAG.getNode(ISD::SRL, NVT, InH, DAG.getConstant(Amt, ShTy)); + } + return; } -} - -void DAGTypeLegalizer::ExpandIntRes_AssertZext(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - GetExpandedInteger(N->getOperand(0), Lo, Hi); - MVT NVT = Lo.getValueType(); - MVT EVT = cast(N->getOperand(1))->getVT(); - unsigned NVTBits = NVT.getSizeInBits(); - unsigned EVTBits = EVT.getSizeInBits(); - if (NVTBits < EVTBits) { - Hi = DAG.getNode(ISD::AssertZext, NVT, Hi, - DAG.getValueType(MVT::getIntegerVT(EVTBits - NVTBits))); + assert(N->getOpcode() == ISD::SRA && "Unknown shift!"); + if (Amt > VTBits) { + Hi = Lo = DAG.getNode(ISD::SRA, NVT, InH, + DAG.getConstant(NVTBits-1, ShTy)); + } else if (Amt > NVTBits) { + Lo = DAG.getNode(ISD::SRA, NVT, InH, + DAG.getConstant(Amt-NVTBits, ShTy)); + Hi = DAG.getNode(ISD::SRA, NVT, InH, + DAG.getConstant(NVTBits-1, ShTy)); + } else if (Amt == NVTBits) { + Lo = InH; + Hi = DAG.getNode(ISD::SRA, NVT, InH, + DAG.getConstant(NVTBits-1, ShTy)); } else { - Lo = DAG.getNode(ISD::AssertZext, NVT, Lo, DAG.getValueType(EVT)); - // The high part must be zero, make it explicit. - Hi = DAG.getConstant(0, NVT); + Lo = DAG.getNode(ISD::OR, NVT, + DAG.getNode(ISD::SRL, NVT, InL, + DAG.getConstant(Amt, ShTy)), + DAG.getNode(ISD::SHL, NVT, InH, + DAG.getConstant(NVTBits-Amt, ShTy))); + Hi = DAG.getNode(ISD::SRA, NVT, InH, DAG.getConstant(Amt, ShTy)); } } -void DAGTypeLegalizer::ExpandIntRes_TRUNCATE(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { +/// ExpandShiftWithKnownAmountBit - Try to determine whether we can simplify +/// this shift based on knowledge of the high bit of the shift amount. If we +/// can tell this, we know that it is >= 32 or < 32, without knowing the actual +/// shift amount. +bool DAGTypeLegalizer:: +ExpandShiftWithKnownAmountBit(SDNode *N, SDOperand &Lo, SDOperand &Hi) { + SDOperand Amt = N->getOperand(1); MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); - Lo = DAG.getNode(ISD::TRUNCATE, NVT, N->getOperand(0)); - Hi = DAG.getNode(ISD::SRL, N->getOperand(0).getValueType(), N->getOperand(0), - DAG.getConstant(NVT.getSizeInBits(), - TLI.getShiftAmountTy())); - Hi = DAG.getNode(ISD::TRUNCATE, NVT, Hi); -} - -void DAGTypeLegalizer:: -ExpandIntRes_SIGN_EXTEND_INREG(SDNode *N, SDOperand &Lo, SDOperand &Hi) { - GetExpandedInteger(N->getOperand(0), Lo, Hi); - MVT EVT = cast(N->getOperand(1))->getVT(); + MVT ShTy = Amt.getValueType(); + unsigned ShBits = ShTy.getSizeInBits(); + unsigned NVTBits = NVT.getSizeInBits(); + assert(isPowerOf2_32(NVTBits) && + "Expanded integer type size not a power of two!"); - if (EVT.bitsLE(Lo.getValueType())) { - // sext_inreg the low part if needed. - Lo = DAG.getNode(ISD::SIGN_EXTEND_INREG, Lo.getValueType(), Lo, - N->getOperand(1)); + APInt HighBitMask = APInt::getHighBitsSet(ShBits, ShBits - Log2_32(NVTBits)); + APInt KnownZero, KnownOne; + DAG.ComputeMaskedBits(N->getOperand(1), HighBitMask, KnownZero, KnownOne); - // The high part gets the sign extension from the lo-part. This handles - // things like sextinreg V:i64 from i8. - Hi = DAG.getNode(ISD::SRA, Hi.getValueType(), Lo, - DAG.getConstant(Hi.getValueType().getSizeInBits()-1, - TLI.getShiftAmountTy())); - } else { - // For example, extension of an i48 to an i64. Leave the low part alone, - // sext_inreg the high part. - unsigned ExcessBits = - EVT.getSizeInBits() - Lo.getValueType().getSizeInBits(); - Hi = DAG.getNode(ISD::SIGN_EXTEND_INREG, Hi.getValueType(), Hi, - DAG.getValueType(MVT::getIntegerVT(ExcessBits))); - } -} + // If we don't know anything about the high bits, exit. + if (((KnownZero|KnownOne) & HighBitMask) == 0) + return false; -void DAGTypeLegalizer::ExpandIntRes_FP_TO_SINT(SDNode *N, SDOperand &Lo, - SDOperand &Hi) { - MVT VT = N->getValueType(0); - SDOperand Op = N->getOperand(0); - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; + // Get the incoming operand to be shifted. + SDOperand InL, InH; + GetExpandedInteger(N->getOperand(0), InL, InH); - if (VT == MVT::i32) { - if (Op.getValueType() == MVT::f32) - LC = RTLIB::FPTOSINT_F32_I32; - else if (Op.getValueType() == MVT::f64) + // If we know that any of the high bits of the shift amount are one, then we + // can do this as a couple of simple shifts. + if (KnownOne.intersects(HighBitMask)) { + // Mask out the high bit, which we know is set. + Amt = DAG.getNode(ISD::AND, ShTy, Amt, + DAG.getConstant(~HighBitMask, ShTy)); + + switch (N->getOpcode()) { + default: assert(0 && "Unknown shift"); + case ISD::SHL: + Lo = DAG.getConstant(0, NVT); // Low part is zero. + Hi = DAG.getNode(ISD::SHL, NVT, InL, Amt); // High part from Lo part. + return true; + case ISD::SRL: + Hi = DAG.getConstant(0, NVT); // Hi part is zero. + Lo = DAG.getNode(ISD::SRL, NVT, InH, Amt); // Lo part from Hi part. + return true; + case ISD::SRA: + Hi = DAG.getNode(ISD::SRA, NVT, InH, // Sign extend high part. + DAG.getConstant(NVTBits-1, ShTy)); + Lo = DAG.getNode(ISD::SRA, NVT, InH, Amt); // Lo part from Hi part. + return true; + } + } + + // If we know that all of the high bits of the shift amount are zero, then we + // can do this as a couple of simple shifts. + if ((KnownZero & HighBitMask) == HighBitMask) { + // Compute 32-amt. + SDOperand Amt2 = DAG.getNode(ISD::SUB, ShTy, + DAG.getConstant(NVTBits, ShTy), + Amt); + unsigned Op1, Op2; + switch (N->getOpcode()) { + default: assert(0 && "Unknown shift"); + case ISD::SHL: Op1 = ISD::SHL; Op2 = ISD::SRL; break; + case ISD::SRL: + case ISD::SRA: Op1 = ISD::SRL; Op2 = ISD::SHL; break; + } + + Lo = DAG.getNode(N->getOpcode(), NVT, InL, Amt); + Hi = DAG.getNode(ISD::OR, NVT, + DAG.getNode(Op1, NVT, InH, Amt), + DAG.getNode(Op2, NVT, InL, Amt2)); + return true; + } + + return false; +} + +void DAGTypeLegalizer::ExpandIntRes_ADDSUB(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + // Expand the subcomponents. + SDOperand LHSL, LHSH, RHSL, RHSH; + GetExpandedInteger(N->getOperand(0), LHSL, LHSH); + GetExpandedInteger(N->getOperand(1), RHSL, RHSH); + SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag); + SDOperand LoOps[2] = { LHSL, RHSL }; + SDOperand HiOps[3] = { LHSH, RHSH }; + + if (N->getOpcode() == ISD::ADD) { + Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); + HiOps[2] = Lo.getValue(1); + Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3); + } else { + Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2); + HiOps[2] = Lo.getValue(1); + Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3); + } +} + +void DAGTypeLegalizer::ExpandIntRes_ADDSUBC(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + // Expand the subcomponents. + SDOperand LHSL, LHSH, RHSL, RHSH; + GetExpandedInteger(N->getOperand(0), LHSL, LHSH); + GetExpandedInteger(N->getOperand(1), RHSL, RHSH); + SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag); + SDOperand LoOps[2] = { LHSL, RHSL }; + SDOperand HiOps[3] = { LHSH, RHSH }; + + if (N->getOpcode() == ISD::ADDC) { + Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); + HiOps[2] = Lo.getValue(1); + Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3); + } else { + Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2); + HiOps[2] = Lo.getValue(1); + Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3); + } + + // Legalized the flag result - switch anything that used the old flag to + // use the new one. + ReplaceValueWith(SDOperand(N, 1), Hi.getValue(1)); +} + +void DAGTypeLegalizer::ExpandIntRes_ADDSUBE(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + // Expand the subcomponents. + SDOperand LHSL, LHSH, RHSL, RHSH; + GetExpandedInteger(N->getOperand(0), LHSL, LHSH); + GetExpandedInteger(N->getOperand(1), RHSL, RHSH); + SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag); + SDOperand LoOps[3] = { LHSL, RHSL, N->getOperand(2) }; + SDOperand HiOps[3] = { LHSH, RHSH }; + + Lo = DAG.getNode(N->getOpcode(), VTList, LoOps, 3); + HiOps[2] = Lo.getValue(1); + Hi = DAG.getNode(N->getOpcode(), VTList, HiOps, 3); + + // Legalized the flag result - switch anything that used the old flag to + // use the new one. + ReplaceValueWith(SDOperand(N, 1), Hi.getValue(1)); +} + +void DAGTypeLegalizer::ExpandIntRes_ANY_EXTEND(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + SDOperand Op = N->getOperand(0); + if (Op.getValueType().bitsLE(NVT)) { + // The low part is any extension of the input (which degenerates to a copy). + Lo = DAG.getNode(ISD::ANY_EXTEND, NVT, Op); + Hi = DAG.getNode(ISD::UNDEF, NVT); // The high part is undefined. + } else { + // For example, extension of an i48 to an i64. The operand type necessarily + // promotes to the result type, so will end up being expanded too. + assert(getTypeAction(Op.getValueType()) == PromoteInteger && + "Only know how to promote this result!"); + SDOperand Res = GetPromotedInteger(Op); + assert(Res.getValueType() == N->getValueType(0) && + "Operand over promoted?"); + // Split the promoted operand. This will simplify when it is expanded. + SplitInteger(Res, Lo, Hi); + } +} + +void DAGTypeLegalizer::ExpandIntRes_AssertZext(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + GetExpandedInteger(N->getOperand(0), Lo, Hi); + MVT NVT = Lo.getValueType(); + MVT EVT = cast(N->getOperand(1))->getVT(); + unsigned NVTBits = NVT.getSizeInBits(); + unsigned EVTBits = EVT.getSizeInBits(); + + if (NVTBits < EVTBits) { + Hi = DAG.getNode(ISD::AssertZext, NVT, Hi, + DAG.getValueType(MVT::getIntegerVT(EVTBits - NVTBits))); + } else { + Lo = DAG.getNode(ISD::AssertZext, NVT, Lo, DAG.getValueType(EVT)); + // The high part must be zero, make it explicit. + Hi = DAG.getConstant(0, NVT); + } +} + +void DAGTypeLegalizer::ExpandIntRes_BSWAP(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + GetExpandedInteger(N->getOperand(0), Hi, Lo); // Note swapped operands. + Lo = DAG.getNode(ISD::BSWAP, Lo.getValueType(), Lo); + Hi = DAG.getNode(ISD::BSWAP, Hi.getValueType(), Hi); +} + +void DAGTypeLegalizer::ExpandIntRes_Constant(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + unsigned NBitWidth = NVT.getSizeInBits(); + const APInt &Cst = cast(N)->getAPIntValue(); + Lo = DAG.getConstant(APInt(Cst).trunc(NBitWidth), NVT); + Hi = DAG.getConstant(Cst.lshr(NBitWidth).trunc(NBitWidth), NVT); +} + +void DAGTypeLegalizer::ExpandIntRes_CTLZ(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + // ctlz (HiLo) -> Hi != 0 ? ctlz(Hi) : (ctlz(Lo)+32) + GetExpandedInteger(N->getOperand(0), Lo, Hi); + MVT NVT = Lo.getValueType(); + + SDOperand HiNotZero = DAG.getSetCC(TLI.getSetCCResultType(Hi), Hi, + DAG.getConstant(0, NVT), ISD::SETNE); + + SDOperand LoLZ = DAG.getNode(ISD::CTLZ, NVT, Lo); + SDOperand HiLZ = DAG.getNode(ISD::CTLZ, NVT, Hi); + + Lo = DAG.getNode(ISD::SELECT, NVT, HiNotZero, HiLZ, + DAG.getNode(ISD::ADD, NVT, LoLZ, + DAG.getConstant(NVT.getSizeInBits(), NVT))); + Hi = DAG.getConstant(0, NVT); +} + +void DAGTypeLegalizer::ExpandIntRes_CTPOP(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + // ctpop(HiLo) -> ctpop(Hi)+ctpop(Lo) + GetExpandedInteger(N->getOperand(0), Lo, Hi); + MVT NVT = Lo.getValueType(); + Lo = DAG.getNode(ISD::ADD, NVT, DAG.getNode(ISD::CTPOP, NVT, Lo), + DAG.getNode(ISD::CTPOP, NVT, Hi)); + Hi = DAG.getConstant(0, NVT); +} + +void DAGTypeLegalizer::ExpandIntRes_CTTZ(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + // cttz (HiLo) -> Lo != 0 ? cttz(Lo) : (cttz(Hi)+32) + GetExpandedInteger(N->getOperand(0), Lo, Hi); + MVT NVT = Lo.getValueType(); + + SDOperand LoNotZero = DAG.getSetCC(TLI.getSetCCResultType(Lo), Lo, + DAG.getConstant(0, NVT), ISD::SETNE); + + SDOperand LoLZ = DAG.getNode(ISD::CTTZ, NVT, Lo); + SDOperand HiLZ = DAG.getNode(ISD::CTTZ, NVT, Hi); + + Lo = DAG.getNode(ISD::SELECT, NVT, LoNotZero, LoLZ, + DAG.getNode(ISD::ADD, NVT, HiLZ, + DAG.getConstant(NVT.getSizeInBits(), NVT))); + Hi = DAG.getConstant(0, NVT); +} + +void DAGTypeLegalizer::ExpandIntRes_FP_TO_SINT(SDNode *N, SDOperand &Lo, + SDOperand &Hi) { + MVT VT = N->getValueType(0); + SDOperand Op = N->getOperand(0); + RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; + + if (VT == MVT::i32) { + if (Op.getValueType() == MVT::f32) + LC = RTLIB::FPTOSINT_F32_I32; + else if (Op.getValueType() == MVT::f64) LC = RTLIB::FPTOSINT_F64_I32; else if (Op.getValueType() == MVT::f80) LC = RTLIB::FPTOSINT_F80_I32; @@ -1194,82 +1388,10 @@ Hi = DAG.getNode(N->getOpcode(), LL.getValueType(), LH, RH); } -void DAGTypeLegalizer::ExpandIntRes_BSWAP(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - GetExpandedInteger(N->getOperand(0), Hi, Lo); // Note swapped operands. - Lo = DAG.getNode(ISD::BSWAP, Lo.getValueType(), Lo); - Hi = DAG.getNode(ISD::BSWAP, Hi.getValueType(), Hi); -} - -void DAGTypeLegalizer::ExpandIntRes_ADDSUB(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - // Expand the subcomponents. - SDOperand LHSL, LHSH, RHSL, RHSH; - GetExpandedInteger(N->getOperand(0), LHSL, LHSH); - GetExpandedInteger(N->getOperand(1), RHSL, RHSH); - SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag); - SDOperand LoOps[2] = { LHSL, RHSL }; - SDOperand HiOps[3] = { LHSH, RHSH }; - - if (N->getOpcode() == ISD::ADD) { - Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); - HiOps[2] = Lo.getValue(1); - Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3); - } else { - Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2); - HiOps[2] = Lo.getValue(1); - Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3); - } -} - -void DAGTypeLegalizer::ExpandIntRes_ADDSUBC(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - // Expand the subcomponents. - SDOperand LHSL, LHSH, RHSL, RHSH; - GetExpandedInteger(N->getOperand(0), LHSL, LHSH); - GetExpandedInteger(N->getOperand(1), RHSL, RHSH); - SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag); - SDOperand LoOps[2] = { LHSL, RHSL }; - SDOperand HiOps[3] = { LHSH, RHSH }; - - if (N->getOpcode() == ISD::ADDC) { - Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); - HiOps[2] = Lo.getValue(1); - Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3); - } else { - Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2); - HiOps[2] = Lo.getValue(1); - Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3); - } - - // Legalized the flag result - switch anything that used the old flag to - // use the new one. - ReplaceValueWith(SDOperand(N, 1), Hi.getValue(1)); -} - -void DAGTypeLegalizer::ExpandIntRes_ADDSUBE(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - // Expand the subcomponents. - SDOperand LHSL, LHSH, RHSL, RHSH; - GetExpandedInteger(N->getOperand(0), LHSL, LHSH); - GetExpandedInteger(N->getOperand(1), RHSL, RHSH); - SDVTList VTList = DAG.getVTList(LHSL.getValueType(), MVT::Flag); - SDOperand LoOps[3] = { LHSL, RHSL, N->getOperand(2) }; - SDOperand HiOps[3] = { LHSH, RHSH }; - - Lo = DAG.getNode(N->getOpcode(), VTList, LoOps, 3); - HiOps[2] = Lo.getValue(1); - Hi = DAG.getNode(N->getOpcode(), VTList, HiOps, 3); - - // Legalized the flag result - switch anything that used the old flag to - // use the new one. - ReplaceValueWith(SDOperand(N, 1), Hi.getValue(1)); -} - -void DAGTypeLegalizer::ExpandIntRes_MUL(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - MVT VT = N->getValueType(0); - MVT NVT = TLI.getTypeToTransformTo(VT); +void DAGTypeLegalizer::ExpandIntRes_MUL(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + MVT VT = N->getValueType(0); + MVT NVT = TLI.getTypeToTransformTo(VT); bool HasMULHS = TLI.isOperationLegal(ISD::MULHS, NVT); bool HasMULHU = TLI.isOperationLegal(ISD::MULHU, NVT); @@ -1370,57 +1492,6 @@ SplitInteger(MakeLibCall(LC, VT, Ops, 2, true), Lo, Hi); } -void DAGTypeLegalizer::ExpandIntRes_SREM(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - MVT VT = N->getValueType(0); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - if (VT == MVT::i32) - LC = RTLIB::SREM_I32; - else if (VT == MVT::i64) - LC = RTLIB::SREM_I64; - else if (VT == MVT::i128) - LC = RTLIB::SREM_I128; - assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SREM!"); - - SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; - SplitInteger(MakeLibCall(LC, VT, Ops, 2, true), Lo, Hi); -} - -void DAGTypeLegalizer::ExpandIntRes_UDIV(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - MVT VT = N->getValueType(0); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - if (VT == MVT::i32) - LC = RTLIB::UDIV_I32; - else if (VT == MVT::i64) - LC = RTLIB::UDIV_I64; - else if (VT == MVT::i128) - LC = RTLIB::UDIV_I128; - assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported UDIV!"); - - SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; - SplitInteger(MakeLibCall(LC, VT, Ops, 2, false), Lo, Hi); -} - -void DAGTypeLegalizer::ExpandIntRes_UREM(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - MVT VT = N->getValueType(0); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - if (VT == MVT::i32) - LC = RTLIB::UREM_I32; - else if (VT == MVT::i64) - LC = RTLIB::UREM_I64; - else if (VT == MVT::i128) - LC = RTLIB::UREM_I128; - assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported UREM!"); - - SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; - SplitInteger(MakeLibCall(LC, VT, Ops, 2, false), Lo, Hi); -} - void DAGTypeLegalizer::ExpandIntRes_Shift(SDNode *N, SDOperand &Lo, SDOperand &Hi) { MVT VT = N->getValueType(0); @@ -1498,210 +1569,142 @@ SplitInteger(MakeLibCall(LC, VT, Ops, 2, isSigned), Lo, Hi); } -void DAGTypeLegalizer::ExpandIntRes_CTLZ(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - // ctlz (HiLo) -> Hi != 0 ? ctlz(Hi) : (ctlz(Lo)+32) +void DAGTypeLegalizer::ExpandIntRes_SIGN_EXTEND(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + SDOperand Op = N->getOperand(0); + if (Op.getValueType().bitsLE(NVT)) { + // The low part is sign extension of the input (which degenerates to a copy). + Lo = DAG.getNode(ISD::SIGN_EXTEND, NVT, N->getOperand(0)); + // The high part is obtained by SRA'ing all but one of the bits of low part. + unsigned LoSize = NVT.getSizeInBits(); + Hi = DAG.getNode(ISD::SRA, NVT, Lo, + DAG.getConstant(LoSize-1, TLI.getShiftAmountTy())); + } else { + // For example, extension of an i48 to an i64. The operand type necessarily + // promotes to the result type, so will end up being expanded too. + assert(getTypeAction(Op.getValueType()) == PromoteInteger && + "Only know how to promote this result!"); + SDOperand Res = GetPromotedInteger(Op); + assert(Res.getValueType() == N->getValueType(0) && + "Operand over promoted?"); + // Split the promoted operand. This will simplify when it is expanded. + SplitInteger(Res, Lo, Hi); + unsigned ExcessBits = + Op.getValueType().getSizeInBits() - NVT.getSizeInBits(); + Hi = DAG.getNode(ISD::SIGN_EXTEND_INREG, Hi.getValueType(), Hi, + DAG.getValueType(MVT::getIntegerVT(ExcessBits))); + } +} + +void DAGTypeLegalizer:: +ExpandIntRes_SIGN_EXTEND_INREG(SDNode *N, SDOperand &Lo, SDOperand &Hi) { GetExpandedInteger(N->getOperand(0), Lo, Hi); - MVT NVT = Lo.getValueType(); + MVT EVT = cast(N->getOperand(1))->getVT(); - SDOperand HiNotZero = DAG.getSetCC(TLI.getSetCCResultType(Hi), Hi, - DAG.getConstant(0, NVT), ISD::SETNE); + if (EVT.bitsLE(Lo.getValueType())) { + // sext_inreg the low part if needed. + Lo = DAG.getNode(ISD::SIGN_EXTEND_INREG, Lo.getValueType(), Lo, + N->getOperand(1)); - SDOperand LoLZ = DAG.getNode(ISD::CTLZ, NVT, Lo); - SDOperand HiLZ = DAG.getNode(ISD::CTLZ, NVT, Hi); + // The high part gets the sign extension from the lo-part. This handles + // things like sextinreg V:i64 from i8. + Hi = DAG.getNode(ISD::SRA, Hi.getValueType(), Lo, + DAG.getConstant(Hi.getValueType().getSizeInBits()-1, + TLI.getShiftAmountTy())); + } else { + // For example, extension of an i48 to an i64. Leave the low part alone, + // sext_inreg the high part. + unsigned ExcessBits = + EVT.getSizeInBits() - Lo.getValueType().getSizeInBits(); + Hi = DAG.getNode(ISD::SIGN_EXTEND_INREG, Hi.getValueType(), Hi, + DAG.getValueType(MVT::getIntegerVT(ExcessBits))); + } +} - Lo = DAG.getNode(ISD::SELECT, NVT, HiNotZero, HiLZ, - DAG.getNode(ISD::ADD, NVT, LoLZ, - DAG.getConstant(NVT.getSizeInBits(), NVT))); - Hi = DAG.getConstant(0, NVT); +void DAGTypeLegalizer::ExpandIntRes_SREM(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + MVT VT = N->getValueType(0); + + RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; + if (VT == MVT::i32) + LC = RTLIB::SREM_I32; + else if (VT == MVT::i64) + LC = RTLIB::SREM_I64; + else if (VT == MVT::i128) + LC = RTLIB::SREM_I128; + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SREM!"); + + SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; + SplitInteger(MakeLibCall(LC, VT, Ops, 2, true), Lo, Hi); } -void DAGTypeLegalizer::ExpandIntRes_CTPOP(SDNode *N, - SDOperand &Lo, SDOperand &Hi) { - // ctpop(HiLo) -> ctpop(Hi)+ctpop(Lo) - GetExpandedInteger(N->getOperand(0), Lo, Hi); - MVT NVT = Lo.getValueType(); - Lo = DAG.getNode(ISD::ADD, NVT, DAG.getNode(ISD::CTPOP, NVT, Lo), - DAG.getNode(ISD::CTPOP, NVT, Hi)); - Hi = DAG.getConstant(0, NVT); +void DAGTypeLegalizer::ExpandIntRes_TRUNCATE(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + Lo = DAG.getNode(ISD::TRUNCATE, NVT, N->getOperand(0)); + Hi = DAG.getNode(ISD::SRL, N->getOperand(0).getValueType(), N->getOperand(0), + DAG.getConstant(NVT.getSizeInBits(), + TLI.getShiftAmountTy())); + Hi = DAG.getNode(ISD::TRUNCATE, NVT, Hi); } -void DAGTypeLegalizer::ExpandIntRes_CTTZ(SDNode *N, +void DAGTypeLegalizer::ExpandIntRes_UDIV(SDNode *N, SDOperand &Lo, SDOperand &Hi) { - // cttz (HiLo) -> Lo != 0 ? cttz(Lo) : (cttz(Hi)+32) - GetExpandedInteger(N->getOperand(0), Lo, Hi); - MVT NVT = Lo.getValueType(); - - SDOperand LoNotZero = DAG.getSetCC(TLI.getSetCCResultType(Lo), Lo, - DAG.getConstant(0, NVT), ISD::SETNE); + MVT VT = N->getValueType(0); - SDOperand LoLZ = DAG.getNode(ISD::CTTZ, NVT, Lo); - SDOperand HiLZ = DAG.getNode(ISD::CTTZ, NVT, Hi); + RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; + if (VT == MVT::i32) + LC = RTLIB::UDIV_I32; + else if (VT == MVT::i64) + LC = RTLIB::UDIV_I64; + else if (VT == MVT::i128) + LC = RTLIB::UDIV_I128; + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported UDIV!"); - Lo = DAG.getNode(ISD::SELECT, NVT, LoNotZero, LoLZ, - DAG.getNode(ISD::ADD, NVT, HiLZ, - DAG.getConstant(NVT.getSizeInBits(), NVT))); - Hi = DAG.getConstant(0, NVT); + SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; + SplitInteger(MakeLibCall(LC, VT, Ops, 2, false), Lo, Hi); } -/// ExpandShiftByConstant - N is a shift by a value that needs to be expanded, -/// and the shift amount is a constant 'Amt'. Expand the operation. -void DAGTypeLegalizer::ExpandShiftByConstant(SDNode *N, unsigned Amt, - SDOperand &Lo, SDOperand &Hi) { - // Expand the incoming operand to be shifted, so that we have its parts - SDOperand InL, InH; - GetExpandedInteger(N->getOperand(0), InL, InH); +void DAGTypeLegalizer::ExpandIntRes_UREM(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + MVT VT = N->getValueType(0); - MVT NVT = InL.getValueType(); - unsigned VTBits = N->getValueType(0).getSizeInBits(); - unsigned NVTBits = NVT.getSizeInBits(); - MVT ShTy = N->getOperand(1).getValueType(); + RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; + if (VT == MVT::i32) + LC = RTLIB::UREM_I32; + else if (VT == MVT::i64) + LC = RTLIB::UREM_I64; + else if (VT == MVT::i128) + LC = RTLIB::UREM_I128; + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported UREM!"); - if (N->getOpcode() == ISD::SHL) { - if (Amt > VTBits) { - Lo = Hi = DAG.getConstant(0, NVT); - } else if (Amt > NVTBits) { - Lo = DAG.getConstant(0, NVT); - Hi = DAG.getNode(ISD::SHL, NVT, InL, DAG.getConstant(Amt-NVTBits,ShTy)); - } else if (Amt == NVTBits) { - Lo = DAG.getConstant(0, NVT); - Hi = InL; - } else if (Amt == 1) { - // Emit this X << 1 as X+X. - SDVTList VTList = DAG.getVTList(NVT, MVT::Flag); - SDOperand LoOps[2] = { InL, InL }; - Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); - SDOperand HiOps[3] = { InH, InH, Lo.getValue(1) }; - Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3); - } else { - Lo = DAG.getNode(ISD::SHL, NVT, InL, DAG.getConstant(Amt, ShTy)); - Hi = DAG.getNode(ISD::OR, NVT, - DAG.getNode(ISD::SHL, NVT, InH, - DAG.getConstant(Amt, ShTy)), - DAG.getNode(ISD::SRL, NVT, InL, - DAG.getConstant(NVTBits-Amt, ShTy))); - } - return; - } - - if (N->getOpcode() == ISD::SRL) { - if (Amt > VTBits) { - Lo = DAG.getConstant(0, NVT); - Hi = DAG.getConstant(0, NVT); - } else if (Amt > NVTBits) { - Lo = DAG.getNode(ISD::SRL, NVT, InH, DAG.getConstant(Amt-NVTBits,ShTy)); - Hi = DAG.getConstant(0, NVT); - } else if (Amt == NVTBits) { - Lo = InH; - Hi = DAG.getConstant(0, NVT); - } else { - Lo = DAG.getNode(ISD::OR, NVT, - DAG.getNode(ISD::SRL, NVT, InL, - DAG.getConstant(Amt, ShTy)), - DAG.getNode(ISD::SHL, NVT, InH, - DAG.getConstant(NVTBits-Amt, ShTy))); - Hi = DAG.getNode(ISD::SRL, NVT, InH, DAG.getConstant(Amt, ShTy)); - } - return; - } - - assert(N->getOpcode() == ISD::SRA && "Unknown shift!"); - if (Amt > VTBits) { - Hi = Lo = DAG.getNode(ISD::SRA, NVT, InH, - DAG.getConstant(NVTBits-1, ShTy)); - } else if (Amt > NVTBits) { - Lo = DAG.getNode(ISD::SRA, NVT, InH, - DAG.getConstant(Amt-NVTBits, ShTy)); - Hi = DAG.getNode(ISD::SRA, NVT, InH, - DAG.getConstant(NVTBits-1, ShTy)); - } else if (Amt == NVTBits) { - Lo = InH; - Hi = DAG.getNode(ISD::SRA, NVT, InH, - DAG.getConstant(NVTBits-1, ShTy)); - } else { - Lo = DAG.getNode(ISD::OR, NVT, - DAG.getNode(ISD::SRL, NVT, InL, - DAG.getConstant(Amt, ShTy)), - DAG.getNode(ISD::SHL, NVT, InH, - DAG.getConstant(NVTBits-Amt, ShTy))); - Hi = DAG.getNode(ISD::SRA, NVT, InH, DAG.getConstant(Amt, ShTy)); - } + SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; + SplitInteger(MakeLibCall(LC, VT, Ops, 2, false), Lo, Hi); } -/// ExpandShiftWithKnownAmountBit - Try to determine whether we can simplify -/// this shift based on knowledge of the high bit of the shift amount. If we -/// can tell this, we know that it is >= 32 or < 32, without knowing the actual -/// shift amount. -bool DAGTypeLegalizer:: -ExpandShiftWithKnownAmountBit(SDNode *N, SDOperand &Lo, SDOperand &Hi) { - SDOperand Amt = N->getOperand(1); +void DAGTypeLegalizer::ExpandIntRes_ZERO_EXTEND(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); - MVT ShTy = Amt.getValueType(); - unsigned ShBits = ShTy.getSizeInBits(); - unsigned NVTBits = NVT.getSizeInBits(); - assert(isPowerOf2_32(NVTBits) && - "Expanded integer type size not a power of two!"); - - APInt HighBitMask = APInt::getHighBitsSet(ShBits, ShBits - Log2_32(NVTBits)); - APInt KnownZero, KnownOne; - DAG.ComputeMaskedBits(N->getOperand(1), HighBitMask, KnownZero, KnownOne); - - // If we don't know anything about the high bits, exit. - if (((KnownZero|KnownOne) & HighBitMask) == 0) - return false; - - // Get the incoming operand to be shifted. - SDOperand InL, InH; - GetExpandedInteger(N->getOperand(0), InL, InH); - - // If we know that any of the high bits of the shift amount are one, then we - // can do this as a couple of simple shifts. - if (KnownOne.intersects(HighBitMask)) { - // Mask out the high bit, which we know is set. - Amt = DAG.getNode(ISD::AND, ShTy, Amt, - DAG.getConstant(~HighBitMask, ShTy)); - - switch (N->getOpcode()) { - default: assert(0 && "Unknown shift"); - case ISD::SHL: - Lo = DAG.getConstant(0, NVT); // Low part is zero. - Hi = DAG.getNode(ISD::SHL, NVT, InL, Amt); // High part from Lo part. - return true; - case ISD::SRL: - Hi = DAG.getConstant(0, NVT); // Hi part is zero. - Lo = DAG.getNode(ISD::SRL, NVT, InH, Amt); // Lo part from Hi part. - return true; - case ISD::SRA: - Hi = DAG.getNode(ISD::SRA, NVT, InH, // Sign extend high part. - DAG.getConstant(NVTBits-1, ShTy)); - Lo = DAG.getNode(ISD::SRA, NVT, InH, Amt); // Lo part from Hi part. - return true; - } - } - - // If we know that all of the high bits of the shift amount are zero, then we - // can do this as a couple of simple shifts. - if ((KnownZero & HighBitMask) == HighBitMask) { - // Compute 32-amt. - SDOperand Amt2 = DAG.getNode(ISD::SUB, ShTy, - DAG.getConstant(NVTBits, ShTy), - Amt); - unsigned Op1, Op2; - switch (N->getOpcode()) { - default: assert(0 && "Unknown shift"); - case ISD::SHL: Op1 = ISD::SHL; Op2 = ISD::SRL; break; - case ISD::SRL: - case ISD::SRA: Op1 = ISD::SRL; Op2 = ISD::SHL; break; - } - - Lo = DAG.getNode(N->getOpcode(), NVT, InL, Amt); - Hi = DAG.getNode(ISD::OR, NVT, - DAG.getNode(Op1, NVT, InH, Amt), - DAG.getNode(Op2, NVT, InL, Amt2)); - return true; + SDOperand Op = N->getOperand(0); + if (Op.getValueType().bitsLE(NVT)) { + // The low part is zero extension of the input (which degenerates to a copy). + Lo = DAG.getNode(ISD::ZERO_EXTEND, NVT, N->getOperand(0)); + Hi = DAG.getConstant(0, NVT); // The high part is just a zero. + } else { + // For example, extension of an i48 to an i64. The operand type necessarily + // promotes to the result type, so will end up being expanded too. + assert(getTypeAction(Op.getValueType()) == PromoteInteger && + "Only know how to promote this result!"); + SDOperand Res = GetPromotedInteger(Op); + assert(Res.getValueType() == N->getValueType(0) && + "Operand over promoted?"); + // Split the promoted operand. This will simplify when it is expanded. + SplitInteger(Res, Lo, Hi); + unsigned ExcessBits = + Op.getValueType().getSizeInBits() - NVT.getSizeInBits(); + Hi = DAG.getZeroExtendInReg(Hi, MVT::getIntegerVT(ExcessBits)); } - - return false; } @@ -1709,254 +1712,60 @@ // Integer Operand Expansion //===----------------------------------------------------------------------===// -/// ExpandIntegerOperand - This method is called when the specified operand of -/// the specified node is found to need expansion. At this point, all of the -/// result types of the node are known to be legal, but other operands of the -/// node may need promotion or expansion as well as the specified one. -bool DAGTypeLegalizer::ExpandIntegerOperand(SDNode *N, unsigned OpNo) { - DEBUG(cerr << "Expand integer operand: "; N->dump(&DAG); cerr << "\n"); - SDOperand Res = SDOperand(); - - if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType()) - == TargetLowering::Custom) - Res = TLI.LowerOperation(SDOperand(N, OpNo), DAG); - - if (Res.Val == 0) { - switch (N->getOpcode()) { - default: - #ifndef NDEBUG - cerr << "ExpandIntegerOperand Op #" << OpNo << ": "; - N->dump(&DAG); cerr << "\n"; - #endif - assert(0 && "Do not know how to expand this operator's operand!"); - abort(); - - case ISD::BUILD_VECTOR: Res = ExpandOp_BUILD_VECTOR(N); break; - case ISD::BIT_CONVERT: Res = ExpandOp_BIT_CONVERT(N); break; - case ISD::EXTRACT_ELEMENT: Res = ExpandOp_EXTRACT_ELEMENT(N); break; - - case ISD::TRUNCATE: Res = ExpandIntOp_TRUNCATE(N); break; - - case ISD::SINT_TO_FP: Res = ExpandIntOp_SINT_TO_FP(N); break; - case ISD::UINT_TO_FP: Res = ExpandIntOp_UINT_TO_FP(N); break; - - case ISD::BR_CC: Res = ExpandIntOp_BR_CC(N); break; - case ISD::SELECT_CC: Res = ExpandIntOp_SELECT_CC(N); break; - case ISD::SETCC: Res = ExpandIntOp_SETCC(N); break; - - case ISD::STORE: - Res = ExpandIntOp_STORE(cast(N), OpNo); - break; - } - } - - // If the result is null, the sub-method took care of registering results etc. - if (!Res.Val) return false; - // If the result is N, the sub-method updated N in place. Check to see if any - // operands are new, and if so, mark them. - if (Res.Val == N) { - // Mark N as new and remark N and its operands. This allows us to correctly - // revisit N if it needs another step of expansion and allows us to visit - // any new operands to N. - ReanalyzeNode(N); - return true; - } - - assert(Res.getValueType() == N->getValueType(0) && N->getNumValues() == 1 && - "Invalid operand expansion"); - - ReplaceValueWith(SDOperand(N, 0), Res); - return false; -} - -SDOperand DAGTypeLegalizer::ExpandIntOp_TRUNCATE(SDNode *N) { - SDOperand InL, InH; - GetExpandedInteger(N->getOperand(0), InL, InH); - // Just truncate the low part of the source. - return DAG.getNode(ISD::TRUNCATE, N->getValueType(0), InL); -} - -SDOperand DAGTypeLegalizer::ExpandIntOp_SINT_TO_FP(SDNode *N) { - SDOperand Op = N->getOperand(0); - MVT SrcVT = Op.getValueType(); - MVT DstVT = N->getValueType(0); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - if (SrcVT == MVT::i32) { - if (DstVT == MVT::f32) - LC = RTLIB::SINTTOFP_I32_F32; - else if (DstVT == MVT::f64) - LC = RTLIB::SINTTOFP_I32_F64; - else if (DstVT == MVT::f80) - LC = RTLIB::SINTTOFP_I32_F80; - else if (DstVT == MVT::ppcf128) - LC = RTLIB::SINTTOFP_I32_PPCF128; - } else if (SrcVT == MVT::i64) { - if (DstVT == MVT::f32) - LC = RTLIB::SINTTOFP_I64_F32; - else if (DstVT == MVT::f64) - LC = RTLIB::SINTTOFP_I64_F64; - else if (DstVT == MVT::f80) - LC = RTLIB::SINTTOFP_I64_F80; - else if (DstVT == MVT::ppcf128) - LC = RTLIB::SINTTOFP_I64_PPCF128; - } else if (SrcVT == MVT::i128) { - if (DstVT == MVT::f32) - LC = RTLIB::SINTTOFP_I128_F32; - else if (DstVT == MVT::f64) - LC = RTLIB::SINTTOFP_I128_F64; - else if (DstVT == MVT::f80) - LC = RTLIB::SINTTOFP_I128_F80; - else if (DstVT == MVT::ppcf128) - LC = RTLIB::SINTTOFP_I128_PPCF128; - } - assert(LC != RTLIB::UNKNOWN_LIBCALL && - "Don't know how to expand this SINT_TO_FP!"); - - return MakeLibCall(LC, DstVT, &Op, 1, true); -} - -SDOperand DAGTypeLegalizer::ExpandIntOp_UINT_TO_FP(SDNode *N) { - SDOperand Op = N->getOperand(0); - MVT SrcVT = Op.getValueType(); - MVT DstVT = N->getValueType(0); - - if (TLI.getOperationAction(ISD::SINT_TO_FP, SrcVT) == TargetLowering::Custom){ - // Do a signed conversion then adjust the result. - SDOperand SignedConv = DAG.getNode(ISD::SINT_TO_FP, DstVT, Op); - SignedConv = TLI.LowerOperation(SignedConv, DAG); - - // The result of the signed conversion needs adjusting if the 'sign bit' of - // the incoming integer was set. To handle this, we dynamically test to see - // if it is set, and, if so, add a fudge factor. - - const uint64_t F32TwoE32 = 0x4F800000ULL; - const uint64_t F32TwoE64 = 0x5F800000ULL; - const uint64_t F32TwoE128 = 0x7F800000ULL; - - APInt FF(32, 0); - if (SrcVT == MVT::i32) - FF = APInt(32, F32TwoE32); - else if (SrcVT == MVT::i64) - FF = APInt(32, F32TwoE64); - else if (SrcVT == MVT::i128) - FF = APInt(32, F32TwoE128); - else - assert(false && "Unsupported UINT_TO_FP!"); - - // Check whether the sign bit is set. - SDOperand Lo, Hi; - GetExpandedInteger(Op, Lo, Hi); - SDOperand SignSet = DAG.getSetCC(TLI.getSetCCResultType(Hi), Hi, - DAG.getConstant(0, Hi.getValueType()), - ISD::SETLT); - - // Build a 64 bit pair (0, FF) in the constant pool, with FF in the lo bits. - SDOperand FudgePtr = DAG.getConstantPool(ConstantInt::get(FF.zext(64)), - TLI.getPointerTy()); - - // Get a pointer to FF if the sign bit was set, or to 0 otherwise. - SDOperand Zero = DAG.getIntPtrConstant(0); - SDOperand Four = DAG.getIntPtrConstant(4); - if (TLI.isBigEndian()) std::swap(Zero, Four); - SDOperand Offset = DAG.getNode(ISD::SELECT, Zero.getValueType(), SignSet, - Zero, Four); - FudgePtr = DAG.getNode(ISD::ADD, TLI.getPointerTy(), FudgePtr, Offset); - - // Load the value out, extending it from f32 to the destination float type. - // FIXME: Avoid the extend by constructing the right constant pool? - SDOperand Fudge = DAG.getExtLoad(ISD::EXTLOAD, DstVT, DAG.getEntryNode(), - FudgePtr, NULL, 0, MVT::f32); - return DAG.getNode(ISD::FADD, DstVT, SignedConv, Fudge); - } - - // Otherwise, use a libcall. - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - if (SrcVT == MVT::i32) { - if (DstVT == MVT::f32) - LC = RTLIB::UINTTOFP_I32_F32; - else if (DstVT == MVT::f64) - LC = RTLIB::UINTTOFP_I32_F64; - else if (DstVT == MVT::f80) - LC = RTLIB::UINTTOFP_I32_F80; - else if (DstVT == MVT::ppcf128) - LC = RTLIB::UINTTOFP_I32_PPCF128; - } else if (SrcVT == MVT::i64) { - if (DstVT == MVT::f32) - LC = RTLIB::UINTTOFP_I64_F32; - else if (DstVT == MVT::f64) - LC = RTLIB::UINTTOFP_I64_F64; - else if (DstVT == MVT::f80) - LC = RTLIB::UINTTOFP_I64_F80; - else if (DstVT == MVT::ppcf128) - LC = RTLIB::UINTTOFP_I64_PPCF128; - } else if (SrcVT == MVT::i128) { - if (DstVT == MVT::f32) - LC = RTLIB::UINTTOFP_I128_F32; - else if (DstVT == MVT::f64) - LC = RTLIB::UINTTOFP_I128_F64; - else if (DstVT == MVT::f80) - LC = RTLIB::UINTTOFP_I128_F80; - else if (DstVT == MVT::ppcf128) - LC = RTLIB::UINTTOFP_I128_PPCF128; - } - assert(LC != RTLIB::UNKNOWN_LIBCALL && - "Don't know how to expand this UINT_TO_FP!"); - - return MakeLibCall(LC, DstVT, &Op, 1, true); -} - -SDOperand DAGTypeLegalizer::ExpandIntOp_BR_CC(SDNode *N) { - SDOperand NewLHS = N->getOperand(2), NewRHS = N->getOperand(3); - ISD::CondCode CCCode = cast(N->getOperand(1))->get(); - IntegerExpandSetCCOperands(NewLHS, NewRHS, CCCode); - - // If ExpandSetCCOperands returned a scalar, we need to compare the result - // against zero to select between true and false values. - if (NewRHS.Val == 0) { - NewRHS = DAG.getConstant(0, NewLHS.getValueType()); - CCCode = ISD::SETNE; - } - - // Update N to have the operands specified. - return DAG.UpdateNodeOperands(SDOperand(N, 0), N->getOperand(0), - DAG.getCondCode(CCCode), NewLHS, NewRHS, - N->getOperand(4)); -} +/// ExpandIntegerOperand - This method is called when the specified operand of +/// the specified node is found to need expansion. At this point, all of the +/// result types of the node are known to be legal, but other operands of the +/// node may need promotion or expansion as well as the specified one. +bool DAGTypeLegalizer::ExpandIntegerOperand(SDNode *N, unsigned OpNo) { + DEBUG(cerr << "Expand integer operand: "; N->dump(&DAG); cerr << "\n"); + SDOperand Res = SDOperand(); -SDOperand DAGTypeLegalizer::ExpandIntOp_SELECT_CC(SDNode *N) { - SDOperand NewLHS = N->getOperand(0), NewRHS = N->getOperand(1); - ISD::CondCode CCCode = cast(N->getOperand(4))->get(); - IntegerExpandSetCCOperands(NewLHS, NewRHS, CCCode); + if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType()) + == TargetLowering::Custom) + Res = TLI.LowerOperation(SDOperand(N, OpNo), DAG); - // If ExpandSetCCOperands returned a scalar, we need to compare the result - // against zero to select between true and false values. - if (NewRHS.Val == 0) { - NewRHS = DAG.getConstant(0, NewLHS.getValueType()); - CCCode = ISD::SETNE; - } + if (Res.Val == 0) { + switch (N->getOpcode()) { + default: + #ifndef NDEBUG + cerr << "ExpandIntegerOperand Op #" << OpNo << ": "; + N->dump(&DAG); cerr << "\n"; + #endif + assert(0 && "Do not know how to expand this operator's operand!"); + abort(); - // Update N to have the operands specified. - return DAG.UpdateNodeOperands(SDOperand(N, 0), NewLHS, NewRHS, - N->getOperand(2), N->getOperand(3), - DAG.getCondCode(CCCode)); -} + case ISD::BUILD_VECTOR: Res = ExpandOp_BUILD_VECTOR(N); break; + case ISD::BIT_CONVERT: Res = ExpandOp_BIT_CONVERT(N); break; + case ISD::EXTRACT_ELEMENT: Res = ExpandOp_EXTRACT_ELEMENT(N); break; -SDOperand DAGTypeLegalizer::ExpandIntOp_SETCC(SDNode *N) { - SDOperand NewLHS = N->getOperand(0), NewRHS = N->getOperand(1); - ISD::CondCode CCCode = cast(N->getOperand(2))->get(); - IntegerExpandSetCCOperands(NewLHS, NewRHS, CCCode); + case ISD::BR_CC: Res = ExpandIntOp_BR_CC(N); break; + case ISD::SELECT_CC: Res = ExpandIntOp_SELECT_CC(N); break; + case ISD::SETCC: Res = ExpandIntOp_SETCC(N); break; + case ISD::SINT_TO_FP: Res = ExpandIntOp_SINT_TO_FP(N); break; + case ISD::STORE: Res = ExpandIntOp_STORE(cast(N), OpNo); + break; + case ISD::TRUNCATE: Res = ExpandIntOp_TRUNCATE(N); break; + case ISD::UINT_TO_FP: Res = ExpandIntOp_UINT_TO_FP(N); break; + } + } - // If ExpandSetCCOperands returned a scalar, use it. - if (NewRHS.Val == 0) { - assert(NewLHS.getValueType() == N->getValueType(0) && - "Unexpected setcc expansion!"); - return NewLHS; + // If the result is null, the sub-method took care of registering results etc. + if (!Res.Val) return false; + // If the result is N, the sub-method updated N in place. Check to see if any + // operands are new, and if so, mark them. + if (Res.Val == N) { + // Mark N as new and remark N and its operands. This allows us to correctly + // revisit N if it needs another step of expansion and allows us to visit + // any new operands to N. + ReanalyzeNode(N); + return true; } - // Otherwise, update N to have the operands specified. - return DAG.UpdateNodeOperands(SDOperand(N, 0), NewLHS, NewRHS, - DAG.getCondCode(CCCode)); + assert(Res.getValueType() == N->getValueType(0) && N->getNumValues() == 1 && + "Invalid operand expansion"); + + ReplaceValueWith(SDOperand(N, 0), Res); + return false; } /// IntegerExpandSetCCOperands - Expand the operands of a comparison. This code @@ -2058,6 +1867,99 @@ NewRHS = SDOperand(); } +SDOperand DAGTypeLegalizer::ExpandIntOp_BR_CC(SDNode *N) { + SDOperand NewLHS = N->getOperand(2), NewRHS = N->getOperand(3); + ISD::CondCode CCCode = cast(N->getOperand(1))->get(); + IntegerExpandSetCCOperands(NewLHS, NewRHS, CCCode); + + // If ExpandSetCCOperands returned a scalar, we need to compare the result + // against zero to select between true and false values. + if (NewRHS.Val == 0) { + NewRHS = DAG.getConstant(0, NewLHS.getValueType()); + CCCode = ISD::SETNE; + } + + // Update N to have the operands specified. + return DAG.UpdateNodeOperands(SDOperand(N, 0), N->getOperand(0), + DAG.getCondCode(CCCode), NewLHS, NewRHS, + N->getOperand(4)); +} + +SDOperand DAGTypeLegalizer::ExpandIntOp_SELECT_CC(SDNode *N) { + SDOperand NewLHS = N->getOperand(0), NewRHS = N->getOperand(1); + ISD::CondCode CCCode = cast(N->getOperand(4))->get(); + IntegerExpandSetCCOperands(NewLHS, NewRHS, CCCode); + + // If ExpandSetCCOperands returned a scalar, we need to compare the result + // against zero to select between true and false values. + if (NewRHS.Val == 0) { + NewRHS = DAG.getConstant(0, NewLHS.getValueType()); + CCCode = ISD::SETNE; + } + + // Update N to have the operands specified. + return DAG.UpdateNodeOperands(SDOperand(N, 0), NewLHS, NewRHS, + N->getOperand(2), N->getOperand(3), + DAG.getCondCode(CCCode)); +} + +SDOperand DAGTypeLegalizer::ExpandIntOp_SETCC(SDNode *N) { + SDOperand NewLHS = N->getOperand(0), NewRHS = N->getOperand(1); + ISD::CondCode CCCode = cast(N->getOperand(2))->get(); + IntegerExpandSetCCOperands(NewLHS, NewRHS, CCCode); + + // If ExpandSetCCOperands returned a scalar, use it. + if (NewRHS.Val == 0) { + assert(NewLHS.getValueType() == N->getValueType(0) && + "Unexpected setcc expansion!"); + return NewLHS; + } + + // Otherwise, update N to have the operands specified. + return DAG.UpdateNodeOperands(SDOperand(N, 0), NewLHS, NewRHS, + DAG.getCondCode(CCCode)); +} + +SDOperand DAGTypeLegalizer::ExpandIntOp_SINT_TO_FP(SDNode *N) { + SDOperand Op = N->getOperand(0); + MVT SrcVT = Op.getValueType(); + MVT DstVT = N->getValueType(0); + + RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; + if (SrcVT == MVT::i32) { + if (DstVT == MVT::f32) + LC = RTLIB::SINTTOFP_I32_F32; + else if (DstVT == MVT::f64) + LC = RTLIB::SINTTOFP_I32_F64; + else if (DstVT == MVT::f80) + LC = RTLIB::SINTTOFP_I32_F80; + else if (DstVT == MVT::ppcf128) + LC = RTLIB::SINTTOFP_I32_PPCF128; + } else if (SrcVT == MVT::i64) { + if (DstVT == MVT::f32) + LC = RTLIB::SINTTOFP_I64_F32; + else if (DstVT == MVT::f64) + LC = RTLIB::SINTTOFP_I64_F64; + else if (DstVT == MVT::f80) + LC = RTLIB::SINTTOFP_I64_F80; + else if (DstVT == MVT::ppcf128) + LC = RTLIB::SINTTOFP_I64_PPCF128; + } else if (SrcVT == MVT::i128) { + if (DstVT == MVT::f32) + LC = RTLIB::SINTTOFP_I128_F32; + else if (DstVT == MVT::f64) + LC = RTLIB::SINTTOFP_I128_F64; + else if (DstVT == MVT::f80) + LC = RTLIB::SINTTOFP_I128_F80; + else if (DstVT == MVT::ppcf128) + LC = RTLIB::SINTTOFP_I128_PPCF128; + } + assert(LC != RTLIB::UNKNOWN_LIBCALL && + "Don't know how to expand this SINT_TO_FP!"); + + return MakeLibCall(LC, DstVT, &Op, 1, true); +} + SDOperand DAGTypeLegalizer::ExpandIntOp_STORE(StoreSDNode *N, unsigned OpNo) { if (ISD::isNormalStore(N)) return ExpandOp_NormalStore(N, OpNo); @@ -2136,3 +2038,100 @@ return DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi); } } + +SDOperand DAGTypeLegalizer::ExpandIntOp_TRUNCATE(SDNode *N) { + SDOperand InL, InH; + GetExpandedInteger(N->getOperand(0), InL, InH); + // Just truncate the low part of the source. + return DAG.getNode(ISD::TRUNCATE, N->getValueType(0), InL); +} + +SDOperand DAGTypeLegalizer::ExpandIntOp_UINT_TO_FP(SDNode *N) { + SDOperand Op = N->getOperand(0); + MVT SrcVT = Op.getValueType(); + MVT DstVT = N->getValueType(0); + + if (TLI.getOperationAction(ISD::SINT_TO_FP, SrcVT) == TargetLowering::Custom){ + // Do a signed conversion then adjust the result. + SDOperand SignedConv = DAG.getNode(ISD::SINT_TO_FP, DstVT, Op); + SignedConv = TLI.LowerOperation(SignedConv, DAG); + + // The result of the signed conversion needs adjusting if the 'sign bit' of + // the incoming integer was set. To handle this, we dynamically test to see + // if it is set, and, if so, add a fudge factor. + + const uint64_t F32TwoE32 = 0x4F800000ULL; + const uint64_t F32TwoE64 = 0x5F800000ULL; + const uint64_t F32TwoE128 = 0x7F800000ULL; + + APInt FF(32, 0); + if (SrcVT == MVT::i32) + FF = APInt(32, F32TwoE32); + else if (SrcVT == MVT::i64) + FF = APInt(32, F32TwoE64); + else if (SrcVT == MVT::i128) + FF = APInt(32, F32TwoE128); + else + assert(false && "Unsupported UINT_TO_FP!"); + + // Check whether the sign bit is set. + SDOperand Lo, Hi; + GetExpandedInteger(Op, Lo, Hi); + SDOperand SignSet = DAG.getSetCC(TLI.getSetCCResultType(Hi), Hi, + DAG.getConstant(0, Hi.getValueType()), + ISD::SETLT); + + // Build a 64 bit pair (0, FF) in the constant pool, with FF in the lo bits. + SDOperand FudgePtr = DAG.getConstantPool(ConstantInt::get(FF.zext(64)), + TLI.getPointerTy()); + + // Get a pointer to FF if the sign bit was set, or to 0 otherwise. + SDOperand Zero = DAG.getIntPtrConstant(0); + SDOperand Four = DAG.getIntPtrConstant(4); + if (TLI.isBigEndian()) std::swap(Zero, Four); + SDOperand Offset = DAG.getNode(ISD::SELECT, Zero.getValueType(), SignSet, + Zero, Four); + FudgePtr = DAG.getNode(ISD::ADD, TLI.getPointerTy(), FudgePtr, Offset); + + // Load the value out, extending it from f32 to the destination float type. + // FIXME: Avoid the extend by constructing the right constant pool? + SDOperand Fudge = DAG.getExtLoad(ISD::EXTLOAD, DstVT, DAG.getEntryNode(), + FudgePtr, NULL, 0, MVT::f32); + return DAG.getNode(ISD::FADD, DstVT, SignedConv, Fudge); + } + + // Otherwise, use a libcall. + RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; + if (SrcVT == MVT::i32) { + if (DstVT == MVT::f32) + LC = RTLIB::UINTTOFP_I32_F32; + else if (DstVT == MVT::f64) + LC = RTLIB::UINTTOFP_I32_F64; + else if (DstVT == MVT::f80) + LC = RTLIB::UINTTOFP_I32_F80; + else if (DstVT == MVT::ppcf128) + LC = RTLIB::UINTTOFP_I32_PPCF128; + } else if (SrcVT == MVT::i64) { + if (DstVT == MVT::f32) + LC = RTLIB::UINTTOFP_I64_F32; + else if (DstVT == MVT::f64) + LC = RTLIB::UINTTOFP_I64_F64; + else if (DstVT == MVT::f80) + LC = RTLIB::UINTTOFP_I64_F80; + else if (DstVT == MVT::ppcf128) + LC = RTLIB::UINTTOFP_I64_PPCF128; + } else if (SrcVT == MVT::i128) { + if (DstVT == MVT::f32) + LC = RTLIB::UINTTOFP_I128_F32; + else if (DstVT == MVT::f64) + LC = RTLIB::UINTTOFP_I128_F64; + else if (DstVT == MVT::f80) + LC = RTLIB::UINTTOFP_I128_F80; + else if (DstVT == MVT::ppcf128) + LC = RTLIB::UINTTOFP_I128_PPCF128; + } + assert(LC != RTLIB::UNKNOWN_LIBCALL && + "Don't know how to expand this UINT_TO_FP!"); + + return MakeLibCall(LC, DstVT, &Op, 1, true); +} Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=53672&r1=53671&r2=53672&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Wed Jul 16 06:41:33 2008 @@ -41,8 +41,14 @@ assert(0 && "Do not know how to scalarize the result of this operator!"); abort(); - case ISD::UNDEF: R = ScalarizeVecRes_UNDEF(N); break; - case ISD::LOAD: R = ScalarizeVecRes_LOAD(cast(N)); break; + case ISD::BIT_CONVERT: R = ScalarizeVecRes_BIT_CONVERT(N); break; + case ISD::BUILD_VECTOR: R = N->getOperand(0); break; + case ISD::FPOWI: R = ScalarizeVecRes_FPOWI(N); break; + case ISD::INSERT_VECTOR_ELT: R = ScalarizeVecRes_INSERT_VECTOR_ELT(N); break; + case ISD::LOAD: R = ScalarizeVecRes_LOAD(cast(N));break; + case ISD::VECTOR_SHUFFLE: R = ScalarizeVecRes_VECTOR_SHUFFLE(N); break; + case ISD::SELECT: R = ScalarizeVecRes_SELECT(N); break; + case ISD::UNDEF: R = ScalarizeVecRes_UNDEF(N); break; case ISD::ADD: case ISD::FADD: @@ -66,13 +72,6 @@ case ISD::FSQRT: case ISD::FSIN: case ISD::FCOS: R = ScalarizeVecRes_UnaryOp(N); break; - - case ISD::FPOWI: R = ScalarizeVecRes_FPOWI(N); break; - case ISD::BUILD_VECTOR: R = N->getOperand(0); break; - case ISD::INSERT_VECTOR_ELT: R = ScalarizeVecRes_INSERT_VECTOR_ELT(N); break; - case ISD::VECTOR_SHUFFLE: R = ScalarizeVecRes_VECTOR_SHUFFLE(N); break; - case ISD::BIT_CONVERT: R = ScalarizeVecRes_BIT_CONVERT(N); break; - case ISD::SELECT: R = ScalarizeVecRes_SELECT(N); break; } // If R is null, the sub-method took care of registering the result. @@ -80,32 +79,15 @@ SetScalarizedVector(SDOperand(N, ResNo), R); } -SDOperand DAGTypeLegalizer::ScalarizeVecRes_UNDEF(SDNode *N) { - return DAG.getNode(ISD::UNDEF, N->getValueType(0).getVectorElementType()); -} - -SDOperand DAGTypeLegalizer::ScalarizeVecRes_LOAD(LoadSDNode *N) { - assert(ISD::isNormalLoad(N) && "Extending load of one-element vector?"); - SDOperand Result = DAG.getLoad(N->getValueType(0).getVectorElementType(), - N->getChain(), N->getBasePtr(), - N->getSrcValue(), N->getSrcValueOffset(), - N->isVolatile(), N->getAlignment()); - - // Legalized the chain result - switch anything that used the old chain to - // use the new one. - ReplaceValueWith(SDOperand(N, 1), Result.getValue(1)); - return Result; -} - SDOperand DAGTypeLegalizer::ScalarizeVecRes_BinOp(SDNode *N) { SDOperand LHS = GetScalarizedVector(N->getOperand(0)); SDOperand RHS = GetScalarizedVector(N->getOperand(1)); return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS); } -SDOperand DAGTypeLegalizer::ScalarizeVecRes_UnaryOp(SDNode *N) { - SDOperand Op = GetScalarizedVector(N->getOperand(0)); - return DAG.getNode(N->getOpcode(), Op.getValueType(), Op); +SDOperand DAGTypeLegalizer::ScalarizeVecRes_BIT_CONVERT(SDNode *N) { + MVT NewVT = N->getValueType(0).getVectorElementType(); + return DAG.getNode(ISD::BIT_CONVERT, NewVT, N->getOperand(0)); } SDOperand DAGTypeLegalizer::ScalarizeVecRes_FPOWI(SDNode *N) { @@ -124,16 +106,26 @@ return Op; } -SDOperand DAGTypeLegalizer::ScalarizeVecRes_VECTOR_SHUFFLE(SDNode *N) { - // Figure out if the scalar is the LHS or RHS and return it. - SDOperand EltNum = N->getOperand(2).getOperand(0); - unsigned Op = cast(EltNum)->getValue() != 0; - return GetScalarizedVector(N->getOperand(Op)); +SDOperand DAGTypeLegalizer::ScalarizeVecRes_LOAD(LoadSDNode *N) { + assert(ISD::isNormalLoad(N) && "Extending load of one-element vector?"); + SDOperand Result = DAG.getLoad(N->getValueType(0).getVectorElementType(), + N->getChain(), N->getBasePtr(), + N->getSrcValue(), N->getSrcValueOffset(), + N->isVolatile(), N->getAlignment()); + + // Legalized the chain result - switch anything that used the old chain to + // use the new one. + ReplaceValueWith(SDOperand(N, 1), Result.getValue(1)); + return Result; } -SDOperand DAGTypeLegalizer::ScalarizeVecRes_BIT_CONVERT(SDNode *N) { - MVT NewVT = N->getValueType(0).getVectorElementType(); - return DAG.getNode(ISD::BIT_CONVERT, NewVT, N->getOperand(0)); +SDOperand DAGTypeLegalizer::ScalarizeVecRes_UnaryOp(SDNode *N) { + SDOperand Op = GetScalarizedVector(N->getOperand(0)); + return DAG.getNode(N->getOpcode(), Op.getValueType(), Op); +} + +SDOperand DAGTypeLegalizer::ScalarizeVecRes_UNDEF(SDNode *N) { + return DAG.getNode(ISD::UNDEF, N->getValueType(0).getVectorElementType()); } SDOperand DAGTypeLegalizer::ScalarizeVecRes_SELECT(SDNode *N) { @@ -142,6 +134,13 @@ GetScalarizedVector(N->getOperand(2))); } +SDOperand DAGTypeLegalizer::ScalarizeVecRes_VECTOR_SHUFFLE(SDNode *N) { + // Figure out if the scalar is the LHS or RHS and return it. + SDOperand EltNum = N->getOperand(2).getOperand(0); + unsigned Op = cast(EltNum)->getValue() != 0; + return GetScalarizedVector(N->getOperand(Op)); +} + //===----------------------------------------------------------------------===// // Operand Vector Scalarization <1 x ty> -> ty. @@ -245,14 +244,14 @@ case ISD::SELECT_CC: SplitRes_SELECT_CC(N, Lo, Hi); break; case ISD::UNDEF: SplitRes_UNDEF(N, Lo, Hi); break; - case ISD::LOAD: - SplitVecRes_LOAD(cast(N), Lo, Hi); - break; - case ISD::INSERT_VECTOR_ELT:SplitVecRes_INSERT_VECTOR_ELT(N, Lo, Hi); break; - case ISD::VECTOR_SHUFFLE: SplitVecRes_VECTOR_SHUFFLE(N, Lo, Hi); break; - case ISD::BUILD_VECTOR: SplitVecRes_BUILD_VECTOR(N, Lo, Hi); break; - case ISD::CONCAT_VECTORS: SplitVecRes_CONCAT_VECTORS(N, Lo, Hi); break; - case ISD::BIT_CONVERT: SplitVecRes_BIT_CONVERT(N, Lo, Hi); break; + case ISD::BIT_CONVERT: SplitVecRes_BIT_CONVERT(N, Lo, Hi); break; + case ISD::BUILD_VECTOR: SplitVecRes_BUILD_VECTOR(N, Lo, Hi); break; + case ISD::CONCAT_VECTORS: SplitVecRes_CONCAT_VECTORS(N, Lo, Hi); break; + case ISD::FPOWI: SplitVecRes_FPOWI(N, Lo, Hi); break; + case ISD::INSERT_VECTOR_ELT: SplitVecRes_INSERT_VECTOR_ELT(N, Lo, Hi); break; + case ISD::LOAD: SplitVecRes_LOAD(cast(N), Lo, Hi);break; + case ISD::VECTOR_SHUFFLE: SplitVecRes_VECTOR_SHUFFLE(N, Lo, Hi); break; + case ISD::CTTZ: case ISD::CTLZ: case ISD::CTPOP: @@ -265,6 +264,7 @@ case ISD::FP_TO_UINT: case ISD::SINT_TO_FP: case ISD::UINT_TO_FP: SplitVecRes_UnOp(N, Lo, Hi); break; + case ISD::ADD: case ISD::SUB: case ISD::MUL: @@ -281,7 +281,6 @@ case ISD::UREM: case ISD::SREM: case ISD::FREM: SplitVecRes_BinOp(N, Lo, Hi); break; - case ISD::FPOWI: SplitVecRes_FPOWI(N, Lo, Hi); break; } // If Lo/Hi is null, the sub-method took care of registering results etc. @@ -289,43 +288,110 @@ SetSplitVector(SDOperand(N, ResNo), Lo, Hi); } -void DAGTypeLegalizer::SplitVecRes_LOAD(LoadSDNode *LD, SDOperand &Lo, - SDOperand &Hi) { - assert(ISD::isUNINDEXEDLoad(LD) && "Indexed load during type legalization!"); +void DAGTypeLegalizer::SplitVecRes_BinOp(SDNode *N, SDOperand &Lo, + SDOperand &Hi) { + SDOperand LHSLo, LHSHi; + GetSplitVector(N->getOperand(0), LHSLo, LHSHi); + SDOperand RHSLo, RHSHi; + GetSplitVector(N->getOperand(1), RHSLo, RHSHi); + + Lo = DAG.getNode(N->getOpcode(), LHSLo.getValueType(), LHSLo, RHSLo); + Hi = DAG.getNode(N->getOpcode(), LHSHi.getValueType(), LHSHi, RHSHi); +} + +void DAGTypeLegalizer::SplitVecRes_BIT_CONVERT(SDNode *N, SDOperand &Lo, + SDOperand &Hi) { + // We know the result is a vector. The input may be either a vector or a + // scalar value. MVT LoVT, HiVT; - GetSplitDestVTs(LD->getValueType(0), LoVT, HiVT); + GetSplitDestVTs(N->getValueType(0), LoVT, HiVT); - SDOperand Ch = LD->getChain(); - SDOperand Ptr = LD->getBasePtr(); - const Value *SV = LD->getSrcValue(); - int SVOffset = LD->getSrcValueOffset(); - unsigned Alignment = LD->getAlignment(); - bool isVolatile = LD->isVolatile(); + SDOperand InOp = N->getOperand(0); + MVT InVT = InOp.getValueType(); - Lo = DAG.getLoad(LoVT, Ch, Ptr, SV, SVOffset, isVolatile, Alignment); + // Handle some special cases efficiently. + switch (getTypeAction(InVT)) { + default: + assert(false && "Unknown type action!"); + case Legal: + case PromoteInteger: + case SoftenFloat: + case ScalarizeVector: + break; + case ExpandInteger: + case ExpandFloat: + // A scalar to vector conversion, where the scalar needs expansion. + // If the vector is being split in two then we can just convert the + // expanded pieces. + if (LoVT == HiVT) { + GetExpandedOp(InOp, Lo, Hi); + if (TLI.isBigEndian()) + std::swap(Lo, Hi); + Lo = DAG.getNode(ISD::BIT_CONVERT, LoVT, Lo); + Hi = DAG.getNode(ISD::BIT_CONVERT, HiVT, Hi); + return; + } + break; + case SplitVector: + // If the input is a vector that needs to be split, convert each split + // piece of the input now. + GetSplitVector(InOp, Lo, Hi); + Lo = DAG.getNode(ISD::BIT_CONVERT, LoVT, Lo); + Hi = DAG.getNode(ISD::BIT_CONVERT, HiVT, Hi); + return; + } - if (LD->getExtensionType() == ISD::NON_EXTLOAD) { - unsigned IncrementSize = LoVT.getSizeInBits()/8; - Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr, - DAG.getIntPtrConstant(IncrementSize)); - SVOffset += IncrementSize; - Alignment = MinAlign(Alignment, IncrementSize); - Hi = DAG.getLoad(HiVT, Ch, Ptr, SV, SVOffset, isVolatile, Alignment); + // In the general case, convert the input to an integer and split it by hand. + MVT LoIntVT = MVT::getIntegerVT(LoVT.getSizeInBits()); + MVT HiIntVT = MVT::getIntegerVT(HiVT.getSizeInBits()); + if (TLI.isBigEndian()) + std::swap(LoIntVT, HiIntVT); - // Build a factor node to remember that this load is independent of the - // other one. - Ch = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1), - Hi.getValue(1)); - } else { - assert(LD->getExtensionType() == ISD::EXTLOAD && - "Unsupported vector extending load!"); - Hi = DAG.getNode(ISD::UNDEF, HiVT); - Ch = Lo.getValue(1); + SplitInteger(BitConvertToInteger(InOp), LoIntVT, HiIntVT, Lo, Hi); + + if (TLI.isBigEndian()) + std::swap(Lo, Hi); + Lo = DAG.getNode(ISD::BIT_CONVERT, LoVT, Lo); + Hi = DAG.getNode(ISD::BIT_CONVERT, HiVT, Hi); +} + +void DAGTypeLegalizer::SplitVecRes_BUILD_VECTOR(SDNode *N, SDOperand &Lo, + SDOperand &Hi) { + MVT LoVT, HiVT; + GetSplitDestVTs(N->getValueType(0), LoVT, HiVT); + unsigned LoNumElts = LoVT.getVectorNumElements(); + SmallVector LoOps(N->op_begin(), N->op_begin()+LoNumElts); + Lo = DAG.getNode(ISD::BUILD_VECTOR, LoVT, &LoOps[0], LoOps.size()); + + SmallVector HiOps(N->op_begin()+LoNumElts, N->op_end()); + Hi = DAG.getNode(ISD::BUILD_VECTOR, HiVT, &HiOps[0], HiOps.size()); +} + +void DAGTypeLegalizer::SplitVecRes_CONCAT_VECTORS(SDNode *N, SDOperand &Lo, + SDOperand &Hi) { + assert(!(N->getNumOperands() & 1) && "Unsupported CONCAT_VECTORS"); + unsigned NumSubvectors = N->getNumOperands() / 2; + if (NumSubvectors == 1) { + Lo = N->getOperand(0); + Hi = N->getOperand(1); + return; } - // Legalized the chain result - switch anything that used the old chain to - // use the new one. - ReplaceValueWith(SDOperand(LD, 1), Ch); + MVT LoVT, HiVT; + GetSplitDestVTs(N->getValueType(0), LoVT, HiVT); + + SmallVector LoOps(N->op_begin(), N->op_begin()+NumSubvectors); + Lo = DAG.getNode(ISD::CONCAT_VECTORS, LoVT, &LoOps[0], LoOps.size()); + + SmallVector HiOps(N->op_begin()+NumSubvectors, N->op_end()); + Hi = DAG.getNode(ISD::CONCAT_VECTORS, HiVT, &HiOps[0], HiOps.size()); +} + +void DAGTypeLegalizer::SplitVecRes_FPOWI(SDNode *N, SDOperand &Lo, + SDOperand &Hi) { + GetSplitVector(N->getOperand(0), Lo, Hi); + Lo = DAG.getNode(ISD::FPOWI, Lo.getValueType(), Lo, N->getOperand(1)); + Hi = DAG.getNode(ISD::FPOWI, Hi.getValueType(), Hi, N->getOperand(1)); } void DAGTypeLegalizer::SplitVecRes_INSERT_VECTOR_ELT(SDNode *N, SDOperand &Lo, @@ -364,6 +430,56 @@ SplitVecRes_LOAD(cast(Load.Val), Lo, Hi); } +void DAGTypeLegalizer::SplitVecRes_LOAD(LoadSDNode *LD, SDOperand &Lo, + SDOperand &Hi) { + assert(ISD::isUNINDEXEDLoad(LD) && "Indexed load during type legalization!"); + MVT LoVT, HiVT; + GetSplitDestVTs(LD->getValueType(0), LoVT, HiVT); + + SDOperand Ch = LD->getChain(); + SDOperand Ptr = LD->getBasePtr(); + const Value *SV = LD->getSrcValue(); + int SVOffset = LD->getSrcValueOffset(); + unsigned Alignment = LD->getAlignment(); + bool isVolatile = LD->isVolatile(); + + Lo = DAG.getLoad(LoVT, Ch, Ptr, SV, SVOffset, isVolatile, Alignment); + + if (LD->getExtensionType() == ISD::NON_EXTLOAD) { + unsigned IncrementSize = LoVT.getSizeInBits()/8; + Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr, + DAG.getIntPtrConstant(IncrementSize)); + SVOffset += IncrementSize; + Alignment = MinAlign(Alignment, IncrementSize); + Hi = DAG.getLoad(HiVT, Ch, Ptr, SV, SVOffset, isVolatile, Alignment); + + // Build a factor node to remember that this load is independent of the + // other one. + Ch = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo.getValue(1), + Hi.getValue(1)); + } else { + assert(LD->getExtensionType() == ISD::EXTLOAD && + "Unsupported vector extending load!"); + Hi = DAG.getNode(ISD::UNDEF, HiVT); + Ch = Lo.getValue(1); + } + + // Legalized the chain result - switch anything that used the old chain to + // use the new one. + ReplaceValueWith(SDOperand(LD, 1), Ch); +} + +void DAGTypeLegalizer::SplitVecRes_UnOp(SDNode *N, SDOperand &Lo, + SDOperand &Hi) { + // Get the dest types. This doesn't always match input types, e.g. int_to_fp. + MVT LoVT, HiVT; + GetSplitDestVTs(N->getValueType(0), LoVT, HiVT); + + GetSplitVector(N->getOperand(0), Lo, Hi); + Lo = DAG.getNode(N->getOpcode(), LoVT, Lo); + Hi = DAG.getNode(N->getOpcode(), HiVT, Hi); +} + void DAGTypeLegalizer::SplitVecRes_VECTOR_SHUFFLE(SDNode *N, SDOperand &Lo, SDOperand &Hi) { // Build the low part. @@ -404,123 +520,6 @@ Hi = DAG.getNode(ISD::BUILD_VECTOR, HiVT, &Ops[0], Ops.size()); } -void DAGTypeLegalizer::SplitVecRes_BUILD_VECTOR(SDNode *N, SDOperand &Lo, - SDOperand &Hi) { - MVT LoVT, HiVT; - GetSplitDestVTs(N->getValueType(0), LoVT, HiVT); - unsigned LoNumElts = LoVT.getVectorNumElements(); - SmallVector LoOps(N->op_begin(), N->op_begin()+LoNumElts); - Lo = DAG.getNode(ISD::BUILD_VECTOR, LoVT, &LoOps[0], LoOps.size()); - - SmallVector HiOps(N->op_begin()+LoNumElts, N->op_end()); - Hi = DAG.getNode(ISD::BUILD_VECTOR, HiVT, &HiOps[0], HiOps.size()); -} - -void DAGTypeLegalizer::SplitVecRes_CONCAT_VECTORS(SDNode *N, SDOperand &Lo, - SDOperand &Hi) { - assert(!(N->getNumOperands() & 1) && "Unsupported CONCAT_VECTORS"); - unsigned NumSubvectors = N->getNumOperands() / 2; - if (NumSubvectors == 1) { - Lo = N->getOperand(0); - Hi = N->getOperand(1); - return; - } - - MVT LoVT, HiVT; - GetSplitDestVTs(N->getValueType(0), LoVT, HiVT); - - SmallVector LoOps(N->op_begin(), N->op_begin()+NumSubvectors); - Lo = DAG.getNode(ISD::CONCAT_VECTORS, LoVT, &LoOps[0], LoOps.size()); - - SmallVector HiOps(N->op_begin()+NumSubvectors, N->op_end()); - Hi = DAG.getNode(ISD::CONCAT_VECTORS, HiVT, &HiOps[0], HiOps.size()); -} - -void DAGTypeLegalizer::SplitVecRes_BIT_CONVERT(SDNode *N, SDOperand &Lo, - SDOperand &Hi) { - // We know the result is a vector. The input may be either a vector or a - // scalar value. - MVT LoVT, HiVT; - GetSplitDestVTs(N->getValueType(0), LoVT, HiVT); - - SDOperand InOp = N->getOperand(0); - MVT InVT = InOp.getValueType(); - - // Handle some special cases efficiently. - switch (getTypeAction(InVT)) { - default: - assert(false && "Unknown type action!"); - case Legal: - case PromoteInteger: - case SoftenFloat: - case ScalarizeVector: - break; - case ExpandInteger: - case ExpandFloat: - // A scalar to vector conversion, where the scalar needs expansion. - // If the vector is being split in two then we can just convert the - // expanded pieces. - if (LoVT == HiVT) { - GetExpandedOp(InOp, Lo, Hi); - if (TLI.isBigEndian()) - std::swap(Lo, Hi); - Lo = DAG.getNode(ISD::BIT_CONVERT, LoVT, Lo); - Hi = DAG.getNode(ISD::BIT_CONVERT, HiVT, Hi); - return; - } - break; - case SplitVector: - // If the input is a vector that needs to be split, convert each split - // piece of the input now. - GetSplitVector(InOp, Lo, Hi); - Lo = DAG.getNode(ISD::BIT_CONVERT, LoVT, Lo); - Hi = DAG.getNode(ISD::BIT_CONVERT, HiVT, Hi); - return; - } - - // In the general case, convert the input to an integer and split it by hand. - MVT LoIntVT = MVT::getIntegerVT(LoVT.getSizeInBits()); - MVT HiIntVT = MVT::getIntegerVT(HiVT.getSizeInBits()); - if (TLI.isBigEndian()) - std::swap(LoIntVT, HiIntVT); - - SplitInteger(BitConvertToInteger(InOp), LoIntVT, HiIntVT, Lo, Hi); - - if (TLI.isBigEndian()) - std::swap(Lo, Hi); - Lo = DAG.getNode(ISD::BIT_CONVERT, LoVT, Lo); - Hi = DAG.getNode(ISD::BIT_CONVERT, HiVT, Hi); -} - -void DAGTypeLegalizer::SplitVecRes_BinOp(SDNode *N, SDOperand &Lo, - SDOperand &Hi) { - SDOperand LHSLo, LHSHi; - GetSplitVector(N->getOperand(0), LHSLo, LHSHi); - SDOperand RHSLo, RHSHi; - GetSplitVector(N->getOperand(1), RHSLo, RHSHi); - - Lo = DAG.getNode(N->getOpcode(), LHSLo.getValueType(), LHSLo, RHSLo); - Hi = DAG.getNode(N->getOpcode(), LHSHi.getValueType(), LHSHi, RHSHi); -} - -void DAGTypeLegalizer::SplitVecRes_UnOp(SDNode *N, SDOperand &Lo, - SDOperand &Hi) { - // Get the dest types. This doesn't always match input types, e.g. int_to_fp. - MVT LoVT, HiVT; - GetSplitDestVTs(N->getValueType(0), LoVT, HiVT); - - GetSplitVector(N->getOperand(0), Lo, Hi); - Lo = DAG.getNode(N->getOpcode(), LoVT, Lo); - Hi = DAG.getNode(N->getOpcode(), HiVT, Hi); -} - -void DAGTypeLegalizer::SplitVecRes_FPOWI(SDNode *N, SDOperand &Lo, - SDOperand &Hi) { - GetSplitVector(N->getOperand(0), Lo, Hi); - Lo = DAG.getNode(ISD::FPOWI, Lo.getValueType(), Lo, N->getOperand(1)); - Hi = DAG.getNode(ISD::FPOWI, Hi.getValueType(), Hi, N->getOperand(1)); -} - //===----------------------------------------------------------------------===// // Operand Vector Splitting @@ -543,15 +542,13 @@ #endif assert(0 && "Do not know how to split this operator's operand!"); abort(); - case ISD::STORE: Res = SplitVecOp_STORE(cast(N), OpNo); break; - - case ISD::BIT_CONVERT: Res = SplitVecOp_BIT_CONVERT(N); break; - case ISD::EXTRACT_VECTOR_ELT: Res = SplitVecOp_EXTRACT_VECTOR_ELT(N); break; - case ISD::EXTRACT_SUBVECTOR: Res = SplitVecOp_EXTRACT_SUBVECTOR(N); break; - case ISD::VECTOR_SHUFFLE: - Res = SplitVecOp_VECTOR_SHUFFLE(N, OpNo); - break; + case ISD::BIT_CONVERT: Res = SplitVecOp_BIT_CONVERT(N); break; + case ISD::EXTRACT_SUBVECTOR: Res = SplitVecOp_EXTRACT_SUBVECTOR(N); break; + case ISD::EXTRACT_VECTOR_ELT:Res = SplitVecOp_EXTRACT_VECTOR_ELT(N); break; + case ISD::STORE: Res = SplitVecOp_STORE(cast(N), + OpNo); break; + case ISD::VECTOR_SHUFFLE: Res = SplitVecOp_VECTOR_SHUFFLE(N, OpNo);break; } } @@ -575,31 +572,6 @@ return false; } -SDOperand DAGTypeLegalizer::SplitVecOp_STORE(StoreSDNode *N, unsigned OpNo) { - assert(ISD::isNormalStore(N) && "Truncating store of vector?"); - assert(OpNo == 1 && "Can only split the stored value"); - - SDOperand Ch = N->getChain(); - SDOperand Ptr = N->getBasePtr(); - int SVOffset = N->getSrcValueOffset(); - unsigned Alignment = N->getAlignment(); - bool isVol = N->isVolatile(); - SDOperand Lo, Hi; - GetSplitVector(N->getOperand(1), Lo, Hi); - - unsigned IncrementSize = Lo.getValueType().getSizeInBits()/8; - - Lo = DAG.getStore(Ch, Lo, Ptr, N->getSrcValue(), SVOffset, isVol, Alignment); - - // Increment the pointer to the other half. - Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr, - DAG.getIntPtrConstant(IncrementSize)); - - Hi = DAG.getStore(Ch, Hi, Ptr, N->getSrcValue(), SVOffset+IncrementSize, - isVol, MinAlign(Alignment, IncrementSize)); - return DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi); -} - SDOperand DAGTypeLegalizer::SplitVecOp_BIT_CONVERT(SDNode *N) { // For example, i64 = BIT_CONVERT v4i16 on alpha. Typically the vector will // end up being split all the way down to individual components. Convert the @@ -616,6 +588,27 @@ JoinIntegers(Lo, Hi)); } +SDOperand DAGTypeLegalizer::SplitVecOp_EXTRACT_SUBVECTOR(SDNode *N) { + // We know that the extracted result type is legal. For now, assume the index + // is a constant. + MVT SubVT = N->getValueType(0); + SDOperand Idx = N->getOperand(1); + SDOperand Lo, Hi; + GetSplitVector(N->getOperand(0), Lo, Hi); + + uint64_t LoElts = Lo.getValueType().getVectorNumElements(); + uint64_t IdxVal = cast(Idx)->getValue(); + + if (IdxVal < LoElts) { + assert(IdxVal + SubVT.getVectorNumElements() <= LoElts && + "Extracted subvector crosses vector split!"); + return DAG.getNode(ISD::EXTRACT_SUBVECTOR, SubVT, Lo, Idx); + } else { + return DAG.getNode(ISD::EXTRACT_SUBVECTOR, SubVT, Hi, + DAG.getConstant(IdxVal - LoElts, Idx.getValueType())); + } +} + SDOperand DAGTypeLegalizer::SplitVecOp_EXTRACT_VECTOR_ELT(SDNode *N) { SDOperand Vec = N->getOperand(0); SDOperand Idx = N->getOperand(1); @@ -648,25 +641,29 @@ return DAG.getLoad(EltVT, Store, StackPtr, NULL, 0); } -SDOperand DAGTypeLegalizer::SplitVecOp_EXTRACT_SUBVECTOR(SDNode *N) { - // We know that the extracted result type is legal. For now, assume the index - // is a constant. - MVT SubVT = N->getValueType(0); - SDOperand Idx = N->getOperand(1); +SDOperand DAGTypeLegalizer::SplitVecOp_STORE(StoreSDNode *N, unsigned OpNo) { + assert(ISD::isNormalStore(N) && "Truncating store of vector?"); + assert(OpNo == 1 && "Can only split the stored value"); + + SDOperand Ch = N->getChain(); + SDOperand Ptr = N->getBasePtr(); + int SVOffset = N->getSrcValueOffset(); + unsigned Alignment = N->getAlignment(); + bool isVol = N->isVolatile(); SDOperand Lo, Hi; - GetSplitVector(N->getOperand(0), Lo, Hi); + GetSplitVector(N->getOperand(1), Lo, Hi); - uint64_t LoElts = Lo.getValueType().getVectorNumElements(); - uint64_t IdxVal = cast(Idx)->getValue(); + unsigned IncrementSize = Lo.getValueType().getSizeInBits()/8; - if (IdxVal < LoElts) { - assert(IdxVal + SubVT.getVectorNumElements() <= LoElts && - "Extracted subvector crosses vector split!"); - return DAG.getNode(ISD::EXTRACT_SUBVECTOR, SubVT, Lo, Idx); - } else { - return DAG.getNode(ISD::EXTRACT_SUBVECTOR, SubVT, Hi, - DAG.getConstant(IdxVal - LoElts, Idx.getValueType())); - } + Lo = DAG.getStore(Ch, Lo, Ptr, N->getSrcValue(), SVOffset, isVol, Alignment); + + // Increment the pointer to the other half. + Ptr = DAG.getNode(ISD::ADD, Ptr.getValueType(), Ptr, + DAG.getIntPtrConstant(IncrementSize)); + + Hi = DAG.getStore(Ch, Hi, Ptr, N->getSrcValue(), SVOffset+IncrementSize, + isVol, MinAlign(Alignment, IncrementSize)); + return DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi); } SDOperand DAGTypeLegalizer::SplitVecOp_VECTOR_SHUFFLE(SDNode *N, unsigned OpNo){ From matthijs at stdin.nl Wed Jul 16 07:55:51 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Wed, 16 Jul 2008 12:55:51 -0000 Subject: [llvm-commits] [llvm] r53673 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200807161255.m6GCtqqv031241@zion.cs.uiuc.edu> Author: matthijs Date: Wed Jul 16 07:55:45 2008 New Revision: 53673 URL: http://llvm.org/viewvc/llvm-project?rev=53673&view=rev Log: Redo InstCombiner::visitExtractValueInst. Instead of using the (complicate) FindInsertedValue, it now performs a number of simple transformations that should result in the same effect when applied iteratively. Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=53673&r1=53672&r2=53673&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul 16 07:55:45 2008 @@ -10649,12 +10649,87 @@ } Instruction *InstCombiner::visitExtractValueInst(ExtractValueInst &EV) { - // See if we are trying to extract a known value. If so, use that instead. - if (Value *Elt = FindInsertedValue(EV.getOperand(0), EV.idx_begin(), - EV.idx_end(), &EV)) - return ReplaceInstUsesWith(EV, Elt); + Value *Agg = EV.getAggregateOperand(); - // No changes + if (!EV.hasIndices()) + return ReplaceInstUsesWith(EV, Agg); + + if (Constant *C = dyn_cast(Agg)) { + if (isa(C)) + return ReplaceInstUsesWith(EV, UndefValue::get(EV.getType())); + + if (isa(C)) + return ReplaceInstUsesWith(EV, Constant::getNullValue(EV.getType())); + + if (isa(C) || isa(C)) { + // Extract the element indexed by the first index out of the constant + Value *V = C->getOperand(*EV.idx_begin()); + if (EV.getNumIndices() > 1) + // Extract the remaining indices out of the constant indexed by the + // first index + return ExtractValueInst::Create(V, EV.idx_begin() + 1, EV.idx_end()); + else + return ReplaceInstUsesWith(EV, V); + } + return 0; // Can't handle other constants + } + if (InsertValueInst *IV = dyn_cast(Agg)) { + // We're extracting from an insertvalue instruction, compare the indices + const unsigned *exti, *exte, *insi, *inse; + for (exti = EV.idx_begin(), insi = IV->idx_begin(), + exte = EV.idx_end(), inse = IV->idx_end(); + exti != exte && insi != inse; + ++exti, ++insi) { + if (*insi != *exti) + // The insert and extract both reference distinctly different elements. + // This means the extract is not influenced by the insert, and we can + // replace the aggregate operand of the extract with the aggregate + // operand of the insert. i.e., replace + // %I = insertvalue { i32, { i32 } } %A, { i32 } { i32 42 }, 1 + // %E = extractvalue { i32, { i32 } } %I, 0 + // with + // %E = extractvalue { i32, { i32 } } %A, 0 + return ExtractValueInst::Create(IV->getAggregateOperand(), + EV.idx_begin(), EV.idx_end()); + } + if (exti == exte && insi == inse) + // Both iterators are at the end: Index lists are identical. Replace + // %B = insertvalue { i32, { i32 } } %A, i32 42, 1, 0 + // %C = extractvalue { i32, { i32 } } %B, 1, 0 + // with "i32 42" + return ReplaceInstUsesWith(EV, IV->getInsertedValueOperand()); + if (exti == exte) { + // The extract list is a prefix of the insert list. i.e. replace + // %I = insertvalue { i32, { i32 } } %A, i32 42, 1, 0 + // %E = extractvalue { i32, { i32 } } %I, 1 + // with + // %X = extractvalue { i32, { i32 } } %A, 1 + // %E = insertvalue { i32 } %X, i32 42, 0 + // by switching the order of the insert and extract (though the + // insertvalue should be left in, since it may have other uses). + Value *NewEV = InsertNewInstBefore( + ExtractValueInst::Create(IV->getAggregateOperand(), + EV.idx_begin(), EV.idx_end()), + EV); + return InsertValueInst::Create(NewEV, IV->getInsertedValueOperand(), + insi, inse); + } + if (insi == inse) + // The insert list is a prefix of the extract list + // We can simply remove the common indices from the extract and make it + // operate on the inserted value instead of the insertvalue result. + // i.e., replace + // %I = insertvalue { i32, { i32 } } %A, { i32 } { i32 42 }, 1 + // %E = extractvalue { i32, { i32 } } %I, 1, 0 + // with + // %E extractvalue { i32 } { i32 42 }, 0 + return ExtractValueInst::Create(IV->getInsertedValueOperand(), + exti, exte); + } + // Can't simplify extracts from other values. Note that nested extracts are + // already simplified implicitely by the above (extract ( extract (insert) ) + // will be translated into extract ( insert ( extract ) ) first and then just + // the value inserted, if appropriate). return 0; } From matthijs at stdin.nl Wed Jul 16 07:56:52 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Wed, 16 Jul 2008 12:56:52 -0000 Subject: [llvm-commits] [llvm] r53674 - /llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll Message-ID: <200807161256.m6GCuqQO031290@zion.cs.uiuc.edu> Author: matthijs Date: Wed Jul 16 07:56:52 2008 New Revision: 53674 URL: http://llvm.org/viewvc/llvm-project?rev=53674&view=rev Log: Un-XFAIL multdeadretval, since instcombine now properly handles the mess deadargelim leaves behind :-) Modified: llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll Modified: llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll?rev=53674&r1=53673&r2=53674&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll (original) +++ llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll Wed Jul 16 07:56:52 2008 @@ -3,7 +3,6 @@ ; run instcombine to fold insert/extractvalue chains and we run dce to clean up ; any remaining dead stuff. ; RUN: llvm-as < %s | opt -deadargelim -instcombine -dce | llvm-dis | not grep i16 -; XFAIL: * define internal {i16, i32} @test(i16 %DEADARG) { %A = insertvalue {i16,i32} undef, i16 1, 0 From matthijs at stdin.nl Wed Jul 16 07:57:25 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Wed, 16 Jul 2008 12:57:25 -0000 Subject: [llvm-commits] [llvm] r53675 - /llvm/trunk/test/Transforms/InstCombine/extractvalue.ll Message-ID: <200807161257.m6GCvPPM031315@zion.cs.uiuc.edu> Author: matthijs Date: Wed Jul 16 07:57:25 2008 New Revision: 53675 URL: http://llvm.org/viewvc/llvm-project?rev=53675&view=rev Log: Add a few cases to instcombine's extractvalue testcase. Modified: llvm/trunk/test/Transforms/InstCombine/extractvalue.ll Modified: llvm/trunk/test/Transforms/InstCombine/extractvalue.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/extractvalue.ll?rev=53675&r1=53674&r2=53675&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/extractvalue.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/extractvalue.ll Wed Jul 16 07:57:25 2008 @@ -17,8 +17,22 @@ %ns1.2 = insertvalue {i32, {i32, i32}} %ns1.1, i32 %v1, 1, 0 %ns1 = insertvalue {i32, {i32, i32}} %ns1.2, i32 %v2, 1, 1 %s2 = extractvalue {i32, {i32, i32}} %ns1, 1 + %v3 = extractvalue {i32, {i32, i32}} %ns1, 1, 1 call void @bar({i32, i32} %s2) - %v3 = extractvalue {i32, {i32, i32}} %ns1, 1, 1 - ret i32 %v3 + + ; Use nested extractvalues to get to a value + %s3 = extractvalue {i32, {i32, i32}} %ns1, 1 + %v4 = extractvalue {i32, i32} %s3, 1 + call void @bar({i32, i32} %s3) + + ; Use nested insertvalues to build a nested struct + %s4.1 = insertvalue {i32, i32} undef, i32 %v3, 0 + %s4 = insertvalue {i32, i32} %s4.1, i32 %v4, 1 + %ns2 = insertvalue {i32, {i32, i32}} undef, {i32, i32} %s4, 1 + + ; And now extract a single value from there + %v5 = extractvalue {i32, {i32, i32}} %ns2, 1, 1 + + ret i32 %v5 } From baldrick at free.fr Wed Jul 16 08:10:21 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 13:10:21 -0000 Subject: [llvm-commits] [llvm] r53676 - /llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll Message-ID: <200807161310.m6GDAMaa031809@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jul 16 08:10:20 2008 New Revision: 53676 URL: http://llvm.org/viewvc/llvm-project?rev=53676&view=rev Log: Test codegen of loads and stores of all integer sizes from i1 to i256. The generated code is like one huge bug report of things that the DAG combiner fails to simplify! Added: llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll Added: llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll?rev=53676&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll (added) +++ llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll Wed Jul 16 08:10:20 2008 @@ -0,0 +1,2049 @@ +; RUN: llvm-as < %s | llc + at i1_l = external global i1 ; [#uses=1] + at i1_s = external global i1 ; [#uses=1] + at i2_l = external global i2 ; [#uses=1] + at i2_s = external global i2 ; [#uses=1] + at i3_l = external global i3 ; [#uses=1] + at i3_s = external global i3 ; [#uses=1] + at i4_l = external global i4 ; [#uses=1] + at i4_s = external global i4 ; [#uses=1] + at i5_l = external global i5 ; [#uses=1] + at i5_s = external global i5 ; [#uses=1] + at i6_l = external global i6 ; [#uses=1] + at i6_s = external global i6 ; [#uses=1] + at i7_l = external global i7 ; [#uses=1] + at i7_s = external global i7 ; [#uses=1] + at i8_l = external global i8 ; [#uses=1] + at i8_s = external global i8 ; [#uses=1] + at i9_l = external global i9 ; [#uses=1] + at i9_s = external global i9 ; [#uses=1] + at i10_l = external global i10 ; [#uses=1] + at i10_s = external global i10 ; [#uses=1] + at i11_l = external global i11 ; [#uses=1] + at i11_s = external global i11 ; [#uses=1] + at i12_l = external global i12 ; [#uses=1] + at i12_s = external global i12 ; [#uses=1] + at i13_l = external global i13 ; [#uses=1] + at i13_s = external global i13 ; [#uses=1] + at i14_l = external global i14 ; [#uses=1] + at i14_s = external global i14 ; [#uses=1] + at i15_l = external global i15 ; [#uses=1] + at i15_s = external global i15 ; [#uses=1] + at i16_l = external global i16 ; [#uses=1] + at i16_s = external global i16 ; [#uses=1] + at i17_l = external global i17 ; [#uses=1] + at i17_s = external global i17 ; [#uses=1] + at i18_l = external global i18 ; [#uses=1] + at i18_s = external global i18 ; [#uses=1] + at i19_l = external global i19 ; [#uses=1] + at i19_s = external global i19 ; [#uses=1] + at i20_l = external global i20 ; [#uses=1] + at i20_s = external global i20 ; [#uses=1] + at i21_l = external global i21 ; [#uses=1] + at i21_s = external global i21 ; [#uses=1] + at i22_l = external global i22 ; [#uses=1] + at i22_s = external global i22 ; [#uses=1] + at i23_l = external global i23 ; [#uses=1] + at i23_s = external global i23 ; [#uses=1] + at i24_l = external global i24 ; [#uses=1] + at i24_s = external global i24 ; [#uses=1] + at i25_l = external global i25 ; [#uses=1] + at i25_s = external global i25 ; [#uses=1] + at i26_l = external global i26 ; [#uses=1] + at i26_s = external global i26 ; [#uses=1] + at i27_l = external global i27 ; [#uses=1] + at i27_s = external global i27 ; [#uses=1] + at i28_l = external global i28 ; [#uses=1] + at i28_s = external global i28 ; [#uses=1] + at i29_l = external global i29 ; [#uses=1] + at i29_s = external global i29 ; [#uses=1] + at i30_l = external global i30 ; [#uses=1] + at i30_s = external global i30 ; [#uses=1] + at i31_l = external global i31 ; [#uses=1] + at i31_s = external global i31 ; [#uses=1] + at i32_l = external global i32 ; [#uses=1] + at i32_s = external global i32 ; [#uses=1] + at i33_l = external global i33 ; [#uses=1] + at i33_s = external global i33 ; [#uses=1] + at i34_l = external global i34 ; [#uses=1] + at i34_s = external global i34 ; [#uses=1] + at i35_l = external global i35 ; [#uses=1] + at i35_s = external global i35 ; [#uses=1] + at i36_l = external global i36 ; [#uses=1] + at i36_s = external global i36 ; [#uses=1] + at i37_l = external global i37 ; [#uses=1] + at i37_s = external global i37 ; [#uses=1] + at i38_l = external global i38 ; [#uses=1] + at i38_s = external global i38 ; [#uses=1] + at i39_l = external global i39 ; [#uses=1] + at i39_s = external global i39 ; [#uses=1] + at i40_l = external global i40 ; [#uses=1] + at i40_s = external global i40 ; [#uses=1] + at i41_l = external global i41 ; [#uses=1] + at i41_s = external global i41 ; [#uses=1] + at i42_l = external global i42 ; [#uses=1] + at i42_s = external global i42 ; [#uses=1] + at i43_l = external global i43 ; [#uses=1] + at i43_s = external global i43 ; [#uses=1] + at i44_l = external global i44 ; [#uses=1] + at i44_s = external global i44 ; [#uses=1] + at i45_l = external global i45 ; [#uses=1] + at i45_s = external global i45 ; [#uses=1] + at i46_l = external global i46 ; [#uses=1] + at i46_s = external global i46 ; [#uses=1] + at i47_l = external global i47 ; [#uses=1] + at i47_s = external global i47 ; [#uses=1] + at i48_l = external global i48 ; [#uses=1] + at i48_s = external global i48 ; [#uses=1] + at i49_l = external global i49 ; [#uses=1] + at i49_s = external global i49 ; [#uses=1] + at i50_l = external global i50 ; [#uses=1] + at i50_s = external global i50 ; [#uses=1] + at i51_l = external global i51 ; [#uses=1] + at i51_s = external global i51 ; [#uses=1] + at i52_l = external global i52 ; [#uses=1] + at i52_s = external global i52 ; [#uses=1] + at i53_l = external global i53 ; [#uses=1] + at i53_s = external global i53 ; [#uses=1] + at i54_l = external global i54 ; [#uses=1] + at i54_s = external global i54 ; [#uses=1] + at i55_l = external global i55 ; [#uses=1] + at i55_s = external global i55 ; [#uses=1] + at i56_l = external global i56 ; [#uses=1] + at i56_s = external global i56 ; [#uses=1] + at i57_l = external global i57 ; [#uses=1] + at i57_s = external global i57 ; [#uses=1] + at i58_l = external global i58 ; [#uses=1] + at i58_s = external global i58 ; [#uses=1] + at i59_l = external global i59 ; [#uses=1] + at i59_s = external global i59 ; [#uses=1] + at i60_l = external global i60 ; [#uses=1] + at i60_s = external global i60 ; [#uses=1] + at i61_l = external global i61 ; [#uses=1] + at i61_s = external global i61 ; [#uses=1] + at i62_l = external global i62 ; [#uses=1] + at i62_s = external global i62 ; [#uses=1] + at i63_l = external global i63 ; [#uses=1] + at i63_s = external global i63 ; [#uses=1] + at i64_l = external global i64 ; [#uses=1] + at i64_s = external global i64 ; [#uses=1] + at i65_l = external global i65 ; [#uses=1] + at i65_s = external global i65 ; [#uses=1] + at i66_l = external global i66 ; [#uses=1] + at i66_s = external global i66 ; [#uses=1] + at i67_l = external global i67 ; [#uses=1] + at i67_s = external global i67 ; [#uses=1] + at i68_l = external global i68 ; [#uses=1] + at i68_s = external global i68 ; [#uses=1] + at i69_l = external global i69 ; [#uses=1] + at i69_s = external global i69 ; [#uses=1] + at i70_l = external global i70 ; [#uses=1] + at i70_s = external global i70 ; [#uses=1] + at i71_l = external global i71 ; [#uses=1] + at i71_s = external global i71 ; [#uses=1] + at i72_l = external global i72 ; [#uses=1] + at i72_s = external global i72 ; [#uses=1] + at i73_l = external global i73 ; [#uses=1] + at i73_s = external global i73 ; [#uses=1] + at i74_l = external global i74 ; [#uses=1] + at i74_s = external global i74 ; [#uses=1] + at i75_l = external global i75 ; [#uses=1] + at i75_s = external global i75 ; [#uses=1] + at i76_l = external global i76 ; [#uses=1] + at i76_s = external global i76 ; [#uses=1] + at i77_l = external global i77 ; [#uses=1] + at i77_s = external global i77 ; [#uses=1] + at i78_l = external global i78 ; [#uses=1] + at i78_s = external global i78 ; [#uses=1] + at i79_l = external global i79 ; [#uses=1] + at i79_s = external global i79 ; [#uses=1] + at i80_l = external global i80 ; [#uses=1] + at i80_s = external global i80 ; [#uses=1] + at i81_l = external global i81 ; [#uses=1] + at i81_s = external global i81 ; [#uses=1] + at i82_l = external global i82 ; [#uses=1] + at i82_s = external global i82 ; [#uses=1] + at i83_l = external global i83 ; [#uses=1] + at i83_s = external global i83 ; [#uses=1] + at i84_l = external global i84 ; [#uses=1] + at i84_s = external global i84 ; [#uses=1] + at i85_l = external global i85 ; [#uses=1] + at i85_s = external global i85 ; [#uses=1] + at i86_l = external global i86 ; [#uses=1] + at i86_s = external global i86 ; [#uses=1] + at i87_l = external global i87 ; [#uses=1] + at i87_s = external global i87 ; [#uses=1] + at i88_l = external global i88 ; [#uses=1] + at i88_s = external global i88 ; [#uses=1] + at i89_l = external global i89 ; [#uses=1] + at i89_s = external global i89 ; [#uses=1] + at i90_l = external global i90 ; [#uses=1] + at i90_s = external global i90 ; [#uses=1] + at i91_l = external global i91 ; [#uses=1] + at i91_s = external global i91 ; [#uses=1] + at i92_l = external global i92 ; [#uses=1] + at i92_s = external global i92 ; [#uses=1] + at i93_l = external global i93 ; [#uses=1] + at i93_s = external global i93 ; [#uses=1] + at i94_l = external global i94 ; [#uses=1] + at i94_s = external global i94 ; [#uses=1] + at i95_l = external global i95 ; [#uses=1] + at i95_s = external global i95 ; [#uses=1] + at i96_l = external global i96 ; [#uses=1] + at i96_s = external global i96 ; [#uses=1] + at i97_l = external global i97 ; [#uses=1] + at i97_s = external global i97 ; [#uses=1] + at i98_l = external global i98 ; [#uses=1] + at i98_s = external global i98 ; [#uses=1] + at i99_l = external global i99 ; [#uses=1] + at i99_s = external global i99 ; [#uses=1] + at i100_l = external global i100 ; [#uses=1] + at i100_s = external global i100 ; [#uses=1] + at i101_l = external global i101 ; [#uses=1] + at i101_s = external global i101 ; [#uses=1] + at i102_l = external global i102 ; [#uses=1] + at i102_s = external global i102 ; [#uses=1] + at i103_l = external global i103 ; [#uses=1] + at i103_s = external global i103 ; [#uses=1] + at i104_l = external global i104 ; [#uses=1] + at i104_s = external global i104 ; [#uses=1] + at i105_l = external global i105 ; [#uses=1] + at i105_s = external global i105 ; [#uses=1] + at i106_l = external global i106 ; [#uses=1] + at i106_s = external global i106 ; [#uses=1] + at i107_l = external global i107 ; [#uses=1] + at i107_s = external global i107 ; [#uses=1] + at i108_l = external global i108 ; [#uses=1] + at i108_s = external global i108 ; [#uses=1] + at i109_l = external global i109 ; [#uses=1] + at i109_s = external global i109 ; [#uses=1] + at i110_l = external global i110 ; [#uses=1] + at i110_s = external global i110 ; [#uses=1] + at i111_l = external global i111 ; [#uses=1] + at i111_s = external global i111 ; [#uses=1] + at i112_l = external global i112 ; [#uses=1] + at i112_s = external global i112 ; [#uses=1] + at i113_l = external global i113 ; [#uses=1] + at i113_s = external global i113 ; [#uses=1] + at i114_l = external global i114 ; [#uses=1] + at i114_s = external global i114 ; [#uses=1] + at i115_l = external global i115 ; [#uses=1] + at i115_s = external global i115 ; [#uses=1] + at i116_l = external global i116 ; [#uses=1] + at i116_s = external global i116 ; [#uses=1] + at i117_l = external global i117 ; [#uses=1] + at i117_s = external global i117 ; [#uses=1] + at i118_l = external global i118 ; [#uses=1] + at i118_s = external global i118 ; [#uses=1] + at i119_l = external global i119 ; [#uses=1] + at i119_s = external global i119 ; [#uses=1] + at i120_l = external global i120 ; [#uses=1] + at i120_s = external global i120 ; [#uses=1] + at i121_l = external global i121 ; [#uses=1] + at i121_s = external global i121 ; [#uses=1] + at i122_l = external global i122 ; [#uses=1] + at i122_s = external global i122 ; [#uses=1] + at i123_l = external global i123 ; [#uses=1] + at i123_s = external global i123 ; [#uses=1] + at i124_l = external global i124 ; [#uses=1] + at i124_s = external global i124 ; [#uses=1] + at i125_l = external global i125 ; [#uses=1] + at i125_s = external global i125 ; [#uses=1] + at i126_l = external global i126 ; [#uses=1] + at i126_s = external global i126 ; [#uses=1] + at i127_l = external global i127 ; [#uses=1] + at i127_s = external global i127 ; [#uses=1] + at i128_l = external global i128 ; [#uses=1] + at i128_s = external global i128 ; [#uses=1] + at i129_l = external global i129 ; [#uses=1] + at i129_s = external global i129 ; [#uses=1] + at i130_l = external global i130 ; [#uses=1] + at i130_s = external global i130 ; [#uses=1] + at i131_l = external global i131 ; [#uses=1] + at i131_s = external global i131 ; [#uses=1] + at i132_l = external global i132 ; [#uses=1] + at i132_s = external global i132 ; [#uses=1] + at i133_l = external global i133 ; [#uses=1] + at i133_s = external global i133 ; [#uses=1] + at i134_l = external global i134 ; [#uses=1] + at i134_s = external global i134 ; [#uses=1] + at i135_l = external global i135 ; [#uses=1] + at i135_s = external global i135 ; [#uses=1] + at i136_l = external global i136 ; [#uses=1] + at i136_s = external global i136 ; [#uses=1] + at i137_l = external global i137 ; [#uses=1] + at i137_s = external global i137 ; [#uses=1] + at i138_l = external global i138 ; [#uses=1] + at i138_s = external global i138 ; [#uses=1] + at i139_l = external global i139 ; [#uses=1] + at i139_s = external global i139 ; [#uses=1] + at i140_l = external global i140 ; [#uses=1] + at i140_s = external global i140 ; [#uses=1] + at i141_l = external global i141 ; [#uses=1] + at i141_s = external global i141 ; [#uses=1] + at i142_l = external global i142 ; [#uses=1] + at i142_s = external global i142 ; [#uses=1] + at i143_l = external global i143 ; [#uses=1] + at i143_s = external global i143 ; [#uses=1] + at i144_l = external global i144 ; [#uses=1] + at i144_s = external global i144 ; [#uses=1] + at i145_l = external global i145 ; [#uses=1] + at i145_s = external global i145 ; [#uses=1] + at i146_l = external global i146 ; [#uses=1] + at i146_s = external global i146 ; [#uses=1] + at i147_l = external global i147 ; [#uses=1] + at i147_s = external global i147 ; [#uses=1] + at i148_l = external global i148 ; [#uses=1] + at i148_s = external global i148 ; [#uses=1] + at i149_l = external global i149 ; [#uses=1] + at i149_s = external global i149 ; [#uses=1] + at i150_l = external global i150 ; [#uses=1] + at i150_s = external global i150 ; [#uses=1] + at i151_l = external global i151 ; [#uses=1] + at i151_s = external global i151 ; [#uses=1] + at i152_l = external global i152 ; [#uses=1] + at i152_s = external global i152 ; [#uses=1] + at i153_l = external global i153 ; [#uses=1] + at i153_s = external global i153 ; [#uses=1] + at i154_l = external global i154 ; [#uses=1] + at i154_s = external global i154 ; [#uses=1] + at i155_l = external global i155 ; [#uses=1] + at i155_s = external global i155 ; [#uses=1] + at i156_l = external global i156 ; [#uses=1] + at i156_s = external global i156 ; [#uses=1] + at i157_l = external global i157 ; [#uses=1] + at i157_s = external global i157 ; [#uses=1] + at i158_l = external global i158 ; [#uses=1] + at i158_s = external global i158 ; [#uses=1] + at i159_l = external global i159 ; [#uses=1] + at i159_s = external global i159 ; [#uses=1] + at i160_l = external global i160 ; [#uses=1] + at i160_s = external global i160 ; [#uses=1] + at i161_l = external global i161 ; [#uses=1] + at i161_s = external global i161 ; [#uses=1] + at i162_l = external global i162 ; [#uses=1] + at i162_s = external global i162 ; [#uses=1] + at i163_l = external global i163 ; [#uses=1] + at i163_s = external global i163 ; [#uses=1] + at i164_l = external global i164 ; [#uses=1] + at i164_s = external global i164 ; [#uses=1] + at i165_l = external global i165 ; [#uses=1] + at i165_s = external global i165 ; [#uses=1] + at i166_l = external global i166 ; [#uses=1] + at i166_s = external global i166 ; [#uses=1] + at i167_l = external global i167 ; [#uses=1] + at i167_s = external global i167 ; [#uses=1] + at i168_l = external global i168 ; [#uses=1] + at i168_s = external global i168 ; [#uses=1] + at i169_l = external global i169 ; [#uses=1] + at i169_s = external global i169 ; [#uses=1] + at i170_l = external global i170 ; [#uses=1] + at i170_s = external global i170 ; [#uses=1] + at i171_l = external global i171 ; [#uses=1] + at i171_s = external global i171 ; [#uses=1] + at i172_l = external global i172 ; [#uses=1] + at i172_s = external global i172 ; [#uses=1] + at i173_l = external global i173 ; [#uses=1] + at i173_s = external global i173 ; [#uses=1] + at i174_l = external global i174 ; [#uses=1] + at i174_s = external global i174 ; [#uses=1] + at i175_l = external global i175 ; [#uses=1] + at i175_s = external global i175 ; [#uses=1] + at i176_l = external global i176 ; [#uses=1] + at i176_s = external global i176 ; [#uses=1] + at i177_l = external global i177 ; [#uses=1] + at i177_s = external global i177 ; [#uses=1] + at i178_l = external global i178 ; [#uses=1] + at i178_s = external global i178 ; [#uses=1] + at i179_l = external global i179 ; [#uses=1] + at i179_s = external global i179 ; [#uses=1] + at i180_l = external global i180 ; [#uses=1] + at i180_s = external global i180 ; [#uses=1] + at i181_l = external global i181 ; [#uses=1] + at i181_s = external global i181 ; [#uses=1] + at i182_l = external global i182 ; [#uses=1] + at i182_s = external global i182 ; [#uses=1] + at i183_l = external global i183 ; [#uses=1] + at i183_s = external global i183 ; [#uses=1] + at i184_l = external global i184 ; [#uses=1] + at i184_s = external global i184 ; [#uses=1] + at i185_l = external global i185 ; [#uses=1] + at i185_s = external global i185 ; [#uses=1] + at i186_l = external global i186 ; [#uses=1] + at i186_s = external global i186 ; [#uses=1] + at i187_l = external global i187 ; [#uses=1] + at i187_s = external global i187 ; [#uses=1] + at i188_l = external global i188 ; [#uses=1] + at i188_s = external global i188 ; [#uses=1] + at i189_l = external global i189 ; [#uses=1] + at i189_s = external global i189 ; [#uses=1] + at i190_l = external global i190 ; [#uses=1] + at i190_s = external global i190 ; [#uses=1] + at i191_l = external global i191 ; [#uses=1] + at i191_s = external global i191 ; [#uses=1] + at i192_l = external global i192 ; [#uses=1] + at i192_s = external global i192 ; [#uses=1] + at i193_l = external global i193 ; [#uses=1] + at i193_s = external global i193 ; [#uses=1] + at i194_l = external global i194 ; [#uses=1] + at i194_s = external global i194 ; [#uses=1] + at i195_l = external global i195 ; [#uses=1] + at i195_s = external global i195 ; [#uses=1] + at i196_l = external global i196 ; [#uses=1] + at i196_s = external global i196 ; [#uses=1] + at i197_l = external global i197 ; [#uses=1] + at i197_s = external global i197 ; [#uses=1] + at i198_l = external global i198 ; [#uses=1] + at i198_s = external global i198 ; [#uses=1] + at i199_l = external global i199 ; [#uses=1] + at i199_s = external global i199 ; [#uses=1] + at i200_l = external global i200 ; [#uses=1] + at i200_s = external global i200 ; [#uses=1] + at i201_l = external global i201 ; [#uses=1] + at i201_s = external global i201 ; [#uses=1] + at i202_l = external global i202 ; [#uses=1] + at i202_s = external global i202 ; [#uses=1] + at i203_l = external global i203 ; [#uses=1] + at i203_s = external global i203 ; [#uses=1] + at i204_l = external global i204 ; [#uses=1] + at i204_s = external global i204 ; [#uses=1] + at i205_l = external global i205 ; [#uses=1] + at i205_s = external global i205 ; [#uses=1] + at i206_l = external global i206 ; [#uses=1] + at i206_s = external global i206 ; [#uses=1] + at i207_l = external global i207 ; [#uses=1] + at i207_s = external global i207 ; [#uses=1] + at i208_l = external global i208 ; [#uses=1] + at i208_s = external global i208 ; [#uses=1] + at i209_l = external global i209 ; [#uses=1] + at i209_s = external global i209 ; [#uses=1] + at i210_l = external global i210 ; [#uses=1] + at i210_s = external global i210 ; [#uses=1] + at i211_l = external global i211 ; [#uses=1] + at i211_s = external global i211 ; [#uses=1] + at i212_l = external global i212 ; [#uses=1] + at i212_s = external global i212 ; [#uses=1] + at i213_l = external global i213 ; [#uses=1] + at i213_s = external global i213 ; [#uses=1] + at i214_l = external global i214 ; [#uses=1] + at i214_s = external global i214 ; [#uses=1] + at i215_l = external global i215 ; [#uses=1] + at i215_s = external global i215 ; [#uses=1] + at i216_l = external global i216 ; [#uses=1] + at i216_s = external global i216 ; [#uses=1] + at i217_l = external global i217 ; [#uses=1] + at i217_s = external global i217 ; [#uses=1] + at i218_l = external global i218 ; [#uses=1] + at i218_s = external global i218 ; [#uses=1] + at i219_l = external global i219 ; [#uses=1] + at i219_s = external global i219 ; [#uses=1] + at i220_l = external global i220 ; [#uses=1] + at i220_s = external global i220 ; [#uses=1] + at i221_l = external global i221 ; [#uses=1] + at i221_s = external global i221 ; [#uses=1] + at i222_l = external global i222 ; [#uses=1] + at i222_s = external global i222 ; [#uses=1] + at i223_l = external global i223 ; [#uses=1] + at i223_s = external global i223 ; [#uses=1] + at i224_l = external global i224 ; [#uses=1] + at i224_s = external global i224 ; [#uses=1] + at i225_l = external global i225 ; [#uses=1] + at i225_s = external global i225 ; [#uses=1] + at i226_l = external global i226 ; [#uses=1] + at i226_s = external global i226 ; [#uses=1] + at i227_l = external global i227 ; [#uses=1] + at i227_s = external global i227 ; [#uses=1] + at i228_l = external global i228 ; [#uses=1] + at i228_s = external global i228 ; [#uses=1] + at i229_l = external global i229 ; [#uses=1] + at i229_s = external global i229 ; [#uses=1] + at i230_l = external global i230 ; [#uses=1] + at i230_s = external global i230 ; [#uses=1] + at i231_l = external global i231 ; [#uses=1] + at i231_s = external global i231 ; [#uses=1] + at i232_l = external global i232 ; [#uses=1] + at i232_s = external global i232 ; [#uses=1] + at i233_l = external global i233 ; [#uses=1] + at i233_s = external global i233 ; [#uses=1] + at i234_l = external global i234 ; [#uses=1] + at i234_s = external global i234 ; [#uses=1] + at i235_l = external global i235 ; [#uses=1] + at i235_s = external global i235 ; [#uses=1] + at i236_l = external global i236 ; [#uses=1] + at i236_s = external global i236 ; [#uses=1] + at i237_l = external global i237 ; [#uses=1] + at i237_s = external global i237 ; [#uses=1] + at i238_l = external global i238 ; [#uses=1] + at i238_s = external global i238 ; [#uses=1] + at i239_l = external global i239 ; [#uses=1] + at i239_s = external global i239 ; [#uses=1] + at i240_l = external global i240 ; [#uses=1] + at i240_s = external global i240 ; [#uses=1] + at i241_l = external global i241 ; [#uses=1] + at i241_s = external global i241 ; [#uses=1] + at i242_l = external global i242 ; [#uses=1] + at i242_s = external global i242 ; [#uses=1] + at i243_l = external global i243 ; [#uses=1] + at i243_s = external global i243 ; [#uses=1] + at i244_l = external global i244 ; [#uses=1] + at i244_s = external global i244 ; [#uses=1] + at i245_l = external global i245 ; [#uses=1] + at i245_s = external global i245 ; [#uses=1] + at i246_l = external global i246 ; [#uses=1] + at i246_s = external global i246 ; [#uses=1] + at i247_l = external global i247 ; [#uses=1] + at i247_s = external global i247 ; [#uses=1] + at i248_l = external global i248 ; [#uses=1] + at i248_s = external global i248 ; [#uses=1] + at i249_l = external global i249 ; [#uses=1] + at i249_s = external global i249 ; [#uses=1] + at i250_l = external global i250 ; [#uses=1] + at i250_s = external global i250 ; [#uses=1] + at i251_l = external global i251 ; [#uses=1] + at i251_s = external global i251 ; [#uses=1] + at i252_l = external global i252 ; [#uses=1] + at i252_s = external global i252 ; [#uses=1] + at i253_l = external global i253 ; [#uses=1] + at i253_s = external global i253 ; [#uses=1] + at i254_l = external global i254 ; [#uses=1] + at i254_s = external global i254 ; [#uses=1] + at i255_l = external global i255 ; [#uses=1] + at i255_s = external global i255 ; [#uses=1] + at i256_l = external global i256 ; [#uses=1] + at i256_s = external global i256 ; [#uses=1] + +define void @i1_ls() nounwind { + %tmp = load i1* @i1_l ; [#uses=1] + store i1 %tmp, i1* @i1_s + ret void +} + +define void @i2_ls() nounwind { + %tmp = load i2* @i2_l ; [#uses=1] + store i2 %tmp, i2* @i2_s + ret void +} + +define void @i3_ls() nounwind { + %tmp = load i3* @i3_l ; [#uses=1] + store i3 %tmp, i3* @i3_s + ret void +} + +define void @i4_ls() nounwind { + %tmp = load i4* @i4_l ; [#uses=1] + store i4 %tmp, i4* @i4_s + ret void +} + +define void @i5_ls() nounwind { + %tmp = load i5* @i5_l ; [#uses=1] + store i5 %tmp, i5* @i5_s + ret void +} + +define void @i6_ls() nounwind { + %tmp = load i6* @i6_l ; [#uses=1] + store i6 %tmp, i6* @i6_s + ret void +} + +define void @i7_ls() nounwind { + %tmp = load i7* @i7_l ; [#uses=1] + store i7 %tmp, i7* @i7_s + ret void +} + +define void @i8_ls() nounwind { + %tmp = load i8* @i8_l ; [#uses=1] + store i8 %tmp, i8* @i8_s + ret void +} + +define void @i9_ls() nounwind { + %tmp = load i9* @i9_l ; [#uses=1] + store i9 %tmp, i9* @i9_s + ret void +} + +define void @i10_ls() nounwind { + %tmp = load i10* @i10_l ; [#uses=1] + store i10 %tmp, i10* @i10_s + ret void +} + +define void @i11_ls() nounwind { + %tmp = load i11* @i11_l ; [#uses=1] + store i11 %tmp, i11* @i11_s + ret void +} + +define void @i12_ls() nounwind { + %tmp = load i12* @i12_l ; [#uses=1] + store i12 %tmp, i12* @i12_s + ret void +} + +define void @i13_ls() nounwind { + %tmp = load i13* @i13_l ; [#uses=1] + store i13 %tmp, i13* @i13_s + ret void +} + +define void @i14_ls() nounwind { + %tmp = load i14* @i14_l ; [#uses=1] + store i14 %tmp, i14* @i14_s + ret void +} + +define void @i15_ls() nounwind { + %tmp = load i15* @i15_l ; [#uses=1] + store i15 %tmp, i15* @i15_s + ret void +} + +define void @i16_ls() nounwind { + %tmp = load i16* @i16_l ; [#uses=1] + store i16 %tmp, i16* @i16_s + ret void +} + +define void @i17_ls() nounwind { + %tmp = load i17* @i17_l ; [#uses=1] + store i17 %tmp, i17* @i17_s + ret void +} + +define void @i18_ls() nounwind { + %tmp = load i18* @i18_l ; [#uses=1] + store i18 %tmp, i18* @i18_s + ret void +} + +define void @i19_ls() nounwind { + %tmp = load i19* @i19_l ; [#uses=1] + store i19 %tmp, i19* @i19_s + ret void +} + +define void @i20_ls() nounwind { + %tmp = load i20* @i20_l ; [#uses=1] + store i20 %tmp, i20* @i20_s + ret void +} + +define void @i21_ls() nounwind { + %tmp = load i21* @i21_l ; [#uses=1] + store i21 %tmp, i21* @i21_s + ret void +} + +define void @i22_ls() nounwind { + %tmp = load i22* @i22_l ; [#uses=1] + store i22 %tmp, i22* @i22_s + ret void +} + +define void @i23_ls() nounwind { + %tmp = load i23* @i23_l ; [#uses=1] + store i23 %tmp, i23* @i23_s + ret void +} + +define void @i24_ls() nounwind { + %tmp = load i24* @i24_l ; [#uses=1] + store i24 %tmp, i24* @i24_s + ret void +} + +define void @i25_ls() nounwind { + %tmp = load i25* @i25_l ; [#uses=1] + store i25 %tmp, i25* @i25_s + ret void +} + +define void @i26_ls() nounwind { + %tmp = load i26* @i26_l ; [#uses=1] + store i26 %tmp, i26* @i26_s + ret void +} + +define void @i27_ls() nounwind { + %tmp = load i27* @i27_l ; [#uses=1] + store i27 %tmp, i27* @i27_s + ret void +} + +define void @i28_ls() nounwind { + %tmp = load i28* @i28_l ; [#uses=1] + store i28 %tmp, i28* @i28_s + ret void +} + +define void @i29_ls() nounwind { + %tmp = load i29* @i29_l ; [#uses=1] + store i29 %tmp, i29* @i29_s + ret void +} + +define void @i30_ls() nounwind { + %tmp = load i30* @i30_l ; [#uses=1] + store i30 %tmp, i30* @i30_s + ret void +} + +define void @i31_ls() nounwind { + %tmp = load i31* @i31_l ; [#uses=1] + store i31 %tmp, i31* @i31_s + ret void +} + +define void @i32_ls() nounwind { + %tmp = load i32* @i32_l ; [#uses=1] + store i32 %tmp, i32* @i32_s + ret void +} + +define void @i33_ls() nounwind { + %tmp = load i33* @i33_l ; [#uses=1] + store i33 %tmp, i33* @i33_s + ret void +} + +define void @i34_ls() nounwind { + %tmp = load i34* @i34_l ; [#uses=1] + store i34 %tmp, i34* @i34_s + ret void +} + +define void @i35_ls() nounwind { + %tmp = load i35* @i35_l ; [#uses=1] + store i35 %tmp, i35* @i35_s + ret void +} + +define void @i36_ls() nounwind { + %tmp = load i36* @i36_l ; [#uses=1] + store i36 %tmp, i36* @i36_s + ret void +} + +define void @i37_ls() nounwind { + %tmp = load i37* @i37_l ; [#uses=1] + store i37 %tmp, i37* @i37_s + ret void +} + +define void @i38_ls() nounwind { + %tmp = load i38* @i38_l ; [#uses=1] + store i38 %tmp, i38* @i38_s + ret void +} + +define void @i39_ls() nounwind { + %tmp = load i39* @i39_l ; [#uses=1] + store i39 %tmp, i39* @i39_s + ret void +} + +define void @i40_ls() nounwind { + %tmp = load i40* @i40_l ; [#uses=1] + store i40 %tmp, i40* @i40_s + ret void +} + +define void @i41_ls() nounwind { + %tmp = load i41* @i41_l ; [#uses=1] + store i41 %tmp, i41* @i41_s + ret void +} + +define void @i42_ls() nounwind { + %tmp = load i42* @i42_l ; [#uses=1] + store i42 %tmp, i42* @i42_s + ret void +} + +define void @i43_ls() nounwind { + %tmp = load i43* @i43_l ; [#uses=1] + store i43 %tmp, i43* @i43_s + ret void +} + +define void @i44_ls() nounwind { + %tmp = load i44* @i44_l ; [#uses=1] + store i44 %tmp, i44* @i44_s + ret void +} + +define void @i45_ls() nounwind { + %tmp = load i45* @i45_l ; [#uses=1] + store i45 %tmp, i45* @i45_s + ret void +} + +define void @i46_ls() nounwind { + %tmp = load i46* @i46_l ; [#uses=1] + store i46 %tmp, i46* @i46_s + ret void +} + +define void @i47_ls() nounwind { + %tmp = load i47* @i47_l ; [#uses=1] + store i47 %tmp, i47* @i47_s + ret void +} + +define void @i48_ls() nounwind { + %tmp = load i48* @i48_l ; [#uses=1] + store i48 %tmp, i48* @i48_s + ret void +} + +define void @i49_ls() nounwind { + %tmp = load i49* @i49_l ; [#uses=1] + store i49 %tmp, i49* @i49_s + ret void +} + +define void @i50_ls() nounwind { + %tmp = load i50* @i50_l ; [#uses=1] + store i50 %tmp, i50* @i50_s + ret void +} + +define void @i51_ls() nounwind { + %tmp = load i51* @i51_l ; [#uses=1] + store i51 %tmp, i51* @i51_s + ret void +} + +define void @i52_ls() nounwind { + %tmp = load i52* @i52_l ; [#uses=1] + store i52 %tmp, i52* @i52_s + ret void +} + +define void @i53_ls() nounwind { + %tmp = load i53* @i53_l ; [#uses=1] + store i53 %tmp, i53* @i53_s + ret void +} + +define void @i54_ls() nounwind { + %tmp = load i54* @i54_l ; [#uses=1] + store i54 %tmp, i54* @i54_s + ret void +} + +define void @i55_ls() nounwind { + %tmp = load i55* @i55_l ; [#uses=1] + store i55 %tmp, i55* @i55_s + ret void +} + +define void @i56_ls() nounwind { + %tmp = load i56* @i56_l ; [#uses=1] + store i56 %tmp, i56* @i56_s + ret void +} + +define void @i57_ls() nounwind { + %tmp = load i57* @i57_l ; [#uses=1] + store i57 %tmp, i57* @i57_s + ret void +} + +define void @i58_ls() nounwind { + %tmp = load i58* @i58_l ; [#uses=1] + store i58 %tmp, i58* @i58_s + ret void +} + +define void @i59_ls() nounwind { + %tmp = load i59* @i59_l ; [#uses=1] + store i59 %tmp, i59* @i59_s + ret void +} + +define void @i60_ls() nounwind { + %tmp = load i60* @i60_l ; [#uses=1] + store i60 %tmp, i60* @i60_s + ret void +} + +define void @i61_ls() nounwind { + %tmp = load i61* @i61_l ; [#uses=1] + store i61 %tmp, i61* @i61_s + ret void +} + +define void @i62_ls() nounwind { + %tmp = load i62* @i62_l ; [#uses=1] + store i62 %tmp, i62* @i62_s + ret void +} + +define void @i63_ls() nounwind { + %tmp = load i63* @i63_l ; [#uses=1] + store i63 %tmp, i63* @i63_s + ret void +} + +define void @i64_ls() nounwind { + %tmp = load i64* @i64_l ; [#uses=1] + store i64 %tmp, i64* @i64_s + ret void +} + +define void @i65_ls() nounwind { + %tmp = load i65* @i65_l ; [#uses=1] + store i65 %tmp, i65* @i65_s + ret void +} + +define void @i66_ls() nounwind { + %tmp = load i66* @i66_l ; [#uses=1] + store i66 %tmp, i66* @i66_s + ret void +} + +define void @i67_ls() nounwind { + %tmp = load i67* @i67_l ; [#uses=1] + store i67 %tmp, i67* @i67_s + ret void +} + +define void @i68_ls() nounwind { + %tmp = load i68* @i68_l ; [#uses=1] + store i68 %tmp, i68* @i68_s + ret void +} + +define void @i69_ls() nounwind { + %tmp = load i69* @i69_l ; [#uses=1] + store i69 %tmp, i69* @i69_s + ret void +} + +define void @i70_ls() nounwind { + %tmp = load i70* @i70_l ; [#uses=1] + store i70 %tmp, i70* @i70_s + ret void +} + +define void @i71_ls() nounwind { + %tmp = load i71* @i71_l ; [#uses=1] + store i71 %tmp, i71* @i71_s + ret void +} + +define void @i72_ls() nounwind { + %tmp = load i72* @i72_l ; [#uses=1] + store i72 %tmp, i72* @i72_s + ret void +} + +define void @i73_ls() nounwind { + %tmp = load i73* @i73_l ; [#uses=1] + store i73 %tmp, i73* @i73_s + ret void +} + +define void @i74_ls() nounwind { + %tmp = load i74* @i74_l ; [#uses=1] + store i74 %tmp, i74* @i74_s + ret void +} + +define void @i75_ls() nounwind { + %tmp = load i75* @i75_l ; [#uses=1] + store i75 %tmp, i75* @i75_s + ret void +} + +define void @i76_ls() nounwind { + %tmp = load i76* @i76_l ; [#uses=1] + store i76 %tmp, i76* @i76_s + ret void +} + +define void @i77_ls() nounwind { + %tmp = load i77* @i77_l ; [#uses=1] + store i77 %tmp, i77* @i77_s + ret void +} + +define void @i78_ls() nounwind { + %tmp = load i78* @i78_l ; [#uses=1] + store i78 %tmp, i78* @i78_s + ret void +} + +define void @i79_ls() nounwind { + %tmp = load i79* @i79_l ; [#uses=1] + store i79 %tmp, i79* @i79_s + ret void +} + +define void @i80_ls() nounwind { + %tmp = load i80* @i80_l ; [#uses=1] + store i80 %tmp, i80* @i80_s + ret void +} + +define void @i81_ls() nounwind { + %tmp = load i81* @i81_l ; [#uses=1] + store i81 %tmp, i81* @i81_s + ret void +} + +define void @i82_ls() nounwind { + %tmp = load i82* @i82_l ; [#uses=1] + store i82 %tmp, i82* @i82_s + ret void +} + +define void @i83_ls() nounwind { + %tmp = load i83* @i83_l ; [#uses=1] + store i83 %tmp, i83* @i83_s + ret void +} + +define void @i84_ls() nounwind { + %tmp = load i84* @i84_l ; [#uses=1] + store i84 %tmp, i84* @i84_s + ret void +} + +define void @i85_ls() nounwind { + %tmp = load i85* @i85_l ; [#uses=1] + store i85 %tmp, i85* @i85_s + ret void +} + +define void @i86_ls() nounwind { + %tmp = load i86* @i86_l ; [#uses=1] + store i86 %tmp, i86* @i86_s + ret void +} + +define void @i87_ls() nounwind { + %tmp = load i87* @i87_l ; [#uses=1] + store i87 %tmp, i87* @i87_s + ret void +} + +define void @i88_ls() nounwind { + %tmp = load i88* @i88_l ; [#uses=1] + store i88 %tmp, i88* @i88_s + ret void +} + +define void @i89_ls() nounwind { + %tmp = load i89* @i89_l ; [#uses=1] + store i89 %tmp, i89* @i89_s + ret void +} + +define void @i90_ls() nounwind { + %tmp = load i90* @i90_l ; [#uses=1] + store i90 %tmp, i90* @i90_s + ret void +} + +define void @i91_ls() nounwind { + %tmp = load i91* @i91_l ; [#uses=1] + store i91 %tmp, i91* @i91_s + ret void +} + +define void @i92_ls() nounwind { + %tmp = load i92* @i92_l ; [#uses=1] + store i92 %tmp, i92* @i92_s + ret void +} + +define void @i93_ls() nounwind { + %tmp = load i93* @i93_l ; [#uses=1] + store i93 %tmp, i93* @i93_s + ret void +} + +define void @i94_ls() nounwind { + %tmp = load i94* @i94_l ; [#uses=1] + store i94 %tmp, i94* @i94_s + ret void +} + +define void @i95_ls() nounwind { + %tmp = load i95* @i95_l ; [#uses=1] + store i95 %tmp, i95* @i95_s + ret void +} + +define void @i96_ls() nounwind { + %tmp = load i96* @i96_l ; [#uses=1] + store i96 %tmp, i96* @i96_s + ret void +} + +define void @i97_ls() nounwind { + %tmp = load i97* @i97_l ; [#uses=1] + store i97 %tmp, i97* @i97_s + ret void +} + +define void @i98_ls() nounwind { + %tmp = load i98* @i98_l ; [#uses=1] + store i98 %tmp, i98* @i98_s + ret void +} + +define void @i99_ls() nounwind { + %tmp = load i99* @i99_l ; [#uses=1] + store i99 %tmp, i99* @i99_s + ret void +} + +define void @i100_ls() nounwind { + %tmp = load i100* @i100_l ; [#uses=1] + store i100 %tmp, i100* @i100_s + ret void +} + +define void @i101_ls() nounwind { + %tmp = load i101* @i101_l ; [#uses=1] + store i101 %tmp, i101* @i101_s + ret void +} + +define void @i102_ls() nounwind { + %tmp = load i102* @i102_l ; [#uses=1] + store i102 %tmp, i102* @i102_s + ret void +} + +define void @i103_ls() nounwind { + %tmp = load i103* @i103_l ; [#uses=1] + store i103 %tmp, i103* @i103_s + ret void +} + +define void @i104_ls() nounwind { + %tmp = load i104* @i104_l ; [#uses=1] + store i104 %tmp, i104* @i104_s + ret void +} + +define void @i105_ls() nounwind { + %tmp = load i105* @i105_l ; [#uses=1] + store i105 %tmp, i105* @i105_s + ret void +} + +define void @i106_ls() nounwind { + %tmp = load i106* @i106_l ; [#uses=1] + store i106 %tmp, i106* @i106_s + ret void +} + +define void @i107_ls() nounwind { + %tmp = load i107* @i107_l ; [#uses=1] + store i107 %tmp, i107* @i107_s + ret void +} + +define void @i108_ls() nounwind { + %tmp = load i108* @i108_l ; [#uses=1] + store i108 %tmp, i108* @i108_s + ret void +} + +define void @i109_ls() nounwind { + %tmp = load i109* @i109_l ; [#uses=1] + store i109 %tmp, i109* @i109_s + ret void +} + +define void @i110_ls() nounwind { + %tmp = load i110* @i110_l ; [#uses=1] + store i110 %tmp, i110* @i110_s + ret void +} + +define void @i111_ls() nounwind { + %tmp = load i111* @i111_l ; [#uses=1] + store i111 %tmp, i111* @i111_s + ret void +} + +define void @i112_ls() nounwind { + %tmp = load i112* @i112_l ; [#uses=1] + store i112 %tmp, i112* @i112_s + ret void +} + +define void @i113_ls() nounwind { + %tmp = load i113* @i113_l ; [#uses=1] + store i113 %tmp, i113* @i113_s + ret void +} + +define void @i114_ls() nounwind { + %tmp = load i114* @i114_l ; [#uses=1] + store i114 %tmp, i114* @i114_s + ret void +} + +define void @i115_ls() nounwind { + %tmp = load i115* @i115_l ; [#uses=1] + store i115 %tmp, i115* @i115_s + ret void +} + +define void @i116_ls() nounwind { + %tmp = load i116* @i116_l ; [#uses=1] + store i116 %tmp, i116* @i116_s + ret void +} + +define void @i117_ls() nounwind { + %tmp = load i117* @i117_l ; [#uses=1] + store i117 %tmp, i117* @i117_s + ret void +} + +define void @i118_ls() nounwind { + %tmp = load i118* @i118_l ; [#uses=1] + store i118 %tmp, i118* @i118_s + ret void +} + +define void @i119_ls() nounwind { + %tmp = load i119* @i119_l ; [#uses=1] + store i119 %tmp, i119* @i119_s + ret void +} + +define void @i120_ls() nounwind { + %tmp = load i120* @i120_l ; [#uses=1] + store i120 %tmp, i120* @i120_s + ret void +} + +define void @i121_ls() nounwind { + %tmp = load i121* @i121_l ; [#uses=1] + store i121 %tmp, i121* @i121_s + ret void +} + +define void @i122_ls() nounwind { + %tmp = load i122* @i122_l ; [#uses=1] + store i122 %tmp, i122* @i122_s + ret void +} + +define void @i123_ls() nounwind { + %tmp = load i123* @i123_l ; [#uses=1] + store i123 %tmp, i123* @i123_s + ret void +} + +define void @i124_ls() nounwind { + %tmp = load i124* @i124_l ; [#uses=1] + store i124 %tmp, i124* @i124_s + ret void +} + +define void @i125_ls() nounwind { + %tmp = load i125* @i125_l ; [#uses=1] + store i125 %tmp, i125* @i125_s + ret void +} + +define void @i126_ls() nounwind { + %tmp = load i126* @i126_l ; [#uses=1] + store i126 %tmp, i126* @i126_s + ret void +} + +define void @i127_ls() nounwind { + %tmp = load i127* @i127_l ; [#uses=1] + store i127 %tmp, i127* @i127_s + ret void +} + +define void @i128_ls() nounwind { + %tmp = load i128* @i128_l ; [#uses=1] + store i128 %tmp, i128* @i128_s + ret void +} + +define void @i129_ls() nounwind { + %tmp = load i129* @i129_l ; [#uses=1] + store i129 %tmp, i129* @i129_s + ret void +} + +define void @i130_ls() nounwind { + %tmp = load i130* @i130_l ; [#uses=1] + store i130 %tmp, i130* @i130_s + ret void +} + +define void @i131_ls() nounwind { + %tmp = load i131* @i131_l ; [#uses=1] + store i131 %tmp, i131* @i131_s + ret void +} + +define void @i132_ls() nounwind { + %tmp = load i132* @i132_l ; [#uses=1] + store i132 %tmp, i132* @i132_s + ret void +} + +define void @i133_ls() nounwind { + %tmp = load i133* @i133_l ; [#uses=1] + store i133 %tmp, i133* @i133_s + ret void +} + +define void @i134_ls() nounwind { + %tmp = load i134* @i134_l ; [#uses=1] + store i134 %tmp, i134* @i134_s + ret void +} + +define void @i135_ls() nounwind { + %tmp = load i135* @i135_l ; [#uses=1] + store i135 %tmp, i135* @i135_s + ret void +} + +define void @i136_ls() nounwind { + %tmp = load i136* @i136_l ; [#uses=1] + store i136 %tmp, i136* @i136_s + ret void +} + +define void @i137_ls() nounwind { + %tmp = load i137* @i137_l ; [#uses=1] + store i137 %tmp, i137* @i137_s + ret void +} + +define void @i138_ls() nounwind { + %tmp = load i138* @i138_l ; [#uses=1] + store i138 %tmp, i138* @i138_s + ret void +} + +define void @i139_ls() nounwind { + %tmp = load i139* @i139_l ; [#uses=1] + store i139 %tmp, i139* @i139_s + ret void +} + +define void @i140_ls() nounwind { + %tmp = load i140* @i140_l ; [#uses=1] + store i140 %tmp, i140* @i140_s + ret void +} + +define void @i141_ls() nounwind { + %tmp = load i141* @i141_l ; [#uses=1] + store i141 %tmp, i141* @i141_s + ret void +} + +define void @i142_ls() nounwind { + %tmp = load i142* @i142_l ; [#uses=1] + store i142 %tmp, i142* @i142_s + ret void +} + +define void @i143_ls() nounwind { + %tmp = load i143* @i143_l ; [#uses=1] + store i143 %tmp, i143* @i143_s + ret void +} + +define void @i144_ls() nounwind { + %tmp = load i144* @i144_l ; [#uses=1] + store i144 %tmp, i144* @i144_s + ret void +} + +define void @i145_ls() nounwind { + %tmp = load i145* @i145_l ; [#uses=1] + store i145 %tmp, i145* @i145_s + ret void +} + +define void @i146_ls() nounwind { + %tmp = load i146* @i146_l ; [#uses=1] + store i146 %tmp, i146* @i146_s + ret void +} + +define void @i147_ls() nounwind { + %tmp = load i147* @i147_l ; [#uses=1] + store i147 %tmp, i147* @i147_s + ret void +} + +define void @i148_ls() nounwind { + %tmp = load i148* @i148_l ; [#uses=1] + store i148 %tmp, i148* @i148_s + ret void +} + +define void @i149_ls() nounwind { + %tmp = load i149* @i149_l ; [#uses=1] + store i149 %tmp, i149* @i149_s + ret void +} + +define void @i150_ls() nounwind { + %tmp = load i150* @i150_l ; [#uses=1] + store i150 %tmp, i150* @i150_s + ret void +} + +define void @i151_ls() nounwind { + %tmp = load i151* @i151_l ; [#uses=1] + store i151 %tmp, i151* @i151_s + ret void +} + +define void @i152_ls() nounwind { + %tmp = load i152* @i152_l ; [#uses=1] + store i152 %tmp, i152* @i152_s + ret void +} + +define void @i153_ls() nounwind { + %tmp = load i153* @i153_l ; [#uses=1] + store i153 %tmp, i153* @i153_s + ret void +} + +define void @i154_ls() nounwind { + %tmp = load i154* @i154_l ; [#uses=1] + store i154 %tmp, i154* @i154_s + ret void +} + +define void @i155_ls() nounwind { + %tmp = load i155* @i155_l ; [#uses=1] + store i155 %tmp, i155* @i155_s + ret void +} + +define void @i156_ls() nounwind { + %tmp = load i156* @i156_l ; [#uses=1] + store i156 %tmp, i156* @i156_s + ret void +} + +define void @i157_ls() nounwind { + %tmp = load i157* @i157_l ; [#uses=1] + store i157 %tmp, i157* @i157_s + ret void +} + +define void @i158_ls() nounwind { + %tmp = load i158* @i158_l ; [#uses=1] + store i158 %tmp, i158* @i158_s + ret void +} + +define void @i159_ls() nounwind { + %tmp = load i159* @i159_l ; [#uses=1] + store i159 %tmp, i159* @i159_s + ret void +} + +define void @i160_ls() nounwind { + %tmp = load i160* @i160_l ; [#uses=1] + store i160 %tmp, i160* @i160_s + ret void +} + +define void @i161_ls() nounwind { + %tmp = load i161* @i161_l ; [#uses=1] + store i161 %tmp, i161* @i161_s + ret void +} + +define void @i162_ls() nounwind { + %tmp = load i162* @i162_l ; [#uses=1] + store i162 %tmp, i162* @i162_s + ret void +} + +define void @i163_ls() nounwind { + %tmp = load i163* @i163_l ; [#uses=1] + store i163 %tmp, i163* @i163_s + ret void +} + +define void @i164_ls() nounwind { + %tmp = load i164* @i164_l ; [#uses=1] + store i164 %tmp, i164* @i164_s + ret void +} + +define void @i165_ls() nounwind { + %tmp = load i165* @i165_l ; [#uses=1] + store i165 %tmp, i165* @i165_s + ret void +} + +define void @i166_ls() nounwind { + %tmp = load i166* @i166_l ; [#uses=1] + store i166 %tmp, i166* @i166_s + ret void +} + +define void @i167_ls() nounwind { + %tmp = load i167* @i167_l ; [#uses=1] + store i167 %tmp, i167* @i167_s + ret void +} + +define void @i168_ls() nounwind { + %tmp = load i168* @i168_l ; [#uses=1] + store i168 %tmp, i168* @i168_s + ret void +} + +define void @i169_ls() nounwind { + %tmp = load i169* @i169_l ; [#uses=1] + store i169 %tmp, i169* @i169_s + ret void +} + +define void @i170_ls() nounwind { + %tmp = load i170* @i170_l ; [#uses=1] + store i170 %tmp, i170* @i170_s + ret void +} + +define void @i171_ls() nounwind { + %tmp = load i171* @i171_l ; [#uses=1] + store i171 %tmp, i171* @i171_s + ret void +} + +define void @i172_ls() nounwind { + %tmp = load i172* @i172_l ; [#uses=1] + store i172 %tmp, i172* @i172_s + ret void +} + +define void @i173_ls() nounwind { + %tmp = load i173* @i173_l ; [#uses=1] + store i173 %tmp, i173* @i173_s + ret void +} + +define void @i174_ls() nounwind { + %tmp = load i174* @i174_l ; [#uses=1] + store i174 %tmp, i174* @i174_s + ret void +} + +define void @i175_ls() nounwind { + %tmp = load i175* @i175_l ; [#uses=1] + store i175 %tmp, i175* @i175_s + ret void +} + +define void @i176_ls() nounwind { + %tmp = load i176* @i176_l ; [#uses=1] + store i176 %tmp, i176* @i176_s + ret void +} + +define void @i177_ls() nounwind { + %tmp = load i177* @i177_l ; [#uses=1] + store i177 %tmp, i177* @i177_s + ret void +} + +define void @i178_ls() nounwind { + %tmp = load i178* @i178_l ; [#uses=1] + store i178 %tmp, i178* @i178_s + ret void +} + +define void @i179_ls() nounwind { + %tmp = load i179* @i179_l ; [#uses=1] + store i179 %tmp, i179* @i179_s + ret void +} + +define void @i180_ls() nounwind { + %tmp = load i180* @i180_l ; [#uses=1] + store i180 %tmp, i180* @i180_s + ret void +} + +define void @i181_ls() nounwind { + %tmp = load i181* @i181_l ; [#uses=1] + store i181 %tmp, i181* @i181_s + ret void +} + +define void @i182_ls() nounwind { + %tmp = load i182* @i182_l ; [#uses=1] + store i182 %tmp, i182* @i182_s + ret void +} + +define void @i183_ls() nounwind { + %tmp = load i183* @i183_l ; [#uses=1] + store i183 %tmp, i183* @i183_s + ret void +} + +define void @i184_ls() nounwind { + %tmp = load i184* @i184_l ; [#uses=1] + store i184 %tmp, i184* @i184_s + ret void +} + +define void @i185_ls() nounwind { + %tmp = load i185* @i185_l ; [#uses=1] + store i185 %tmp, i185* @i185_s + ret void +} + +define void @i186_ls() nounwind { + %tmp = load i186* @i186_l ; [#uses=1] + store i186 %tmp, i186* @i186_s + ret void +} + +define void @i187_ls() nounwind { + %tmp = load i187* @i187_l ; [#uses=1] + store i187 %tmp, i187* @i187_s + ret void +} + +define void @i188_ls() nounwind { + %tmp = load i188* @i188_l ; [#uses=1] + store i188 %tmp, i188* @i188_s + ret void +} + +define void @i189_ls() nounwind { + %tmp = load i189* @i189_l ; [#uses=1] + store i189 %tmp, i189* @i189_s + ret void +} + +define void @i190_ls() nounwind { + %tmp = load i190* @i190_l ; [#uses=1] + store i190 %tmp, i190* @i190_s + ret void +} + +define void @i191_ls() nounwind { + %tmp = load i191* @i191_l ; [#uses=1] + store i191 %tmp, i191* @i191_s + ret void +} + +define void @i192_ls() nounwind { + %tmp = load i192* @i192_l ; [#uses=1] + store i192 %tmp, i192* @i192_s + ret void +} + +define void @i193_ls() nounwind { + %tmp = load i193* @i193_l ; [#uses=1] + store i193 %tmp, i193* @i193_s + ret void +} + +define void @i194_ls() nounwind { + %tmp = load i194* @i194_l ; [#uses=1] + store i194 %tmp, i194* @i194_s + ret void +} + +define void @i195_ls() nounwind { + %tmp = load i195* @i195_l ; [#uses=1] + store i195 %tmp, i195* @i195_s + ret void +} + +define void @i196_ls() nounwind { + %tmp = load i196* @i196_l ; [#uses=1] + store i196 %tmp, i196* @i196_s + ret void +} + +define void @i197_ls() nounwind { + %tmp = load i197* @i197_l ; [#uses=1] + store i197 %tmp, i197* @i197_s + ret void +} + +define void @i198_ls() nounwind { + %tmp = load i198* @i198_l ; [#uses=1] + store i198 %tmp, i198* @i198_s + ret void +} + +define void @i199_ls() nounwind { + %tmp = load i199* @i199_l ; [#uses=1] + store i199 %tmp, i199* @i199_s + ret void +} + +define void @i200_ls() nounwind { + %tmp = load i200* @i200_l ; [#uses=1] + store i200 %tmp, i200* @i200_s + ret void +} + +define void @i201_ls() nounwind { + %tmp = load i201* @i201_l ; [#uses=1] + store i201 %tmp, i201* @i201_s + ret void +} + +define void @i202_ls() nounwind { + %tmp = load i202* @i202_l ; [#uses=1] + store i202 %tmp, i202* @i202_s + ret void +} + +define void @i203_ls() nounwind { + %tmp = load i203* @i203_l ; [#uses=1] + store i203 %tmp, i203* @i203_s + ret void +} + +define void @i204_ls() nounwind { + %tmp = load i204* @i204_l ; [#uses=1] + store i204 %tmp, i204* @i204_s + ret void +} + +define void @i205_ls() nounwind { + %tmp = load i205* @i205_l ; [#uses=1] + store i205 %tmp, i205* @i205_s + ret void +} + +define void @i206_ls() nounwind { + %tmp = load i206* @i206_l ; [#uses=1] + store i206 %tmp, i206* @i206_s + ret void +} + +define void @i207_ls() nounwind { + %tmp = load i207* @i207_l ; [#uses=1] + store i207 %tmp, i207* @i207_s + ret void +} + +define void @i208_ls() nounwind { + %tmp = load i208* @i208_l ; [#uses=1] + store i208 %tmp, i208* @i208_s + ret void +} + +define void @i209_ls() nounwind { + %tmp = load i209* @i209_l ; [#uses=1] + store i209 %tmp, i209* @i209_s + ret void +} + +define void @i210_ls() nounwind { + %tmp = load i210* @i210_l ; [#uses=1] + store i210 %tmp, i210* @i210_s + ret void +} + +define void @i211_ls() nounwind { + %tmp = load i211* @i211_l ; [#uses=1] + store i211 %tmp, i211* @i211_s + ret void +} + +define void @i212_ls() nounwind { + %tmp = load i212* @i212_l ; [#uses=1] + store i212 %tmp, i212* @i212_s + ret void +} + +define void @i213_ls() nounwind { + %tmp = load i213* @i213_l ; [#uses=1] + store i213 %tmp, i213* @i213_s + ret void +} + +define void @i214_ls() nounwind { + %tmp = load i214* @i214_l ; [#uses=1] + store i214 %tmp, i214* @i214_s + ret void +} + +define void @i215_ls() nounwind { + %tmp = load i215* @i215_l ; [#uses=1] + store i215 %tmp, i215* @i215_s + ret void +} + +define void @i216_ls() nounwind { + %tmp = load i216* @i216_l ; [#uses=1] + store i216 %tmp, i216* @i216_s + ret void +} + +define void @i217_ls() nounwind { + %tmp = load i217* @i217_l ; [#uses=1] + store i217 %tmp, i217* @i217_s + ret void +} + +define void @i218_ls() nounwind { + %tmp = load i218* @i218_l ; [#uses=1] + store i218 %tmp, i218* @i218_s + ret void +} + +define void @i219_ls() nounwind { + %tmp = load i219* @i219_l ; [#uses=1] + store i219 %tmp, i219* @i219_s + ret void +} + +define void @i220_ls() nounwind { + %tmp = load i220* @i220_l ; [#uses=1] + store i220 %tmp, i220* @i220_s + ret void +} + +define void @i221_ls() nounwind { + %tmp = load i221* @i221_l ; [#uses=1] + store i221 %tmp, i221* @i221_s + ret void +} + +define void @i222_ls() nounwind { + %tmp = load i222* @i222_l ; [#uses=1] + store i222 %tmp, i222* @i222_s + ret void +} + +define void @i223_ls() nounwind { + %tmp = load i223* @i223_l ; [#uses=1] + store i223 %tmp, i223* @i223_s + ret void +} + +define void @i224_ls() nounwind { + %tmp = load i224* @i224_l ; [#uses=1] + store i224 %tmp, i224* @i224_s + ret void +} + +define void @i225_ls() nounwind { + %tmp = load i225* @i225_l ; [#uses=1] + store i225 %tmp, i225* @i225_s + ret void +} + +define void @i226_ls() nounwind { + %tmp = load i226* @i226_l ; [#uses=1] + store i226 %tmp, i226* @i226_s + ret void +} + +define void @i227_ls() nounwind { + %tmp = load i227* @i227_l ; [#uses=1] + store i227 %tmp, i227* @i227_s + ret void +} + +define void @i228_ls() nounwind { + %tmp = load i228* @i228_l ; [#uses=1] + store i228 %tmp, i228* @i228_s + ret void +} + +define void @i229_ls() nounwind { + %tmp = load i229* @i229_l ; [#uses=1] + store i229 %tmp, i229* @i229_s + ret void +} + +define void @i230_ls() nounwind { + %tmp = load i230* @i230_l ; [#uses=1] + store i230 %tmp, i230* @i230_s + ret void +} + +define void @i231_ls() nounwind { + %tmp = load i231* @i231_l ; [#uses=1] + store i231 %tmp, i231* @i231_s + ret void +} + +define void @i232_ls() nounwind { + %tmp = load i232* @i232_l ; [#uses=1] + store i232 %tmp, i232* @i232_s + ret void +} + +define void @i233_ls() nounwind { + %tmp = load i233* @i233_l ; [#uses=1] + store i233 %tmp, i233* @i233_s + ret void +} + +define void @i234_ls() nounwind { + %tmp = load i234* @i234_l ; [#uses=1] + store i234 %tmp, i234* @i234_s + ret void +} + +define void @i235_ls() nounwind { + %tmp = load i235* @i235_l ; [#uses=1] + store i235 %tmp, i235* @i235_s + ret void +} + +define void @i236_ls() nounwind { + %tmp = load i236* @i236_l ; [#uses=1] + store i236 %tmp, i236* @i236_s + ret void +} + +define void @i237_ls() nounwind { + %tmp = load i237* @i237_l ; [#uses=1] + store i237 %tmp, i237* @i237_s + ret void +} + +define void @i238_ls() nounwind { + %tmp = load i238* @i238_l ; [#uses=1] + store i238 %tmp, i238* @i238_s + ret void +} + +define void @i239_ls() nounwind { + %tmp = load i239* @i239_l ; [#uses=1] + store i239 %tmp, i239* @i239_s + ret void +} + +define void @i240_ls() nounwind { + %tmp = load i240* @i240_l ; [#uses=1] + store i240 %tmp, i240* @i240_s + ret void +} + +define void @i241_ls() nounwind { + %tmp = load i241* @i241_l ; [#uses=1] + store i241 %tmp, i241* @i241_s + ret void +} + +define void @i242_ls() nounwind { + %tmp = load i242* @i242_l ; [#uses=1] + store i242 %tmp, i242* @i242_s + ret void +} + +define void @i243_ls() nounwind { + %tmp = load i243* @i243_l ; [#uses=1] + store i243 %tmp, i243* @i243_s + ret void +} + +define void @i244_ls() nounwind { + %tmp = load i244* @i244_l ; [#uses=1] + store i244 %tmp, i244* @i244_s + ret void +} + +define void @i245_ls() nounwind { + %tmp = load i245* @i245_l ; [#uses=1] + store i245 %tmp, i245* @i245_s + ret void +} + +define void @i246_ls() nounwind { + %tmp = load i246* @i246_l ; [#uses=1] + store i246 %tmp, i246* @i246_s + ret void +} + +define void @i247_ls() nounwind { + %tmp = load i247* @i247_l ; [#uses=1] + store i247 %tmp, i247* @i247_s + ret void +} + +define void @i248_ls() nounwind { + %tmp = load i248* @i248_l ; [#uses=1] + store i248 %tmp, i248* @i248_s + ret void +} + +define void @i249_ls() nounwind { + %tmp = load i249* @i249_l ; [#uses=1] + store i249 %tmp, i249* @i249_s + ret void +} + +define void @i250_ls() nounwind { + %tmp = load i250* @i250_l ; [#uses=1] + store i250 %tmp, i250* @i250_s + ret void +} + +define void @i251_ls() nounwind { + %tmp = load i251* @i251_l ; [#uses=1] + store i251 %tmp, i251* @i251_s + ret void +} + +define void @i252_ls() nounwind { + %tmp = load i252* @i252_l ; [#uses=1] + store i252 %tmp, i252* @i252_s + ret void +} + +define void @i253_ls() nounwind { + %tmp = load i253* @i253_l ; [#uses=1] + store i253 %tmp, i253* @i253_s + ret void +} + +define void @i254_ls() nounwind { + %tmp = load i254* @i254_l ; [#uses=1] + store i254 %tmp, i254* @i254_s + ret void +} + +define void @i255_ls() nounwind { + %tmp = load i255* @i255_l ; [#uses=1] + store i255 %tmp, i255* @i255_s + ret void +} + +define void @i256_ls() nounwind { + %tmp = load i256* @i256_l ; [#uses=1] + store i256 %tmp, i256* @i256_s + ret void +} From matthijs at stdin.nl Wed Jul 16 08:10:26 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Wed, 16 Jul 2008 15:10:26 +0200 Subject: [llvm-commits] [llvm] r52217 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/extractvalue.ll In-Reply-To: <20080624083305.GX3816@katherina.student.utwente.nl> References: <200806111405.m5BE55rj002564@zion.cs.uiuc.edu> <20080624083305.GX3816@katherina.student.utwente.nl> Message-ID: <20080716131026.GJ26592@katherina.student.utwente.nl> Hi Chris, > > visitExtractValueInst(I) { > > op = I.getOperand(0); > > if (isa(op)) > > use new zero; > > else if (insertvalueinst) { > > if (index is the thing inserted) > > use inserted value > > else > > use new extract value inst of aggregate input > > ... I've implemented this suggestion, and it actually works pretty nicely. The code is certainly a lot simpler. It's not really much less code, though a large part of the new code is comments :-) > A = insertvalue undef, X, 0, 0 ; { {X, _}, _} > B = insertvalue A, Y, 0, 1 ; { {X, Y}, _} > C = extractvalue B, 0 ; {X, Y} > > This can be simplified to > A = insertvalue undef, X, 0 ; {X, _} > C = insertvalue A, Y, 1 ; {X, Y} > > This is currently being done by iterating all the elements in C and looking up > known values for each of them (or, for nested structs, also for sub structs if > not all individual elements are known). > > This could probably be handled by iterating of the elements of C (only the > first level), inserting extractvalue B, 0, i (ie, the partially > matching indices plus the element index) and insertvalues for each of them (in > effect rebuilding the request struct. For the above example, this would give: > > A = insertvalue undef, X, 0, 0 ; { {X, _}, _} > B = insertvalue A, Y, 0, 1 ; { {X, Y}, _} > Xp = extractvalue B, 0, 0 > D = insertvalue undef, Xp, 0 > Yp = extractvalue B, 0, 1 > C = insertvalue D, Yp, 1 > > The inserted extractvalues can be folded in the next iteration, resulting in > the wanted: > > D = insertvalue undef, X, 0 ; {X, _} > C = insertvalue D, Y, 1 ; {X, Y} The above is still a little complicated, and it turns out this can be easily be done iteratively by swapping the order of insert and extract. i.e., turn A = insertvalue undef, X, 0, 0 ; { {X, _}, _} B = insertvalue A, Y, 0, 1 ; { {X, Y}, _} C = extractvalue B, 0 ; {X, Y} into A = insertvalue undef, X, 0, 0 ; { {X, _}, _} Z = extractvalue A, 0 ; {X, _} C = insertvalue Z, Y, 1 ; {X, Y} and iteratively into Z = extractvalue undef, 0 ; {_, _} A = insertvalue Z, X, 0 ; {X, _} C = insertvalue A, Y, 1 ; {X, Y} and finally into A = insertvalue undef, X, 0 ; {X, _} C = insertvalue A, Y, 1 ; {X, Y} Thanks for the suggestion, it even catches some extra cases now :-) Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080716/8afb89f2/attachment.bin From baldrick at free.fr Wed Jul 16 08:37:46 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 13:37:46 -0000 Subject: [llvm-commits] [llvm] r53677 - /llvm/trunk/test/CodeGen/Generic/APIntParam.ll Message-ID: <200807161337.m6GDbmdn032612@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jul 16 08:37:36 2008 New Revision: 53677 URL: http://llvm.org/viewvc/llvm-project?rev=53677&view=rev Log: Test passing of integer parameters for integers of all sizes from i1 to i256. The code is not always that great, for example (x86) movw %di, %ax movw %ax, i17_s where the store could be directly from %di. Added: llvm/trunk/test/CodeGen/Generic/APIntParam.ll Added: llvm/trunk/test/CodeGen/Generic/APIntParam.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/APIntParam.ll?rev=53677&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/APIntParam.ll (added) +++ llvm/trunk/test/CodeGen/Generic/APIntParam.ll Wed Jul 16 08:37:36 2008 @@ -0,0 +1,1537 @@ +; RUN: llvm-as < %s | llc + at i1_s = external global i1 ; [#uses=1] + at i2_s = external global i2 ; [#uses=1] + at i3_s = external global i3 ; [#uses=1] + at i4_s = external global i4 ; [#uses=1] + at i5_s = external global i5 ; [#uses=1] + at i6_s = external global i6 ; [#uses=1] + at i7_s = external global i7 ; [#uses=1] + at i8_s = external global i8 ; [#uses=1] + at i9_s = external global i9 ; [#uses=1] + at i10_s = external global i10 ; [#uses=1] + at i11_s = external global i11 ; [#uses=1] + at i12_s = external global i12 ; [#uses=1] + at i13_s = external global i13 ; [#uses=1] + at i14_s = external global i14 ; [#uses=1] + at i15_s = external global i15 ; [#uses=1] + at i16_s = external global i16 ; [#uses=1] + at i17_s = external global i17 ; [#uses=1] + at i18_s = external global i18 ; [#uses=1] + at i19_s = external global i19 ; [#uses=1] + at i20_s = external global i20 ; [#uses=1] + at i21_s = external global i21 ; [#uses=1] + at i22_s = external global i22 ; [#uses=1] + at i23_s = external global i23 ; [#uses=1] + at i24_s = external global i24 ; [#uses=1] + at i25_s = external global i25 ; [#uses=1] + at i26_s = external global i26 ; [#uses=1] + at i27_s = external global i27 ; [#uses=1] + at i28_s = external global i28 ; [#uses=1] + at i29_s = external global i29 ; [#uses=1] + at i30_s = external global i30 ; [#uses=1] + at i31_s = external global i31 ; [#uses=1] + at i32_s = external global i32 ; [#uses=1] + at i33_s = external global i33 ; [#uses=1] + at i34_s = external global i34 ; [#uses=1] + at i35_s = external global i35 ; [#uses=1] + at i36_s = external global i36 ; [#uses=1] + at i37_s = external global i37 ; [#uses=1] + at i38_s = external global i38 ; [#uses=1] + at i39_s = external global i39 ; [#uses=1] + at i40_s = external global i40 ; [#uses=1] + at i41_s = external global i41 ; [#uses=1] + at i42_s = external global i42 ; [#uses=1] + at i43_s = external global i43 ; [#uses=1] + at i44_s = external global i44 ; [#uses=1] + at i45_s = external global i45 ; [#uses=1] + at i46_s = external global i46 ; [#uses=1] + at i47_s = external global i47 ; [#uses=1] + at i48_s = external global i48 ; [#uses=1] + at i49_s = external global i49 ; [#uses=1] + at i50_s = external global i50 ; [#uses=1] + at i51_s = external global i51 ; [#uses=1] + at i52_s = external global i52 ; [#uses=1] + at i53_s = external global i53 ; [#uses=1] + at i54_s = external global i54 ; [#uses=1] + at i55_s = external global i55 ; [#uses=1] + at i56_s = external global i56 ; [#uses=1] + at i57_s = external global i57 ; [#uses=1] + at i58_s = external global i58 ; [#uses=1] + at i59_s = external global i59 ; [#uses=1] + at i60_s = external global i60 ; [#uses=1] + at i61_s = external global i61 ; [#uses=1] + at i62_s = external global i62 ; [#uses=1] + at i63_s = external global i63 ; [#uses=1] + at i64_s = external global i64 ; [#uses=1] + at i65_s = external global i65 ; [#uses=1] + at i66_s = external global i66 ; [#uses=1] + at i67_s = external global i67 ; [#uses=1] + at i68_s = external global i68 ; [#uses=1] + at i69_s = external global i69 ; [#uses=1] + at i70_s = external global i70 ; [#uses=1] + at i71_s = external global i71 ; [#uses=1] + at i72_s = external global i72 ; [#uses=1] + at i73_s = external global i73 ; [#uses=1] + at i74_s = external global i74 ; [#uses=1] + at i75_s = external global i75 ; [#uses=1] + at i76_s = external global i76 ; [#uses=1] + at i77_s = external global i77 ; [#uses=1] + at i78_s = external global i78 ; [#uses=1] + at i79_s = external global i79 ; [#uses=1] + at i80_s = external global i80 ; [#uses=1] + at i81_s = external global i81 ; [#uses=1] + at i82_s = external global i82 ; [#uses=1] + at i83_s = external global i83 ; [#uses=1] + at i84_s = external global i84 ; [#uses=1] + at i85_s = external global i85 ; [#uses=1] + at i86_s = external global i86 ; [#uses=1] + at i87_s = external global i87 ; [#uses=1] + at i88_s = external global i88 ; [#uses=1] + at i89_s = external global i89 ; [#uses=1] + at i90_s = external global i90 ; [#uses=1] + at i91_s = external global i91 ; [#uses=1] + at i92_s = external global i92 ; [#uses=1] + at i93_s = external global i93 ; [#uses=1] + at i94_s = external global i94 ; [#uses=1] + at i95_s = external global i95 ; [#uses=1] + at i96_s = external global i96 ; [#uses=1] + at i97_s = external global i97 ; [#uses=1] + at i98_s = external global i98 ; [#uses=1] + at i99_s = external global i99 ; [#uses=1] + at i100_s = external global i100 ; [#uses=1] + at i101_s = external global i101 ; [#uses=1] + at i102_s = external global i102 ; [#uses=1] + at i103_s = external global i103 ; [#uses=1] + at i104_s = external global i104 ; [#uses=1] + at i105_s = external global i105 ; [#uses=1] + at i106_s = external global i106 ; [#uses=1] + at i107_s = external global i107 ; [#uses=1] + at i108_s = external global i108 ; [#uses=1] + at i109_s = external global i109 ; [#uses=1] + at i110_s = external global i110 ; [#uses=1] + at i111_s = external global i111 ; [#uses=1] + at i112_s = external global i112 ; [#uses=1] + at i113_s = external global i113 ; [#uses=1] + at i114_s = external global i114 ; [#uses=1] + at i115_s = external global i115 ; [#uses=1] + at i116_s = external global i116 ; [#uses=1] + at i117_s = external global i117 ; [#uses=1] + at i118_s = external global i118 ; [#uses=1] + at i119_s = external global i119 ; [#uses=1] + at i120_s = external global i120 ; [#uses=1] + at i121_s = external global i121 ; [#uses=1] + at i122_s = external global i122 ; [#uses=1] + at i123_s = external global i123 ; [#uses=1] + at i124_s = external global i124 ; [#uses=1] + at i125_s = external global i125 ; [#uses=1] + at i126_s = external global i126 ; [#uses=1] + at i127_s = external global i127 ; [#uses=1] + at i128_s = external global i128 ; [#uses=1] + at i129_s = external global i129 ; [#uses=1] + at i130_s = external global i130 ; [#uses=1] + at i131_s = external global i131 ; [#uses=1] + at i132_s = external global i132 ; [#uses=1] + at i133_s = external global i133 ; [#uses=1] + at i134_s = external global i134 ; [#uses=1] + at i135_s = external global i135 ; [#uses=1] + at i136_s = external global i136 ; [#uses=1] + at i137_s = external global i137 ; [#uses=1] + at i138_s = external global i138 ; [#uses=1] + at i139_s = external global i139 ; [#uses=1] + at i140_s = external global i140 ; [#uses=1] + at i141_s = external global i141 ; [#uses=1] + at i142_s = external global i142 ; [#uses=1] + at i143_s = external global i143 ; [#uses=1] + at i144_s = external global i144 ; [#uses=1] + at i145_s = external global i145 ; [#uses=1] + at i146_s = external global i146 ; [#uses=1] + at i147_s = external global i147 ; [#uses=1] + at i148_s = external global i148 ; [#uses=1] + at i149_s = external global i149 ; [#uses=1] + at i150_s = external global i150 ; [#uses=1] + at i151_s = external global i151 ; [#uses=1] + at i152_s = external global i152 ; [#uses=1] + at i153_s = external global i153 ; [#uses=1] + at i154_s = external global i154 ; [#uses=1] + at i155_s = external global i155 ; [#uses=1] + at i156_s = external global i156 ; [#uses=1] + at i157_s = external global i157 ; [#uses=1] + at i158_s = external global i158 ; [#uses=1] + at i159_s = external global i159 ; [#uses=1] + at i160_s = external global i160 ; [#uses=1] + at i161_s = external global i161 ; [#uses=1] + at i162_s = external global i162 ; [#uses=1] + at i163_s = external global i163 ; [#uses=1] + at i164_s = external global i164 ; [#uses=1] + at i165_s = external global i165 ; [#uses=1] + at i166_s = external global i166 ; [#uses=1] + at i167_s = external global i167 ; [#uses=1] + at i168_s = external global i168 ; [#uses=1] + at i169_s = external global i169 ; [#uses=1] + at i170_s = external global i170 ; [#uses=1] + at i171_s = external global i171 ; [#uses=1] + at i172_s = external global i172 ; [#uses=1] + at i173_s = external global i173 ; [#uses=1] + at i174_s = external global i174 ; [#uses=1] + at i175_s = external global i175 ; [#uses=1] + at i176_s = external global i176 ; [#uses=1] + at i177_s = external global i177 ; [#uses=1] + at i178_s = external global i178 ; [#uses=1] + at i179_s = external global i179 ; [#uses=1] + at i180_s = external global i180 ; [#uses=1] + at i181_s = external global i181 ; [#uses=1] + at i182_s = external global i182 ; [#uses=1] + at i183_s = external global i183 ; [#uses=1] + at i184_s = external global i184 ; [#uses=1] + at i185_s = external global i185 ; [#uses=1] + at i186_s = external global i186 ; [#uses=1] + at i187_s = external global i187 ; [#uses=1] + at i188_s = external global i188 ; [#uses=1] + at i189_s = external global i189 ; [#uses=1] + at i190_s = external global i190 ; [#uses=1] + at i191_s = external global i191 ; [#uses=1] + at i192_s = external global i192 ; [#uses=1] + at i193_s = external global i193 ; [#uses=1] + at i194_s = external global i194 ; [#uses=1] + at i195_s = external global i195 ; [#uses=1] + at i196_s = external global i196 ; [#uses=1] + at i197_s = external global i197 ; [#uses=1] + at i198_s = external global i198 ; [#uses=1] + at i199_s = external global i199 ; [#uses=1] + at i200_s = external global i200 ; [#uses=1] + at i201_s = external global i201 ; [#uses=1] + at i202_s = external global i202 ; [#uses=1] + at i203_s = external global i203 ; [#uses=1] + at i204_s = external global i204 ; [#uses=1] + at i205_s = external global i205 ; [#uses=1] + at i206_s = external global i206 ; [#uses=1] + at i207_s = external global i207 ; [#uses=1] + at i208_s = external global i208 ; [#uses=1] + at i209_s = external global i209 ; [#uses=1] + at i210_s = external global i210 ; [#uses=1] + at i211_s = external global i211 ; [#uses=1] + at i212_s = external global i212 ; [#uses=1] + at i213_s = external global i213 ; [#uses=1] + at i214_s = external global i214 ; [#uses=1] + at i215_s = external global i215 ; [#uses=1] + at i216_s = external global i216 ; [#uses=1] + at i217_s = external global i217 ; [#uses=1] + at i218_s = external global i218 ; [#uses=1] + at i219_s = external global i219 ; [#uses=1] + at i220_s = external global i220 ; [#uses=1] + at i221_s = external global i221 ; [#uses=1] + at i222_s = external global i222 ; [#uses=1] + at i223_s = external global i223 ; [#uses=1] + at i224_s = external global i224 ; [#uses=1] + at i225_s = external global i225 ; [#uses=1] + at i226_s = external global i226 ; [#uses=1] + at i227_s = external global i227 ; [#uses=1] + at i228_s = external global i228 ; [#uses=1] + at i229_s = external global i229 ; [#uses=1] + at i230_s = external global i230 ; [#uses=1] + at i231_s = external global i231 ; [#uses=1] + at i232_s = external global i232 ; [#uses=1] + at i233_s = external global i233 ; [#uses=1] + at i234_s = external global i234 ; [#uses=1] + at i235_s = external global i235 ; [#uses=1] + at i236_s = external global i236 ; [#uses=1] + at i237_s = external global i237 ; [#uses=1] + at i238_s = external global i238 ; [#uses=1] + at i239_s = external global i239 ; [#uses=1] + at i240_s = external global i240 ; [#uses=1] + at i241_s = external global i241 ; [#uses=1] + at i242_s = external global i242 ; [#uses=1] + at i243_s = external global i243 ; [#uses=1] + at i244_s = external global i244 ; [#uses=1] + at i245_s = external global i245 ; [#uses=1] + at i246_s = external global i246 ; [#uses=1] + at i247_s = external global i247 ; [#uses=1] + at i248_s = external global i248 ; [#uses=1] + at i249_s = external global i249 ; [#uses=1] + at i250_s = external global i250 ; [#uses=1] + at i251_s = external global i251 ; [#uses=1] + at i252_s = external global i252 ; [#uses=1] + at i253_s = external global i253 ; [#uses=1] + at i254_s = external global i254 ; [#uses=1] + at i255_s = external global i255 ; [#uses=1] + at i256_s = external global i256 ; [#uses=1] + +define void @i1_ls(i1 %x) nounwind { + store i1 %x, i1* @i1_s + ret void +} + +define void @i2_ls(i2 %x) nounwind { + store i2 %x, i2* @i2_s + ret void +} + +define void @i3_ls(i3 %x) nounwind { + store i3 %x, i3* @i3_s + ret void +} + +define void @i4_ls(i4 %x) nounwind { + store i4 %x, i4* @i4_s + ret void +} + +define void @i5_ls(i5 %x) nounwind { + store i5 %x, i5* @i5_s + ret void +} + +define void @i6_ls(i6 %x) nounwind { + store i6 %x, i6* @i6_s + ret void +} + +define void @i7_ls(i7 %x) nounwind { + store i7 %x, i7* @i7_s + ret void +} + +define void @i8_ls(i8 %x) nounwind { + store i8 %x, i8* @i8_s + ret void +} + +define void @i9_ls(i9 %x) nounwind { + store i9 %x, i9* @i9_s + ret void +} + +define void @i10_ls(i10 %x) nounwind { + store i10 %x, i10* @i10_s + ret void +} + +define void @i11_ls(i11 %x) nounwind { + store i11 %x, i11* @i11_s + ret void +} + +define void @i12_ls(i12 %x) nounwind { + store i12 %x, i12* @i12_s + ret void +} + +define void @i13_ls(i13 %x) nounwind { + store i13 %x, i13* @i13_s + ret void +} + +define void @i14_ls(i14 %x) nounwind { + store i14 %x, i14* @i14_s + ret void +} + +define void @i15_ls(i15 %x) nounwind { + store i15 %x, i15* @i15_s + ret void +} + +define void @i16_ls(i16 %x) nounwind { + store i16 %x, i16* @i16_s + ret void +} + +define void @i17_ls(i17 %x) nounwind { + store i17 %x, i17* @i17_s + ret void +} + +define void @i18_ls(i18 %x) nounwind { + store i18 %x, i18* @i18_s + ret void +} + +define void @i19_ls(i19 %x) nounwind { + store i19 %x, i19* @i19_s + ret void +} + +define void @i20_ls(i20 %x) nounwind { + store i20 %x, i20* @i20_s + ret void +} + +define void @i21_ls(i21 %x) nounwind { + store i21 %x, i21* @i21_s + ret void +} + +define void @i22_ls(i22 %x) nounwind { + store i22 %x, i22* @i22_s + ret void +} + +define void @i23_ls(i23 %x) nounwind { + store i23 %x, i23* @i23_s + ret void +} + +define void @i24_ls(i24 %x) nounwind { + store i24 %x, i24* @i24_s + ret void +} + +define void @i25_ls(i25 %x) nounwind { + store i25 %x, i25* @i25_s + ret void +} + +define void @i26_ls(i26 %x) nounwind { + store i26 %x, i26* @i26_s + ret void +} + +define void @i27_ls(i27 %x) nounwind { + store i27 %x, i27* @i27_s + ret void +} + +define void @i28_ls(i28 %x) nounwind { + store i28 %x, i28* @i28_s + ret void +} + +define void @i29_ls(i29 %x) nounwind { + store i29 %x, i29* @i29_s + ret void +} + +define void @i30_ls(i30 %x) nounwind { + store i30 %x, i30* @i30_s + ret void +} + +define void @i31_ls(i31 %x) nounwind { + store i31 %x, i31* @i31_s + ret void +} + +define void @i32_ls(i32 %x) nounwind { + store i32 %x, i32* @i32_s + ret void +} + +define void @i33_ls(i33 %x) nounwind { + store i33 %x, i33* @i33_s + ret void +} + +define void @i34_ls(i34 %x) nounwind { + store i34 %x, i34* @i34_s + ret void +} + +define void @i35_ls(i35 %x) nounwind { + store i35 %x, i35* @i35_s + ret void +} + +define void @i36_ls(i36 %x) nounwind { + store i36 %x, i36* @i36_s + ret void +} + +define void @i37_ls(i37 %x) nounwind { + store i37 %x, i37* @i37_s + ret void +} + +define void @i38_ls(i38 %x) nounwind { + store i38 %x, i38* @i38_s + ret void +} + +define void @i39_ls(i39 %x) nounwind { + store i39 %x, i39* @i39_s + ret void +} + +define void @i40_ls(i40 %x) nounwind { + store i40 %x, i40* @i40_s + ret void +} + +define void @i41_ls(i41 %x) nounwind { + store i41 %x, i41* @i41_s + ret void +} + +define void @i42_ls(i42 %x) nounwind { + store i42 %x, i42* @i42_s + ret void +} + +define void @i43_ls(i43 %x) nounwind { + store i43 %x, i43* @i43_s + ret void +} + +define void @i44_ls(i44 %x) nounwind { + store i44 %x, i44* @i44_s + ret void +} + +define void @i45_ls(i45 %x) nounwind { + store i45 %x, i45* @i45_s + ret void +} + +define void @i46_ls(i46 %x) nounwind { + store i46 %x, i46* @i46_s + ret void +} + +define void @i47_ls(i47 %x) nounwind { + store i47 %x, i47* @i47_s + ret void +} + +define void @i48_ls(i48 %x) nounwind { + store i48 %x, i48* @i48_s + ret void +} + +define void @i49_ls(i49 %x) nounwind { + store i49 %x, i49* @i49_s + ret void +} + +define void @i50_ls(i50 %x) nounwind { + store i50 %x, i50* @i50_s + ret void +} + +define void @i51_ls(i51 %x) nounwind { + store i51 %x, i51* @i51_s + ret void +} + +define void @i52_ls(i52 %x) nounwind { + store i52 %x, i52* @i52_s + ret void +} + +define void @i53_ls(i53 %x) nounwind { + store i53 %x, i53* @i53_s + ret void +} + +define void @i54_ls(i54 %x) nounwind { + store i54 %x, i54* @i54_s + ret void +} + +define void @i55_ls(i55 %x) nounwind { + store i55 %x, i55* @i55_s + ret void +} + +define void @i56_ls(i56 %x) nounwind { + store i56 %x, i56* @i56_s + ret void +} + +define void @i57_ls(i57 %x) nounwind { + store i57 %x, i57* @i57_s + ret void +} + +define void @i58_ls(i58 %x) nounwind { + store i58 %x, i58* @i58_s + ret void +} + +define void @i59_ls(i59 %x) nounwind { + store i59 %x, i59* @i59_s + ret void +} + +define void @i60_ls(i60 %x) nounwind { + store i60 %x, i60* @i60_s + ret void +} + +define void @i61_ls(i61 %x) nounwind { + store i61 %x, i61* @i61_s + ret void +} + +define void @i62_ls(i62 %x) nounwind { + store i62 %x, i62* @i62_s + ret void +} + +define void @i63_ls(i63 %x) nounwind { + store i63 %x, i63* @i63_s + ret void +} + +define void @i64_ls(i64 %x) nounwind { + store i64 %x, i64* @i64_s + ret void +} + +define void @i65_ls(i65 %x) nounwind { + store i65 %x, i65* @i65_s + ret void +} + +define void @i66_ls(i66 %x) nounwind { + store i66 %x, i66* @i66_s + ret void +} + +define void @i67_ls(i67 %x) nounwind { + store i67 %x, i67* @i67_s + ret void +} + +define void @i68_ls(i68 %x) nounwind { + store i68 %x, i68* @i68_s + ret void +} + +define void @i69_ls(i69 %x) nounwind { + store i69 %x, i69* @i69_s + ret void +} + +define void @i70_ls(i70 %x) nounwind { + store i70 %x, i70* @i70_s + ret void +} + +define void @i71_ls(i71 %x) nounwind { + store i71 %x, i71* @i71_s + ret void +} + +define void @i72_ls(i72 %x) nounwind { + store i72 %x, i72* @i72_s + ret void +} + +define void @i73_ls(i73 %x) nounwind { + store i73 %x, i73* @i73_s + ret void +} + +define void @i74_ls(i74 %x) nounwind { + store i74 %x, i74* @i74_s + ret void +} + +define void @i75_ls(i75 %x) nounwind { + store i75 %x, i75* @i75_s + ret void +} + +define void @i76_ls(i76 %x) nounwind { + store i76 %x, i76* @i76_s + ret void +} + +define void @i77_ls(i77 %x) nounwind { + store i77 %x, i77* @i77_s + ret void +} + +define void @i78_ls(i78 %x) nounwind { + store i78 %x, i78* @i78_s + ret void +} + +define void @i79_ls(i79 %x) nounwind { + store i79 %x, i79* @i79_s + ret void +} + +define void @i80_ls(i80 %x) nounwind { + store i80 %x, i80* @i80_s + ret void +} + +define void @i81_ls(i81 %x) nounwind { + store i81 %x, i81* @i81_s + ret void +} + +define void @i82_ls(i82 %x) nounwind { + store i82 %x, i82* @i82_s + ret void +} + +define void @i83_ls(i83 %x) nounwind { + store i83 %x, i83* @i83_s + ret void +} + +define void @i84_ls(i84 %x) nounwind { + store i84 %x, i84* @i84_s + ret void +} + +define void @i85_ls(i85 %x) nounwind { + store i85 %x, i85* @i85_s + ret void +} + +define void @i86_ls(i86 %x) nounwind { + store i86 %x, i86* @i86_s + ret void +} + +define void @i87_ls(i87 %x) nounwind { + store i87 %x, i87* @i87_s + ret void +} + +define void @i88_ls(i88 %x) nounwind { + store i88 %x, i88* @i88_s + ret void +} + +define void @i89_ls(i89 %x) nounwind { + store i89 %x, i89* @i89_s + ret void +} + +define void @i90_ls(i90 %x) nounwind { + store i90 %x, i90* @i90_s + ret void +} + +define void @i91_ls(i91 %x) nounwind { + store i91 %x, i91* @i91_s + ret void +} + +define void @i92_ls(i92 %x) nounwind { + store i92 %x, i92* @i92_s + ret void +} + +define void @i93_ls(i93 %x) nounwind { + store i93 %x, i93* @i93_s + ret void +} + +define void @i94_ls(i94 %x) nounwind { + store i94 %x, i94* @i94_s + ret void +} + +define void @i95_ls(i95 %x) nounwind { + store i95 %x, i95* @i95_s + ret void +} + +define void @i96_ls(i96 %x) nounwind { + store i96 %x, i96* @i96_s + ret void +} + +define void @i97_ls(i97 %x) nounwind { + store i97 %x, i97* @i97_s + ret void +} + +define void @i98_ls(i98 %x) nounwind { + store i98 %x, i98* @i98_s + ret void +} + +define void @i99_ls(i99 %x) nounwind { + store i99 %x, i99* @i99_s + ret void +} + +define void @i100_ls(i100 %x) nounwind { + store i100 %x, i100* @i100_s + ret void +} + +define void @i101_ls(i101 %x) nounwind { + store i101 %x, i101* @i101_s + ret void +} + +define void @i102_ls(i102 %x) nounwind { + store i102 %x, i102* @i102_s + ret void +} + +define void @i103_ls(i103 %x) nounwind { + store i103 %x, i103* @i103_s + ret void +} + +define void @i104_ls(i104 %x) nounwind { + store i104 %x, i104* @i104_s + ret void +} + +define void @i105_ls(i105 %x) nounwind { + store i105 %x, i105* @i105_s + ret void +} + +define void @i106_ls(i106 %x) nounwind { + store i106 %x, i106* @i106_s + ret void +} + +define void @i107_ls(i107 %x) nounwind { + store i107 %x, i107* @i107_s + ret void +} + +define void @i108_ls(i108 %x) nounwind { + store i108 %x, i108* @i108_s + ret void +} + +define void @i109_ls(i109 %x) nounwind { + store i109 %x, i109* @i109_s + ret void +} + +define void @i110_ls(i110 %x) nounwind { + store i110 %x, i110* @i110_s + ret void +} + +define void @i111_ls(i111 %x) nounwind { + store i111 %x, i111* @i111_s + ret void +} + +define void @i112_ls(i112 %x) nounwind { + store i112 %x, i112* @i112_s + ret void +} + +define void @i113_ls(i113 %x) nounwind { + store i113 %x, i113* @i113_s + ret void +} + +define void @i114_ls(i114 %x) nounwind { + store i114 %x, i114* @i114_s + ret void +} + +define void @i115_ls(i115 %x) nounwind { + store i115 %x, i115* @i115_s + ret void +} + +define void @i116_ls(i116 %x) nounwind { + store i116 %x, i116* @i116_s + ret void +} + +define void @i117_ls(i117 %x) nounwind { + store i117 %x, i117* @i117_s + ret void +} + +define void @i118_ls(i118 %x) nounwind { + store i118 %x, i118* @i118_s + ret void +} + +define void @i119_ls(i119 %x) nounwind { + store i119 %x, i119* @i119_s + ret void +} + +define void @i120_ls(i120 %x) nounwind { + store i120 %x, i120* @i120_s + ret void +} + +define void @i121_ls(i121 %x) nounwind { + store i121 %x, i121* @i121_s + ret void +} + +define void @i122_ls(i122 %x) nounwind { + store i122 %x, i122* @i122_s + ret void +} + +define void @i123_ls(i123 %x) nounwind { + store i123 %x, i123* @i123_s + ret void +} + +define void @i124_ls(i124 %x) nounwind { + store i124 %x, i124* @i124_s + ret void +} + +define void @i125_ls(i125 %x) nounwind { + store i125 %x, i125* @i125_s + ret void +} + +define void @i126_ls(i126 %x) nounwind { + store i126 %x, i126* @i126_s + ret void +} + +define void @i127_ls(i127 %x) nounwind { + store i127 %x, i127* @i127_s + ret void +} + +define void @i128_ls(i128 %x) nounwind { + store i128 %x, i128* @i128_s + ret void +} + +define void @i129_ls(i129 %x) nounwind { + store i129 %x, i129* @i129_s + ret void +} + +define void @i130_ls(i130 %x) nounwind { + store i130 %x, i130* @i130_s + ret void +} + +define void @i131_ls(i131 %x) nounwind { + store i131 %x, i131* @i131_s + ret void +} + +define void @i132_ls(i132 %x) nounwind { + store i132 %x, i132* @i132_s + ret void +} + +define void @i133_ls(i133 %x) nounwind { + store i133 %x, i133* @i133_s + ret void +} + +define void @i134_ls(i134 %x) nounwind { + store i134 %x, i134* @i134_s + ret void +} + +define void @i135_ls(i135 %x) nounwind { + store i135 %x, i135* @i135_s + ret void +} + +define void @i136_ls(i136 %x) nounwind { + store i136 %x, i136* @i136_s + ret void +} + +define void @i137_ls(i137 %x) nounwind { + store i137 %x, i137* @i137_s + ret void +} + +define void @i138_ls(i138 %x) nounwind { + store i138 %x, i138* @i138_s + ret void +} + +define void @i139_ls(i139 %x) nounwind { + store i139 %x, i139* @i139_s + ret void +} + +define void @i140_ls(i140 %x) nounwind { + store i140 %x, i140* @i140_s + ret void +} + +define void @i141_ls(i141 %x) nounwind { + store i141 %x, i141* @i141_s + ret void +} + +define void @i142_ls(i142 %x) nounwind { + store i142 %x, i142* @i142_s + ret void +} + +define void @i143_ls(i143 %x) nounwind { + store i143 %x, i143* @i143_s + ret void +} + +define void @i144_ls(i144 %x) nounwind { + store i144 %x, i144* @i144_s + ret void +} + +define void @i145_ls(i145 %x) nounwind { + store i145 %x, i145* @i145_s + ret void +} + +define void @i146_ls(i146 %x) nounwind { + store i146 %x, i146* @i146_s + ret void +} + +define void @i147_ls(i147 %x) nounwind { + store i147 %x, i147* @i147_s + ret void +} + +define void @i148_ls(i148 %x) nounwind { + store i148 %x, i148* @i148_s + ret void +} + +define void @i149_ls(i149 %x) nounwind { + store i149 %x, i149* @i149_s + ret void +} + +define void @i150_ls(i150 %x) nounwind { + store i150 %x, i150* @i150_s + ret void +} + +define void @i151_ls(i151 %x) nounwind { + store i151 %x, i151* @i151_s + ret void +} + +define void @i152_ls(i152 %x) nounwind { + store i152 %x, i152* @i152_s + ret void +} + +define void @i153_ls(i153 %x) nounwind { + store i153 %x, i153* @i153_s + ret void +} + +define void @i154_ls(i154 %x) nounwind { + store i154 %x, i154* @i154_s + ret void +} + +define void @i155_ls(i155 %x) nounwind { + store i155 %x, i155* @i155_s + ret void +} + +define void @i156_ls(i156 %x) nounwind { + store i156 %x, i156* @i156_s + ret void +} + +define void @i157_ls(i157 %x) nounwind { + store i157 %x, i157* @i157_s + ret void +} + +define void @i158_ls(i158 %x) nounwind { + store i158 %x, i158* @i158_s + ret void +} + +define void @i159_ls(i159 %x) nounwind { + store i159 %x, i159* @i159_s + ret void +} + +define void @i160_ls(i160 %x) nounwind { + store i160 %x, i160* @i160_s + ret void +} + +define void @i161_ls(i161 %x) nounwind { + store i161 %x, i161* @i161_s + ret void +} + +define void @i162_ls(i162 %x) nounwind { + store i162 %x, i162* @i162_s + ret void +} + +define void @i163_ls(i163 %x) nounwind { + store i163 %x, i163* @i163_s + ret void +} + +define void @i164_ls(i164 %x) nounwind { + store i164 %x, i164* @i164_s + ret void +} + +define void @i165_ls(i165 %x) nounwind { + store i165 %x, i165* @i165_s + ret void +} + +define void @i166_ls(i166 %x) nounwind { + store i166 %x, i166* @i166_s + ret void +} + +define void @i167_ls(i167 %x) nounwind { + store i167 %x, i167* @i167_s + ret void +} + +define void @i168_ls(i168 %x) nounwind { + store i168 %x, i168* @i168_s + ret void +} + +define void @i169_ls(i169 %x) nounwind { + store i169 %x, i169* @i169_s + ret void +} + +define void @i170_ls(i170 %x) nounwind { + store i170 %x, i170* @i170_s + ret void +} + +define void @i171_ls(i171 %x) nounwind { + store i171 %x, i171* @i171_s + ret void +} + +define void @i172_ls(i172 %x) nounwind { + store i172 %x, i172* @i172_s + ret void +} + +define void @i173_ls(i173 %x) nounwind { + store i173 %x, i173* @i173_s + ret void +} + +define void @i174_ls(i174 %x) nounwind { + store i174 %x, i174* @i174_s + ret void +} + +define void @i175_ls(i175 %x) nounwind { + store i175 %x, i175* @i175_s + ret void +} + +define void @i176_ls(i176 %x) nounwind { + store i176 %x, i176* @i176_s + ret void +} + +define void @i177_ls(i177 %x) nounwind { + store i177 %x, i177* @i177_s + ret void +} + +define void @i178_ls(i178 %x) nounwind { + store i178 %x, i178* @i178_s + ret void +} + +define void @i179_ls(i179 %x) nounwind { + store i179 %x, i179* @i179_s + ret void +} + +define void @i180_ls(i180 %x) nounwind { + store i180 %x, i180* @i180_s + ret void +} + +define void @i181_ls(i181 %x) nounwind { + store i181 %x, i181* @i181_s + ret void +} + +define void @i182_ls(i182 %x) nounwind { + store i182 %x, i182* @i182_s + ret void +} + +define void @i183_ls(i183 %x) nounwind { + store i183 %x, i183* @i183_s + ret void +} + +define void @i184_ls(i184 %x) nounwind { + store i184 %x, i184* @i184_s + ret void +} + +define void @i185_ls(i185 %x) nounwind { + store i185 %x, i185* @i185_s + ret void +} + +define void @i186_ls(i186 %x) nounwind { + store i186 %x, i186* @i186_s + ret void +} + +define void @i187_ls(i187 %x) nounwind { + store i187 %x, i187* @i187_s + ret void +} + +define void @i188_ls(i188 %x) nounwind { + store i188 %x, i188* @i188_s + ret void +} + +define void @i189_ls(i189 %x) nounwind { + store i189 %x, i189* @i189_s + ret void +} + +define void @i190_ls(i190 %x) nounwind { + store i190 %x, i190* @i190_s + ret void +} + +define void @i191_ls(i191 %x) nounwind { + store i191 %x, i191* @i191_s + ret void +} + +define void @i192_ls(i192 %x) nounwind { + store i192 %x, i192* @i192_s + ret void +} + +define void @i193_ls(i193 %x) nounwind { + store i193 %x, i193* @i193_s + ret void +} + +define void @i194_ls(i194 %x) nounwind { + store i194 %x, i194* @i194_s + ret void +} + +define void @i195_ls(i195 %x) nounwind { + store i195 %x, i195* @i195_s + ret void +} + +define void @i196_ls(i196 %x) nounwind { + store i196 %x, i196* @i196_s + ret void +} + +define void @i197_ls(i197 %x) nounwind { + store i197 %x, i197* @i197_s + ret void +} + +define void @i198_ls(i198 %x) nounwind { + store i198 %x, i198* @i198_s + ret void +} + +define void @i199_ls(i199 %x) nounwind { + store i199 %x, i199* @i199_s + ret void +} + +define void @i200_ls(i200 %x) nounwind { + store i200 %x, i200* @i200_s + ret void +} + +define void @i201_ls(i201 %x) nounwind { + store i201 %x, i201* @i201_s + ret void +} + +define void @i202_ls(i202 %x) nounwind { + store i202 %x, i202* @i202_s + ret void +} + +define void @i203_ls(i203 %x) nounwind { + store i203 %x, i203* @i203_s + ret void +} + +define void @i204_ls(i204 %x) nounwind { + store i204 %x, i204* @i204_s + ret void +} + +define void @i205_ls(i205 %x) nounwind { + store i205 %x, i205* @i205_s + ret void +} + +define void @i206_ls(i206 %x) nounwind { + store i206 %x, i206* @i206_s + ret void +} + +define void @i207_ls(i207 %x) nounwind { + store i207 %x, i207* @i207_s + ret void +} + +define void @i208_ls(i208 %x) nounwind { + store i208 %x, i208* @i208_s + ret void +} + +define void @i209_ls(i209 %x) nounwind { + store i209 %x, i209* @i209_s + ret void +} + +define void @i210_ls(i210 %x) nounwind { + store i210 %x, i210* @i210_s + ret void +} + +define void @i211_ls(i211 %x) nounwind { + store i211 %x, i211* @i211_s + ret void +} + +define void @i212_ls(i212 %x) nounwind { + store i212 %x, i212* @i212_s + ret void +} + +define void @i213_ls(i213 %x) nounwind { + store i213 %x, i213* @i213_s + ret void +} + +define void @i214_ls(i214 %x) nounwind { + store i214 %x, i214* @i214_s + ret void +} + +define void @i215_ls(i215 %x) nounwind { + store i215 %x, i215* @i215_s + ret void +} + +define void @i216_ls(i216 %x) nounwind { + store i216 %x, i216* @i216_s + ret void +} + +define void @i217_ls(i217 %x) nounwind { + store i217 %x, i217* @i217_s + ret void +} + +define void @i218_ls(i218 %x) nounwind { + store i218 %x, i218* @i218_s + ret void +} + +define void @i219_ls(i219 %x) nounwind { + store i219 %x, i219* @i219_s + ret void +} + +define void @i220_ls(i220 %x) nounwind { + store i220 %x, i220* @i220_s + ret void +} + +define void @i221_ls(i221 %x) nounwind { + store i221 %x, i221* @i221_s + ret void +} + +define void @i222_ls(i222 %x) nounwind { + store i222 %x, i222* @i222_s + ret void +} + +define void @i223_ls(i223 %x) nounwind { + store i223 %x, i223* @i223_s + ret void +} + +define void @i224_ls(i224 %x) nounwind { + store i224 %x, i224* @i224_s + ret void +} + +define void @i225_ls(i225 %x) nounwind { + store i225 %x, i225* @i225_s + ret void +} + +define void @i226_ls(i226 %x) nounwind { + store i226 %x, i226* @i226_s + ret void +} + +define void @i227_ls(i227 %x) nounwind { + store i227 %x, i227* @i227_s + ret void +} + +define void @i228_ls(i228 %x) nounwind { + store i228 %x, i228* @i228_s + ret void +} + +define void @i229_ls(i229 %x) nounwind { + store i229 %x, i229* @i229_s + ret void +} + +define void @i230_ls(i230 %x) nounwind { + store i230 %x, i230* @i230_s + ret void +} + +define void @i231_ls(i231 %x) nounwind { + store i231 %x, i231* @i231_s + ret void +} + +define void @i232_ls(i232 %x) nounwind { + store i232 %x, i232* @i232_s + ret void +} + +define void @i233_ls(i233 %x) nounwind { + store i233 %x, i233* @i233_s + ret void +} + +define void @i234_ls(i234 %x) nounwind { + store i234 %x, i234* @i234_s + ret void +} + +define void @i235_ls(i235 %x) nounwind { + store i235 %x, i235* @i235_s + ret void +} + +define void @i236_ls(i236 %x) nounwind { + store i236 %x, i236* @i236_s + ret void +} + +define void @i237_ls(i237 %x) nounwind { + store i237 %x, i237* @i237_s + ret void +} + +define void @i238_ls(i238 %x) nounwind { + store i238 %x, i238* @i238_s + ret void +} + +define void @i239_ls(i239 %x) nounwind { + store i239 %x, i239* @i239_s + ret void +} + +define void @i240_ls(i240 %x) nounwind { + store i240 %x, i240* @i240_s + ret void +} + +define void @i241_ls(i241 %x) nounwind { + store i241 %x, i241* @i241_s + ret void +} + +define void @i242_ls(i242 %x) nounwind { + store i242 %x, i242* @i242_s + ret void +} + +define void @i243_ls(i243 %x) nounwind { + store i243 %x, i243* @i243_s + ret void +} + +define void @i244_ls(i244 %x) nounwind { + store i244 %x, i244* @i244_s + ret void +} + +define void @i245_ls(i245 %x) nounwind { + store i245 %x, i245* @i245_s + ret void +} + +define void @i246_ls(i246 %x) nounwind { + store i246 %x, i246* @i246_s + ret void +} + +define void @i247_ls(i247 %x) nounwind { + store i247 %x, i247* @i247_s + ret void +} + +define void @i248_ls(i248 %x) nounwind { + store i248 %x, i248* @i248_s + ret void +} + +define void @i249_ls(i249 %x) nounwind { + store i249 %x, i249* @i249_s + ret void +} + +define void @i250_ls(i250 %x) nounwind { + store i250 %x, i250* @i250_s + ret void +} + +define void @i251_ls(i251 %x) nounwind { + store i251 %x, i251* @i251_s + ret void +} + +define void @i252_ls(i252 %x) nounwind { + store i252 %x, i252* @i252_s + ret void +} + +define void @i253_ls(i253 %x) nounwind { + store i253 %x, i253* @i253_s + ret void +} + +define void @i254_ls(i254 %x) nounwind { + store i254 %x, i254* @i254_s + ret void +} + +define void @i255_ls(i255 %x) nounwind { + store i255 %x, i255* @i255_s + ret void +} + +define void @i256_ls(i256 %x) nounwind { + store i256 %x, i256* @i256_s + ret void +} From gohman at apple.com Wed Jul 16 10:56:46 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Jul 2008 15:56:46 -0000 Subject: [llvm-commits] [llvm] r53680 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp Message-ID: <200807161556.m6GFulwD004661@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 16 10:56:42 2008 New Revision: 53680 URL: http://llvm.org/viewvc/llvm-project?rev=53680&view=rev Log: Add an assert to check for empty flags for MachineMemOperand. Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=53680&r1=53679&r2=53680&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Wed Jul 16 10:56:42 2008 @@ -246,6 +246,7 @@ : Offset(o), Size(s), V(v), Flags((f & 7) | ((Log2_32(a) + 1) << 3)) { assert(isPowerOf2_32(a) && "Alignment is not a power of 2!"); + assert((isLoad() || isStore()) && "Not a load/store!"); } //===----------------------------------------------------------------------===// From gohman at apple.com Wed Jul 16 10:57:10 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Jul 2008 15:57:10 -0000 Subject: [llvm-commits] [llvm] r53681 - /llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Message-ID: <200807161557.m6GFvB1G004682@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 16 10:57:10 2008 New Revision: 53681 URL: http://llvm.org/viewvc/llvm-project?rev=53681&view=rev Log: Fix a comment to say nonnegative instead of positive. Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=53681&r1=53680&r2=53681&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Wed Jul 16 10:57:10 2008 @@ -317,7 +317,7 @@ // Start at the beginning of the local area. // The Offset is the distance from the stack top in the direction - // of stack growth -- so it's always positive. + // of stack growth -- so it's always nonnegative. int64_t Offset = TFI.getOffsetOfLocalArea(); if (StackGrowsDown) Offset = -Offset; From gohman at apple.com Wed Jul 16 10:59:56 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Jul 2008 15:59:56 -0000 Subject: [llvm-commits] [llvm] r53682 - /llvm/trunk/include/llvm/CallingConv.h Message-ID: <200807161559.m6GFxv4S004808@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 16 10:59:56 2008 New Revision: 53682 URL: http://llvm.org/viewvc/llvm-project?rev=53682&view=rev Log: Tidy a doxygen comment. Modified: llvm/trunk/include/llvm/CallingConv.h Modified: llvm/trunk/include/llvm/CallingConv.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CallingConv.h?rev=53682&r1=53681&r2=53682&view=diff ============================================================================== --- llvm/trunk/include/llvm/CallingConv.h (original) +++ llvm/trunk/include/llvm/CallingConv.h Wed Jul 16 10:59:56 2008 @@ -35,7 +35,7 @@ // prototype exactly match. /// Fast - This calling convention attempts to make calls as fast as - /// possible /// (e.g. by passing things in registers). + /// possible (e.g. by passing things in registers). Fast = 8, // Cold - This calling convention attempts to make code in the caller as From gohman at apple.com Wed Jul 16 11:03:00 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Jul 2008 16:03:00 -0000 Subject: [llvm-commits] [llvm] r53683 - /llvm/trunk/include/llvm/Target/TargetInstrInfo.h Message-ID: <200807161603.m6GG30cL004955@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 16 11:02:59 2008 New Revision: 53683 URL: http://llvm.org/viewvc/llvm-project?rev=53683&view=rev Log: Clarify the comments here, to make slightly more clear the difference in purpose of TargetInstrInfo and TargetInstrDesc, which isn't immediately obvious from the name. Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=53683&r1=53682&r2=53683&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Wed Jul 16 11:02:59 2008 @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file describes the target machine instructions to the code generator. +// This file describes the target machine instruction set to the code generator. // //===----------------------------------------------------------------------===// @@ -30,7 +30,7 @@ //--------------------------------------------------------------------------- /// -/// TargetInstrInfo - Interface to description of machine instructions +/// TargetInstrInfo - Interface to description of machine instruction set /// class TargetInstrInfo { const TargetInstrDesc *Descriptors; // Raw array to allow static init'n From baldrick at free.fr Wed Jul 16 11:03:07 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 16:03:07 -0000 Subject: [llvm-commits] [llvm] r53684 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h test/CodeGen/Generic/APIntSextParam.ll test/CodeGen/Generic/APIntZextParam.ll Message-ID: <200807161603.m6GG38U5004976@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jul 16 11:03:07 2008 New Revision: 53684 URL: http://llvm.org/viewvc/llvm-project?rev=53684&view=rev Log: Add support for promoting and expanding AssertZext and AssertSext. Needed when passing huge integer parameters with the zeroext or signext attributes. Added: llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=53684&r1=53683&r2=53684&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Wed Jul 16 11:03:07 2008 @@ -53,6 +53,8 @@ #endif assert(0 && "Do not know how to promote this operator!"); abort(); + case ISD::AssertSext: Result = PromoteIntRes_AssertSext(N); break; + case ISD::AssertZext: Result = PromoteIntRes_AssertZext(N); break; case ISD::BIT_CONVERT: Result = PromoteIntRes_BIT_CONVERT(N); break; case ISD::BSWAP: Result = PromoteIntRes_BSWAP(N); break; case ISD::BUILD_PAIR: Result = PromoteIntRes_BUILD_PAIR(N); break; @@ -101,6 +103,23 @@ SetPromotedInteger(SDOperand(N, ResNo), Result); } +SDOperand DAGTypeLegalizer::PromoteIntRes_AssertSext(SDNode *N) { + // Sign-extend the new bits, and continue the assertion. + MVT OldVT = N->getValueType(0); + SDOperand Op = GetPromotedInteger(N->getOperand(0)); + return DAG.getNode(ISD::AssertSext, Op.getValueType(), + DAG.getNode(ISD::SIGN_EXTEND_INREG, Op.getValueType(), Op, + DAG.getValueType(OldVT)), N->getOperand(1)); +} + +SDOperand DAGTypeLegalizer::PromoteIntRes_AssertZext(SDNode *N) { + // Zero the new bits, and continue the assertion. + MVT OldVT = N->getValueType(0); + SDOperand Op = GetPromotedInteger(N->getOperand(0)); + return DAG.getNode(ISD::AssertZext, Op.getValueType(), + DAG.getZeroExtendInReg(Op, OldVT), N->getOperand(1)); +} + SDOperand DAGTypeLegalizer::PromoteIntRes_BIT_CONVERT(SDNode *N) { SDOperand InOp = N->getOperand(0); MVT InVT = InOp.getValueType(); @@ -827,6 +846,7 @@ case ISD::EXTRACT_VECTOR_ELT: ExpandRes_EXTRACT_VECTOR_ELT(N, Lo, Hi); break; case ISD::ANY_EXTEND: ExpandIntRes_ANY_EXTEND(N, Lo, Hi); break; + case ISD::AssertSext: ExpandIntRes_AssertSext(N, Lo, Hi); break; case ISD::AssertZext: ExpandIntRes_AssertZext(N, Lo, Hi); break; case ISD::BSWAP: ExpandIntRes_BSWAP(N, Lo, Hi); break; case ISD::Constant: ExpandIntRes_Constant(N, Lo, Hi); break; @@ -1115,6 +1135,25 @@ } } +void DAGTypeLegalizer::ExpandIntRes_AssertSext(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + GetExpandedInteger(N->getOperand(0), Lo, Hi); + MVT NVT = Lo.getValueType(); + MVT EVT = cast(N->getOperand(1))->getVT(); + unsigned NVTBits = NVT.getSizeInBits(); + unsigned EVTBits = EVT.getSizeInBits(); + + if (NVTBits < EVTBits) { + Hi = DAG.getNode(ISD::AssertSext, NVT, Hi, + DAG.getValueType(MVT::getIntegerVT(EVTBits - NVTBits))); + } else { + Lo = DAG.getNode(ISD::AssertSext, NVT, Lo, DAG.getValueType(EVT)); + // The high part replicates the sign bit of Lo, make it explicit. + Hi = DAG.getNode(ISD::SRA, NVT, Lo, + DAG.getConstant(NVTBits-1, TLI.getShiftAmountTy())); + } +} + void DAGTypeLegalizer::ExpandIntRes_AssertZext(SDNode *N, SDOperand &Lo, SDOperand &Hi) { GetExpandedInteger(N->getOperand(0), Lo, Hi); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=53684&r1=53683&r2=53684&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Wed Jul 16 11:03:07 2008 @@ -212,6 +212,8 @@ // Integer Result Promotion. void PromoteIntegerResult(SDNode *N, unsigned ResNo); + SDOperand PromoteIntRes_AssertSext(SDNode *N); + SDOperand PromoteIntRes_AssertZext(SDNode *N); SDOperand PromoteIntRes_BIT_CONVERT(SDNode *N); SDOperand PromoteIntRes_BSWAP(SDNode *N); SDOperand PromoteIntRes_BUILD_PAIR(SDNode *N); @@ -269,6 +271,7 @@ // Integer Result Expansion. void ExpandIntegerResult(SDNode *N, unsigned ResNo); void ExpandIntRes_ANY_EXTEND (SDNode *N, SDOperand &Lo, SDOperand &Hi); + void ExpandIntRes_AssertSext (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandIntRes_AssertZext (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandIntRes_Constant (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandIntRes_CTLZ (SDNode *N, SDOperand &Lo, SDOperand &Hi); Added: llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll?rev=53684&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll (added) +++ llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll Wed Jul 16 11:03:07 2008 @@ -0,0 +1,1537 @@ +; RUN: llvm-as < %s | llc + at i1_s = external global i1 ; [#uses=1] + at i2_s = external global i2 ; [#uses=1] + at i3_s = external global i3 ; [#uses=1] + at i4_s = external global i4 ; [#uses=1] + at i5_s = external global i5 ; [#uses=1] + at i6_s = external global i6 ; [#uses=1] + at i7_s = external global i7 ; [#uses=1] + at i8_s = external global i8 ; [#uses=1] + at i9_s = external global i9 ; [#uses=1] + at i10_s = external global i10 ; [#uses=1] + at i11_s = external global i11 ; [#uses=1] + at i12_s = external global i12 ; [#uses=1] + at i13_s = external global i13 ; [#uses=1] + at i14_s = external global i14 ; [#uses=1] + at i15_s = external global i15 ; [#uses=1] + at i16_s = external global i16 ; [#uses=1] + at i17_s = external global i17 ; [#uses=1] + at i18_s = external global i18 ; [#uses=1] + at i19_s = external global i19 ; [#uses=1] + at i20_s = external global i20 ; [#uses=1] + at i21_s = external global i21 ; [#uses=1] + at i22_s = external global i22 ; [#uses=1] + at i23_s = external global i23 ; [#uses=1] + at i24_s = external global i24 ; [#uses=1] + at i25_s = external global i25 ; [#uses=1] + at i26_s = external global i26 ; [#uses=1] + at i27_s = external global i27 ; [#uses=1] + at i28_s = external global i28 ; [#uses=1] + at i29_s = external global i29 ; [#uses=1] + at i30_s = external global i30 ; [#uses=1] + at i31_s = external global i31 ; [#uses=1] + at i32_s = external global i32 ; [#uses=1] + at i33_s = external global i33 ; [#uses=1] + at i34_s = external global i34 ; [#uses=1] + at i35_s = external global i35 ; [#uses=1] + at i36_s = external global i36 ; [#uses=1] + at i37_s = external global i37 ; [#uses=1] + at i38_s = external global i38 ; [#uses=1] + at i39_s = external global i39 ; [#uses=1] + at i40_s = external global i40 ; [#uses=1] + at i41_s = external global i41 ; [#uses=1] + at i42_s = external global i42 ; [#uses=1] + at i43_s = external global i43 ; [#uses=1] + at i44_s = external global i44 ; [#uses=1] + at i45_s = external global i45 ; [#uses=1] + at i46_s = external global i46 ; [#uses=1] + at i47_s = external global i47 ; [#uses=1] + at i48_s = external global i48 ; [#uses=1] + at i49_s = external global i49 ; [#uses=1] + at i50_s = external global i50 ; [#uses=1] + at i51_s = external global i51 ; [#uses=1] + at i52_s = external global i52 ; [#uses=1] + at i53_s = external global i53 ; [#uses=1] + at i54_s = external global i54 ; [#uses=1] + at i55_s = external global i55 ; [#uses=1] + at i56_s = external global i56 ; [#uses=1] + at i57_s = external global i57 ; [#uses=1] + at i58_s = external global i58 ; [#uses=1] + at i59_s = external global i59 ; [#uses=1] + at i60_s = external global i60 ; [#uses=1] + at i61_s = external global i61 ; [#uses=1] + at i62_s = external global i62 ; [#uses=1] + at i63_s = external global i63 ; [#uses=1] + at i64_s = external global i64 ; [#uses=1] + at i65_s = external global i65 ; [#uses=1] + at i66_s = external global i66 ; [#uses=1] + at i67_s = external global i67 ; [#uses=1] + at i68_s = external global i68 ; [#uses=1] + at i69_s = external global i69 ; [#uses=1] + at i70_s = external global i70 ; [#uses=1] + at i71_s = external global i71 ; [#uses=1] + at i72_s = external global i72 ; [#uses=1] + at i73_s = external global i73 ; [#uses=1] + at i74_s = external global i74 ; [#uses=1] + at i75_s = external global i75 ; [#uses=1] + at i76_s = external global i76 ; [#uses=1] + at i77_s = external global i77 ; [#uses=1] + at i78_s = external global i78 ; [#uses=1] + at i79_s = external global i79 ; [#uses=1] + at i80_s = external global i80 ; [#uses=1] + at i81_s = external global i81 ; [#uses=1] + at i82_s = external global i82 ; [#uses=1] + at i83_s = external global i83 ; [#uses=1] + at i84_s = external global i84 ; [#uses=1] + at i85_s = external global i85 ; [#uses=1] + at i86_s = external global i86 ; [#uses=1] + at i87_s = external global i87 ; [#uses=1] + at i88_s = external global i88 ; [#uses=1] + at i89_s = external global i89 ; [#uses=1] + at i90_s = external global i90 ; [#uses=1] + at i91_s = external global i91 ; [#uses=1] + at i92_s = external global i92 ; [#uses=1] + at i93_s = external global i93 ; [#uses=1] + at i94_s = external global i94 ; [#uses=1] + at i95_s = external global i95 ; [#uses=1] + at i96_s = external global i96 ; [#uses=1] + at i97_s = external global i97 ; [#uses=1] + at i98_s = external global i98 ; [#uses=1] + at i99_s = external global i99 ; [#uses=1] + at i100_s = external global i100 ; [#uses=1] + at i101_s = external global i101 ; [#uses=1] + at i102_s = external global i102 ; [#uses=1] + at i103_s = external global i103 ; [#uses=1] + at i104_s = external global i104 ; [#uses=1] + at i105_s = external global i105 ; [#uses=1] + at i106_s = external global i106 ; [#uses=1] + at i107_s = external global i107 ; [#uses=1] + at i108_s = external global i108 ; [#uses=1] + at i109_s = external global i109 ; [#uses=1] + at i110_s = external global i110 ; [#uses=1] + at i111_s = external global i111 ; [#uses=1] + at i112_s = external global i112 ; [#uses=1] + at i113_s = external global i113 ; [#uses=1] + at i114_s = external global i114 ; [#uses=1] + at i115_s = external global i115 ; [#uses=1] + at i116_s = external global i116 ; [#uses=1] + at i117_s = external global i117 ; [#uses=1] + at i118_s = external global i118 ; [#uses=1] + at i119_s = external global i119 ; [#uses=1] + at i120_s = external global i120 ; [#uses=1] + at i121_s = external global i121 ; [#uses=1] + at i122_s = external global i122 ; [#uses=1] + at i123_s = external global i123 ; [#uses=1] + at i124_s = external global i124 ; [#uses=1] + at i125_s = external global i125 ; [#uses=1] + at i126_s = external global i126 ; [#uses=1] + at i127_s = external global i127 ; [#uses=1] + at i128_s = external global i128 ; [#uses=1] + at i129_s = external global i129 ; [#uses=1] + at i130_s = external global i130 ; [#uses=1] + at i131_s = external global i131 ; [#uses=1] + at i132_s = external global i132 ; [#uses=1] + at i133_s = external global i133 ; [#uses=1] + at i134_s = external global i134 ; [#uses=1] + at i135_s = external global i135 ; [#uses=1] + at i136_s = external global i136 ; [#uses=1] + at i137_s = external global i137 ; [#uses=1] + at i138_s = external global i138 ; [#uses=1] + at i139_s = external global i139 ; [#uses=1] + at i140_s = external global i140 ; [#uses=1] + at i141_s = external global i141 ; [#uses=1] + at i142_s = external global i142 ; [#uses=1] + at i143_s = external global i143 ; [#uses=1] + at i144_s = external global i144 ; [#uses=1] + at i145_s = external global i145 ; [#uses=1] + at i146_s = external global i146 ; [#uses=1] + at i147_s = external global i147 ; [#uses=1] + at i148_s = external global i148 ; [#uses=1] + at i149_s = external global i149 ; [#uses=1] + at i150_s = external global i150 ; [#uses=1] + at i151_s = external global i151 ; [#uses=1] + at i152_s = external global i152 ; [#uses=1] + at i153_s = external global i153 ; [#uses=1] + at i154_s = external global i154 ; [#uses=1] + at i155_s = external global i155 ; [#uses=1] + at i156_s = external global i156 ; [#uses=1] + at i157_s = external global i157 ; [#uses=1] + at i158_s = external global i158 ; [#uses=1] + at i159_s = external global i159 ; [#uses=1] + at i160_s = external global i160 ; [#uses=1] + at i161_s = external global i161 ; [#uses=1] + at i162_s = external global i162 ; [#uses=1] + at i163_s = external global i163 ; [#uses=1] + at i164_s = external global i164 ; [#uses=1] + at i165_s = external global i165 ; [#uses=1] + at i166_s = external global i166 ; [#uses=1] + at i167_s = external global i167 ; [#uses=1] + at i168_s = external global i168 ; [#uses=1] + at i169_s = external global i169 ; [#uses=1] + at i170_s = external global i170 ; [#uses=1] + at i171_s = external global i171 ; [#uses=1] + at i172_s = external global i172 ; [#uses=1] + at i173_s = external global i173 ; [#uses=1] + at i174_s = external global i174 ; [#uses=1] + at i175_s = external global i175 ; [#uses=1] + at i176_s = external global i176 ; [#uses=1] + at i177_s = external global i177 ; [#uses=1] + at i178_s = external global i178 ; [#uses=1] + at i179_s = external global i179 ; [#uses=1] + at i180_s = external global i180 ; [#uses=1] + at i181_s = external global i181 ; [#uses=1] + at i182_s = external global i182 ; [#uses=1] + at i183_s = external global i183 ; [#uses=1] + at i184_s = external global i184 ; [#uses=1] + at i185_s = external global i185 ; [#uses=1] + at i186_s = external global i186 ; [#uses=1] + at i187_s = external global i187 ; [#uses=1] + at i188_s = external global i188 ; [#uses=1] + at i189_s = external global i189 ; [#uses=1] + at i190_s = external global i190 ; [#uses=1] + at i191_s = external global i191 ; [#uses=1] + at i192_s = external global i192 ; [#uses=1] + at i193_s = external global i193 ; [#uses=1] + at i194_s = external global i194 ; [#uses=1] + at i195_s = external global i195 ; [#uses=1] + at i196_s = external global i196 ; [#uses=1] + at i197_s = external global i197 ; [#uses=1] + at i198_s = external global i198 ; [#uses=1] + at i199_s = external global i199 ; [#uses=1] + at i200_s = external global i200 ; [#uses=1] + at i201_s = external global i201 ; [#uses=1] + at i202_s = external global i202 ; [#uses=1] + at i203_s = external global i203 ; [#uses=1] + at i204_s = external global i204 ; [#uses=1] + at i205_s = external global i205 ; [#uses=1] + at i206_s = external global i206 ; [#uses=1] + at i207_s = external global i207 ; [#uses=1] + at i208_s = external global i208 ; [#uses=1] + at i209_s = external global i209 ; [#uses=1] + at i210_s = external global i210 ; [#uses=1] + at i211_s = external global i211 ; [#uses=1] + at i212_s = external global i212 ; [#uses=1] + at i213_s = external global i213 ; [#uses=1] + at i214_s = external global i214 ; [#uses=1] + at i215_s = external global i215 ; [#uses=1] + at i216_s = external global i216 ; [#uses=1] + at i217_s = external global i217 ; [#uses=1] + at i218_s = external global i218 ; [#uses=1] + at i219_s = external global i219 ; [#uses=1] + at i220_s = external global i220 ; [#uses=1] + at i221_s = external global i221 ; [#uses=1] + at i222_s = external global i222 ; [#uses=1] + at i223_s = external global i223 ; [#uses=1] + at i224_s = external global i224 ; [#uses=1] + at i225_s = external global i225 ; [#uses=1] + at i226_s = external global i226 ; [#uses=1] + at i227_s = external global i227 ; [#uses=1] + at i228_s = external global i228 ; [#uses=1] + at i229_s = external global i229 ; [#uses=1] + at i230_s = external global i230 ; [#uses=1] + at i231_s = external global i231 ; [#uses=1] + at i232_s = external global i232 ; [#uses=1] + at i233_s = external global i233 ; [#uses=1] + at i234_s = external global i234 ; [#uses=1] + at i235_s = external global i235 ; [#uses=1] + at i236_s = external global i236 ; [#uses=1] + at i237_s = external global i237 ; [#uses=1] + at i238_s = external global i238 ; [#uses=1] + at i239_s = external global i239 ; [#uses=1] + at i240_s = external global i240 ; [#uses=1] + at i241_s = external global i241 ; [#uses=1] + at i242_s = external global i242 ; [#uses=1] + at i243_s = external global i243 ; [#uses=1] + at i244_s = external global i244 ; [#uses=1] + at i245_s = external global i245 ; [#uses=1] + at i246_s = external global i246 ; [#uses=1] + at i247_s = external global i247 ; [#uses=1] + at i248_s = external global i248 ; [#uses=1] + at i249_s = external global i249 ; [#uses=1] + at i250_s = external global i250 ; [#uses=1] + at i251_s = external global i251 ; [#uses=1] + at i252_s = external global i252 ; [#uses=1] + at i253_s = external global i253 ; [#uses=1] + at i254_s = external global i254 ; [#uses=1] + at i255_s = external global i255 ; [#uses=1] + at i256_s = external global i256 ; [#uses=1] + +define void @i1_ls(i1 signext %x) nounwind { + store i1 %x, i1* @i1_s + ret void +} + +define void @i2_ls(i2 signext %x) nounwind { + store i2 %x, i2* @i2_s + ret void +} + +define void @i3_ls(i3 signext %x) nounwind { + store i3 %x, i3* @i3_s + ret void +} + +define void @i4_ls(i4 signext %x) nounwind { + store i4 %x, i4* @i4_s + ret void +} + +define void @i5_ls(i5 signext %x) nounwind { + store i5 %x, i5* @i5_s + ret void +} + +define void @i6_ls(i6 signext %x) nounwind { + store i6 %x, i6* @i6_s + ret void +} + +define void @i7_ls(i7 signext %x) nounwind { + store i7 %x, i7* @i7_s + ret void +} + +define void @i8_ls(i8 signext %x) nounwind { + store i8 %x, i8* @i8_s + ret void +} + +define void @i9_ls(i9 signext %x) nounwind { + store i9 %x, i9* @i9_s + ret void +} + +define void @i10_ls(i10 signext %x) nounwind { + store i10 %x, i10* @i10_s + ret void +} + +define void @i11_ls(i11 signext %x) nounwind { + store i11 %x, i11* @i11_s + ret void +} + +define void @i12_ls(i12 signext %x) nounwind { + store i12 %x, i12* @i12_s + ret void +} + +define void @i13_ls(i13 signext %x) nounwind { + store i13 %x, i13* @i13_s + ret void +} + +define void @i14_ls(i14 signext %x) nounwind { + store i14 %x, i14* @i14_s + ret void +} + +define void @i15_ls(i15 signext %x) nounwind { + store i15 %x, i15* @i15_s + ret void +} + +define void @i16_ls(i16 signext %x) nounwind { + store i16 %x, i16* @i16_s + ret void +} + +define void @i17_ls(i17 signext %x) nounwind { + store i17 %x, i17* @i17_s + ret void +} + +define void @i18_ls(i18 signext %x) nounwind { + store i18 %x, i18* @i18_s + ret void +} + +define void @i19_ls(i19 signext %x) nounwind { + store i19 %x, i19* @i19_s + ret void +} + +define void @i20_ls(i20 signext %x) nounwind { + store i20 %x, i20* @i20_s + ret void +} + +define void @i21_ls(i21 signext %x) nounwind { + store i21 %x, i21* @i21_s + ret void +} + +define void @i22_ls(i22 signext %x) nounwind { + store i22 %x, i22* @i22_s + ret void +} + +define void @i23_ls(i23 signext %x) nounwind { + store i23 %x, i23* @i23_s + ret void +} + +define void @i24_ls(i24 signext %x) nounwind { + store i24 %x, i24* @i24_s + ret void +} + +define void @i25_ls(i25 signext %x) nounwind { + store i25 %x, i25* @i25_s + ret void +} + +define void @i26_ls(i26 signext %x) nounwind { + store i26 %x, i26* @i26_s + ret void +} + +define void @i27_ls(i27 signext %x) nounwind { + store i27 %x, i27* @i27_s + ret void +} + +define void @i28_ls(i28 signext %x) nounwind { + store i28 %x, i28* @i28_s + ret void +} + +define void @i29_ls(i29 signext %x) nounwind { + store i29 %x, i29* @i29_s + ret void +} + +define void @i30_ls(i30 signext %x) nounwind { + store i30 %x, i30* @i30_s + ret void +} + +define void @i31_ls(i31 signext %x) nounwind { + store i31 %x, i31* @i31_s + ret void +} + +define void @i32_ls(i32 signext %x) nounwind { + store i32 %x, i32* @i32_s + ret void +} + +define void @i33_ls(i33 signext %x) nounwind { + store i33 %x, i33* @i33_s + ret void +} + +define void @i34_ls(i34 signext %x) nounwind { + store i34 %x, i34* @i34_s + ret void +} + +define void @i35_ls(i35 signext %x) nounwind { + store i35 %x, i35* @i35_s + ret void +} + +define void @i36_ls(i36 signext %x) nounwind { + store i36 %x, i36* @i36_s + ret void +} + +define void @i37_ls(i37 signext %x) nounwind { + store i37 %x, i37* @i37_s + ret void +} + +define void @i38_ls(i38 signext %x) nounwind { + store i38 %x, i38* @i38_s + ret void +} + +define void @i39_ls(i39 signext %x) nounwind { + store i39 %x, i39* @i39_s + ret void +} + +define void @i40_ls(i40 signext %x) nounwind { + store i40 %x, i40* @i40_s + ret void +} + +define void @i41_ls(i41 signext %x) nounwind { + store i41 %x, i41* @i41_s + ret void +} + +define void @i42_ls(i42 signext %x) nounwind { + store i42 %x, i42* @i42_s + ret void +} + +define void @i43_ls(i43 signext %x) nounwind { + store i43 %x, i43* @i43_s + ret void +} + +define void @i44_ls(i44 signext %x) nounwind { + store i44 %x, i44* @i44_s + ret void +} + +define void @i45_ls(i45 signext %x) nounwind { + store i45 %x, i45* @i45_s + ret void +} + +define void @i46_ls(i46 signext %x) nounwind { + store i46 %x, i46* @i46_s + ret void +} + +define void @i47_ls(i47 signext %x) nounwind { + store i47 %x, i47* @i47_s + ret void +} + +define void @i48_ls(i48 signext %x) nounwind { + store i48 %x, i48* @i48_s + ret void +} + +define void @i49_ls(i49 signext %x) nounwind { + store i49 %x, i49* @i49_s + ret void +} + +define void @i50_ls(i50 signext %x) nounwind { + store i50 %x, i50* @i50_s + ret void +} + +define void @i51_ls(i51 signext %x) nounwind { + store i51 %x, i51* @i51_s + ret void +} + +define void @i52_ls(i52 signext %x) nounwind { + store i52 %x, i52* @i52_s + ret void +} + +define void @i53_ls(i53 signext %x) nounwind { + store i53 %x, i53* @i53_s + ret void +} + +define void @i54_ls(i54 signext %x) nounwind { + store i54 %x, i54* @i54_s + ret void +} + +define void @i55_ls(i55 signext %x) nounwind { + store i55 %x, i55* @i55_s + ret void +} + +define void @i56_ls(i56 signext %x) nounwind { + store i56 %x, i56* @i56_s + ret void +} + +define void @i57_ls(i57 signext %x) nounwind { + store i57 %x, i57* @i57_s + ret void +} + +define void @i58_ls(i58 signext %x) nounwind { + store i58 %x, i58* @i58_s + ret void +} + +define void @i59_ls(i59 signext %x) nounwind { + store i59 %x, i59* @i59_s + ret void +} + +define void @i60_ls(i60 signext %x) nounwind { + store i60 %x, i60* @i60_s + ret void +} + +define void @i61_ls(i61 signext %x) nounwind { + store i61 %x, i61* @i61_s + ret void +} + +define void @i62_ls(i62 signext %x) nounwind { + store i62 %x, i62* @i62_s + ret void +} + +define void @i63_ls(i63 signext %x) nounwind { + store i63 %x, i63* @i63_s + ret void +} + +define void @i64_ls(i64 signext %x) nounwind { + store i64 %x, i64* @i64_s + ret void +} + +define void @i65_ls(i65 signext %x) nounwind { + store i65 %x, i65* @i65_s + ret void +} + +define void @i66_ls(i66 signext %x) nounwind { + store i66 %x, i66* @i66_s + ret void +} + +define void @i67_ls(i67 signext %x) nounwind { + store i67 %x, i67* @i67_s + ret void +} + +define void @i68_ls(i68 signext %x) nounwind { + store i68 %x, i68* @i68_s + ret void +} + +define void @i69_ls(i69 signext %x) nounwind { + store i69 %x, i69* @i69_s + ret void +} + +define void @i70_ls(i70 signext %x) nounwind { + store i70 %x, i70* @i70_s + ret void +} + +define void @i71_ls(i71 signext %x) nounwind { + store i71 %x, i71* @i71_s + ret void +} + +define void @i72_ls(i72 signext %x) nounwind { + store i72 %x, i72* @i72_s + ret void +} + +define void @i73_ls(i73 signext %x) nounwind { + store i73 %x, i73* @i73_s + ret void +} + +define void @i74_ls(i74 signext %x) nounwind { + store i74 %x, i74* @i74_s + ret void +} + +define void @i75_ls(i75 signext %x) nounwind { + store i75 %x, i75* @i75_s + ret void +} + +define void @i76_ls(i76 signext %x) nounwind { + store i76 %x, i76* @i76_s + ret void +} + +define void @i77_ls(i77 signext %x) nounwind { + store i77 %x, i77* @i77_s + ret void +} + +define void @i78_ls(i78 signext %x) nounwind { + store i78 %x, i78* @i78_s + ret void +} + +define void @i79_ls(i79 signext %x) nounwind { + store i79 %x, i79* @i79_s + ret void +} + +define void @i80_ls(i80 signext %x) nounwind { + store i80 %x, i80* @i80_s + ret void +} + +define void @i81_ls(i81 signext %x) nounwind { + store i81 %x, i81* @i81_s + ret void +} + +define void @i82_ls(i82 signext %x) nounwind { + store i82 %x, i82* @i82_s + ret void +} + +define void @i83_ls(i83 signext %x) nounwind { + store i83 %x, i83* @i83_s + ret void +} + +define void @i84_ls(i84 signext %x) nounwind { + store i84 %x, i84* @i84_s + ret void +} + +define void @i85_ls(i85 signext %x) nounwind { + store i85 %x, i85* @i85_s + ret void +} + +define void @i86_ls(i86 signext %x) nounwind { + store i86 %x, i86* @i86_s + ret void +} + +define void @i87_ls(i87 signext %x) nounwind { + store i87 %x, i87* @i87_s + ret void +} + +define void @i88_ls(i88 signext %x) nounwind { + store i88 %x, i88* @i88_s + ret void +} + +define void @i89_ls(i89 signext %x) nounwind { + store i89 %x, i89* @i89_s + ret void +} + +define void @i90_ls(i90 signext %x) nounwind { + store i90 %x, i90* @i90_s + ret void +} + +define void @i91_ls(i91 signext %x) nounwind { + store i91 %x, i91* @i91_s + ret void +} + +define void @i92_ls(i92 signext %x) nounwind { + store i92 %x, i92* @i92_s + ret void +} + +define void @i93_ls(i93 signext %x) nounwind { + store i93 %x, i93* @i93_s + ret void +} + +define void @i94_ls(i94 signext %x) nounwind { + store i94 %x, i94* @i94_s + ret void +} + +define void @i95_ls(i95 signext %x) nounwind { + store i95 %x, i95* @i95_s + ret void +} + +define void @i96_ls(i96 signext %x) nounwind { + store i96 %x, i96* @i96_s + ret void +} + +define void @i97_ls(i97 signext %x) nounwind { + store i97 %x, i97* @i97_s + ret void +} + +define void @i98_ls(i98 signext %x) nounwind { + store i98 %x, i98* @i98_s + ret void +} + +define void @i99_ls(i99 signext %x) nounwind { + store i99 %x, i99* @i99_s + ret void +} + +define void @i100_ls(i100 signext %x) nounwind { + store i100 %x, i100* @i100_s + ret void +} + +define void @i101_ls(i101 signext %x) nounwind { + store i101 %x, i101* @i101_s + ret void +} + +define void @i102_ls(i102 signext %x) nounwind { + store i102 %x, i102* @i102_s + ret void +} + +define void @i103_ls(i103 signext %x) nounwind { + store i103 %x, i103* @i103_s + ret void +} + +define void @i104_ls(i104 signext %x) nounwind { + store i104 %x, i104* @i104_s + ret void +} + +define void @i105_ls(i105 signext %x) nounwind { + store i105 %x, i105* @i105_s + ret void +} + +define void @i106_ls(i106 signext %x) nounwind { + store i106 %x, i106* @i106_s + ret void +} + +define void @i107_ls(i107 signext %x) nounwind { + store i107 %x, i107* @i107_s + ret void +} + +define void @i108_ls(i108 signext %x) nounwind { + store i108 %x, i108* @i108_s + ret void +} + +define void @i109_ls(i109 signext %x) nounwind { + store i109 %x, i109* @i109_s + ret void +} + +define void @i110_ls(i110 signext %x) nounwind { + store i110 %x, i110* @i110_s + ret void +} + +define void @i111_ls(i111 signext %x) nounwind { + store i111 %x, i111* @i111_s + ret void +} + +define void @i112_ls(i112 signext %x) nounwind { + store i112 %x, i112* @i112_s + ret void +} + +define void @i113_ls(i113 signext %x) nounwind { + store i113 %x, i113* @i113_s + ret void +} + +define void @i114_ls(i114 signext %x) nounwind { + store i114 %x, i114* @i114_s + ret void +} + +define void @i115_ls(i115 signext %x) nounwind { + store i115 %x, i115* @i115_s + ret void +} + +define void @i116_ls(i116 signext %x) nounwind { + store i116 %x, i116* @i116_s + ret void +} + +define void @i117_ls(i117 signext %x) nounwind { + store i117 %x, i117* @i117_s + ret void +} + +define void @i118_ls(i118 signext %x) nounwind { + store i118 %x, i118* @i118_s + ret void +} + +define void @i119_ls(i119 signext %x) nounwind { + store i119 %x, i119* @i119_s + ret void +} + +define void @i120_ls(i120 signext %x) nounwind { + store i120 %x, i120* @i120_s + ret void +} + +define void @i121_ls(i121 signext %x) nounwind { + store i121 %x, i121* @i121_s + ret void +} + +define void @i122_ls(i122 signext %x) nounwind { + store i122 %x, i122* @i122_s + ret void +} + +define void @i123_ls(i123 signext %x) nounwind { + store i123 %x, i123* @i123_s + ret void +} + +define void @i124_ls(i124 signext %x) nounwind { + store i124 %x, i124* @i124_s + ret void +} + +define void @i125_ls(i125 signext %x) nounwind { + store i125 %x, i125* @i125_s + ret void +} + +define void @i126_ls(i126 signext %x) nounwind { + store i126 %x, i126* @i126_s + ret void +} + +define void @i127_ls(i127 signext %x) nounwind { + store i127 %x, i127* @i127_s + ret void +} + +define void @i128_ls(i128 signext %x) nounwind { + store i128 %x, i128* @i128_s + ret void +} + +define void @i129_ls(i129 signext %x) nounwind { + store i129 %x, i129* @i129_s + ret void +} + +define void @i130_ls(i130 signext %x) nounwind { + store i130 %x, i130* @i130_s + ret void +} + +define void @i131_ls(i131 signext %x) nounwind { + store i131 %x, i131* @i131_s + ret void +} + +define void @i132_ls(i132 signext %x) nounwind { + store i132 %x, i132* @i132_s + ret void +} + +define void @i133_ls(i133 signext %x) nounwind { + store i133 %x, i133* @i133_s + ret void +} + +define void @i134_ls(i134 signext %x) nounwind { + store i134 %x, i134* @i134_s + ret void +} + +define void @i135_ls(i135 signext %x) nounwind { + store i135 %x, i135* @i135_s + ret void +} + +define void @i136_ls(i136 signext %x) nounwind { + store i136 %x, i136* @i136_s + ret void +} + +define void @i137_ls(i137 signext %x) nounwind { + store i137 %x, i137* @i137_s + ret void +} + +define void @i138_ls(i138 signext %x) nounwind { + store i138 %x, i138* @i138_s + ret void +} + +define void @i139_ls(i139 signext %x) nounwind { + store i139 %x, i139* @i139_s + ret void +} + +define void @i140_ls(i140 signext %x) nounwind { + store i140 %x, i140* @i140_s + ret void +} + +define void @i141_ls(i141 signext %x) nounwind { + store i141 %x, i141* @i141_s + ret void +} + +define void @i142_ls(i142 signext %x) nounwind { + store i142 %x, i142* @i142_s + ret void +} + +define void @i143_ls(i143 signext %x) nounwind { + store i143 %x, i143* @i143_s + ret void +} + +define void @i144_ls(i144 signext %x) nounwind { + store i144 %x, i144* @i144_s + ret void +} + +define void @i145_ls(i145 signext %x) nounwind { + store i145 %x, i145* @i145_s + ret void +} + +define void @i146_ls(i146 signext %x) nounwind { + store i146 %x, i146* @i146_s + ret void +} + +define void @i147_ls(i147 signext %x) nounwind { + store i147 %x, i147* @i147_s + ret void +} + +define void @i148_ls(i148 signext %x) nounwind { + store i148 %x, i148* @i148_s + ret void +} + +define void @i149_ls(i149 signext %x) nounwind { + store i149 %x, i149* @i149_s + ret void +} + +define void @i150_ls(i150 signext %x) nounwind { + store i150 %x, i150* @i150_s + ret void +} + +define void @i151_ls(i151 signext %x) nounwind { + store i151 %x, i151* @i151_s + ret void +} + +define void @i152_ls(i152 signext %x) nounwind { + store i152 %x, i152* @i152_s + ret void +} + +define void @i153_ls(i153 signext %x) nounwind { + store i153 %x, i153* @i153_s + ret void +} + +define void @i154_ls(i154 signext %x) nounwind { + store i154 %x, i154* @i154_s + ret void +} + +define void @i155_ls(i155 signext %x) nounwind { + store i155 %x, i155* @i155_s + ret void +} + +define void @i156_ls(i156 signext %x) nounwind { + store i156 %x, i156* @i156_s + ret void +} + +define void @i157_ls(i157 signext %x) nounwind { + store i157 %x, i157* @i157_s + ret void +} + +define void @i158_ls(i158 signext %x) nounwind { + store i158 %x, i158* @i158_s + ret void +} + +define void @i159_ls(i159 signext %x) nounwind { + store i159 %x, i159* @i159_s + ret void +} + +define void @i160_ls(i160 signext %x) nounwind { + store i160 %x, i160* @i160_s + ret void +} + +define void @i161_ls(i161 signext %x) nounwind { + store i161 %x, i161* @i161_s + ret void +} + +define void @i162_ls(i162 signext %x) nounwind { + store i162 %x, i162* @i162_s + ret void +} + +define void @i163_ls(i163 signext %x) nounwind { + store i163 %x, i163* @i163_s + ret void +} + +define void @i164_ls(i164 signext %x) nounwind { + store i164 %x, i164* @i164_s + ret void +} + +define void @i165_ls(i165 signext %x) nounwind { + store i165 %x, i165* @i165_s + ret void +} + +define void @i166_ls(i166 signext %x) nounwind { + store i166 %x, i166* @i166_s + ret void +} + +define void @i167_ls(i167 signext %x) nounwind { + store i167 %x, i167* @i167_s + ret void +} + +define void @i168_ls(i168 signext %x) nounwind { + store i168 %x, i168* @i168_s + ret void +} + +define void @i169_ls(i169 signext %x) nounwind { + store i169 %x, i169* @i169_s + ret void +} + +define void @i170_ls(i170 signext %x) nounwind { + store i170 %x, i170* @i170_s + ret void +} + +define void @i171_ls(i171 signext %x) nounwind { + store i171 %x, i171* @i171_s + ret void +} + +define void @i172_ls(i172 signext %x) nounwind { + store i172 %x, i172* @i172_s + ret void +} + +define void @i173_ls(i173 signext %x) nounwind { + store i173 %x, i173* @i173_s + ret void +} + +define void @i174_ls(i174 signext %x) nounwind { + store i174 %x, i174* @i174_s + ret void +} + +define void @i175_ls(i175 signext %x) nounwind { + store i175 %x, i175* @i175_s + ret void +} + +define void @i176_ls(i176 signext %x) nounwind { + store i176 %x, i176* @i176_s + ret void +} + +define void @i177_ls(i177 signext %x) nounwind { + store i177 %x, i177* @i177_s + ret void +} + +define void @i178_ls(i178 signext %x) nounwind { + store i178 %x, i178* @i178_s + ret void +} + +define void @i179_ls(i179 signext %x) nounwind { + store i179 %x, i179* @i179_s + ret void +} + +define void @i180_ls(i180 signext %x) nounwind { + store i180 %x, i180* @i180_s + ret void +} + +define void @i181_ls(i181 signext %x) nounwind { + store i181 %x, i181* @i181_s + ret void +} + +define void @i182_ls(i182 signext %x) nounwind { + store i182 %x, i182* @i182_s + ret void +} + +define void @i183_ls(i183 signext %x) nounwind { + store i183 %x, i183* @i183_s + ret void +} + +define void @i184_ls(i184 signext %x) nounwind { + store i184 %x, i184* @i184_s + ret void +} + +define void @i185_ls(i185 signext %x) nounwind { + store i185 %x, i185* @i185_s + ret void +} + +define void @i186_ls(i186 signext %x) nounwind { + store i186 %x, i186* @i186_s + ret void +} + +define void @i187_ls(i187 signext %x) nounwind { + store i187 %x, i187* @i187_s + ret void +} + +define void @i188_ls(i188 signext %x) nounwind { + store i188 %x, i188* @i188_s + ret void +} + +define void @i189_ls(i189 signext %x) nounwind { + store i189 %x, i189* @i189_s + ret void +} + +define void @i190_ls(i190 signext %x) nounwind { + store i190 %x, i190* @i190_s + ret void +} + +define void @i191_ls(i191 signext %x) nounwind { + store i191 %x, i191* @i191_s + ret void +} + +define void @i192_ls(i192 signext %x) nounwind { + store i192 %x, i192* @i192_s + ret void +} + +define void @i193_ls(i193 signext %x) nounwind { + store i193 %x, i193* @i193_s + ret void +} + +define void @i194_ls(i194 signext %x) nounwind { + store i194 %x, i194* @i194_s + ret void +} + +define void @i195_ls(i195 signext %x) nounwind { + store i195 %x, i195* @i195_s + ret void +} + +define void @i196_ls(i196 signext %x) nounwind { + store i196 %x, i196* @i196_s + ret void +} + +define void @i197_ls(i197 signext %x) nounwind { + store i197 %x, i197* @i197_s + ret void +} + +define void @i198_ls(i198 signext %x) nounwind { + store i198 %x, i198* @i198_s + ret void +} + +define void @i199_ls(i199 signext %x) nounwind { + store i199 %x, i199* @i199_s + ret void +} + +define void @i200_ls(i200 signext %x) nounwind { + store i200 %x, i200* @i200_s + ret void +} + +define void @i201_ls(i201 signext %x) nounwind { + store i201 %x, i201* @i201_s + ret void +} + +define void @i202_ls(i202 signext %x) nounwind { + store i202 %x, i202* @i202_s + ret void +} + +define void @i203_ls(i203 signext %x) nounwind { + store i203 %x, i203* @i203_s + ret void +} + +define void @i204_ls(i204 signext %x) nounwind { + store i204 %x, i204* @i204_s + ret void +} + +define void @i205_ls(i205 signext %x) nounwind { + store i205 %x, i205* @i205_s + ret void +} + +define void @i206_ls(i206 signext %x) nounwind { + store i206 %x, i206* @i206_s + ret void +} + +define void @i207_ls(i207 signext %x) nounwind { + store i207 %x, i207* @i207_s + ret void +} + +define void @i208_ls(i208 signext %x) nounwind { + store i208 %x, i208* @i208_s + ret void +} + +define void @i209_ls(i209 signext %x) nounwind { + store i209 %x, i209* @i209_s + ret void +} + +define void @i210_ls(i210 signext %x) nounwind { + store i210 %x, i210* @i210_s + ret void +} + +define void @i211_ls(i211 signext %x) nounwind { + store i211 %x, i211* @i211_s + ret void +} + +define void @i212_ls(i212 signext %x) nounwind { + store i212 %x, i212* @i212_s + ret void +} + +define void @i213_ls(i213 signext %x) nounwind { + store i213 %x, i213* @i213_s + ret void +} + +define void @i214_ls(i214 signext %x) nounwind { + store i214 %x, i214* @i214_s + ret void +} + +define void @i215_ls(i215 signext %x) nounwind { + store i215 %x, i215* @i215_s + ret void +} + +define void @i216_ls(i216 signext %x) nounwind { + store i216 %x, i216* @i216_s + ret void +} + +define void @i217_ls(i217 signext %x) nounwind { + store i217 %x, i217* @i217_s + ret void +} + +define void @i218_ls(i218 signext %x) nounwind { + store i218 %x, i218* @i218_s + ret void +} + +define void @i219_ls(i219 signext %x) nounwind { + store i219 %x, i219* @i219_s + ret void +} + +define void @i220_ls(i220 signext %x) nounwind { + store i220 %x, i220* @i220_s + ret void +} + +define void @i221_ls(i221 signext %x) nounwind { + store i221 %x, i221* @i221_s + ret void +} + +define void @i222_ls(i222 signext %x) nounwind { + store i222 %x, i222* @i222_s + ret void +} + +define void @i223_ls(i223 signext %x) nounwind { + store i223 %x, i223* @i223_s + ret void +} + +define void @i224_ls(i224 signext %x) nounwind { + store i224 %x, i224* @i224_s + ret void +} + +define void @i225_ls(i225 signext %x) nounwind { + store i225 %x, i225* @i225_s + ret void +} + +define void @i226_ls(i226 signext %x) nounwind { + store i226 %x, i226* @i226_s + ret void +} + +define void @i227_ls(i227 signext %x) nounwind { + store i227 %x, i227* @i227_s + ret void +} + +define void @i228_ls(i228 signext %x) nounwind { + store i228 %x, i228* @i228_s + ret void +} + +define void @i229_ls(i229 signext %x) nounwind { + store i229 %x, i229* @i229_s + ret void +} + +define void @i230_ls(i230 signext %x) nounwind { + store i230 %x, i230* @i230_s + ret void +} + +define void @i231_ls(i231 signext %x) nounwind { + store i231 %x, i231* @i231_s + ret void +} + +define void @i232_ls(i232 signext %x) nounwind { + store i232 %x, i232* @i232_s + ret void +} + +define void @i233_ls(i233 signext %x) nounwind { + store i233 %x, i233* @i233_s + ret void +} + +define void @i234_ls(i234 signext %x) nounwind { + store i234 %x, i234* @i234_s + ret void +} + +define void @i235_ls(i235 signext %x) nounwind { + store i235 %x, i235* @i235_s + ret void +} + +define void @i236_ls(i236 signext %x) nounwind { + store i236 %x, i236* @i236_s + ret void +} + +define void @i237_ls(i237 signext %x) nounwind { + store i237 %x, i237* @i237_s + ret void +} + +define void @i238_ls(i238 signext %x) nounwind { + store i238 %x, i238* @i238_s + ret void +} + +define void @i239_ls(i239 signext %x) nounwind { + store i239 %x, i239* @i239_s + ret void +} + +define void @i240_ls(i240 signext %x) nounwind { + store i240 %x, i240* @i240_s + ret void +} + +define void @i241_ls(i241 signext %x) nounwind { + store i241 %x, i241* @i241_s + ret void +} + +define void @i242_ls(i242 signext %x) nounwind { + store i242 %x, i242* @i242_s + ret void +} + +define void @i243_ls(i243 signext %x) nounwind { + store i243 %x, i243* @i243_s + ret void +} + +define void @i244_ls(i244 signext %x) nounwind { + store i244 %x, i244* @i244_s + ret void +} + +define void @i245_ls(i245 signext %x) nounwind { + store i245 %x, i245* @i245_s + ret void +} + +define void @i246_ls(i246 signext %x) nounwind { + store i246 %x, i246* @i246_s + ret void +} + +define void @i247_ls(i247 signext %x) nounwind { + store i247 %x, i247* @i247_s + ret void +} + +define void @i248_ls(i248 signext %x) nounwind { + store i248 %x, i248* @i248_s + ret void +} + +define void @i249_ls(i249 signext %x) nounwind { + store i249 %x, i249* @i249_s + ret void +} + +define void @i250_ls(i250 signext %x) nounwind { + store i250 %x, i250* @i250_s + ret void +} + +define void @i251_ls(i251 signext %x) nounwind { + store i251 %x, i251* @i251_s + ret void +} + +define void @i252_ls(i252 signext %x) nounwind { + store i252 %x, i252* @i252_s + ret void +} + +define void @i253_ls(i253 signext %x) nounwind { + store i253 %x, i253* @i253_s + ret void +} + +define void @i254_ls(i254 signext %x) nounwind { + store i254 %x, i254* @i254_s + ret void +} + +define void @i255_ls(i255 signext %x) nounwind { + store i255 %x, i255* @i255_s + ret void +} + +define void @i256_ls(i256 signext %x) nounwind { + store i256 %x, i256* @i256_s + ret void +} Added: llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll?rev=53684&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll (added) +++ llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll Wed Jul 16 11:03:07 2008 @@ -0,0 +1,1537 @@ +; RUN: llvm-as < %s | llc + at i1_s = external global i1 ; [#uses=1] + at i2_s = external global i2 ; [#uses=1] + at i3_s = external global i3 ; [#uses=1] + at i4_s = external global i4 ; [#uses=1] + at i5_s = external global i5 ; [#uses=1] + at i6_s = external global i6 ; [#uses=1] + at i7_s = external global i7 ; [#uses=1] + at i8_s = external global i8 ; [#uses=1] + at i9_s = external global i9 ; [#uses=1] + at i10_s = external global i10 ; [#uses=1] + at i11_s = external global i11 ; [#uses=1] + at i12_s = external global i12 ; [#uses=1] + at i13_s = external global i13 ; [#uses=1] + at i14_s = external global i14 ; [#uses=1] + at i15_s = external global i15 ; [#uses=1] + at i16_s = external global i16 ; [#uses=1] + at i17_s = external global i17 ; [#uses=1] + at i18_s = external global i18 ; [#uses=1] + at i19_s = external global i19 ; [#uses=1] + at i20_s = external global i20 ; [#uses=1] + at i21_s = external global i21 ; [#uses=1] + at i22_s = external global i22 ; [#uses=1] + at i23_s = external global i23 ; [#uses=1] + at i24_s = external global i24 ; [#uses=1] + at i25_s = external global i25 ; [#uses=1] + at i26_s = external global i26 ; [#uses=1] + at i27_s = external global i27 ; [#uses=1] + at i28_s = external global i28 ; [#uses=1] + at i29_s = external global i29 ; [#uses=1] + at i30_s = external global i30 ; [#uses=1] + at i31_s = external global i31 ; [#uses=1] + at i32_s = external global i32 ; [#uses=1] + at i33_s = external global i33 ; [#uses=1] + at i34_s = external global i34 ; [#uses=1] + at i35_s = external global i35 ; [#uses=1] + at i36_s = external global i36 ; [#uses=1] + at i37_s = external global i37 ; [#uses=1] + at i38_s = external global i38 ; [#uses=1] + at i39_s = external global i39 ; [#uses=1] + at i40_s = external global i40 ; [#uses=1] + at i41_s = external global i41 ; [#uses=1] + at i42_s = external global i42 ; [#uses=1] + at i43_s = external global i43 ; [#uses=1] + at i44_s = external global i44 ; [#uses=1] + at i45_s = external global i45 ; [#uses=1] + at i46_s = external global i46 ; [#uses=1] + at i47_s = external global i47 ; [#uses=1] + at i48_s = external global i48 ; [#uses=1] + at i49_s = external global i49 ; [#uses=1] + at i50_s = external global i50 ; [#uses=1] + at i51_s = external global i51 ; [#uses=1] + at i52_s = external global i52 ; [#uses=1] + at i53_s = external global i53 ; [#uses=1] + at i54_s = external global i54 ; [#uses=1] + at i55_s = external global i55 ; [#uses=1] + at i56_s = external global i56 ; [#uses=1] + at i57_s = external global i57 ; [#uses=1] + at i58_s = external global i58 ; [#uses=1] + at i59_s = external global i59 ; [#uses=1] + at i60_s = external global i60 ; [#uses=1] + at i61_s = external global i61 ; [#uses=1] + at i62_s = external global i62 ; [#uses=1] + at i63_s = external global i63 ; [#uses=1] + at i64_s = external global i64 ; [#uses=1] + at i65_s = external global i65 ; [#uses=1] + at i66_s = external global i66 ; [#uses=1] + at i67_s = external global i67 ; [#uses=1] + at i68_s = external global i68 ; [#uses=1] + at i69_s = external global i69 ; [#uses=1] + at i70_s = external global i70 ; [#uses=1] + at i71_s = external global i71 ; [#uses=1] + at i72_s = external global i72 ; [#uses=1] + at i73_s = external global i73 ; [#uses=1] + at i74_s = external global i74 ; [#uses=1] + at i75_s = external global i75 ; [#uses=1] + at i76_s = external global i76 ; [#uses=1] + at i77_s = external global i77 ; [#uses=1] + at i78_s = external global i78 ; [#uses=1] + at i79_s = external global i79 ; [#uses=1] + at i80_s = external global i80 ; [#uses=1] + at i81_s = external global i81 ; [#uses=1] + at i82_s = external global i82 ; [#uses=1] + at i83_s = external global i83 ; [#uses=1] + at i84_s = external global i84 ; [#uses=1] + at i85_s = external global i85 ; [#uses=1] + at i86_s = external global i86 ; [#uses=1] + at i87_s = external global i87 ; [#uses=1] + at i88_s = external global i88 ; [#uses=1] + at i89_s = external global i89 ; [#uses=1] + at i90_s = external global i90 ; [#uses=1] + at i91_s = external global i91 ; [#uses=1] + at i92_s = external global i92 ; [#uses=1] + at i93_s = external global i93 ; [#uses=1] + at i94_s = external global i94 ; [#uses=1] + at i95_s = external global i95 ; [#uses=1] + at i96_s = external global i96 ; [#uses=1] + at i97_s = external global i97 ; [#uses=1] + at i98_s = external global i98 ; [#uses=1] + at i99_s = external global i99 ; [#uses=1] + at i100_s = external global i100 ; [#uses=1] + at i101_s = external global i101 ; [#uses=1] + at i102_s = external global i102 ; [#uses=1] + at i103_s = external global i103 ; [#uses=1] + at i104_s = external global i104 ; [#uses=1] + at i105_s = external global i105 ; [#uses=1] + at i106_s = external global i106 ; [#uses=1] + at i107_s = external global i107 ; [#uses=1] + at i108_s = external global i108 ; [#uses=1] + at i109_s = external global i109 ; [#uses=1] + at i110_s = external global i110 ; [#uses=1] + at i111_s = external global i111 ; [#uses=1] + at i112_s = external global i112 ; [#uses=1] + at i113_s = external global i113 ; [#uses=1] + at i114_s = external global i114 ; [#uses=1] + at i115_s = external global i115 ; [#uses=1] + at i116_s = external global i116 ; [#uses=1] + at i117_s = external global i117 ; [#uses=1] + at i118_s = external global i118 ; [#uses=1] + at i119_s = external global i119 ; [#uses=1] + at i120_s = external global i120 ; [#uses=1] + at i121_s = external global i121 ; [#uses=1] + at i122_s = external global i122 ; [#uses=1] + at i123_s = external global i123 ; [#uses=1] + at i124_s = external global i124 ; [#uses=1] + at i125_s = external global i125 ; [#uses=1] + at i126_s = external global i126 ; [#uses=1] + at i127_s = external global i127 ; [#uses=1] + at i128_s = external global i128 ; [#uses=1] + at i129_s = external global i129 ; [#uses=1] + at i130_s = external global i130 ; [#uses=1] + at i131_s = external global i131 ; [#uses=1] + at i132_s = external global i132 ; [#uses=1] + at i133_s = external global i133 ; [#uses=1] + at i134_s = external global i134 ; [#uses=1] + at i135_s = external global i135 ; [#uses=1] + at i136_s = external global i136 ; [#uses=1] + at i137_s = external global i137 ; [#uses=1] + at i138_s = external global i138 ; [#uses=1] + at i139_s = external global i139 ; [#uses=1] + at i140_s = external global i140 ; [#uses=1] + at i141_s = external global i141 ; [#uses=1] + at i142_s = external global i142 ; [#uses=1] + at i143_s = external global i143 ; [#uses=1] + at i144_s = external global i144 ; [#uses=1] + at i145_s = external global i145 ; [#uses=1] + at i146_s = external global i146 ; [#uses=1] + at i147_s = external global i147 ; [#uses=1] + at i148_s = external global i148 ; [#uses=1] + at i149_s = external global i149 ; [#uses=1] + at i150_s = external global i150 ; [#uses=1] + at i151_s = external global i151 ; [#uses=1] + at i152_s = external global i152 ; [#uses=1] + at i153_s = external global i153 ; [#uses=1] + at i154_s = external global i154 ; [#uses=1] + at i155_s = external global i155 ; [#uses=1] + at i156_s = external global i156 ; [#uses=1] + at i157_s = external global i157 ; [#uses=1] + at i158_s = external global i158 ; [#uses=1] + at i159_s = external global i159 ; [#uses=1] + at i160_s = external global i160 ; [#uses=1] + at i161_s = external global i161 ; [#uses=1] + at i162_s = external global i162 ; [#uses=1] + at i163_s = external global i163 ; [#uses=1] + at i164_s = external global i164 ; [#uses=1] + at i165_s = external global i165 ; [#uses=1] + at i166_s = external global i166 ; [#uses=1] + at i167_s = external global i167 ; [#uses=1] + at i168_s = external global i168 ; [#uses=1] + at i169_s = external global i169 ; [#uses=1] + at i170_s = external global i170 ; [#uses=1] + at i171_s = external global i171 ; [#uses=1] + at i172_s = external global i172 ; [#uses=1] + at i173_s = external global i173 ; [#uses=1] + at i174_s = external global i174 ; [#uses=1] + at i175_s = external global i175 ; [#uses=1] + at i176_s = external global i176 ; [#uses=1] + at i177_s = external global i177 ; [#uses=1] + at i178_s = external global i178 ; [#uses=1] + at i179_s = external global i179 ; [#uses=1] + at i180_s = external global i180 ; [#uses=1] + at i181_s = external global i181 ; [#uses=1] + at i182_s = external global i182 ; [#uses=1] + at i183_s = external global i183 ; [#uses=1] + at i184_s = external global i184 ; [#uses=1] + at i185_s = external global i185 ; [#uses=1] + at i186_s = external global i186 ; [#uses=1] + at i187_s = external global i187 ; [#uses=1] + at i188_s = external global i188 ; [#uses=1] + at i189_s = external global i189 ; [#uses=1] + at i190_s = external global i190 ; [#uses=1] + at i191_s = external global i191 ; [#uses=1] + at i192_s = external global i192 ; [#uses=1] + at i193_s = external global i193 ; [#uses=1] + at i194_s = external global i194 ; [#uses=1] + at i195_s = external global i195 ; [#uses=1] + at i196_s = external global i196 ; [#uses=1] + at i197_s = external global i197 ; [#uses=1] + at i198_s = external global i198 ; [#uses=1] + at i199_s = external global i199 ; [#uses=1] + at i200_s = external global i200 ; [#uses=1] + at i201_s = external global i201 ; [#uses=1] + at i202_s = external global i202 ; [#uses=1] + at i203_s = external global i203 ; [#uses=1] + at i204_s = external global i204 ; [#uses=1] + at i205_s = external global i205 ; [#uses=1] + at i206_s = external global i206 ; [#uses=1] + at i207_s = external global i207 ; [#uses=1] + at i208_s = external global i208 ; [#uses=1] + at i209_s = external global i209 ; [#uses=1] + at i210_s = external global i210 ; [#uses=1] + at i211_s = external global i211 ; [#uses=1] + at i212_s = external global i212 ; [#uses=1] + at i213_s = external global i213 ; [#uses=1] + at i214_s = external global i214 ; [#uses=1] + at i215_s = external global i215 ; [#uses=1] + at i216_s = external global i216 ; [#uses=1] + at i217_s = external global i217 ; [#uses=1] + at i218_s = external global i218 ; [#uses=1] + at i219_s = external global i219 ; [#uses=1] + at i220_s = external global i220 ; [#uses=1] + at i221_s = external global i221 ; [#uses=1] + at i222_s = external global i222 ; [#uses=1] + at i223_s = external global i223 ; [#uses=1] + at i224_s = external global i224 ; [#uses=1] + at i225_s = external global i225 ; [#uses=1] + at i226_s = external global i226 ; [#uses=1] + at i227_s = external global i227 ; [#uses=1] + at i228_s = external global i228 ; [#uses=1] + at i229_s = external global i229 ; [#uses=1] + at i230_s = external global i230 ; [#uses=1] + at i231_s = external global i231 ; [#uses=1] + at i232_s = external global i232 ; [#uses=1] + at i233_s = external global i233 ; [#uses=1] + at i234_s = external global i234 ; [#uses=1] + at i235_s = external global i235 ; [#uses=1] + at i236_s = external global i236 ; [#uses=1] + at i237_s = external global i237 ; [#uses=1] + at i238_s = external global i238 ; [#uses=1] + at i239_s = external global i239 ; [#uses=1] + at i240_s = external global i240 ; [#uses=1] + at i241_s = external global i241 ; [#uses=1] + at i242_s = external global i242 ; [#uses=1] + at i243_s = external global i243 ; [#uses=1] + at i244_s = external global i244 ; [#uses=1] + at i245_s = external global i245 ; [#uses=1] + at i246_s = external global i246 ; [#uses=1] + at i247_s = external global i247 ; [#uses=1] + at i248_s = external global i248 ; [#uses=1] + at i249_s = external global i249 ; [#uses=1] + at i250_s = external global i250 ; [#uses=1] + at i251_s = external global i251 ; [#uses=1] + at i252_s = external global i252 ; [#uses=1] + at i253_s = external global i253 ; [#uses=1] + at i254_s = external global i254 ; [#uses=1] + at i255_s = external global i255 ; [#uses=1] + at i256_s = external global i256 ; [#uses=1] + +define void @i1_ls(i1 zeroext %x) nounwind { + store i1 %x, i1* @i1_s + ret void +} + +define void @i2_ls(i2 zeroext %x) nounwind { + store i2 %x, i2* @i2_s + ret void +} + +define void @i3_ls(i3 zeroext %x) nounwind { + store i3 %x, i3* @i3_s + ret void +} + +define void @i4_ls(i4 zeroext %x) nounwind { + store i4 %x, i4* @i4_s + ret void +} + +define void @i5_ls(i5 zeroext %x) nounwind { + store i5 %x, i5* @i5_s + ret void +} + +define void @i6_ls(i6 zeroext %x) nounwind { + store i6 %x, i6* @i6_s + ret void +} + +define void @i7_ls(i7 zeroext %x) nounwind { + store i7 %x, i7* @i7_s + ret void +} + +define void @i8_ls(i8 zeroext %x) nounwind { + store i8 %x, i8* @i8_s + ret void +} + +define void @i9_ls(i9 zeroext %x) nounwind { + store i9 %x, i9* @i9_s + ret void +} + +define void @i10_ls(i10 zeroext %x) nounwind { + store i10 %x, i10* @i10_s + ret void +} + +define void @i11_ls(i11 zeroext %x) nounwind { + store i11 %x, i11* @i11_s + ret void +} + +define void @i12_ls(i12 zeroext %x) nounwind { + store i12 %x, i12* @i12_s + ret void +} + +define void @i13_ls(i13 zeroext %x) nounwind { + store i13 %x, i13* @i13_s + ret void +} + +define void @i14_ls(i14 zeroext %x) nounwind { + store i14 %x, i14* @i14_s + ret void +} + +define void @i15_ls(i15 zeroext %x) nounwind { + store i15 %x, i15* @i15_s + ret void +} + +define void @i16_ls(i16 zeroext %x) nounwind { + store i16 %x, i16* @i16_s + ret void +} + +define void @i17_ls(i17 zeroext %x) nounwind { + store i17 %x, i17* @i17_s + ret void +} + +define void @i18_ls(i18 zeroext %x) nounwind { + store i18 %x, i18* @i18_s + ret void +} + +define void @i19_ls(i19 zeroext %x) nounwind { + store i19 %x, i19* @i19_s + ret void +} + +define void @i20_ls(i20 zeroext %x) nounwind { + store i20 %x, i20* @i20_s + ret void +} + +define void @i21_ls(i21 zeroext %x) nounwind { + store i21 %x, i21* @i21_s + ret void +} + +define void @i22_ls(i22 zeroext %x) nounwind { + store i22 %x, i22* @i22_s + ret void +} + +define void @i23_ls(i23 zeroext %x) nounwind { + store i23 %x, i23* @i23_s + ret void +} + +define void @i24_ls(i24 zeroext %x) nounwind { + store i24 %x, i24* @i24_s + ret void +} + +define void @i25_ls(i25 zeroext %x) nounwind { + store i25 %x, i25* @i25_s + ret void +} + +define void @i26_ls(i26 zeroext %x) nounwind { + store i26 %x, i26* @i26_s + ret void +} + +define void @i27_ls(i27 zeroext %x) nounwind { + store i27 %x, i27* @i27_s + ret void +} + +define void @i28_ls(i28 zeroext %x) nounwind { + store i28 %x, i28* @i28_s + ret void +} + +define void @i29_ls(i29 zeroext %x) nounwind { + store i29 %x, i29* @i29_s + ret void +} + +define void @i30_ls(i30 zeroext %x) nounwind { + store i30 %x, i30* @i30_s + ret void +} + +define void @i31_ls(i31 zeroext %x) nounwind { + store i31 %x, i31* @i31_s + ret void +} + +define void @i32_ls(i32 zeroext %x) nounwind { + store i32 %x, i32* @i32_s + ret void +} + +define void @i33_ls(i33 zeroext %x) nounwind { + store i33 %x, i33* @i33_s + ret void +} + +define void @i34_ls(i34 zeroext %x) nounwind { + store i34 %x, i34* @i34_s + ret void +} + +define void @i35_ls(i35 zeroext %x) nounwind { + store i35 %x, i35* @i35_s + ret void +} + +define void @i36_ls(i36 zeroext %x) nounwind { + store i36 %x, i36* @i36_s + ret void +} + +define void @i37_ls(i37 zeroext %x) nounwind { + store i37 %x, i37* @i37_s + ret void +} + +define void @i38_ls(i38 zeroext %x) nounwind { + store i38 %x, i38* @i38_s + ret void +} + +define void @i39_ls(i39 zeroext %x) nounwind { + store i39 %x, i39* @i39_s + ret void +} + +define void @i40_ls(i40 zeroext %x) nounwind { + store i40 %x, i40* @i40_s + ret void +} + +define void @i41_ls(i41 zeroext %x) nounwind { + store i41 %x, i41* @i41_s + ret void +} + +define void @i42_ls(i42 zeroext %x) nounwind { + store i42 %x, i42* @i42_s + ret void +} + +define void @i43_ls(i43 zeroext %x) nounwind { + store i43 %x, i43* @i43_s + ret void +} + +define void @i44_ls(i44 zeroext %x) nounwind { + store i44 %x, i44* @i44_s + ret void +} + +define void @i45_ls(i45 zeroext %x) nounwind { + store i45 %x, i45* @i45_s + ret void +} + +define void @i46_ls(i46 zeroext %x) nounwind { + store i46 %x, i46* @i46_s + ret void +} + +define void @i47_ls(i47 zeroext %x) nounwind { + store i47 %x, i47* @i47_s + ret void +} + +define void @i48_ls(i48 zeroext %x) nounwind { + store i48 %x, i48* @i48_s + ret void +} + +define void @i49_ls(i49 zeroext %x) nounwind { + store i49 %x, i49* @i49_s + ret void +} + +define void @i50_ls(i50 zeroext %x) nounwind { + store i50 %x, i50* @i50_s + ret void +} + +define void @i51_ls(i51 zeroext %x) nounwind { + store i51 %x, i51* @i51_s + ret void +} + +define void @i52_ls(i52 zeroext %x) nounwind { + store i52 %x, i52* @i52_s + ret void +} + +define void @i53_ls(i53 zeroext %x) nounwind { + store i53 %x, i53* @i53_s + ret void +} + +define void @i54_ls(i54 zeroext %x) nounwind { + store i54 %x, i54* @i54_s + ret void +} + +define void @i55_ls(i55 zeroext %x) nounwind { + store i55 %x, i55* @i55_s + ret void +} + +define void @i56_ls(i56 zeroext %x) nounwind { + store i56 %x, i56* @i56_s + ret void +} + +define void @i57_ls(i57 zeroext %x) nounwind { + store i57 %x, i57* @i57_s + ret void +} + +define void @i58_ls(i58 zeroext %x) nounwind { + store i58 %x, i58* @i58_s + ret void +} + +define void @i59_ls(i59 zeroext %x) nounwind { + store i59 %x, i59* @i59_s + ret void +} + +define void @i60_ls(i60 zeroext %x) nounwind { + store i60 %x, i60* @i60_s + ret void +} + +define void @i61_ls(i61 zeroext %x) nounwind { + store i61 %x, i61* @i61_s + ret void +} + +define void @i62_ls(i62 zeroext %x) nounwind { + store i62 %x, i62* @i62_s + ret void +} + +define void @i63_ls(i63 zeroext %x) nounwind { + store i63 %x, i63* @i63_s + ret void +} + +define void @i64_ls(i64 zeroext %x) nounwind { + store i64 %x, i64* @i64_s + ret void +} + +define void @i65_ls(i65 zeroext %x) nounwind { + store i65 %x, i65* @i65_s + ret void +} + +define void @i66_ls(i66 zeroext %x) nounwind { + store i66 %x, i66* @i66_s + ret void +} + +define void @i67_ls(i67 zeroext %x) nounwind { + store i67 %x, i67* @i67_s + ret void +} + +define void @i68_ls(i68 zeroext %x) nounwind { + store i68 %x, i68* @i68_s + ret void +} + +define void @i69_ls(i69 zeroext %x) nounwind { + store i69 %x, i69* @i69_s + ret void +} + +define void @i70_ls(i70 zeroext %x) nounwind { + store i70 %x, i70* @i70_s + ret void +} + +define void @i71_ls(i71 zeroext %x) nounwind { + store i71 %x, i71* @i71_s + ret void +} + +define void @i72_ls(i72 zeroext %x) nounwind { + store i72 %x, i72* @i72_s + ret void +} + +define void @i73_ls(i73 zeroext %x) nounwind { + store i73 %x, i73* @i73_s + ret void +} + +define void @i74_ls(i74 zeroext %x) nounwind { + store i74 %x, i74* @i74_s + ret void +} + +define void @i75_ls(i75 zeroext %x) nounwind { + store i75 %x, i75* @i75_s + ret void +} + +define void @i76_ls(i76 zeroext %x) nounwind { + store i76 %x, i76* @i76_s + ret void +} + +define void @i77_ls(i77 zeroext %x) nounwind { + store i77 %x, i77* @i77_s + ret void +} + +define void @i78_ls(i78 zeroext %x) nounwind { + store i78 %x, i78* @i78_s + ret void +} + +define void @i79_ls(i79 zeroext %x) nounwind { + store i79 %x, i79* @i79_s + ret void +} + +define void @i80_ls(i80 zeroext %x) nounwind { + store i80 %x, i80* @i80_s + ret void +} + +define void @i81_ls(i81 zeroext %x) nounwind { + store i81 %x, i81* @i81_s + ret void +} + +define void @i82_ls(i82 zeroext %x) nounwind { + store i82 %x, i82* @i82_s + ret void +} + +define void @i83_ls(i83 zeroext %x) nounwind { + store i83 %x, i83* @i83_s + ret void +} + +define void @i84_ls(i84 zeroext %x) nounwind { + store i84 %x, i84* @i84_s + ret void +} + +define void @i85_ls(i85 zeroext %x) nounwind { + store i85 %x, i85* @i85_s + ret void +} + +define void @i86_ls(i86 zeroext %x) nounwind { + store i86 %x, i86* @i86_s + ret void +} + +define void @i87_ls(i87 zeroext %x) nounwind { + store i87 %x, i87* @i87_s + ret void +} + +define void @i88_ls(i88 zeroext %x) nounwind { + store i88 %x, i88* @i88_s + ret void +} + +define void @i89_ls(i89 zeroext %x) nounwind { + store i89 %x, i89* @i89_s + ret void +} + +define void @i90_ls(i90 zeroext %x) nounwind { + store i90 %x, i90* @i90_s + ret void +} + +define void @i91_ls(i91 zeroext %x) nounwind { + store i91 %x, i91* @i91_s + ret void +} + +define void @i92_ls(i92 zeroext %x) nounwind { + store i92 %x, i92* @i92_s + ret void +} + +define void @i93_ls(i93 zeroext %x) nounwind { + store i93 %x, i93* @i93_s + ret void +} + +define void @i94_ls(i94 zeroext %x) nounwind { + store i94 %x, i94* @i94_s + ret void +} + +define void @i95_ls(i95 zeroext %x) nounwind { + store i95 %x, i95* @i95_s + ret void +} + +define void @i96_ls(i96 zeroext %x) nounwind { + store i96 %x, i96* @i96_s + ret void +} + +define void @i97_ls(i97 zeroext %x) nounwind { + store i97 %x, i97* @i97_s + ret void +} + +define void @i98_ls(i98 zeroext %x) nounwind { + store i98 %x, i98* @i98_s + ret void +} + +define void @i99_ls(i99 zeroext %x) nounwind { + store i99 %x, i99* @i99_s + ret void +} + +define void @i100_ls(i100 zeroext %x) nounwind { + store i100 %x, i100* @i100_s + ret void +} + +define void @i101_ls(i101 zeroext %x) nounwind { + store i101 %x, i101* @i101_s + ret void +} + +define void @i102_ls(i102 zeroext %x) nounwind { + store i102 %x, i102* @i102_s + ret void +} + +define void @i103_ls(i103 zeroext %x) nounwind { + store i103 %x, i103* @i103_s + ret void +} + +define void @i104_ls(i104 zeroext %x) nounwind { + store i104 %x, i104* @i104_s + ret void +} + +define void @i105_ls(i105 zeroext %x) nounwind { + store i105 %x, i105* @i105_s + ret void +} + +define void @i106_ls(i106 zeroext %x) nounwind { + store i106 %x, i106* @i106_s + ret void +} + +define void @i107_ls(i107 zeroext %x) nounwind { + store i107 %x, i107* @i107_s + ret void +} + +define void @i108_ls(i108 zeroext %x) nounwind { + store i108 %x, i108* @i108_s + ret void +} + +define void @i109_ls(i109 zeroext %x) nounwind { + store i109 %x, i109* @i109_s + ret void +} + +define void @i110_ls(i110 zeroext %x) nounwind { + store i110 %x, i110* @i110_s + ret void +} + +define void @i111_ls(i111 zeroext %x) nounwind { + store i111 %x, i111* @i111_s + ret void +} + +define void @i112_ls(i112 zeroext %x) nounwind { + store i112 %x, i112* @i112_s + ret void +} + +define void @i113_ls(i113 zeroext %x) nounwind { + store i113 %x, i113* @i113_s + ret void +} + +define void @i114_ls(i114 zeroext %x) nounwind { + store i114 %x, i114* @i114_s + ret void +} + +define void @i115_ls(i115 zeroext %x) nounwind { + store i115 %x, i115* @i115_s + ret void +} + +define void @i116_ls(i116 zeroext %x) nounwind { + store i116 %x, i116* @i116_s + ret void +} + +define void @i117_ls(i117 zeroext %x) nounwind { + store i117 %x, i117* @i117_s + ret void +} + +define void @i118_ls(i118 zeroext %x) nounwind { + store i118 %x, i118* @i118_s + ret void +} + +define void @i119_ls(i119 zeroext %x) nounwind { + store i119 %x, i119* @i119_s + ret void +} + +define void @i120_ls(i120 zeroext %x) nounwind { + store i120 %x, i120* @i120_s + ret void +} + +define void @i121_ls(i121 zeroext %x) nounwind { + store i121 %x, i121* @i121_s + ret void +} + +define void @i122_ls(i122 zeroext %x) nounwind { + store i122 %x, i122* @i122_s + ret void +} + +define void @i123_ls(i123 zeroext %x) nounwind { + store i123 %x, i123* @i123_s + ret void +} + +define void @i124_ls(i124 zeroext %x) nounwind { + store i124 %x, i124* @i124_s + ret void +} + +define void @i125_ls(i125 zeroext %x) nounwind { + store i125 %x, i125* @i125_s + ret void +} + +define void @i126_ls(i126 zeroext %x) nounwind { + store i126 %x, i126* @i126_s + ret void +} + +define void @i127_ls(i127 zeroext %x) nounwind { + store i127 %x, i127* @i127_s + ret void +} + +define void @i128_ls(i128 zeroext %x) nounwind { + store i128 %x, i128* @i128_s + ret void +} + +define void @i129_ls(i129 zeroext %x) nounwind { + store i129 %x, i129* @i129_s + ret void +} + +define void @i130_ls(i130 zeroext %x) nounwind { + store i130 %x, i130* @i130_s + ret void +} + +define void @i131_ls(i131 zeroext %x) nounwind { + store i131 %x, i131* @i131_s + ret void +} + +define void @i132_ls(i132 zeroext %x) nounwind { + store i132 %x, i132* @i132_s + ret void +} + +define void @i133_ls(i133 zeroext %x) nounwind { + store i133 %x, i133* @i133_s + ret void +} + +define void @i134_ls(i134 zeroext %x) nounwind { + store i134 %x, i134* @i134_s + ret void +} + +define void @i135_ls(i135 zeroext %x) nounwind { + store i135 %x, i135* @i135_s + ret void +} + +define void @i136_ls(i136 zeroext %x) nounwind { + store i136 %x, i136* @i136_s + ret void +} + +define void @i137_ls(i137 zeroext %x) nounwind { + store i137 %x, i137* @i137_s + ret void +} + +define void @i138_ls(i138 zeroext %x) nounwind { + store i138 %x, i138* @i138_s + ret void +} + +define void @i139_ls(i139 zeroext %x) nounwind { + store i139 %x, i139* @i139_s + ret void +} + +define void @i140_ls(i140 zeroext %x) nounwind { + store i140 %x, i140* @i140_s + ret void +} + +define void @i141_ls(i141 zeroext %x) nounwind { + store i141 %x, i141* @i141_s + ret void +} + +define void @i142_ls(i142 zeroext %x) nounwind { + store i142 %x, i142* @i142_s + ret void +} + +define void @i143_ls(i143 zeroext %x) nounwind { + store i143 %x, i143* @i143_s + ret void +} + +define void @i144_ls(i144 zeroext %x) nounwind { + store i144 %x, i144* @i144_s + ret void +} + +define void @i145_ls(i145 zeroext %x) nounwind { + store i145 %x, i145* @i145_s + ret void +} + +define void @i146_ls(i146 zeroext %x) nounwind { + store i146 %x, i146* @i146_s + ret void +} + +define void @i147_ls(i147 zeroext %x) nounwind { + store i147 %x, i147* @i147_s + ret void +} + +define void @i148_ls(i148 zeroext %x) nounwind { + store i148 %x, i148* @i148_s + ret void +} + +define void @i149_ls(i149 zeroext %x) nounwind { + store i149 %x, i149* @i149_s + ret void +} + +define void @i150_ls(i150 zeroext %x) nounwind { + store i150 %x, i150* @i150_s + ret void +} + +define void @i151_ls(i151 zeroext %x) nounwind { + store i151 %x, i151* @i151_s + ret void +} + +define void @i152_ls(i152 zeroext %x) nounwind { + store i152 %x, i152* @i152_s + ret void +} + +define void @i153_ls(i153 zeroext %x) nounwind { + store i153 %x, i153* @i153_s + ret void +} + +define void @i154_ls(i154 zeroext %x) nounwind { + store i154 %x, i154* @i154_s + ret void +} + +define void @i155_ls(i155 zeroext %x) nounwind { + store i155 %x, i155* @i155_s + ret void +} + +define void @i156_ls(i156 zeroext %x) nounwind { + store i156 %x, i156* @i156_s + ret void +} + +define void @i157_ls(i157 zeroext %x) nounwind { + store i157 %x, i157* @i157_s + ret void +} + +define void @i158_ls(i158 zeroext %x) nounwind { + store i158 %x, i158* @i158_s + ret void +} + +define void @i159_ls(i159 zeroext %x) nounwind { + store i159 %x, i159* @i159_s + ret void +} + +define void @i160_ls(i160 zeroext %x) nounwind { + store i160 %x, i160* @i160_s + ret void +} + +define void @i161_ls(i161 zeroext %x) nounwind { + store i161 %x, i161* @i161_s + ret void +} + +define void @i162_ls(i162 zeroext %x) nounwind { + store i162 %x, i162* @i162_s + ret void +} + +define void @i163_ls(i163 zeroext %x) nounwind { + store i163 %x, i163* @i163_s + ret void +} + +define void @i164_ls(i164 zeroext %x) nounwind { + store i164 %x, i164* @i164_s + ret void +} + +define void @i165_ls(i165 zeroext %x) nounwind { + store i165 %x, i165* @i165_s + ret void +} + +define void @i166_ls(i166 zeroext %x) nounwind { + store i166 %x, i166* @i166_s + ret void +} + +define void @i167_ls(i167 zeroext %x) nounwind { + store i167 %x, i167* @i167_s + ret void +} + +define void @i168_ls(i168 zeroext %x) nounwind { + store i168 %x, i168* @i168_s + ret void +} + +define void @i169_ls(i169 zeroext %x) nounwind { + store i169 %x, i169* @i169_s + ret void +} + +define void @i170_ls(i170 zeroext %x) nounwind { + store i170 %x, i170* @i170_s + ret void +} + +define void @i171_ls(i171 zeroext %x) nounwind { + store i171 %x, i171* @i171_s + ret void +} + +define void @i172_ls(i172 zeroext %x) nounwind { + store i172 %x, i172* @i172_s + ret void +} + +define void @i173_ls(i173 zeroext %x) nounwind { + store i173 %x, i173* @i173_s + ret void +} + +define void @i174_ls(i174 zeroext %x) nounwind { + store i174 %x, i174* @i174_s + ret void +} + +define void @i175_ls(i175 zeroext %x) nounwind { + store i175 %x, i175* @i175_s + ret void +} + +define void @i176_ls(i176 zeroext %x) nounwind { + store i176 %x, i176* @i176_s + ret void +} + +define void @i177_ls(i177 zeroext %x) nounwind { + store i177 %x, i177* @i177_s + ret void +} + +define void @i178_ls(i178 zeroext %x) nounwind { + store i178 %x, i178* @i178_s + ret void +} + +define void @i179_ls(i179 zeroext %x) nounwind { + store i179 %x, i179* @i179_s + ret void +} + +define void @i180_ls(i180 zeroext %x) nounwind { + store i180 %x, i180* @i180_s + ret void +} + +define void @i181_ls(i181 zeroext %x) nounwind { + store i181 %x, i181* @i181_s + ret void +} + +define void @i182_ls(i182 zeroext %x) nounwind { + store i182 %x, i182* @i182_s + ret void +} + +define void @i183_ls(i183 zeroext %x) nounwind { + store i183 %x, i183* @i183_s + ret void +} + +define void @i184_ls(i184 zeroext %x) nounwind { + store i184 %x, i184* @i184_s + ret void +} + +define void @i185_ls(i185 zeroext %x) nounwind { + store i185 %x, i185* @i185_s + ret void +} + +define void @i186_ls(i186 zeroext %x) nounwind { + store i186 %x, i186* @i186_s + ret void +} + +define void @i187_ls(i187 zeroext %x) nounwind { + store i187 %x, i187* @i187_s + ret void +} + +define void @i188_ls(i188 zeroext %x) nounwind { + store i188 %x, i188* @i188_s + ret void +} + +define void @i189_ls(i189 zeroext %x) nounwind { + store i189 %x, i189* @i189_s + ret void +} + +define void @i190_ls(i190 zeroext %x) nounwind { + store i190 %x, i190* @i190_s + ret void +} + +define void @i191_ls(i191 zeroext %x) nounwind { + store i191 %x, i191* @i191_s + ret void +} + +define void @i192_ls(i192 zeroext %x) nounwind { + store i192 %x, i192* @i192_s + ret void +} + +define void @i193_ls(i193 zeroext %x) nounwind { + store i193 %x, i193* @i193_s + ret void +} + +define void @i194_ls(i194 zeroext %x) nounwind { + store i194 %x, i194* @i194_s + ret void +} + +define void @i195_ls(i195 zeroext %x) nounwind { + store i195 %x, i195* @i195_s + ret void +} + +define void @i196_ls(i196 zeroext %x) nounwind { + store i196 %x, i196* @i196_s + ret void +} + +define void @i197_ls(i197 zeroext %x) nounwind { + store i197 %x, i197* @i197_s + ret void +} + +define void @i198_ls(i198 zeroext %x) nounwind { + store i198 %x, i198* @i198_s + ret void +} + +define void @i199_ls(i199 zeroext %x) nounwind { + store i199 %x, i199* @i199_s + ret void +} + +define void @i200_ls(i200 zeroext %x) nounwind { + store i200 %x, i200* @i200_s + ret void +} + +define void @i201_ls(i201 zeroext %x) nounwind { + store i201 %x, i201* @i201_s + ret void +} + +define void @i202_ls(i202 zeroext %x) nounwind { + store i202 %x, i202* @i202_s + ret void +} + +define void @i203_ls(i203 zeroext %x) nounwind { + store i203 %x, i203* @i203_s + ret void +} + +define void @i204_ls(i204 zeroext %x) nounwind { + store i204 %x, i204* @i204_s + ret void +} + +define void @i205_ls(i205 zeroext %x) nounwind { + store i205 %x, i205* @i205_s + ret void +} + +define void @i206_ls(i206 zeroext %x) nounwind { + store i206 %x, i206* @i206_s + ret void +} + +define void @i207_ls(i207 zeroext %x) nounwind { + store i207 %x, i207* @i207_s + ret void +} + +define void @i208_ls(i208 zeroext %x) nounwind { + store i208 %x, i208* @i208_s + ret void +} + +define void @i209_ls(i209 zeroext %x) nounwind { + store i209 %x, i209* @i209_s + ret void +} + +define void @i210_ls(i210 zeroext %x) nounwind { + store i210 %x, i210* @i210_s + ret void +} + +define void @i211_ls(i211 zeroext %x) nounwind { + store i211 %x, i211* @i211_s + ret void +} + +define void @i212_ls(i212 zeroext %x) nounwind { + store i212 %x, i212* @i212_s + ret void +} + +define void @i213_ls(i213 zeroext %x) nounwind { + store i213 %x, i213* @i213_s + ret void +} + +define void @i214_ls(i214 zeroext %x) nounwind { + store i214 %x, i214* @i214_s + ret void +} + +define void @i215_ls(i215 zeroext %x) nounwind { + store i215 %x, i215* @i215_s + ret void +} + +define void @i216_ls(i216 zeroext %x) nounwind { + store i216 %x, i216* @i216_s + ret void +} + +define void @i217_ls(i217 zeroext %x) nounwind { + store i217 %x, i217* @i217_s + ret void +} + +define void @i218_ls(i218 zeroext %x) nounwind { + store i218 %x, i218* @i218_s + ret void +} + +define void @i219_ls(i219 zeroext %x) nounwind { + store i219 %x, i219* @i219_s + ret void +} + +define void @i220_ls(i220 zeroext %x) nounwind { + store i220 %x, i220* @i220_s + ret void +} + +define void @i221_ls(i221 zeroext %x) nounwind { + store i221 %x, i221* @i221_s + ret void +} + +define void @i222_ls(i222 zeroext %x) nounwind { + store i222 %x, i222* @i222_s + ret void +} + +define void @i223_ls(i223 zeroext %x) nounwind { + store i223 %x, i223* @i223_s + ret void +} + +define void @i224_ls(i224 zeroext %x) nounwind { + store i224 %x, i224* @i224_s + ret void +} + +define void @i225_ls(i225 zeroext %x) nounwind { + store i225 %x, i225* @i225_s + ret void +} + +define void @i226_ls(i226 zeroext %x) nounwind { + store i226 %x, i226* @i226_s + ret void +} + +define void @i227_ls(i227 zeroext %x) nounwind { + store i227 %x, i227* @i227_s + ret void +} + +define void @i228_ls(i228 zeroext %x) nounwind { + store i228 %x, i228* @i228_s + ret void +} + +define void @i229_ls(i229 zeroext %x) nounwind { + store i229 %x, i229* @i229_s + ret void +} + +define void @i230_ls(i230 zeroext %x) nounwind { + store i230 %x, i230* @i230_s + ret void +} + +define void @i231_ls(i231 zeroext %x) nounwind { + store i231 %x, i231* @i231_s + ret void +} + +define void @i232_ls(i232 zeroext %x) nounwind { + store i232 %x, i232* @i232_s + ret void +} + +define void @i233_ls(i233 zeroext %x) nounwind { + store i233 %x, i233* @i233_s + ret void +} + +define void @i234_ls(i234 zeroext %x) nounwind { + store i234 %x, i234* @i234_s + ret void +} + +define void @i235_ls(i235 zeroext %x) nounwind { + store i235 %x, i235* @i235_s + ret void +} + +define void @i236_ls(i236 zeroext %x) nounwind { + store i236 %x, i236* @i236_s + ret void +} + +define void @i237_ls(i237 zeroext %x) nounwind { + store i237 %x, i237* @i237_s + ret void +} + +define void @i238_ls(i238 zeroext %x) nounwind { + store i238 %x, i238* @i238_s + ret void +} + +define void @i239_ls(i239 zeroext %x) nounwind { + store i239 %x, i239* @i239_s + ret void +} + +define void @i240_ls(i240 zeroext %x) nounwind { + store i240 %x, i240* @i240_s + ret void +} + +define void @i241_ls(i241 zeroext %x) nounwind { + store i241 %x, i241* @i241_s + ret void +} + +define void @i242_ls(i242 zeroext %x) nounwind { + store i242 %x, i242* @i242_s + ret void +} + +define void @i243_ls(i243 zeroext %x) nounwind { + store i243 %x, i243* @i243_s + ret void +} + +define void @i244_ls(i244 zeroext %x) nounwind { + store i244 %x, i244* @i244_s + ret void +} + +define void @i245_ls(i245 zeroext %x) nounwind { + store i245 %x, i245* @i245_s + ret void +} + +define void @i246_ls(i246 zeroext %x) nounwind { + store i246 %x, i246* @i246_s + ret void +} + +define void @i247_ls(i247 zeroext %x) nounwind { + store i247 %x, i247* @i247_s + ret void +} + +define void @i248_ls(i248 zeroext %x) nounwind { + store i248 %x, i248* @i248_s + ret void +} + +define void @i249_ls(i249 zeroext %x) nounwind { + store i249 %x, i249* @i249_s + ret void +} + +define void @i250_ls(i250 zeroext %x) nounwind { + store i250 %x, i250* @i250_s + ret void +} + +define void @i251_ls(i251 zeroext %x) nounwind { + store i251 %x, i251* @i251_s + ret void +} + +define void @i252_ls(i252 zeroext %x) nounwind { + store i252 %x, i252* @i252_s + ret void +} + +define void @i253_ls(i253 zeroext %x) nounwind { + store i253 %x, i253* @i253_s + ret void +} + +define void @i254_ls(i254 zeroext %x) nounwind { + store i254 %x, i254* @i254_s + ret void +} + +define void @i255_ls(i255 zeroext %x) nounwind { + store i255 %x, i255* @i255_s + ret void +} + +define void @i256_ls(i256 zeroext %x) nounwind { + store i256 %x, i256* @i256_s + ret void +} From gohman at apple.com Wed Jul 16 11:03:31 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Jul 2008 16:03:31 -0000 Subject: [llvm-commits] [llvm] r53685 - /llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h Message-ID: <200807161603.m6GG3VU4004998@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 16 11:03:31 2008 New Revision: 53685 URL: http://llvm.org/viewvc/llvm-project?rev=53685&view=rev Log: Correct a top-level comment. Modified: llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h Modified: llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h?rev=53685&r1=53684&r2=53685&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h Wed Jul 16 11:03:31 2008 @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file implements bottom-up inlining of functions into callees. +// This file implements heuristics for inlining decisions. // //===----------------------------------------------------------------------===// From gohman at apple.com Wed Jul 16 11:04:07 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Jul 2008 16:04:07 -0000 Subject: [llvm-commits] [llvm] r53686 - /llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h Message-ID: <200807161604.m6GG47Bm005034@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 16 11:04:07 2008 New Revision: 53686 URL: http://llvm.org/viewvc/llvm-project?rev=53686&view=rev Log: Fix the name of BreakCriticalMachineEdge.h's include guard Modified: llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h Modified: llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h?rev=53686&r1=53685&r2=53686&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h (original) +++ llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h Wed Jul 16 11:04:07 2008 @@ -11,8 +11,8 @@ // //===---------------------------------------------------------------------===// -#ifndef LLVM_CODEGEN_ASMPRINTER_H -#define LLVM_CODEGEN_ASMPRINTER_H +#ifndef LLVM_CODEGEN_BREAKCRITICALMACHINEEDGES_H +#define LLVM_CODEGEN_BREAKCRITICALMACHINEEDGES_H #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/Target/TargetInstrInfo.h" From gohman at apple.com Wed Jul 16 11:13:59 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Jul 2008 16:13:59 -0000 Subject: [llvm-commits] [llvm] r53687 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200807161613.m6GGDxbj005686@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 16 11:13:58 2008 New Revision: 53687 URL: http://llvm.org/viewvc/llvm-project?rev=53687&view=rev Log: Fix the result type of a VECTOR_SHUFFLE+BIT_CONVERT dagcombine. This was turned up by some new SelectionDAG assertion checks that I'm working on. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=53687&r1=53686&r2=53687&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Jul 16 11:13:58 2008 @@ -5070,9 +5070,8 @@ &IdxOps[0], IdxOps.size())); SDOperand Result = DAG.getNode(ISD::VECTOR_SHUFFLE, VT, &Ops[0], Ops.size()); - if (VT != LHS.getValueType()) { - Result = DAG.getNode(ISD::BIT_CONVERT, LHS.getValueType(), Result); - } + if (VT != N->getValueType(0)) + Result = DAG.getNode(ISD::BIT_CONVERT, N->getValueType(0), Result); return Result; } } From gohman at apple.com Wed Jul 16 11:20:48 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Jul 2008 16:20:48 -0000 Subject: [llvm-commits] [llvm] r53688 - /llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200807161620.m6GGKnrX006029@zion.cs.uiuc.edu> Author: djg Date: Wed Jul 16 11:20:48 2008 New Revision: 53688 URL: http://llvm.org/viewvc/llvm-project?rev=53688&view=rev Log: Fix the result type of X86's truncate to i8. Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=53688&r1=53687&r2=53688&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Jul 16 11:20:48 2008 @@ -1120,19 +1120,17 @@ // Ensure that the source register has an 8-bit subreg on 32-bit targets if (!Subtarget->is64Bit()) { unsigned Opc; - MVT VT; - switch (N0.getValueType().getSimpleVT()) { + MVT N0VT = N0.getValueType(); + switch (N0VT.getSimpleVT()) { default: assert(0 && "Unknown truncate!"); case MVT::i16: Opc = X86::MOV16to16_; - VT = MVT::i16; break; case MVT::i32: Opc = X86::MOV32to32_; - VT = MVT::i32; break; } - N0 = SDOperand(CurDAG->getTargetNode(Opc, VT, MVT::Flag, N0), 0); + N0 = SDOperand(CurDAG->getTargetNode(Opc, N0VT, MVT::Flag, N0), 0); return CurDAG->getTargetNode(X86::EXTRACT_SUBREG, VT, N0, SRIdx, N0.getValue(1)); } From baldrick at free.fr Wed Jul 16 12:17:00 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 19:17:00 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> <200807152300.27489.baldrick@free.fr> Message-ID: <200807161917.00908.baldrick@free.fr> Hi, > > thanks for the explanation. However llvm-gcc already supports > > variable byte-offsets, i.e. where the value of the byte offset > > depends on the value of some variable, the content of a memory > > location etc. Ada does this for example. So why does ObjC2 > > need something special here? > > Presumably the ObjC FE trees do not look like the Ada trees. > I don't know what the Ada trees look like. > In ObjC, the offset is actually there twice in the tree in effect , > and the user > needs to compensate at some stage. Don't ask me why, I didn't write > it:) how does it manage to work in mainline? Ciao, Duncan. From scottm at aero.org Wed Jul 16 12:17:31 2008 From: scottm at aero.org (Scott Michel) Date: Wed, 16 Jul 2008 17:17:31 -0000 Subject: [llvm-commits] [llvm] r53689 - /llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Message-ID: <200807161717.m6GHHV1j008244@zion.cs.uiuc.edu> Author: pingbak Date: Wed Jul 16 12:17:29 2008 New Revision: 53689 URL: http://llvm.org/viewvc/llvm-project?rev=53689&view=rev Log: Somehow, custom lowering of i64 multiplications got dropped along the way. Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=53689&r1=53688&r2=53689&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Wed Jul 16 12:17:29 2008 @@ -42,7 +42,7 @@ const MVT valtype; const int prefslot_byte; }; - + const valtype_map_s valtype_map[] = { { MVT::i1, 3 }, { MVT::i8, 3 }, @@ -120,7 +120,7 @@ // Use _setjmp/_longjmp instead of setjmp/longjmp. setUseUnderscoreSetJmp(true); setUseUnderscoreLongJmp(true); - + // Set up the SPU's register classes: addRegisterClass(MVT::i8, SPU::R8CRegisterClass); addRegisterClass(MVT::i16, SPU::R16CRegisterClass); @@ -129,7 +129,7 @@ addRegisterClass(MVT::f32, SPU::R32FPRegisterClass); addRegisterClass(MVT::f64, SPU::R64FPRegisterClass); addRegisterClass(MVT::i128, SPU::GPRCRegisterClass); - + // SPU has no sign or zero extended loads for i1, i8, i16: setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote); setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote); @@ -148,7 +148,7 @@ setTruncStoreAction(MVT::i32 , MVT::i8, Custom); setTruncStoreAction(MVT::i64 , MVT::i8, Custom); setTruncStoreAction(MVT::i128, MVT::i8, Custom); - + setLoadXAction(ISD::EXTLOAD, MVT::i16, Custom); setLoadXAction(ISD::SEXTLOAD, MVT::i16, Custom); setLoadXAction(ISD::ZEXTLOAD, MVT::i16, Custom); @@ -174,7 +174,7 @@ // Expand the jumptable branches setOperationAction(ISD::BR_JT, MVT::Other, Expand); setOperationAction(ISD::BR_CC, MVT::Other, Expand); - setOperationAction(ISD::SELECT_CC, MVT::Other, Expand); + setOperationAction(ISD::SELECT_CC, MVT::Other, Expand); // SPU has no intrinsics for these particular operations: setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand); @@ -184,7 +184,7 @@ setOperationAction(ISD::UREM, MVT::i32, Expand); setOperationAction(ISD::SREM, MVT::i64, Expand); setOperationAction(ISD::UREM, MVT::i64, Expand); - + // We don't support sin/cos/sqrt/fmod setOperationAction(ISD::FSIN , MVT::f64, Expand); setOperationAction(ISD::FCOS , MVT::f64, Expand); @@ -192,11 +192,11 @@ setOperationAction(ISD::FSIN , MVT::f32, Expand); setOperationAction(ISD::FCOS , MVT::f32, Expand); setOperationAction(ISD::FREM , MVT::f32, Expand); - + // If we're enabling GP optimizations, use hardware square root setOperationAction(ISD::FSQRT, MVT::f64, Expand); setOperationAction(ISD::FSQRT, MVT::f32, Expand); - + setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand); setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand); @@ -217,15 +217,16 @@ setOperationAction(ISD::SRL, MVT::i64, Custom); setOperationAction(ISD::SRA, MVT::i64, Custom); - // Custom lower i32 multiplications + // Custom lower i8, i32 and i64 multiplications + setOperationAction(ISD::MUL, MVT::i8, Custom); setOperationAction(ISD::MUL, MVT::i32, Custom); + setOperationAction(ISD::MUL, MVT::i64, Custom); // Need to custom handle (some) common i8, i64 math ops setOperationAction(ISD::ADD, MVT::i64, Custom); setOperationAction(ISD::SUB, MVT::i8, Custom); setOperationAction(ISD::SUB, MVT::i64, Custom); - setOperationAction(ISD::MUL, MVT::i8, Custom); - + // SPU does not have BSWAP. It does have i32 support CTLZ. // CTPOP has to be custom lowered. setOperationAction(ISD::BSWAP, MVT::i32, Expand); @@ -240,7 +241,7 @@ setOperationAction(ISD::CTTZ , MVT::i64, Expand); setOperationAction(ISD::CTLZ , MVT::i32, Legal); - + // SPU has a version of select that implements (a&~c)|(b&c), just like // select ought to work: setOperationAction(ISD::SELECT, MVT::i1, Promote); @@ -260,7 +261,7 @@ setOperationAction(ISD::ZERO_EXTEND, MVT::i64, Custom); setOperationAction(ISD::SIGN_EXTEND, MVT::i64, Custom); setOperationAction(ISD::ANY_EXTEND, MVT::i64, Custom); - + // SPU has a legal FP -> signed INT instruction setOperationAction(ISD::FP_TO_SINT, MVT::i32, Legal); setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom); @@ -288,12 +289,12 @@ // We cannot sextinreg(i1). Expand to shifts. setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); - + // Support label based line numbers. setOperationAction(ISD::DBG_STOPPOINT, MVT::Other, Expand); setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); - - // We want to legalize GlobalAddress and ConstantPool nodes into the + + // We want to legalize GlobalAddress and ConstantPool nodes into the // appropriate instructions to materialize the address. for (unsigned sctype = (unsigned) MVT::i1; sctype < (unsigned) MVT::f128; ++sctype) { @@ -306,15 +307,15 @@ // RET must be custom lowered, to meet ABI requirements setOperationAction(ISD::RET, MVT::Other, Custom); - + // VASTART needs to be custom lowered to use the VarArgsFrameIndex setOperationAction(ISD::VASTART , MVT::Other, Custom); - + // Use the default implementation. setOperationAction(ISD::VAARG , MVT::Other, Expand); setOperationAction(ISD::VACOPY , MVT::Other, Expand); setOperationAction(ISD::VAEND , MVT::Other, Expand); - setOperationAction(ISD::STACKSAVE , MVT::Other, Expand); + setOperationAction(ISD::STACKSAVE , MVT::Other, Expand); setOperationAction(ISD::STACKRESTORE , MVT::Other, Expand); setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32 , Expand); setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64 , Expand); @@ -322,7 +323,7 @@ // Cell SPU has instructions for converting between i64 and fp. setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom); setOperationAction(ISD::SINT_TO_FP, MVT::i64, Custom); - + // To take advantage of the above i64 FP_TO_SINT, promote i32 FP_TO_UINT setOperationAction(ISD::FP_TO_UINT, MVT::i32, Promote); @@ -354,7 +355,7 @@ setOperationAction(ISD::LOAD , VT, Legal); setOperationAction(ISD::SELECT, VT, Legal); setOperationAction(ISD::STORE, VT, Legal); - + // These operations need to be expanded: setOperationAction(ISD::SDIV, VT, Expand); setOperationAction(ISD::SREM, VT, Expand); @@ -380,15 +381,15 @@ setShiftAmountType(MVT::i32); setSetCCResultContents(ZeroOrOneSetCCResult); - + setStackPointerRegisterToSaveRestore(SPU::R1); - + // We have target-specific dag combine patterns for the following nodes: setTargetDAGCombine(ISD::ADD); setTargetDAGCombine(ISD::ZERO_EXTEND); setTargetDAGCombine(ISD::SIGN_EXTEND); setTargetDAGCombine(ISD::ANY_EXTEND); - + computeRegisterProperties(); } @@ -618,7 +619,7 @@ if (VT == OpVT || ExtType == ISD::EXTLOAD) { SDVTList scalarvts; MVT vecVT = MVT::v16i8; - + // Convert the loaded v16i8 vector to the appropriate vector type // specified by the operand: if (OpVT == VT) { @@ -698,7 +699,7 @@ // The vector type we really want to load from the 16-byte chunk, except // in the case of MVT::i1, which has to be v16i8. MVT vecVT, stVecVT = MVT::v16i8; - + if (StVT != MVT::i1) stVecVT = MVT::getVectorVT(StVT, (128 / StVT.getSizeInBits())); vecVT = MVT::getVectorVT(VT, (128 / VT.getSizeInBits())); @@ -721,7 +722,7 @@ || theValue.getOpcode() == ISD::AssertSext)) { // Drill down and get the value for zero- and sign-extended // quantities - theValue = theValue.getOperand(0); + theValue = theValue.getOperand(0); } chunk_offset &= 0xf; @@ -831,7 +832,7 @@ SDOperand GA = DAG.getTargetGlobalAddress(GV, PtrVT, GSDN->getOffset()); const TargetMachine &TM = DAG.getTarget(); SDOperand Zero = DAG.getConstant(0, PtrVT); - + if (TM.getRelocationModel() == Reloc::Static) { if (!ST->usingLargeMem()) { return DAG.getNode(SPUISD::AFormAddr, PtrVT, GA, Zero); @@ -923,13 +924,13 @@ const unsigned *ArgRegs = SPURegisterInfo::getArgRegs(); const unsigned NumArgRegs = SPURegisterInfo::getNumArgRegs(); - + unsigned ArgOffset = SPUFrameInfo::minStackSize(); unsigned ArgRegIdx = 0; unsigned StackSlotSize = SPUFrameInfo::stackSlotSize(); - + MVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); - + // Add DAG nodes to load the arguments or copy them out of registers. for (unsigned ArgNo = 0, e = Op.Val->getNumValues()-1; ArgNo != e; ++ArgNo) { SDOperand ArgVal; @@ -1020,7 +1021,7 @@ } break; } - + // We need to load the argument to a virtual register if we determined above // that we ran out of physical registers of the appropriate type if (needsLoad) { @@ -1029,10 +1030,10 @@ ArgVal = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0); ArgOffset += StackSlotSize; } - + ArgValues.push_back(ArgVal); } - + // If the function takes variable number of arguments, make a frame index for // the start of the first vararg value... for expansion of llvm.va_start. if (isVarArg) { @@ -1056,9 +1057,9 @@ if (!MemOps.empty()) Root = DAG.getNode(ISD::TokenFactor, MVT::Other,&MemOps[0],MemOps.size()); } - + ArgValues.push_back(Root); - + // Return the new list of results. return DAG.getMergeValues(Op.Val->getVTList(), &ArgValues[0], ArgValues.size()); @@ -1069,12 +1070,12 @@ static SDNode *isLSAAddress(SDOperand Op, SelectionDAG &DAG) { ConstantSDNode *C = dyn_cast(Op); if (!C) return 0; - + int Addr = C->getValue(); if ((Addr & 3) != 0 || // Low 2 bits are implicitly zero. (Addr << 14 >> 14) != Addr) return 0; // Top 14 bits have to be sext of immediate. - + return DAG.getConstant((int)C->getValue() >> 2, MVT::i32).Val; } @@ -1094,17 +1095,17 @@ // Handy pointer type MVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); - + // Accumulate how many bytes are to be pushed on the stack, including the // linkage area, and parameter passing area. According to the SPU ABI, // we minimally need space for [LR] and [SP] unsigned NumStackBytes = SPUFrameInfo::minStackSize(); - + // Set up a copy of the stack pointer for use loading and storing any // arguments that may not fit in the registers available for argument // passing. SDOperand StackPtr = DAG.getRegister(SPU::R1, MVT::i32); - + // Figure out which arguments are going to go in registers, and which in // memory. unsigned ArgOffset = SPUFrameInfo::minStackSize(); // Just below [LR] @@ -1117,7 +1118,7 @@ for (unsigned i = 0; i != NumOps; ++i) { SDOperand Arg = Op.getOperand(5+2*i); - + // PtrOff will be used to store the current argument to the stack if a // register cannot be found for it. SDOperand PtrOff = DAG.getConstant(ArgOffset, StackPtr.getValueType()); @@ -1167,7 +1168,7 @@ Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &MemOpChains[0], MemOpChains.size()); } - + // Build a sequence of copy-to-reg nodes chained together with token chain // and flag operands which copy the outgoing args into the appropriate regs. SDOperand InFlag; @@ -1176,10 +1177,10 @@ InFlag); InFlag = Chain.getValue(1); } - + SmallVector Ops; unsigned CallOpc = SPUISD::CALL; - + // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol // node so that legalize doesn't hack it. @@ -1218,13 +1219,13 @@ Ops.push_back(Chain); Ops.push_back(Callee); - + // Add argument registers to the end of the list so that they are known live // into the call. for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) - Ops.push_back(DAG.getRegister(RegsToPass[i].first, + Ops.push_back(DAG.getRegister(RegsToPass[i].first, RegsToPass[i].second.getValueType())); - + if (InFlag.Val) Ops.push_back(InFlag); // Returns a chain and a flag for retval copy to use. @@ -1241,7 +1242,7 @@ SDOperand ResultVals[3]; unsigned NumResults = 0; - + // If the call has results, copy the values out of the ret val registers. switch (Op.Val->getValueType(0).getSimpleVT()) { default: assert(0 && "Unexpected ret value!"); @@ -1287,7 +1288,7 @@ // If the function returns void, just return the chain. if (NumResults == 0) return Chain; - + // Otherwise, merge everything together with a MERGE_VALUES node. ResultVals[NumResults++] = Chain; SDOperand Res = DAG.getMergeValues(ResultVals, NumResults); @@ -1301,7 +1302,7 @@ bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg(); CCState CCInfo(CC, isVarArg, TM, RVLocs); CCInfo.AnalyzeReturn(Op.Val, RetCC_SPU); - + // If this is the first return lowered for this function, add the regs to the // liveout set for the function. if (DAG.getMachineFunction().getRegInfo().liveout_empty()) { @@ -1311,7 +1312,7 @@ SDOperand Chain = Op.getOperand(0); SDOperand Flag; - + // Copy the result values into the output registers. for (unsigned i = 0; i != RVLocs.size(); ++i) { CCValAssign &VA = RVLocs[i]; @@ -1334,7 +1335,7 @@ static ConstantSDNode * getVecImm(SDNode *N) { SDOperand OpVal(0, 0); - + // Check to see if this buildvec has a single non-undef value in its elements. for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { if (N->getOperand(i).getOpcode() == ISD::UNDEF) continue; @@ -1343,7 +1344,7 @@ else if (OpVal != N->getOperand(i)) return 0; } - + if (OpVal.Val != 0) { if (ConstantSDNode *CN = dyn_cast(OpVal)) { return CN; @@ -1478,7 +1479,7 @@ } // If this is a vector of constants or undefs, get the bits. A bit in -// UndefBits is set if the corresponding element of the vector is an +// UndefBits is set if the corresponding element of the vector is an // ISD::UNDEF value. For undefs, the corresponding VectorBits values are // zero. Return true if this is not an array of constants, false if it is. // @@ -1486,11 +1487,11 @@ uint64_t UndefBits[2]) { // Start with zero'd results. VectorBits[0] = VectorBits[1] = UndefBits[0] = UndefBits[1] = 0; - + unsigned EltBitSize = BV->getOperand(0).getValueType().getSizeInBits(); for (unsigned i = 0, e = BV->getNumOperands(); i != e; ++i) { SDOperand OpVal = BV->getOperand(i); - + unsigned PartNo = i >= e/2; // In the upper 128 bits? unsigned SlotNo = e/2 - (i & (e/2-1))-1; // Which subpiece of the uint64_t. @@ -1510,20 +1511,20 @@ // Nonconstant element. return true; } - + VectorBits[PartNo] |= EltBits << (SlotNo*EltBitSize); } - - //printf("%llx %llx %llx %llx\n", + + //printf("%llx %llx %llx %llx\n", // VectorBits[0], VectorBits[1], UndefBits[0], UndefBits[1]); return false; } /// If this is a splat (repetition) of a value across the whole vector, return /// the smallest size that splats it. For example, "0x01010101010101..." is a -/// splat of 0x01, 0x0101, and 0x01010101. We return SplatBits = 0x01 and +/// splat of 0x01, 0x0101, and 0x01010101. We return SplatBits = 0x01 and /// SplatSize = 1 byte. -static bool isConstantSplat(const uint64_t Bits128[2], +static bool isConstantSplat(const uint64_t Bits128[2], const uint64_t Undef128[2], int MinSplatBits, uint64_t &SplatBits, uint64_t &SplatUndef, @@ -1539,7 +1540,7 @@ if ((Bits128[0] & ~Undef128[1]) == (Bits128[1] & ~Undef128[0])) { if (MinSplatBits < 64) { - + // Check that the top 32-bits are the same as the lower 32-bits, ignoring // undefs. if ((Bits64 & (~Undef64 >> 32)) == ((Bits64 >> 32) & ~Undef64)) { @@ -1591,9 +1592,9 @@ static SDOperand LowerBUILD_VECTOR(SDOperand Op, SelectionDAG &DAG) { MVT VT = Op.getValueType(); // If this is a vector of constants or undefs, get the bits. A bit in - // UndefBits is set if the corresponding element of the vector is an + // UndefBits is set if the corresponding element of the vector is an // ISD::UNDEF value. For undefs, the corresponding VectorBits values are - // zero. + // zero. uint64_t VectorBits[2]; uint64_t UndefBits[2]; uint64_t SplatBits, SplatUndef; @@ -1603,7 +1604,7 @@ VT.getVectorElementType().getSizeInBits(), SplatBits, SplatUndef, SplatSize)) return SDOperand(); // Not a constant vector, not a splat. - + switch (VT.getSimpleVT()) { default: case MVT::v4f32: { @@ -1637,7 +1638,7 @@ } case MVT::v8i16: { unsigned short Value16; - if (SplatSize == 2) + if (SplatSize == 2) Value16 = (unsigned short) (SplatBits & 0xffff); else Value16 = (unsigned short) (SplatBits | (SplatBits << 8)); @@ -1737,7 +1738,7 @@ } } } - + return SDOperand(); } @@ -1758,9 +1759,9 @@ SDOperand V1 = Op.getOperand(0); SDOperand V2 = Op.getOperand(1); SDOperand PermMask = Op.getOperand(2); - + if (V2.getOpcode() == ISD::UNDEF) V2 = V1; - + // If we have a single element being moved from V1 to V2, this can be handled // using the C*[DX] compute mask instructions, but the vector elements have // to be monotonically increasing with one exception element. @@ -1785,7 +1786,7 @@ unsigned SrcElt; if (PermMask.getOperand(i).getOpcode() == ISD::UNDEF) SrcElt = 0; - else + else SrcElt = cast(PermMask.getOperand(i))->getValue(); if (SrcElt >= V2EltIdx0) { @@ -1817,21 +1818,21 @@ } else { // Convert the SHUFFLE_VECTOR mask's input element units to the actual bytes. unsigned BytesPerElement = EltVT.getSizeInBits()/8; - + SmallVector ResultMask; for (unsigned i = 0, e = PermMask.getNumOperands(); i != e; ++i) { unsigned SrcElt; if (PermMask.getOperand(i).getOpcode() == ISD::UNDEF) SrcElt = 0; - else + else SrcElt = cast(PermMask.getOperand(i))->getValue(); - + for (unsigned j = 0; j < BytesPerElement; ++j) { ResultMask.push_back(DAG.getConstant(SrcElt*BytesPerElement+j, MVT::i8)); } } - + SDOperand VPermMask = DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8, &ResultMask[0], ResultMask.size()); return DAG.getNode(SPUISD::SHUFB, V1.getValueType(), V1, V2, VPermMask); @@ -1979,7 +1980,7 @@ SDOperand LoProdMask = DAG.getConstant(0xffff, MVT::i32); - SDOperand LoProd = + SDOperand LoProd = DAG.getNode(ISD::AND, MVT::v4i32, LoProdParts, DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, @@ -2047,24 +2048,24 @@ // Computes BRcpl = // (Floating Interpolate (FP Reciprocal Estimate B)) SDOperand BRcpl = - DAG.getCopyToReg(DAG.getEntryNode(), VRegBR, - DAG.getNode(SPUISD::FPInterp, VT, B, + DAG.getCopyToReg(DAG.getEntryNode(), VRegBR, + DAG.getNode(SPUISD::FPInterp, VT, B, DAG.getNode(SPUISD::FPRecipEst, VT, B))); - + // Computes A * BRcpl and stores in a temporary register SDOperand AxBRcpl = DAG.getCopyToReg(BRcpl, VRegC, - DAG.getNode(ISD::FMUL, VT, A, + DAG.getNode(ISD::FMUL, VT, A, DAG.getCopyFromReg(BRcpl, VRegBR, VT))); // What's the Chain variable do? It's magic! // TODO: set Chain = Op(0).getEntryNode() - - return DAG.getNode(ISD::FADD, VT, + + return DAG.getNode(ISD::FADD, VT, DAG.getCopyFromReg(AxBRcpl, VRegC, VT), - DAG.getNode(ISD::FMUL, VT, - DAG.getCopyFromReg(AxBRcpl, VRegBR, VT), + DAG.getNode(ISD::FMUL, VT, + DAG.getCopyFromReg(AxBRcpl, VRegBR, VT), DAG.getNode(ISD::FSUB, VT, A, - DAG.getNode(ISD::FMUL, VT, B, + DAG.getNode(ISD::FMUL, VT, B, DAG.getCopyFromReg(AxBRcpl, VRegC, VT))))); } @@ -2134,7 +2135,7 @@ : elt_byte + (i - prefslot_begin)); ShufMask[i] = DAG.getConstant(mask_val, MVT::i8); - } else + } else ShufMask[i] = ShufMask[i % (prefslot_end + 1)]; } @@ -2146,7 +2147,7 @@ return DAG.getNode(SPUISD::EXTRACT_ELT0, VT, DAG.getNode(SPUISD::SHUFB, N.getValueType(), N, N, ShufMaskVec)); - + } static SDOperand LowerINSERT_VECTOR_ELT(SDOperand Op, SelectionDAG &DAG) { @@ -2195,9 +2196,9 @@ N1 = (N1.getOpcode() != ISD::Constant ? DAG.getNode(ISD::SIGN_EXTEND, MVT::i16, N1) : DAG.getConstant(cast(N1)->getValue(), MVT::i16)); - return DAG.getNode(ISD::TRUNCATE, MVT::i8, + return DAG.getNode(ISD::TRUNCATE, MVT::i8, DAG.getNode(Opc, MVT::i16, N0, N1)); - } + } case ISD::ROTR: case ISD::ROTL: { SDOperand N1 = Op.getOperand(1); @@ -2213,7 +2214,7 @@ DAG.getNode(ISD::OR, MVT::i16, N0, DAG.getNode(ISD::SHL, MVT::i16, N0, DAG.getConstant(8, MVT::i16))); - return DAG.getNode(ISD::TRUNCATE, MVT::i8, + return DAG.getNode(ISD::TRUNCATE, MVT::i8, DAG.getNode(Opc, MVT::i16, ExpandArg, N1)); } case ISD::SRL: @@ -2227,7 +2228,7 @@ N1 = (N1.getOpcode() != ISD::Constant ? DAG.getNode(N1Opc, MVT::i16, N1) : DAG.getConstant(cast(N1)->getValue(), MVT::i16)); - return DAG.getNode(ISD::TRUNCATE, MVT::i8, + return DAG.getNode(ISD::TRUNCATE, MVT::i8, DAG.getNode(Opc, MVT::i16, N0, N1)); } case ISD::SRA: { @@ -2240,7 +2241,7 @@ N1 = (N1.getOpcode() != ISD::Constant ? DAG.getNode(N1Opc, MVT::i16, N1) : DAG.getConstant(cast(N1)->getValue(), MVT::i16)); - return DAG.getNode(ISD::TRUNCATE, MVT::i8, + return DAG.getNode(ISD::TRUNCATE, MVT::i8, DAG.getNode(Opc, MVT::i16, N0, N1)); } case ISD::MUL: { @@ -2253,7 +2254,7 @@ N1 = (N1.getOpcode() != ISD::Constant ? DAG.getNode(N1Opc, MVT::i16, N1) : DAG.getConstant(cast(N1)->getValue(), MVT::i16)); - return DAG.getNode(ISD::TRUNCATE, MVT::i8, + return DAG.getNode(ISD::TRUNCATE, MVT::i8, DAG.getNode(Opc, MVT::i16, N0, N1)); break; } @@ -2551,7 +2552,7 @@ // CNTB_reg, SUM1_reg become associated: SDOperand CNTB_result = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i16, CNTB, Elt0); - + SDOperand CNTB_rescopy = DAG.getCopyToReg(CNTB_result, CNTB_reg, CNTB_result); @@ -2585,7 +2586,7 @@ // CNTB_reg, SUM1_reg become associated: SDOperand CNTB_result = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i32, CNTB, Elt0); - + SDOperand CNTB_rescopy = DAG.getCopyToReg(CNTB_result, CNTB_reg, CNTB_result); @@ -2862,7 +2863,7 @@ // Result = Op0.getOperand(0); break; - } + } } break; } @@ -2887,7 +2888,7 @@ /// getConstraintType - Given a constraint letter, return the type of /// constraint it is for this target. -SPUTargetLowering::ConstraintType +SPUTargetLowering::ConstraintType SPUTargetLowering::getConstraintType(const std::string &ConstraintLetter) const { if (ConstraintLetter.size() == 1) { switch (ConstraintLetter[0]) { @@ -2898,12 +2899,12 @@ case 'v': case 'y': return C_RegisterClass; - } + } } return TargetLowering::getConstraintType(ConstraintLetter); } -std::pair +std::pair SPUTargetLowering::getRegForInlineAsmConstraint(const std::string &Constraint, MVT VT) const { @@ -2921,11 +2922,11 @@ else if (VT == MVT::f64) return std::make_pair(0U, SPU::R64FPRegisterClass); break; - case 'v': + case 'v': return std::make_pair(0U, SPU::GPRCRegisterClass); } } - + return TargetLowering::getRegForInlineAsmConstraint(Constraint, VT); } @@ -2933,7 +2934,7 @@ void SPUTargetLowering::computeMaskedBitsForTargetNode(const SDOperand Op, const APInt &Mask, - APInt &KnownZero, + APInt &KnownZero, APInt &KnownOne, const SelectionDAG &DAG, unsigned Depth ) const { @@ -2962,7 +2963,7 @@ KnownOne |= APInt(Op0VTBits, InMask, false); break; } - + case SPUISD::LDRESULT: case SPUISD::EXTRACT_ELT0: case SPUISD::EXTRACT_ELT0_CHAINED: { @@ -3022,5 +3023,5 @@ } bool SPUTargetLowering::isLegalAddressImmediate(llvm::GlobalValue* GV) const { - return false; + return false; } From isanbard at gmail.com Wed Jul 16 12:40:24 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 16 Jul 2008 17:40:24 -0000 Subject: [llvm-commits] [llvm] r53690 - in /llvm/branches/Apple/Gaz: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll Message-ID: <200807161740.m6GHeO3c009024@zion.cs.uiuc.edu> Author: void Date: Wed Jul 16 12:40:24 2008 New Revision: 53690 URL: http://llvm.org/viewvc/llvm-project?rev=53690&view=rev Log: Pull r53666 into Gaz: Fix PR2296. Do not transform x86_sse2_storel_dq into a full-width store. Added: llvm/branches/Apple/Gaz/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll Modified: llvm/branches/Apple/Gaz/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/branches/Apple/Gaz/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/lib/Transforms/Scalar/InstructionCombining.cpp?rev=53690&r1=53689&r2=53690&view=diff ============================================================================== --- llvm/branches/Apple/Gaz/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/branches/Apple/Gaz/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jul 16 12:40:24 2008 @@ -8639,7 +8639,6 @@ case Intrinsic::x86_sse_storeu_ps: case Intrinsic::x86_sse2_storeu_pd: case Intrinsic::x86_sse2_storeu_dq: - case Intrinsic::x86_sse2_storel_dq: // Turn X86 storeu -> store if the pointer is known aligned. if (GetOrEnforceKnownAlignment(II->getOperand(1), 16) >= 16) { const Type *OpPtrTy = Added: llvm/branches/Apple/Gaz/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll?rev=53690&view=auto ============================================================================== --- llvm/branches/Apple/Gaz/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll (added) +++ llvm/branches/Apple/Gaz/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll Wed Jul 16 12:40:24 2008 @@ -0,0 +1,13 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {store } +; PR2296 + + at G = common global double 0.000000e+00, align 16 + +define void @x(<2 x i64> %y) nounwind { +entry: + bitcast <2 x i64> %y to <4 x i32> + call void @llvm.x86.sse2.storel.dq( i8* bitcast (double* @G to i8*), <4 x i32> %0 ) nounwind + ret void +} + +declare void @llvm.x86.sse2.storel.dq(i8*, <4 x i32>) nounwind From resistor at mac.com Wed Jul 16 12:52:31 2008 From: resistor at mac.com (Owen Anderson) Date: Wed, 16 Jul 2008 17:52:31 -0000 Subject: [llvm-commits] [llvm] r53691 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200807161752.m6GHqVDx009403@zion.cs.uiuc.edu> Author: resistor Date: Wed Jul 16 12:52:31 2008 New Revision: 53691 URL: http://llvm.org/viewvc/llvm-project?rev=53691&view=rev Log: There's no need to iterate block merging and PRE. In fact, iterating the latter could cause problems for memdep when it breaks critical edges. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=53691&r1=53690&r2=53691&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Wed Jul 16 12:52:31 2008 @@ -727,7 +727,6 @@ AU.addPreserved(); AU.addPreserved(); - AU.addPreserved(); } // Helper fuctions @@ -1121,11 +1120,22 @@ bool changed = false; bool shouldContinue = true; + // Merge unconditional branches, allowing PRE to catch more + // optimization opportunities. + for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ) { + BasicBlock* BB = FI; + ++FI; + changed |= mergeBlockIntoPredecessor(BB); + } + while (shouldContinue) { shouldContinue = iterateOnFunction(F); changed |= shouldContinue; } + if (EnablePRE) + changed |= performPRE(F); + return changed; } @@ -1382,15 +1392,6 @@ VN.clear(); phiMap.clear(); - // Merge unconditional branches, allowing PRE to catch more - // optimization opportunities. - bool mergedBlocks = false; - for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ) { - BasicBlock* BB = FI; - ++FI; - mergedBlocks |= mergeBlockIntoPredecessor(BB); - } - for (DenseMap::iterator I = localAvail.begin(), E = localAvail.end(); I != E; ++I) delete I->second; @@ -1404,8 +1405,5 @@ DE = df_end(DT.getRootNode()); DI != DE; ++DI) changed |= processBlock(*DI); - if (EnablePRE) - changed |= performPRE(F); - - return changed || mergedBlocks; + return changed; } From dpatel at apple.com Wed Jul 16 12:54:35 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 16 Jul 2008 17:54:35 -0000 Subject: [llvm-commits] [llvm] r53692 - in /llvm/trunk: include/llvm/Support/Compiler.h lib/Target/X86/X86JITInfo.cpp Message-ID: <200807161754.m6GHsZh2009476@zion.cs.uiuc.edu> Author: dpatel Date: Wed Jul 16 12:54:34 2008 New Revision: 53692 URL: http://llvm.org/viewvc/llvm-project?rev=53692&view=rev Log: Mark function used by asm block as used, otherwise optimizer may not see the use and may delete the function. Modified: llvm/trunk/include/llvm/Support/Compiler.h llvm/trunk/lib/Target/X86/X86JITInfo.cpp Modified: llvm/trunk/include/llvm/Support/Compiler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=53692&r1=53691&r2=53692&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Compiler.h (original) +++ llvm/trunk/include/llvm/Support/Compiler.h Wed Jul 16 12:54:34 2008 @@ -23,6 +23,11 @@ #define VISIBILITY_HIDDEN #endif +#if (__GNUC__ >= 4) +#define ATTRIBUTE_USED __attribute__((__used__)) +#else +#define ATTRIBUTE_USED +#endif // C++ doesn't support 'extern template' of template specializations. GCC does, // but requires __extension__ before it. In the header, use this: Modified: llvm/trunk/lib/Target/X86/X86JITInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86JITInfo.cpp?rev=53692&r1=53691&r2=53692&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86JITInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86JITInfo.cpp Wed Jul 16 12:54:34 2008 @@ -18,6 +18,7 @@ #include "llvm/Function.h" #include "llvm/CodeGen/MachineCodeEmitter.h" #include "llvm/Config/alloca.h" +#include "llvm/Support/Compiler.h" #include #include using namespace llvm; @@ -315,7 +316,8 @@ /// function stub when we did not know the real target of a call. This function /// must locate the start of the stub or call site and pass it into the JIT /// compiler function. -extern "C" void X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr) { +extern "C" void ATTRIBUTE_USED +X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr) { intptr_t *RetAddrLoc = &StackPtr[1]; assert(*RetAddrLoc == RetAddr && "Could not find return address on the stack!"); From dalej at apple.com Wed Jul 16 13:05:58 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 16 Jul 2008 11:05:58 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200807161917.00908.baldrick@free.fr> References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> <200807152300.27489.baldrick@free.fr> <200807161917.00908.baldrick@free.fr> Message-ID: <3301437E-3D34-4312-AFF3-0A18B7CD6293@apple.com> On Jul 16, 2008, at 10:17 AMPDT, Duncan Sands wrote: > Hi, > >>> thanks for the explanation. However llvm-gcc already supports >>> variable byte-offsets, i.e. where the value of the byte offset >>> depends on the value of some variable, the content of a memory >>> location etc. Ada does this for example. So why does ObjC2 >>> need something special here? >> >> Presumably the ObjC FE trees do not look like the Ada trees. >> I don't know what the Ada trees look like. >> In ObjC, the offset is actually there twice in the tree in effect , >> and the user >> needs to compensate at some stage. Don't ask me why, I didn't write >> it:) > > how does it manage to work in mainline? I don't think ObjC V2 is in FSF mainline, if that's the mainline you mean. From dpatel at apple.com Wed Jul 16 13:06:53 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 16 Jul 2008 18:06:53 -0000 Subject: [llvm-commits] [llvm] r53693 - in /llvm/trunk/tools/lto: LTOModule.cpp LTOModule.h Message-ID: <200807161806.m6GI6rET009890@zion.cs.uiuc.edu> Author: dpatel Date: Wed Jul 16 13:06:52 2008 New Revision: 53693 URL: http://llvm.org/viewvc/llvm-project?rev=53693&view=rev Log: Do not forget global definitions from inline asm code block. Modified: llvm/trunk/tools/lto/LTOModule.cpp llvm/trunk/tools/lto/LTOModule.h Modified: llvm/trunk/tools/lto/LTOModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOModule.cpp?rev=53693&r1=53692&r2=53693&view=diff ============================================================================== --- llvm/trunk/tools/lto/LTOModule.cpp (original) +++ llvm/trunk/tools/lto/LTOModule.cpp Wed Jul 16 13:06:52 2008 @@ -238,6 +238,19 @@ _defines[info.name] = 1; } +void LTOModule::addAsmGlobalSymbol(const char *name) { + // string is owned by _defines + const char *symbolName = ::strdup(name); + uint32_t attr = LTO_SYMBOL_DEFINITION_REGULAR; + attr |= LTO_SYMBOL_SCOPE_DEFAULT; + + // add to table of symbols + NameAndAttributes info; + info.name = symbolName; + info.attributes = (lto_symbol_attributes)attr; + _symbols.push_back(info); + _defines[info.name] = 1; +} void LTOModule::addPotentialUndefinedSymbol(GlobalValue* decl, Mangler &mangler) { @@ -297,6 +310,32 @@ addDefinedDataSymbol(v, mangler); } + // add asm globals + const std::string &inlineAsm = _module->getModuleInlineAsm(); + const std::string glbl = ".globl"; + std::string asmSymbolName; + std::string::size_type pos = inlineAsm.find(glbl, 0); + while (pos != std::string::npos) { + // eat .globl + pos = pos + 6; + + // skip white space between .globl and symbol name + std::string::size_type pbegin = inlineAsm.find_first_not_of(' ', pos); + if (pbegin == std::string::npos) + break; + + // find end-of-line + std::string::size_type pend = inlineAsm.find_first_of('\n', pbegin); + if (pend == std::string::npos) + break; + + asmSymbolName.assign(inlineAsm, pbegin, pbegin-pend); + addAsmGlobalSymbol(asmSymbolName.c_str()); + + // search next .globl + pos = inlineAsm.find(glbl, pend); + } + // make symbols for all undefines for (StringSet::iterator it=_undefines.begin(); it != _undefines.end(); ++it) { Modified: llvm/trunk/tools/lto/LTOModule.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOModule.h?rev=53693&r1=53692&r2=53693&view=diff ============================================================================== --- llvm/trunk/tools/lto/LTOModule.h (original) +++ llvm/trunk/tools/lto/LTOModule.h Wed Jul 16 13:06:52 2008 @@ -76,6 +76,7 @@ llvm::Mangler &mangler); void addDefinedDataSymbol(llvm::GlobalValue* v, llvm::Mangler &mangler); + void addAsmGlobalSymbol(const char *); static bool isTargetMatch(llvm::MemoryBuffer* memBuffer, const char* triplePrefix); From baldrick at free.fr Wed Jul 16 13:13:48 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 20:13:48 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <3301437E-3D34-4312-AFF3-0A18B7CD6293@apple.com> References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> <200807161917.00908.baldrick@free.fr> <3301437E-3D34-4312-AFF3-0A18B7CD6293@apple.com> Message-ID: <200807162013.48159.baldrick@free.fr> Hi, > > how does it manage to work in mainline? > > I don't think ObjC V2 is in FSF mainline, if that's the mainline you > mean. I was thinking of Apple's non-llvm gcc (if there still is one), or llvm-gcc without ENABLE_LLVM. D. From dalej at apple.com Wed Jul 16 13:18:13 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 16 Jul 2008 11:18:13 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200807162013.48159.baldrick@free.fr> References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> <200807161917.00908.baldrick@free.fr> <3301437E-3D34-4312-AFF3-0A18B7CD6293@apple.com> <200807162013.48159.baldrick@free.fr> Message-ID: On Jul 16, 2008, at 11:13 AMPDT, Duncan Sands wrote: > Hi, > >>> how does it manage to work in mainline? >> >> I don't think ObjC V2 is in FSF mainline, if that's the mainline you >> mean. > > I was thinking of Apple's non-llvm gcc (if there still > is one), or llvm-gcc without ENABLE_LLVM. Ah OK. Basically the same way, you'll find a similar address adjustment in get_inner_reference. From evan.cheng at apple.com Wed Jul 16 13:24:48 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Jul 2008 11:24:48 -0700 Subject: [llvm-commits] [llvm] r52537 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp In-Reply-To: <20080715161033.GE26592@katherina.student.utwente.nl> References: <200806201516.m5KFGkRv024435@zion.cs.uiuc.edu> <20080702161624.GI7287@katherina.student.utwente.nl> <192117C6-9780-4C96-9F1F-E055FFC033FE@apple.com> <20080715144754.GD26592@katherina.student.utwente.nl> <20080715161033.GE26592@katherina.student.utwente.nl> Message-ID: On Jul 15, 2008, at 9:10 AM, Matthijs Kooijman wrote: > Hi all, > > as you might have noticed, I've restructed the deadargelim pass a > bit more. It > should be really done by now. All changes are committed I'm > currently running > it against the test suite. Could someone (Evan?) perhaps see if the > SPEC tests > still work properly? I haven't noticed any regressions. Evan > > > Gr. > > Matthijs > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From bruno.cardoso at gmail.com Wed Jul 16 13:39:59 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 16 Jul 2008 15:39:59 -0300 Subject: [llvm-commits] SoftenFloatOp support for fp_round Message-ID: <275e64e40807161139x699f650cx816bf9947e5b0ae9@mail.gmail.com> fpround support into the new DAGTypeLegalizer. This adds a libcall for f64->f32 when f64 is not legal. -- Bruno Cardoso Lopes http://www.brunocardoso.cc "When faced with untenable alternatives, you should consider your imperative." -------------- next part -------------- A non-text attachment was scrubbed... Name: LegalizeFloatTypes.patch Type: application/octet-stream Size: 1838 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080716/5be80638/attachment.obj From bruno.cardoso at gmail.com Wed Jul 16 13:54:57 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 16 Jul 2008 15:54:57 -0300 Subject: [llvm-commits] [llvm] [PATCH] fpround libcall In-Reply-To: <69E6660A-8ABF-4EFB-9448-806AF6C6D2B6@apple.com> References: <275e64e40807071708x787b6dc8oaf04a71e3c582f2f@mail.gmail.com> <6AD89224-A6DA-439A-A6A6-0771952055F4@apple.com> <275e64e40807071916p68e3e977w582d430960a6aecd@mail.gmail.com> <69E6660A-8ABF-4EFB-9448-806AF6C6D2B6@apple.com> Message-ID: <275e64e40807161154n1dde2485p2fb0de990f54efd5@mail.gmail.com> Hi Evan, I sent a patch for the new Legalize Types instead. Thanks. On Tue, Jul 8, 2008 at 2:49 AM, Evan Cheng wrote: > Ok, I see. > > Evan > > On Jul 7, 2008, at 7:16 PM, Bruno Cardoso Lopes wrote: > >> On Mon, Jul 7, 2008 at 10:22 PM, Evan Cheng >> wrote: >>> Also, it might be cleaner to just call ExpandOp. I'd hate to have 2 >>> places that generate the same libcall. >> >> calling ExpandOp directly gives me an assert >> getTypeAction(VT) == Expand && "Not an expanded type!" >> since f32 is supported on the target! >> That's why I issued directly! >> >> -- >> Bruno Cardoso Lopes >> http://www.brunocardoso.cc >> "When faced with untenable alternatives, you >> should consider your imperative." >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -- Bruno Cardoso Lopes http://www.brunocardoso.cc "When faced with untenable alternatives, you should consider your imperative." From baldrick at free.fr Wed Jul 16 14:43:44 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 21:43:44 +0200 Subject: [llvm-commits] SoftenFloatOp support for fp_round In-Reply-To: <275e64e40807161139x699f650cx816bf9947e5b0ae9@mail.gmail.com> References: <275e64e40807161139x699f650cx816bf9947e5b0ae9@mail.gmail.com> Message-ID: <200807162143.44860.baldrick@free.fr> > fpround support into the new DAGTypeLegalizer. > This adds a libcall for f64->f32 when f64 is not legal. Thanks Bruno. How about handling all other possible types while there? Ciao, Duncan. From dpatel at apple.com Wed Jul 16 14:49:09 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 16 Jul 2008 19:49:09 -0000 Subject: [llvm-commits] [llvm] r53697 - /llvm/trunk/tools/lto/LTOModule.cpp Message-ID: <200807161949.m6GJn9YY013407@zion.cs.uiuc.edu> Author: dpatel Date: Wed Jul 16 14:49:09 2008 New Revision: 53697 URL: http://llvm.org/viewvc/llvm-project?rev=53697&view=rev Log: Name string length is end position marker - begin position marker. Modified: llvm/trunk/tools/lto/LTOModule.cpp Modified: llvm/trunk/tools/lto/LTOModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOModule.cpp?rev=53697&r1=53696&r2=53697&view=diff ============================================================================== --- llvm/trunk/tools/lto/LTOModule.cpp (original) +++ llvm/trunk/tools/lto/LTOModule.cpp Wed Jul 16 14:49:09 2008 @@ -329,7 +329,7 @@ if (pend == std::string::npos) break; - asmSymbolName.assign(inlineAsm, pbegin, pbegin-pend); + asmSymbolName.assign(inlineAsm, pbegin, pend - pbegin); addAsmGlobalSymbol(asmSymbolName.c_str()); // search next .globl From isanbard at gmail.com Wed Jul 16 14:52:08 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 16 Jul 2008 19:52:08 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53698 - /llvm-gcc-4.2/branches/Apple/Gaz/gcc/objc/objc-act.c Message-ID: <200807161952.m6GJq9NJ013554@zion.cs.uiuc.edu> Author: void Date: Wed Jul 16 14:52:08 2008 New Revision: 53698 URL: http://llvm.org/viewvc/llvm-project?rev=53698&view=rev Log: Pull r53570 into Gaz: Fix how the alignment for bitfields is calculated. For instance, in this situation: typedef unsigned long NSUInteger; @interface NSData { int x; } - (NSUInteger)length; @end @interface NSConcreteData : NSData { unsigned int _inline:1; } @end We were generating: L_OBJC_$_INSTANCE_VARIABLES_NSConcreteData: .long 32 ## 0x20 .long 1 ## 0x1 .quad _OBJC_IVAR_$_NSConcreteData._inline .quad L_OBJC_METH_VAR_NAME_0 .quad L_OBJC_METH_VAR_TYPE_0 .space 4 .long 1 ## 0x1 the ".space 4" should be ".long 2" Modified: llvm-gcc-4.2/branches/Apple/Gaz/gcc/objc/objc-act.c Modified: llvm-gcc-4.2/branches/Apple/Gaz/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Gaz/gcc/objc/objc-act.c?rev=53698&r1=53697&r2=53698&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Gaz/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/branches/Apple/Gaz/gcc/objc/objc-act.c Wed Jul 16 14:52:08 2008 @@ -10617,7 +10617,10 @@ /* Set alignment */ /* APPLE LOCAL radar 5724385 */ - val = TYPE_ALIGN_UNIT (TREE_TYPE (field_decl)); + val = TYPE_ALIGN_UNIT ( + DECL_BIT_FIELD_TYPE (field_decl) ? DECL_BIT_FIELD_TYPE (field_decl) : + TREE_TYPE (field_decl)); + /* APPLE LOCAL end radar 5724385 */ val = exact_log2 (val); ivar = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, val), ivar); From isanbard at gmail.com Wed Jul 16 14:55:39 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 16 Jul 2008 19:55:39 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53699 - /llvm-gcc-4.2/branches/Apple/Gaz/gcc/llvm-convert.cpp Message-ID: <200807161955.m6GJtdEr013675@zion.cs.uiuc.edu> Author: void Date: Wed Jul 16 14:55:39 2008 New Revision: 53699 URL: http://llvm.org/viewvc/llvm-project?rev=53699&view=rev Log: Pull r53572 into Gaz: Fix code generation for bitfields in ObjC2. Fixes objc.dg/bitfield-1.m obj-c++.dg/bitfield-2.mm (in 64-bit mode). Modified: llvm-gcc-4.2/branches/Apple/Gaz/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/branches/Apple/Gaz/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Gaz/gcc/llvm-convert.cpp?rev=53699&r1=53698&r2=53699&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Gaz/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/branches/Apple/Gaz/gcc/llvm-convert.cpp Wed Jul 16 14:55:39 2008 @@ -5753,6 +5753,12 @@ } else { Value *Offset = Emit(field_offset, 0); + // For ObjC2, we may have a base class field that should not be taken into + // account here, as it is already in Offset. The ObjC FE figures this out. + tree field_bit_offset = objc_v2_bitfield_ivar_bitpos(exp); + if (field_bit_offset) { + BitStart = (unsigned)getINTEGER_CSTVal(field_bit_offset); + } // Here BitStart gives the offset of the field in bits from field_offset. // Incorporate as much of it as possible into the pointer computation. unsigned ByteOffset = BitStart/8; From baldrick at free.fr Wed Jul 16 15:06:59 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 22:06:59 +0200 Subject: [llvm-commits] SoftenFloatOp support for fp_round In-Reply-To: <275e64e40807161139x699f650cx816bf9947e5b0ae9@mail.gmail.com> References: <275e64e40807161139x699f650cx816bf9947e5b0ae9@mail.gmail.com> Message-ID: <200807162206.59382.baldrick@free.fr> On Wednesday 16 July 2008 20:39:59 Bruno Cardoso Lopes wrote: > fpround support into the new DAGTypeLegalizer. > This adds a libcall for f64->f32 when f64 is not legal. PS: RVT should be defined as MVT RVT = TLI.getTypeToTransformTo(N->getValueType(0)); This doesn't actually matter, but it seems more correct to pass the type that will actually be used to return the value. Also, this is what all the other routines do. From criswell at uiuc.edu Wed Jul 16 15:15:57 2008 From: criswell at uiuc.edu (John Criswell) Date: Wed, 16 Jul 2008 20:15:57 -0000 Subject: [llvm-commits] [poolalloc] r53700 - /poolalloc/branches/SVA/include/dsa/DSSupport.h Message-ID: <200807162015.m6GKFv3U014271@zion.cs.uiuc.edu> Author: criswell Date: Wed Jul 16 15:15:57 2008 New Revision: 53700 URL: http://llvm.org/viewvc/llvm-project?rev=53700&view=rev Log: Added a comment to remind me what the Offset does. Thanks, Andrew. Modified: poolalloc/branches/SVA/include/dsa/DSSupport.h Modified: poolalloc/branches/SVA/include/dsa/DSSupport.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/include/dsa/DSSupport.h?rev=53700&r1=53699&r2=53700&view=diff ============================================================================== --- poolalloc/branches/SVA/include/dsa/DSSupport.h (original) +++ poolalloc/branches/SVA/include/dsa/DSSupport.h Wed Jul 16 15:15:57 2008 @@ -55,6 +55,8 @@ /// class DSNodeHandle { mutable DSNode *N; + + // The offset into the node to which the DSHandle points mutable unsigned Offset; void operator==(const DSNode *N); // DISALLOW, use to promote N to nodehandle public: From baldrick at free.fr Wed Jul 16 15:25:27 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 22:25:27 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> <200807152300.27489.baldrick@free.fr> Message-ID: <200807162225.27532.baldrick@free.fr> Hi, > > thanks for the explanation. However llvm-gcc already supports > > variable byte-offsets, i.e. where the value of the byte offset > > depends on the value of some variable, the content of a memory > > location etc. Ada does this for example. So why does ObjC2 > > need something special here? > > Presumably the ObjC FE trees do not look like the Ada trees. by the time they hit llvm-convert these aren't front-end trees anymore. I understand that there are many delicate issues when mapping a language to gcc trees, but I'm still surprised that the ObjC2 people felt it necessary to invent a new mechanism, rather than exploiting the standard one (which has existed for many years, and is mature). > I don't know what the Ada trees look like. You really don't want to know! The funkiest ones are those where the offset or size of a field of a struct nested inside some other struct depends on the value of a field in the parent struct. In some situations you have to do hairy tricks for this, which is what the mysterious PLACEHOLDER_EXPR exists for. It took a while to get this all working smoothly with llvm... > In ObjC, the offset is actually there twice in the tree in effect , > and the user > needs to compensate at some stage. Don't ask me why, I didn't write > it:) Is this stuff (ObjC2) ever going to be pushed to mainline? Duncan. From baldrick at free.fr Wed Jul 16 15:25:45 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 16 Jul 2008 22:25:45 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> <200807162013.48159.baldrick@free.fr> Message-ID: <200807162225.45903.baldrick@free.fr> > Ah OK. Basically the same way, you'll find a similar address > adjustment in get_inner_reference. Found it, thanks. Ciao, Duncan. From clattner at apple.com Wed Jul 16 15:34:49 2008 From: clattner at apple.com (Chris Lattner) Date: Wed, 16 Jul 2008 13:34:49 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r53572 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200807162225.27532.baldrick@free.fr> References: <200807142015.m6EKFYDD020435@zion.cs.uiuc.edu> <200807152300.27489.baldrick@free.fr> <200807162225.27532.baldrick@free.fr> Message-ID: On Jul 16, 2008, at 1:25 PM, Duncan Sands wrote: >> >> In ObjC, the offset is actually there twice in the tree in effect , >> and the user >> needs to compensate at some stage. Don't ask me why, I didn't write >> it:) > > Is this stuff (ObjC2) ever going to be pushed to mainline? We don't know yet. -Chris From dalej at apple.com Wed Jul 16 15:54:36 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 16 Jul 2008 20:54:36 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53701 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Message-ID: <200807162054.m6GKsamQ015448@zion.cs.uiuc.edu> Author: johannes Date: Wed Jul 16 15:54:35 2008 New Revision: 53701 URL: http://llvm.org/viewvc/llvm-project?rev=53701&view=rev Log: ObjC V2 was allocating 32-bit objects for some of the magic variables it constructs for "foreach", but the call that stores into one of them has a 64-bit result. Oops. Fixes objc.dg/objc-foreach-11.m objc.dg/objc-foreach-8.m objc.dg/objc-foreach-9.m obj-c++.dg/objc-foreach-10.mm obj-c++.dg/objc-foreach-11.mm obj-c++.dg/objc-foreach-4.mm obj-c++.dg/objc-foreach-9.mm in 64-bit mode. Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=53701&r1=53700&r2=53701&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Jul 16 15:54:35 2008 @@ -18878,9 +18878,9 @@ __objcFastEnumerationState enumState = { 0 }; id items[16]; - unsigned int limit; + unsigned long limit; unsigned long startMutations; - unsigned int counter; + unsigned long counter; [collection countByEnumeratingWithState:&enumState objects:items count:16]; it returns expression for: @@ -18924,14 +18924,14 @@ build_index_type (build_int_cst (NULL_TREE, 16 - 1))); *items_decl = objc_create_named_tmp_var (type, "cstar"); - /* unsigned int limit */ - *limit_decl = objc_create_named_tmp_var (unsigned_type_node, "cstar"); + /* unsigned long limit */ + *limit_decl = objc_create_named_tmp_var (long_unsigned_type_node, "cstar"); /* unsigned long startMutations */ *startMutations_decl = objc_create_named_tmp_var (long_unsigned_type_node, "cstar"); - /* unsigned int counter */ - *counter_decl = objc_create_named_tmp_var (unsigned_type_node, "cstar"); + /* unsigned long counter */ + *counter_decl = objc_create_named_tmp_var (long_unsigned_type_node, "cstar"); /* [collection countByEnumeratingWithState:&enumState objects:items count:16] */ sel_name = get_identifier ("countByEnumeratingWithState:objects:count:"); @@ -19094,7 +19094,7 @@ /* do { */ outer_do_body = c_begin_compound_stmt (true); - /* unsigned int counter = 0; */ + /* unsigned long counter = 0; */ exp = build2 (MODIFY_EXPR, void_type_node, counter_decl, fold_convert (TREE_TYPE (counter_decl), integer_zero_node)); bind = build3 (BIND_EXPR, void_type_node, counter_decl, exp, NULL); From dalej at apple.com Wed Jul 16 17:49:59 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 16 Jul 2008 22:49:59 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53704 - /llvm-gcc-4.2/trunk/gcc/config/darwin.c Message-ID: <200807162249.m6GMnxp5018827@zion.cs.uiuc.edu> Author: johannes Date: Wed Jul 16 17:49:59 2008 New Revision: 53704 URL: http://llvm.org/viewvc/llvm-project?rev=53704&view=rev Log: Fix typo in metadata section name. Fixes objc/execute/load-3.m in 64-bit mode Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.c?rev=53704&r1=53703&r2=53704&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.c Wed Jul 16 17:49:59 2008 @@ -1619,7 +1619,7 @@ return "__DATA, __objc_catlist, regular, no_dead_strip"; else if (!strncmp (name, "LABEL_NONLAZY_CLASS_", 20)) return "__DATA, __objc_nlclslist, regular, no_dead_strip"; - else if (!strncmp (name, "LABEL_NONLAZY_CAGEGORY_", 23)) + else if (!strncmp (name, "LABEL_NONLAZY_CATEGORY_", 23)) return "__DATA, __objc_nlcatlist, regular, no_dead_strip"; else if (!strncmp (name, "PROTOCOL_REFERENCE_", 19)) return "__DATA, __objc_protorefs, regular, no_dead_strip"; From resistor at mac.com Wed Jul 16 19:01:40 2008 From: resistor at mac.com (Owen Anderson) Date: Thu, 17 Jul 2008 00:01:40 -0000 Subject: [llvm-commits] [llvm] r53705 - in /llvm/trunk: include/llvm/Transforms/Utils/BasicBlockUtils.h lib/Transforms/Scalar/GVN.cpp lib/Transforms/Utils/BasicBlockUtils.cpp Message-ID: <200807170001.m6H01eL5021088@zion.cs.uiuc.edu> Author: resistor Date: Wed Jul 16 19:01:40 2008 New Revision: 53705 URL: http://llvm.org/viewvc/llvm-project?rev=53705&view=rev Log: Factor MergeBlockIntoPredecessor out into BasicBlockUtils. Modified: llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h llvm/trunk/lib/Transforms/Scalar/GVN.cpp llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Modified: llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h?rev=53705&r1=53704&r2=53705&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h Wed Jul 16 19:01:40 2008 @@ -25,6 +25,10 @@ class Instruction; class Pass; +/// MergeBlockIntoPredecessor - Attempts to merge a block into its predecessor, +/// if possible. The return value indicates success or failure. +bool MergeBlockIntoPredecessor(BasicBlock* BB, Pass* P); + // ReplaceInstWithValue - Replace all uses of an instruction (specified by BI) // with a value, then remove and delete the original instruction. // Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=53705&r1=53704&r2=53705&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Wed Jul 16 19:01:40 2008 @@ -1125,7 +1125,10 @@ for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ) { BasicBlock* BB = FI; ++FI; - changed |= mergeBlockIntoPredecessor(BB); + bool removedBlock = MergeBlockIntoPredecessor(BB, this); + if (removedBlock) NumGVNBlocks++; + + changed |= removedBlock; } while (shouldContinue) { @@ -1336,56 +1339,6 @@ return changed; } -// mergeBlockIntoPredecessor - If this block is the only successor -// of its predecessor, and the edge is non-critical, -// fold it into that predecessor. -bool GVN::mergeBlockIntoPredecessor(BasicBlock* BB) { - // Can't merge the entry block. - if (pred_begin(BB) == pred_end(BB)) return false; - // Can't merge if there are multiple preds. - if (++pred_begin(BB) != pred_end(BB)) return false; - - BasicBlock* PredBB = *pred_begin(BB); - - // Can't merge if the edge is critical. - if (PredBB->getTerminator()->getNumSuccessors() != 1) return false; - - // Begin by getting rid of unneeded PHIs. - while (PHINode *PN = dyn_cast(&BB->front())) { - PN->replaceAllUsesWith(PN->getIncomingValue(0)); - BB->getInstList().pop_front(); // Delete the phi node... - } - - // Delete the unconditional branch from the predecessor... - PredBB->getInstList().pop_back(); - - // Move all definitions in the successor to the predecessor... - PredBB->getInstList().splice(PredBB->end(), BB->getInstList()); - - // Make all PHI nodes that referred to BB now refer to Pred as their - // source... - BB->replaceAllUsesWith(PredBB); - - // Finally, erase the old block and update dominator info. - DominatorTree& DT = getAnalysis(); - DomTreeNode* DTN = DT[BB]; - DomTreeNode* PredDTN = DT[PredBB]; - - if (DTN) { - SmallPtrSet Children(DTN->begin(), DTN->end()); - for (SmallPtrSet::iterator DI = Children.begin(), - DE = Children.end(); DI != DE; ++DI) - DT.changeImmediateDominator(*DI, PredDTN); - - DT.eraseNode(BB); - } - - BB->eraseFromParent(); - - NumGVNBlocks++; - return true; -} - // iterateOnFunction - Executes one iteration of GVN bool GVN::iterateOnFunction(Function &F) { // Clean out global sets from any previous functions Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=53705&r1=53704&r2=53705&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Wed Jul 16 19:01:40 2008 @@ -23,6 +23,58 @@ #include using namespace llvm; +/// MergeBlockIntoPredecessor - Attempts to merge a block into its predecessor, +/// if possible. The return value indicates success or failure. +bool llvm::MergeBlockIntoPredecessor(BasicBlock* BB, Pass* P) { + // Can't merge the entry block. + if (pred_begin(BB) == pred_end(BB)) return false; + // Can't merge if there are multiple preds. + if (++pred_begin(BB) != pred_end(BB)) return false; + + BasicBlock* PredBB = *pred_begin(BB); + + // Can't merge if the edge is critical. + if (PredBB->getTerminator()->getNumSuccessors() != 1) return false; + + // Begin by getting rid of unneeded PHIs. + while (PHINode *PN = dyn_cast(&BB->front())) { + PN->replaceAllUsesWith(PN->getIncomingValue(0)); + BB->getInstList().pop_front(); // Delete the phi node... + } + + // Delete the unconditional branch from the predecessor... + PredBB->getInstList().pop_back(); + + // Move all definitions in the successor to the predecessor... + PredBB->getInstList().splice(PredBB->end(), BB->getInstList()); + + // Make all PHI nodes that referred to BB now refer to Pred as their + // source... + BB->replaceAllUsesWith(PredBB); + + // Finally, erase the old block and update dominator info. + if (P) { + if (DominatorTree* DT = P->getAnalysisToUpdate()) { + DomTreeNode* DTN = DT->getNode(BB); + DomTreeNode* PredDTN = DT->getNode(PredBB); + + if (DTN) { + SmallPtrSet Children(DTN->begin(), DTN->end()); + for (SmallPtrSet::iterator DI = Children.begin(), + DE = Children.end(); DI != DE; ++DI) + DT->changeImmediateDominator(*DI, PredDTN); + + DT->eraseNode(BB); + } + } + } + + BB->eraseFromParent(); + + + return true; +} + /// ReplaceInstWithValue - Replace all uses of an instruction (specified by BI) /// with a value, then remove and delete the original instruction. /// From isanbard at gmail.com Wed Jul 16 19:36:05 2008 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 17 Jul 2008 00:36:05 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53706 - /llvm-gcc-4.2/branches/Apple/Gaz/gcc/config/darwin.c Message-ID: <200807170036.m6H0a5Ke022210@zion.cs.uiuc.edu> Author: void Date: Wed Jul 16 19:36:05 2008 New Revision: 53706 URL: http://llvm.org/viewvc/llvm-project?rev=53706&view=rev Log: Pull r53704 into Gaz: Fix typo in metadata section name. Fixes objc/execute/load-3.m in 64-bit mode Modified: llvm-gcc-4.2/branches/Apple/Gaz/gcc/config/darwin.c Modified: llvm-gcc-4.2/branches/Apple/Gaz/gcc/config/darwin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Gaz/gcc/config/darwin.c?rev=53706&r1=53705&r2=53706&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Gaz/gcc/config/darwin.c (original) +++ llvm-gcc-4.2/branches/Apple/Gaz/gcc/config/darwin.c Wed Jul 16 19:36:05 2008 @@ -1619,7 +1619,7 @@ return "__DATA, __objc_catlist, regular, no_dead_strip"; else if (!strncmp (name, "LABEL_NONLAZY_CLASS_", 20)) return "__DATA, __objc_nlclslist, regular, no_dead_strip"; - else if (!strncmp (name, "LABEL_NONLAZY_CAGEGORY_", 23)) + else if (!strncmp (name, "LABEL_NONLAZY_CATEGORY_", 23)) return "__DATA, __objc_nlcatlist, regular, no_dead_strip"; else if (!strncmp (name, "PROTOCOL_REFERENCE_", 19)) return "__DATA, __objc_protorefs, regular, no_dead_strip"; From isanbard at gmail.com Wed Jul 16 19:54:21 2008 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 17 Jul 2008 00:54:21 -0000 Subject: [llvm-commits] [llvm] r53707 - in /llvm/tags/Apple/llvmCore-2045.3: ./ utils/buildit/build_llvm Message-ID: <200807170054.m6H0sLOj022755@zion.cs.uiuc.edu> Author: void Date: Wed Jul 16 19:54:21 2008 New Revision: 53707 URL: http://llvm.org/viewvc/llvm-project?rev=53707&view=rev Log: Temporary hack to 2045.2 to force it to build with gcc 4.0. Added: llvm/tags/Apple/llvmCore-2045.3/ - copied from r53706, llvm/tags/Apple/llvmCore-2045.2/ Modified: llvm/tags/Apple/llvmCore-2045.3/utils/buildit/build_llvm Modified: llvm/tags/Apple/llvmCore-2045.3/utils/buildit/build_llvm URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2045.3/utils/buildit/build_llvm?rev=53707&r1=53706&r2=53707&view=diff ============================================================================== --- llvm/tags/Apple/llvmCore-2045.3/utils/buildit/build_llvm (original) +++ llvm/tags/Apple/llvmCore-2045.3/utils/buildit/build_llvm Wed Jul 16 19:54:21 2008 @@ -138,7 +138,8 @@ make $JOBS_FLAG $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$TARGETS" \ LLVM_SUBMIT_VERSION=$LLVM_SUBMIT_VERSION \ LLVM_SUBMIT_SUBVERSION=$LLVM_SUBMIT_SUBVERSION \ - CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'" + CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'" \ + CC=/usr/bin/gcc-4.0 CXX=/usr/bin/g++-4.0 if ! test $? == 0 ; then echo "error: LLVM 'make' failed!" From resistor at mac.com Wed Jul 16 19:58:01 2008 From: resistor at mac.com (Owen Anderson) Date: Thu, 17 Jul 2008 00:58:01 -0000 Subject: [llvm-commits] [test-suite] r53708 - /test-suite/trunk/SingleSource/Benchmarks/Misc/perlin.c Message-ID: <200807170058.m6H0w2Zp022870@zion.cs.uiuc.edu> Author: resistor Date: Wed Jul 16 19:58:01 2008 New Revision: 53708 URL: http://llvm.org/viewvc/llvm-project?rev=53708&view=rev Log: Add a simple perlin noise generator testcase where GCC beats us slightly. Added: test-suite/trunk/SingleSource/Benchmarks/Misc/perlin.c Added: test-suite/trunk/SingleSource/Benchmarks/Misc/perlin.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Misc/perlin.c?rev=53708&view=auto ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Misc/perlin.c (added) +++ test-suite/trunk/SingleSource/Benchmarks/Misc/perlin.c Wed Jul 16 19:58:01 2008 @@ -0,0 +1,75 @@ +// perlin noise, derived from the Java reference implementation at +// http://mrl.nyu.edu/~perlin/noise/ + +#include +#include + +static int p[512]; + +static int permutation[256] = { 151,160,137,91,90,15, + 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, + 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, + 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, + 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244, + 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196, + 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123, + 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42, + 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9, + 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228, + 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107, + 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, + 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180 + }; + +static double fade(double t) { return t * t * t * (t * (t * 6 - 15) + 10); } + +static double lerp(double t, double a, double b) { return a + t * (b - a); } + +static double grad(int hash, double x, double y, double z) { + int h = hash & 15; // CONVERT LO 4 BITS OF HASH CODE + double u = h<8 ? x : y, // INTO 12 GRADIENT DIRECTIONS. + v = h<4 ? y : h==12||h==14 ? x : z; + return ((h&1) == 0 ? u : -u) + ((h&2) == 0 ? v : -v); +} + +static double noise(double x, double y, double z) { + int X = (int)floor(x) & 255, // FIND UNIT CUBE THAT + Y = (int)floor(y) & 255, // CONTAINS POINT. + Z = (int)floor(z) & 255; + x -= floor(x); // FIND RELATIVE X,Y,Z + y -= floor(y); // OF POINT IN CUBE. + z -= floor(z); + double u = fade(x), // COMPUTE FADE CURVES + v = fade(y), // FOR EACH OF X,Y,Z. + w = fade(z); + int A = p[X ]+Y, AA = p[A]+Z, AB = p[A+1]+Z, // HASH COORDINATES OF + B = p[X+1]+Y, BA = p[B]+Z, BB = p[B+1]+Z; // THE 8 CUBE CORNERS, + + return lerp(w, lerp(v, lerp(u, grad(p[AA ], x , y , z ), // AND ADD + grad(p[BA ], x-1, y , z )), // BLENDED + lerp(u, grad(p[AB ], x , y-1, z ), // RESULTS + grad(p[BB ], x-1, y-1, z ))),// FROM 8 + lerp(v, lerp(u, grad(p[AA+1], x , y , z-1 ), // CORNERS + grad(p[BA+1], x-1, y , z-1 )), // OF CUBE + lerp(u, grad(p[AB+1], x , y-1, z-1 ), + grad(p[BB+1], x-1, y-1, z-1 )))); +} + +static init() { + int i = 0; + for (i=0; i < 256 ; i++) + p[256+i] = p[i] = permutation[i]; +} + +int main() { + init(); + + double x, y, z, sum = 0.0; + for (x = -11352.57; x < 23561.57; x += .1235) + for (y = -346.1235; y < 124.124; y += 1.4325) + for (z = -156.235; y < 23.2345; y += 2.45) + sum += noise(x, y, z); + + printf("%e\n", sum); + return 0; +} \ No newline at end of file From isanbard at gmail.com Wed Jul 16 20:21:17 2008 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 17 Jul 2008 01:21:17 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53709 - /llvm-gcc-4.2/branches/Apple/Gaz/gcc/objc/objc-act.c Message-ID: <200807170121.m6H1LHrR023585@zion.cs.uiuc.edu> Author: void Date: Wed Jul 16 20:21:16 2008 New Revision: 53709 URL: http://llvm.org/viewvc/llvm-project?rev=53709&view=rev Log: Pull r53701 into Gaz: ObjC V2 was allocating 32-bit objects for some of the magic variables it constructs for "foreach", but the call that stores into one of them has a 64-bit result. Oops. Fixes objc.dg/objc-foreach-11.m objc.dg/objc-foreach-8.m objc.dg/objc-foreach-9.m obj-c++.dg/objc-foreach-10.mm obj-c++.dg/objc-foreach-11.mm obj-c++.dg/objc-foreach-4.mm obj-c++.dg/objc-foreach-9.mm in 64-bit mode. Modified: llvm-gcc-4.2/branches/Apple/Gaz/gcc/objc/objc-act.c Modified: llvm-gcc-4.2/branches/Apple/Gaz/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Gaz/gcc/objc/objc-act.c?rev=53709&r1=53708&r2=53709&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Gaz/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/branches/Apple/Gaz/gcc/objc/objc-act.c Wed Jul 16 20:21:16 2008 @@ -18873,9 +18873,9 @@ __objcFastEnumerationState enumState = { 0 }; id items[16]; - unsigned int limit; + unsigned long limit; unsigned long startMutations; - unsigned int counter; + unsigned long counter; [collection countByEnumeratingWithState:&enumState objects:items count:16]; it returns expression for: @@ -18919,14 +18919,14 @@ build_index_type (build_int_cst (NULL_TREE, 16 - 1))); *items_decl = objc_create_named_tmp_var (type, "cstar"); - /* unsigned int limit */ - *limit_decl = objc_create_named_tmp_var (unsigned_type_node, "cstar"); + /* unsigned long limit */ + *limit_decl = objc_create_named_tmp_var (long_unsigned_type_node, "cstar"); /* unsigned long startMutations */ *startMutations_decl = objc_create_named_tmp_var (long_unsigned_type_node, "cstar"); - /* unsigned int counter */ - *counter_decl = objc_create_named_tmp_var (unsigned_type_node, "cstar"); + /* unsigned long counter */ + *counter_decl = objc_create_named_tmp_var (long_unsigned_type_node, "cstar"); /* [collection countByEnumeratingWithState:&enumState objects:items count:16] */ sel_name = get_identifier ("countByEnumeratingWithState:objects:count:"); @@ -19089,7 +19089,7 @@ /* do { */ outer_do_body = c_begin_compound_stmt (true); - /* unsigned int counter = 0; */ + /* unsigned long counter = 0; */ exp = build2 (MODIFY_EXPR, void_type_node, counter_decl, fold_convert (TREE_TYPE (counter_decl), integer_zero_node)); bind = build3 (BIND_EXPR, void_type_node, counter_decl, exp, NULL); From isanbard at gmail.com Wed Jul 16 20:22:53 2008 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 17 Jul 2008 01:22:53 -0000 Subject: [llvm-commits] [llvm] r53710 - /llvm/tags/Apple/llvmCore-2055/ Message-ID: <200807170122.m6H1Mrq2023639@zion.cs.uiuc.edu> Author: void Date: Wed Jul 16 20:22:53 2008 New Revision: 53710 URL: http://llvm.org/viewvc/llvm-project?rev=53710&view=rev Log: Creating llvmCore-2055 tag from Gaz Added: llvm/tags/Apple/llvmCore-2055/ - copied from r53709, llvm/branches/Apple/Gaz/ From isanbard at gmail.com Wed Jul 16 20:23:23 2008 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 17 Jul 2008 01:23:23 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53711 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2055/ Message-ID: <200807170123.m6H1NNAY023662@zion.cs.uiuc.edu> Author: void Date: Wed Jul 16 20:23:23 2008 New Revision: 53711 URL: http://llvm.org/viewvc/llvm-project?rev=53711&view=rev Log: Creating llvmgcc42-2055 tag from Gaz Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2055/ - copied from r53710, llvm-gcc-4.2/branches/Apple/Gaz/ From evan.cheng at apple.com Wed Jul 16 20:31:49 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 17 Jul 2008 01:31:49 -0000 Subject: [llvm-commits] [llvm] r53712 - /llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Message-ID: <200807170131.m6H1VnkY023952@zion.cs.uiuc.edu> Author: evancheng Date: Wed Jul 16 20:31:49 2008 New Revision: 53712 URL: http://llvm.org/viewvc/llvm-project?rev=53712&view=rev Log: Inliner tweak. Function calls should cost more than one instruction! Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp?rev=53712&r1=53711&r2=53712&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InlineCost.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Wed Jul 16 20:31:49 2008 @@ -119,6 +119,11 @@ NeverInline = true; return; } + + // Calls often compile into many machine instructions. Bump up their + // cost to reflect this. + if (!isa(II)) + NumInsts += 5; } if (isa(II) || isa(II->getType())) From baldrick at free.fr Wed Jul 16 20:46:17 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 17 Jul 2008 03:46:17 +0200 Subject: [llvm-commits] [llvm] r53712 - /llvm/trunk/lib/Transforms/Utils/InlineCost.cpp In-Reply-To: <200807170131.m6H1VnkY023952@zion.cs.uiuc.edu> References: <200807170131.m6H1VnkY023952@zion.cs.uiuc.edu> Message-ID: <200807170346.18641.baldrick@free.fr> Hi Evan, > + // Calls often compile into many machine instructions. Bump up their > + // cost to reflect this. > + if (!isa(II)) > + NumInsts += 5; I suppose you could also add in the number of operands in order to vaguely reflect the cost of inlining a call with many parameters. Ciao, Duncan. From baldrick at free.fr Wed Jul 16 21:36:29 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 17 Jul 2008 02:36:29 -0000 Subject: [llvm-commits] [llvm] r53713 - in /llvm/trunk: include/llvm/CodeGen/RuntimeLibcalls.h lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <200807170236.m6H2aTmq026014@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jul 16 21:36:29 2008 New Revision: 53713 URL: http://llvm.org/viewvc/llvm-project?rev=53713&view=rev Log: Factorize some code for determining which libcall to use. Modified: llvm/trunk/include/llvm/CodeGen/RuntimeLibcalls.h llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Modified: llvm/trunk/include/llvm/CodeGen/RuntimeLibcalls.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RuntimeLibcalls.h?rev=53713&r1=53712&r2=53713&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/RuntimeLibcalls.h (original) +++ llvm/trunk/include/llvm/CodeGen/RuntimeLibcalls.h Wed Jul 16 21:36:29 2008 @@ -8,13 +8,15 @@ //===----------------------------------------------------------------------===// // // This file defines the enum representing the list of runtime library calls -// the backend may emit during code generation. +// the backend may emit during code generation, and also some helper functions. // //===----------------------------------------------------------------------===// #ifndef LLVM_CODEGEN_RUNTIMELIBCALLS_H #define LLVM_CODEGEN_RUNTIMELIBCALLS_H +#include "llvm/CodeGen/ValueTypes.h" + namespace llvm { namespace RTLIB { /// RTLIB::Libcall enum - This enum defines all of the runtime library calls @@ -168,6 +170,30 @@ UNKNOWN_LIBCALL }; + + /// getFPEXT - Return the FPEXT_*_* value for the given types, or + /// UNKNOWN_LIBCALL if there is none. + Libcall getFPEXT(MVT OpVT, MVT RetVT); + + /// getFPROUND - Return the FPROUND_*_* value for the given types, or + /// UNKNOWN_LIBCALL if there is none. + Libcall getFPROUND(MVT OpVT, MVT RetVT); + + /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or + /// UNKNOWN_LIBCALL if there is none. + Libcall getFPTOSINT(MVT OpVT, MVT RetVT); + + /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or + /// UNKNOWN_LIBCALL if there is none. + Libcall getFPTOUINT(MVT OpVT, MVT RetVT); + + /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or + /// UNKNOWN_LIBCALL if there is none. + Libcall getSINTTOFP(MVT OpVT, MVT RetVT); + + /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or + /// UNKNOWN_LIBCALL if there is none. + Libcall getUINTTOFP(MVT OpVT, MVT RetVT); } } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=53713&r1=53712&r2=53713&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Jul 16 21:36:29 2008 @@ -3764,86 +3764,9 @@ break; } // Convert f32 / f64 to i32 / i64 / i128. - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - switch (Node->getOpcode()) { - case ISD::FP_TO_SINT: { - if (VT == MVT::i32) { - if (OVT == MVT::f32) - LC = RTLIB::FPTOSINT_F32_I32; - else if (OVT == MVT::f64) - LC = RTLIB::FPTOSINT_F64_I32; - else if (OVT == MVT::f80) - LC = RTLIB::FPTOSINT_F80_I32; - else if (OVT == MVT::ppcf128) - LC = RTLIB::FPTOSINT_PPCF128_I32; - else - assert(0 && "Unexpected i32-to-fp conversion!"); - } else if (VT == MVT::i64) { - if (OVT == MVT::f32) - LC = RTLIB::FPTOSINT_F32_I64; - else if (OVT == MVT::f64) - LC = RTLIB::FPTOSINT_F64_I64; - else if (OVT == MVT::f80) - LC = RTLIB::FPTOSINT_F80_I64; - else if (OVT == MVT::ppcf128) - LC = RTLIB::FPTOSINT_PPCF128_I64; - else - assert(0 && "Unexpected i64-to-fp conversion!"); - } else if (VT == MVT::i128) { - if (OVT == MVT::f32) - LC = RTLIB::FPTOSINT_F32_I128; - else if (OVT == MVT::f64) - LC = RTLIB::FPTOSINT_F64_I128; - else if (OVT == MVT::f80) - LC = RTLIB::FPTOSINT_F80_I128; - else if (OVT == MVT::ppcf128) - LC = RTLIB::FPTOSINT_PPCF128_I128; - else - assert(0 && "Unexpected i128-to-fp conversion!"); - } else { - assert(0 && "Unexpectd int-to-fp conversion!"); - } - break; - } - case ISD::FP_TO_UINT: { - if (VT == MVT::i32) { - if (OVT == MVT::f32) - LC = RTLIB::FPTOUINT_F32_I32; - else if (OVT == MVT::f64) - LC = RTLIB::FPTOUINT_F64_I32; - else if (OVT == MVT::f80) - LC = RTLIB::FPTOUINT_F80_I32; - else - assert(0 && "Unexpected i32-to-fp conversion!"); - } else if (VT == MVT::i64) { - if (OVT == MVT::f32) - LC = RTLIB::FPTOUINT_F32_I64; - else if (OVT == MVT::f64) - LC = RTLIB::FPTOUINT_F64_I64; - else if (OVT == MVT::f80) - LC = RTLIB::FPTOUINT_F80_I64; - else if (OVT == MVT::ppcf128) - LC = RTLIB::FPTOUINT_PPCF128_I64; - else - assert(0 && "Unexpected i64-to-fp conversion!"); - } else if (VT == MVT::i128) { - if (OVT == MVT::f32) - LC = RTLIB::FPTOUINT_F32_I128; - else if (OVT == MVT::f64) - LC = RTLIB::FPTOUINT_F64_I128; - else if (OVT == MVT::f80) - LC = RTLIB::FPTOUINT_F80_I128; - else if (OVT == MVT::ppcf128) - LC = RTLIB::FPTOUINT_PPCF128_I128; - else - assert(0 && "Unexpected i128-to-fp conversion!"); - } else { - assert(0 && "Unexpectd int-to-fp conversion!"); - } - break; - } - default: assert(0 && "Unreachable!"); - } + RTLIB::Libcall LC = (Node->getOpcode() == ISD::FP_TO_SINT) ? + RTLIB::getFPTOSINT(OVT, VT) : RTLIB::getFPTOUINT(OVT, VT); + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unexpectd fp-to-int conversion!"); SDOperand Dummy; Result = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Dummy); break; @@ -5412,41 +5335,11 @@ Source = DAG.getNode(ISD::BUILD_PAIR, SourceVT, SrcLo, SrcHi); } - RTLIB::Libcall LC; - if (SourceVT == MVT::i32) { - if (DestTy == MVT::f32) - LC = isSigned ? RTLIB::SINTTOFP_I32_F32 : RTLIB::UINTTOFP_I32_F32; - else { - assert(DestTy == MVT::f64 && "Unknown fp value type!"); - LC = isSigned ? RTLIB::SINTTOFP_I32_F64 : RTLIB::UINTTOFP_I32_F64; - } - } else if (SourceVT == MVT::i64) { - if (DestTy == MVT::f32) - LC = RTLIB::SINTTOFP_I64_F32; - else if (DestTy == MVT::f64) - LC = RTLIB::SINTTOFP_I64_F64; - else if (DestTy == MVT::f80) - LC = RTLIB::SINTTOFP_I64_F80; - else { - assert(DestTy == MVT::ppcf128 && "Unknown fp value type!"); - LC = RTLIB::SINTTOFP_I64_PPCF128; - } - } else if (SourceVT == MVT::i128) { - if (DestTy == MVT::f32) - LC = RTLIB::SINTTOFP_I128_F32; - else if (DestTy == MVT::f64) - LC = RTLIB::SINTTOFP_I128_F64; - else if (DestTy == MVT::f80) - LC = RTLIB::SINTTOFP_I128_F80; - else { - assert(DestTy == MVT::ppcf128 && "Unknown fp value type!"); - LC = RTLIB::SINTTOFP_I128_PPCF128; - } - } else { - assert(0 && "Unknown int value type"); - } - - assert(TLI.getLibcallName(LC) && "Don't know how to expand this SINT_TO_FP!"); + RTLIB::Libcall LC = isSigned ? + RTLIB::getSINTTOFP(SourceVT, DestTy) : + RTLIB::getUINTTOFP(SourceVT, DestTy); + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unknown int value type"); + Source = DAG.getNode(ISD::SINT_TO_FP, DestTy, Source); SDOperand HiPart; SDOperand Result = ExpandLibCall(LC, Source.Val, isSigned, HiPart); @@ -6196,30 +6089,10 @@ } } - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - if (VT == MVT::i64) { - if (Node->getOperand(0).getValueType() == MVT::f32) - LC = RTLIB::FPTOSINT_F32_I64; - else if (Node->getOperand(0).getValueType() == MVT::f64) - LC = RTLIB::FPTOSINT_F64_I64; - else if (Node->getOperand(0).getValueType() == MVT::f80) - LC = RTLIB::FPTOSINT_F80_I64; - else if (Node->getOperand(0).getValueType() == MVT::ppcf128) - LC = RTLIB::FPTOSINT_PPCF128_I64; - Lo = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Hi); - } else if (VT == MVT::i128) { - if (Node->getOperand(0).getValueType() == MVT::f32) - LC = RTLIB::FPTOSINT_F32_I128; - else if (Node->getOperand(0).getValueType() == MVT::f64) - LC = RTLIB::FPTOSINT_F64_I128; - else if (Node->getOperand(0).getValueType() == MVT::f80) - LC = RTLIB::FPTOSINT_F80_I128; - else if (Node->getOperand(0).getValueType() == MVT::ppcf128) - LC = RTLIB::FPTOSINT_PPCF128_I128; - Lo = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Hi); - } else { - assert(0 && "Unexpected uint-to-fp conversion!"); - } + RTLIB::Libcall LC = RTLIB::getFPTOSINT(Node->getOperand(0).getValueType(), + VT); + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unexpected uint-to-fp conversion!"); + Lo = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Hi); break; } @@ -6241,30 +6114,10 @@ } } - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - if (VT == MVT::i64) { - if (Node->getOperand(0).getValueType() == MVT::f32) - LC = RTLIB::FPTOUINT_F32_I64; - else if (Node->getOperand(0).getValueType() == MVT::f64) - LC = RTLIB::FPTOUINT_F64_I64; - else if (Node->getOperand(0).getValueType() == MVT::f80) - LC = RTLIB::FPTOUINT_F80_I64; - else if (Node->getOperand(0).getValueType() == MVT::ppcf128) - LC = RTLIB::FPTOUINT_PPCF128_I64; - Lo = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Hi); - } else if (VT == MVT::i128) { - if (Node->getOperand(0).getValueType() == MVT::f32) - LC = RTLIB::FPTOUINT_F32_I128; - else if (Node->getOperand(0).getValueType() == MVT::f64) - LC = RTLIB::FPTOUINT_F64_I128; - else if (Node->getOperand(0).getValueType() == MVT::f80) - LC = RTLIB::FPTOUINT_F80_I128; - else if (Node->getOperand(0).getValueType() == MVT::ppcf128) - LC = RTLIB::FPTOUINT_PPCF128_I128; - Lo = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Hi); - } else { - assert(0 && "Unexpected uint-to-fp conversion!"); - } + RTLIB::Libcall LC = RTLIB::getFPTOUINT(Node->getOperand(0).getValueType(), + VT); + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unexpected fp-to-uint conversion!"); + Lo = ExpandLibCall(LC, Node, false/*sign irrelevant*/, Hi); break; } @@ -6579,7 +6432,7 @@ RTLIB::DIV_PPCF128), Node, false, Hi); break; - case ISD::FP_EXTEND: + case ISD::FP_EXTEND: { if (VT == MVT::ppcf128) { assert(Node->getOperand(0).getValueType()==MVT::f32 || Node->getOperand(0).getValueType()==MVT::f64); @@ -6591,11 +6444,18 @@ Lo = DAG.getConstantFP(APFloat(APInt(64, 1, &zero)), MVT::f64); break; } - Lo = ExpandLibCall(RTLIB::FPEXT_F32_F64, Node, true, Hi); + RTLIB::Libcall LC = RTLIB::getFPEXT(Node->getOperand(0).getValueType(), VT); + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_EXTEND!"); + Lo = ExpandLibCall(LC, Node, true, Hi); break; - case ISD::FP_ROUND: - Lo = ExpandLibCall(RTLIB::FPROUND_F64_F32, Node, true, Hi); + } + case ISD::FP_ROUND: { + RTLIB::Libcall LC = RTLIB::getFPROUND(Node->getOperand(0).getValueType(), + VT); + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_ROUND!"); + Lo = ExpandLibCall(LC, Node, true, Hi); break; + } case ISD::FPOWI: Lo = ExpandLibCall(GetFPLibCall(VT, RTLIB::POWI_F32, RTLIB::POWI_F64, Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp?rev=53713&r1=53712&r2=53713&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Wed Jul 16 21:36:29 2008 @@ -161,40 +161,16 @@ SDOperand DAGTypeLegalizer::SoftenFloatRes_FP_EXTEND(SDNode *N) { MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); SDOperand Op = N->getOperand(0); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - switch (Op.getValueType().getSimpleVT()) { - default: - assert(false && "Unsupported FP_EXTEND!"); - case MVT::f32: - switch (N->getValueType(0).getSimpleVT()) { - default: - assert(false && "Unsupported FP_EXTEND!"); - case MVT::f64: - LC = RTLIB::FPEXT_F32_F64; - } - } - + RTLIB::Libcall LC = RTLIB::getFPEXT(Op.getValueType(), N->getValueType(0)); + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_EXTEND!"); return MakeLibCall(LC, NVT, &Op, 1, false); } SDOperand DAGTypeLegalizer::SoftenFloatRes_FP_ROUND(SDNode *N) { MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); SDOperand Op = N->getOperand(0); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - switch (Op.getValueType().getSimpleVT()) { - default: - assert(false && "Unsupported FP_ROUND!"); - case MVT::f64: - switch (N->getValueType(0).getSimpleVT()) { - default: - assert(false && "Unsupported FP_ROUND!"); - case MVT::f32: - LC = RTLIB::FPROUND_F64_F32; - } - } - + RTLIB::Libcall LC = RTLIB::getFPROUND(Op.getValueType(), N->getValueType(0)); + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_ROUND!"); return MakeLibCall(LC, NVT, &Op, 1, false); } @@ -267,100 +243,16 @@ SDOperand DAGTypeLegalizer::SoftenFloatRes_SINT_TO_FP(SDNode *N) { SDOperand Op = N->getOperand(0); MVT RVT = N->getValueType(0); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - switch (Op.getValueType().getSimpleVT()) { - case MVT::i32: - switch (RVT.getSimpleVT()) { - case MVT::f32: - LC = RTLIB::SINTTOFP_I32_F32; - break; - case MVT::f64: - LC = RTLIB::SINTTOFP_I32_F64; - break; - default: - break; - } - break; - case MVT::i64: - switch (RVT.getSimpleVT()) { - case MVT::f32: - LC = RTLIB::SINTTOFP_I64_F32; - break; - case MVT::f64: - LC = RTLIB::SINTTOFP_I64_F64; - break; - case MVT::f80: - LC = RTLIB::SINTTOFP_I64_F80; - break; - case MVT::ppcf128: - LC = RTLIB::SINTTOFP_I64_PPCF128; - break; - default: - break; - } - break; - case MVT::i128: - switch (RVT.getSimpleVT()) { - case MVT::f32: - LC = RTLIB::SINTTOFP_I128_F32; - break; - case MVT::f64: - LC = RTLIB::SINTTOFP_I128_F64; - break; - case MVT::f80: - LC = RTLIB::SINTTOFP_I128_F80; - break; - case MVT::ppcf128: - LC = RTLIB::SINTTOFP_I128_PPCF128; - break; - default: - break; - } - break; - default: - break; - } + RTLIB::Libcall LC = RTLIB::getSINTTOFP(Op.getValueType(), RVT); assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SINT_TO_FP!"); - return MakeLibCall(LC, TLI.getTypeToTransformTo(RVT), &Op, 1, false); } SDOperand DAGTypeLegalizer::SoftenFloatRes_UINT_TO_FP(SDNode *N) { SDOperand Op = N->getOperand(0); MVT RVT = N->getValueType(0); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - switch (Op.getValueType().getSimpleVT()) { - case MVT::i32: - switch (RVT.getSimpleVT()) { - case MVT::f32: - LC = RTLIB::UINTTOFP_I32_F32; - break; - case MVT::f64: - LC = RTLIB::UINTTOFP_I32_F64; - break; - default: - break; - } - break; - case MVT::i64: - switch (RVT.getSimpleVT()) { - case MVT::f32: - LC = RTLIB::UINTTOFP_I64_F32; - break; - case MVT::f64: - LC = RTLIB::UINTTOFP_I64_F64; - break; - default: - break; - } - break; - default: - break; - } + RTLIB::Libcall LC = RTLIB::getUINTTOFP(Op.getValueType(), RVT); assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported UINT_TO_FP!"); - return MakeLibCall(LC, TLI.getTypeToTransformTo(RVT), &Op, 1, false); } @@ -521,139 +413,17 @@ } SDOperand DAGTypeLegalizer::SoftenFloatOp_FP_TO_SINT(SDNode *N) { - MVT SVT = N->getOperand(0).getValueType(); MVT RVT = N->getValueType(0); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - switch (RVT.getSimpleVT()) { - case MVT::i32: - switch (SVT.getSimpleVT()) { - case MVT::f32: - LC = RTLIB::FPTOSINT_F32_I32; - break; - case MVT::f64: - LC = RTLIB::FPTOSINT_F64_I32; - break; - case MVT::f80: - LC = RTLIB::FPTOSINT_F80_I32; - break; - case MVT::ppcf128: - LC = RTLIB::FPTOSINT_PPCF128_I32; - break; - default: - break; - } - break; - case MVT::i64: - switch (SVT.getSimpleVT()) { - case MVT::f32: - LC = RTLIB::FPTOSINT_F32_I64; - break; - case MVT::f64: - LC = RTLIB::FPTOSINT_F64_I64; - break; - case MVT::f80: - LC = RTLIB::FPTOSINT_F80_I64; - break; - case MVT::ppcf128: - LC = RTLIB::FPTOSINT_PPCF128_I64; - break; - default: - break; - } - break; - case MVT::i128: - switch (SVT.getSimpleVT()) { - case MVT::f32: - LC = RTLIB::FPTOSINT_F32_I128; - break; - case MVT::f64: - LC = RTLIB::FPTOSINT_F64_I128; - break; - case MVT::f80: - LC = RTLIB::FPTOSINT_F80_I128; - break; - case MVT::ppcf128: - LC = RTLIB::FPTOSINT_PPCF128_I128; - break; - default: - break; - } - break; - default: - break; - } + RTLIB::Libcall LC = RTLIB::getFPTOSINT(N->getOperand(0).getValueType(), RVT); assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_TO_SINT!"); - SDOperand Op = GetSoftenedFloat(N->getOperand(0)); return MakeLibCall(LC, RVT, &Op, 1, false); } SDOperand DAGTypeLegalizer::SoftenFloatOp_FP_TO_UINT(SDNode *N) { - MVT SVT = N->getOperand(0).getValueType(); MVT RVT = N->getValueType(0); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - switch (RVT.getSimpleVT()) { - case MVT::i32: - switch (SVT.getSimpleVT()) { - case MVT::f32: - LC = RTLIB::FPTOUINT_F32_I32; - break; - case MVT::f64: - LC = RTLIB::FPTOUINT_F64_I32; - break; - case MVT::f80: - LC = RTLIB::FPTOUINT_F80_I32; - break; - case MVT::ppcf128: - LC = RTLIB::FPTOUINT_PPCF128_I32; - break; - default: - break; - } - break; - case MVT::i64: - switch (SVT.getSimpleVT()) { - case MVT::f32: - LC = RTLIB::FPTOUINT_F32_I64; - break; - case MVT::f64: - LC = RTLIB::FPTOUINT_F64_I64; - break; - case MVT::f80: - LC = RTLIB::FPTOUINT_F80_I64; - break; - case MVT::ppcf128: - LC = RTLIB::FPTOUINT_PPCF128_I64; - break; - default: - break; - } - break; - case MVT::i128: - switch (SVT.getSimpleVT()) { - case MVT::f32: - LC = RTLIB::FPTOUINT_F32_I128; - break; - case MVT::f64: - LC = RTLIB::FPTOUINT_F64_I128; - break; - case MVT::f80: - LC = RTLIB::FPTOUINT_F80_I128; - break; - case MVT::ppcf128: - LC = RTLIB::FPTOUINT_PPCF128_I128; - break; - default: - break; - } - break; - default: - break; - } + RTLIB::Libcall LC = RTLIB::getFPTOUINT(N->getOperand(0).getValueType(), RVT); assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_TO_UINT!"); - SDOperand Op = GetSoftenedFloat(N->getOperand(0)); return MakeLibCall(LC, RVT, &Op, 1, false); } @@ -1067,45 +837,16 @@ } SDOperand DAGTypeLegalizer::ExpandFloatOp_FP_TO_SINT(SDNode *N) { - assert(N->getOperand(0).getValueType() == MVT::ppcf128 && - "Unsupported FP_TO_SINT!"); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - switch (N->getValueType(0).getSimpleVT()) { - default: - assert(false && "Unsupported FP_TO_SINT!"); - case MVT::i32: - LC = RTLIB::FPTOSINT_PPCF128_I32; - case MVT::i64: - LC = RTLIB::FPTOSINT_PPCF128_I64; - break; - case MVT::i128: - LC = RTLIB::FPTOSINT_PPCF128_I64; - break; - } - - return MakeLibCall(LC, N->getValueType(0), &N->getOperand(0), 1, false); + MVT RVT = N->getValueType(0); + RTLIB::Libcall LC = RTLIB::getFPTOSINT(N->getOperand(0).getValueType(), RVT); + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_TO_SINT!"); + return MakeLibCall(LC, RVT, &N->getOperand(0), 1, false); } SDOperand DAGTypeLegalizer::ExpandFloatOp_FP_TO_UINT(SDNode *N) { - assert(N->getOperand(0).getValueType() == MVT::ppcf128 && - "Unsupported FP_TO_UINT!"); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - switch (N->getValueType(0).getSimpleVT()) { - default: - assert(false && "Unsupported FP_TO_UINT!"); - case MVT::i32: - LC = RTLIB::FPTOUINT_PPCF128_I32; - break; - case MVT::i64: - LC = RTLIB::FPTOUINT_PPCF128_I64; - break; - case MVT::i128: - LC = RTLIB::FPTOUINT_PPCF128_I128; - break; - } - + MVT RVT = N->getValueType(0); + RTLIB::Libcall LC = RTLIB::getFPTOUINT(N->getOperand(0).getValueType(), RVT); + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_TO_UINT!"); return MakeLibCall(LC, N->getValueType(0), &N->getOperand(0), 1, false); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=53713&r1=53712&r2=53713&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Wed Jul 16 21:36:29 2008 @@ -1238,36 +1238,7 @@ SDOperand &Hi) { MVT VT = N->getValueType(0); SDOperand Op = N->getOperand(0); - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - - if (VT == MVT::i32) { - if (Op.getValueType() == MVT::f32) - LC = RTLIB::FPTOSINT_F32_I32; - else if (Op.getValueType() == MVT::f64) - LC = RTLIB::FPTOSINT_F64_I32; - else if (Op.getValueType() == MVT::f80) - LC = RTLIB::FPTOSINT_F80_I32; - else if (Op.getValueType() == MVT::ppcf128) - LC = RTLIB::FPTOSINT_PPCF128_I32; - } else if (VT == MVT::i64) { - if (Op.getValueType() == MVT::f32) - LC = RTLIB::FPTOSINT_F32_I64; - else if (Op.getValueType() == MVT::f64) - LC = RTLIB::FPTOSINT_F64_I64; - else if (Op.getValueType() == MVT::f80) - LC = RTLIB::FPTOSINT_F80_I64; - else if (Op.getValueType() == MVT::ppcf128) - LC = RTLIB::FPTOSINT_PPCF128_I64; - } else if (VT == MVT::i128) { - if (Op.getValueType() == MVT::f32) - LC = RTLIB::FPTOSINT_F32_I128; - else if (Op.getValueType() == MVT::f64) - LC = RTLIB::FPTOSINT_F64_I128; - else if (Op.getValueType() == MVT::f80) - LC = RTLIB::FPTOSINT_F80_I128; - else if (Op.getValueType() == MVT::ppcf128) - LC = RTLIB::FPTOSINT_PPCF128_I128; - } + RTLIB::Libcall LC = RTLIB::getFPTOSINT(Op.getValueType(), VT); assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unexpected fp-to-sint conversion!"); SplitInteger(MakeLibCall(LC, VT, &Op, 1, true/*sign irrelevant*/), Lo, Hi); } @@ -1276,35 +1247,7 @@ SDOperand &Hi) { MVT VT = N->getValueType(0); SDOperand Op = N->getOperand(0); - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - if (VT == MVT::i32) { - if (Op.getValueType() == MVT::f32) - LC = RTLIB::FPTOUINT_F32_I32; - else if (Op.getValueType() == MVT::f64) - LC = RTLIB::FPTOUINT_F64_I32; - else if (Op.getValueType() == MVT::f80) - LC = RTLIB::FPTOUINT_F80_I32; - else if (Op.getValueType() == MVT::ppcf128) - LC = RTLIB::FPTOUINT_PPCF128_I32; - } else if (VT == MVT::i64) { - if (Op.getValueType() == MVT::f32) - LC = RTLIB::FPTOUINT_F32_I64; - else if (Op.getValueType() == MVT::f64) - LC = RTLIB::FPTOUINT_F64_I64; - else if (Op.getValueType() == MVT::f80) - LC = RTLIB::FPTOUINT_F80_I64; - else if (Op.getValueType() == MVT::ppcf128) - LC = RTLIB::FPTOUINT_PPCF128_I64; - } else if (VT == MVT::i128) { - if (Op.getValueType() == MVT::f32) - LC = RTLIB::FPTOUINT_F32_I128; - else if (Op.getValueType() == MVT::f64) - LC = RTLIB::FPTOUINT_F64_I128; - else if (Op.getValueType() == MVT::f80) - LC = RTLIB::FPTOUINT_F80_I128; - else if (Op.getValueType() == MVT::ppcf128) - LC = RTLIB::FPTOUINT_PPCF128_I128; - } + RTLIB::Libcall LC = RTLIB::getFPTOUINT(Op.getValueType(), VT); assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unexpected fp-to-uint conversion!"); SplitInteger(MakeLibCall(LC, VT, &Op, 1, false/*sign irrelevant*/), Lo, Hi); } @@ -1961,41 +1904,10 @@ SDOperand DAGTypeLegalizer::ExpandIntOp_SINT_TO_FP(SDNode *N) { SDOperand Op = N->getOperand(0); - MVT SrcVT = Op.getValueType(); MVT DstVT = N->getValueType(0); - - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - if (SrcVT == MVT::i32) { - if (DstVT == MVT::f32) - LC = RTLIB::SINTTOFP_I32_F32; - else if (DstVT == MVT::f64) - LC = RTLIB::SINTTOFP_I32_F64; - else if (DstVT == MVT::f80) - LC = RTLIB::SINTTOFP_I32_F80; - else if (DstVT == MVT::ppcf128) - LC = RTLIB::SINTTOFP_I32_PPCF128; - } else if (SrcVT == MVT::i64) { - if (DstVT == MVT::f32) - LC = RTLIB::SINTTOFP_I64_F32; - else if (DstVT == MVT::f64) - LC = RTLIB::SINTTOFP_I64_F64; - else if (DstVT == MVT::f80) - LC = RTLIB::SINTTOFP_I64_F80; - else if (DstVT == MVT::ppcf128) - LC = RTLIB::SINTTOFP_I64_PPCF128; - } else if (SrcVT == MVT::i128) { - if (DstVT == MVT::f32) - LC = RTLIB::SINTTOFP_I128_F32; - else if (DstVT == MVT::f64) - LC = RTLIB::SINTTOFP_I128_F64; - else if (DstVT == MVT::f80) - LC = RTLIB::SINTTOFP_I128_F80; - else if (DstVT == MVT::ppcf128) - LC = RTLIB::SINTTOFP_I128_PPCF128; - } + RTLIB::Libcall LC = RTLIB::getSINTTOFP(Op.getValueType(), DstVT); assert(LC != RTLIB::UNKNOWN_LIBCALL && "Don't know how to expand this SINT_TO_FP!"); - return MakeLibCall(LC, DstVT, &Op, 1, true); } @@ -2140,37 +2052,8 @@ } // Otherwise, use a libcall. - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - if (SrcVT == MVT::i32) { - if (DstVT == MVT::f32) - LC = RTLIB::UINTTOFP_I32_F32; - else if (DstVT == MVT::f64) - LC = RTLIB::UINTTOFP_I32_F64; - else if (DstVT == MVT::f80) - LC = RTLIB::UINTTOFP_I32_F80; - else if (DstVT == MVT::ppcf128) - LC = RTLIB::UINTTOFP_I32_PPCF128; - } else if (SrcVT == MVT::i64) { - if (DstVT == MVT::f32) - LC = RTLIB::UINTTOFP_I64_F32; - else if (DstVT == MVT::f64) - LC = RTLIB::UINTTOFP_I64_F64; - else if (DstVT == MVT::f80) - LC = RTLIB::UINTTOFP_I64_F80; - else if (DstVT == MVT::ppcf128) - LC = RTLIB::UINTTOFP_I64_PPCF128; - } else if (SrcVT == MVT::i128) { - if (DstVT == MVT::f32) - LC = RTLIB::UINTTOFP_I128_F32; - else if (DstVT == MVT::f64) - LC = RTLIB::UINTTOFP_I128_F64; - else if (DstVT == MVT::f80) - LC = RTLIB::UINTTOFP_I128_F80; - else if (DstVT == MVT::ppcf128) - LC = RTLIB::UINTTOFP_I128_PPCF128; - } + RTLIB::Libcall LC = RTLIB::getUINTTOFP(SrcVT, DstVT); assert(LC != RTLIB::UNKNOWN_LIBCALL && "Don't know how to expand this UINT_TO_FP!"); - return MakeLibCall(LC, DstVT, &Op, 1, true); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=53713&r1=53712&r2=53713&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Wed Jul 16 21:36:29 2008 @@ -163,6 +163,164 @@ Names[RTLIB::O_F64] = "__unorddf2"; } +/// getFPEXT - Return the FPEXT_*_* value for the given types, or +/// UNKNOWN_LIBCALL if there is none. +RTLIB::Libcall RTLIB::getFPEXT(MVT OpVT, MVT RetVT) { + if (OpVT == MVT::f32) { + if (RetVT == MVT::f64) + return FPEXT_F32_F64; + } + return UNKNOWN_LIBCALL; +} + +/// getFPROUND - Return the FPROUND_*_* value for the given types, or +/// UNKNOWN_LIBCALL if there is none. +RTLIB::Libcall RTLIB::getFPROUND(MVT OpVT, MVT RetVT) { + if (OpVT == MVT::f64) { + if (RetVT == MVT::f32) + return FPROUND_F64_F32; + } + return UNKNOWN_LIBCALL; +} + +/// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or +/// UNKNOWN_LIBCALL if there is none. +RTLIB::Libcall RTLIB::getFPTOSINT(MVT OpVT, MVT RetVT) { + if (OpVT == MVT::f32) { + if (RetVT == MVT::i32) + return FPTOSINT_F32_I32; + if (RetVT == MVT::i64) + return FPTOSINT_F32_I64; + if (RetVT == MVT::i128) + return FPTOSINT_F32_I128; + } else if (OpVT == MVT::f64) { + if (RetVT == MVT::i32) + return FPTOSINT_F64_I32; + if (RetVT == MVT::i64) + return FPTOSINT_F64_I64; + if (RetVT == MVT::i128) + return FPTOSINT_F64_I128; + } else if (OpVT == MVT::f80) { + if (RetVT == MVT::i32) + return FPTOSINT_F80_I32; + if (RetVT == MVT::i64) + return FPTOSINT_F80_I64; + if (RetVT == MVT::i128) + return FPTOSINT_F80_I128; + } else if (OpVT == MVT::ppcf128) { + if (RetVT == MVT::i32) + return FPTOSINT_PPCF128_I32; + if (RetVT == MVT::i64) + return FPTOSINT_PPCF128_I64; + if (RetVT == MVT::i128) + return FPTOSINT_PPCF128_I128; + } + return UNKNOWN_LIBCALL; +} + +/// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or +/// UNKNOWN_LIBCALL if there is none. +RTLIB::Libcall RTLIB::getFPTOUINT(MVT OpVT, MVT RetVT) { + if (OpVT == MVT::f32) { + if (RetVT == MVT::i32) + return FPTOUINT_F32_I32; + if (RetVT == MVT::i64) + return FPTOUINT_F32_I64; + if (RetVT == MVT::i128) + return FPTOUINT_F32_I128; + } else if (OpVT == MVT::f64) { + if (RetVT == MVT::i32) + return FPTOUINT_F64_I32; + if (RetVT == MVT::i64) + return FPTOUINT_F64_I64; + if (RetVT == MVT::i128) + return FPTOUINT_F64_I128; + } else if (OpVT == MVT::f80) { + if (RetVT == MVT::i32) + return FPTOUINT_F80_I32; + if (RetVT == MVT::i64) + return FPTOUINT_F80_I64; + if (RetVT == MVT::i128) + return FPTOUINT_F80_I128; + } else if (OpVT == MVT::ppcf128) { + if (RetVT == MVT::i32) + return FPTOUINT_PPCF128_I32; + if (RetVT == MVT::i64) + return FPTOUINT_PPCF128_I64; + if (RetVT == MVT::i128) + return FPTOUINT_PPCF128_I128; + } + return UNKNOWN_LIBCALL; +} + +/// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or +/// UNKNOWN_LIBCALL if there is none. +RTLIB::Libcall RTLIB::getSINTTOFP(MVT OpVT, MVT RetVT) { + if (OpVT == MVT::i32) { + if (RetVT == MVT::f32) + return SINTTOFP_I32_F32; + else if (RetVT == MVT::f64) + return SINTTOFP_I32_F64; + else if (RetVT == MVT::f80) + return SINTTOFP_I32_F80; + else if (RetVT == MVT::ppcf128) + return SINTTOFP_I32_PPCF128; + } else if (OpVT == MVT::i64) { + if (RetVT == MVT::f32) + return SINTTOFP_I64_F32; + else if (RetVT == MVT::f64) + return SINTTOFP_I64_F64; + else if (RetVT == MVT::f80) + return SINTTOFP_I64_F80; + else if (RetVT == MVT::ppcf128) + return SINTTOFP_I64_PPCF128; + } else if (OpVT == MVT::i128) { + if (RetVT == MVT::f32) + return SINTTOFP_I128_F32; + else if (RetVT == MVT::f64) + return SINTTOFP_I128_F64; + else if (RetVT == MVT::f80) + return SINTTOFP_I128_F80; + else if (RetVT == MVT::ppcf128) + return SINTTOFP_I128_PPCF128; + } + return UNKNOWN_LIBCALL; +} + +/// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or +/// UNKNOWN_LIBCALL if there is none. +RTLIB::Libcall RTLIB::getUINTTOFP(MVT OpVT, MVT RetVT) { + if (OpVT == MVT::i32) { + if (RetVT == MVT::f32) + return UINTTOFP_I32_F32; + else if (RetVT == MVT::f64) + return UINTTOFP_I32_F64; + else if (RetVT == MVT::f80) + return UINTTOFP_I32_F80; + else if (RetVT == MVT::ppcf128) + return UINTTOFP_I32_PPCF128; + } else if (OpVT == MVT::i64) { + if (RetVT == MVT::f32) + return UINTTOFP_I64_F32; + else if (RetVT == MVT::f64) + return UINTTOFP_I64_F64; + else if (RetVT == MVT::f80) + return UINTTOFP_I64_F80; + else if (RetVT == MVT::ppcf128) + return UINTTOFP_I64_PPCF128; + } else if (OpVT == MVT::i128) { + if (RetVT == MVT::f32) + return UINTTOFP_I128_F32; + else if (RetVT == MVT::f64) + return UINTTOFP_I128_F64; + else if (RetVT == MVT::f80) + return UINTTOFP_I128_F80; + else if (RetVT == MVT::ppcf128) + return UINTTOFP_I128_PPCF128; + } + return UNKNOWN_LIBCALL; +} + /// InitCmpLibcallCCs - Set default comparison libcall CC. /// static void InitCmpLibcallCCs(ISD::CondCode *CCs) { From gabor at mac.com Wed Jul 16 21:17:40 2008 From: gabor at mac.com (Gabor Greif) Date: Thu, 17 Jul 2008 04:17:40 +0200 Subject: [llvm-commits] [llvm] r53712 - /llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Message-ID: <5016A063-74AC-4E29-93B4-EA42EB53E7AC@mac.com> > Hi Evan, > > > + // Calls often compile into many machine instructions. > Bump up their > > + // cost to reflect this. > > + if (!isa(II)) > > + NumInsts += 5; > > I suppose you could also add in the number of operands in order > to vaguely reflect the cost of inlining a call with many parameters. Or even better, the number of operands that are actually *used*. Cheers, Gabor > > Ciao, > > Duncan. From wangmp at apple.com Wed Jul 16 23:51:16 2008 From: wangmp at apple.com (Mon P Wang) Date: Wed, 16 Jul 2008 21:51:16 -0700 Subject: [llvm-commits] [LLVMdev] atomic memoperand patch In-Reply-To: <200807170303.11953.baldrick@free.fr> References: <036A5A51-F349-4876-9AF1-E13E0CDD5AEA@apple.com> <200807170303.11953.baldrick@free.fr> Message-ID: <0570D092-58E5-49D4-8F46-8D5EC5430B76@apple.com> Hi, Opps, I sent it the wrong list so I'm sending it back to commit. I think the indentation in the code is fine but the subversion difference and the wrapping makes it look like we are missing a space. Thanks, -- Mon Ping On Jul 16, 2008, at 6:03 PM, Duncan Sands wrote: > Hi, > >> MIB.addReg(t2); >> - >> + assert(bInstr->hasOneMemOperand() && "Unexpected number of >> memoperand"); >> + (*MIB).addMemOperand(*F, *bInstr->memoperands_begin()); >> + >> MIB = BuildMI(newMBB, TII->get(X86::MOV32rr), destOper.getReg()); > > this doesn't seem to be indented right (needs one more space). > Same for the rest of the patch. > > Ciao, > > Duncan. From wangmp at apple.com Wed Jul 16 23:54:07 2008 From: wangmp at apple.com (Mon P Wang) Date: Thu, 17 Jul 2008 04:54:07 -0000 Subject: [llvm-commits] [llvm] r53714 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200807170454.m6H4s7B0030132@zion.cs.uiuc.edu> Author: wangmp Date: Wed Jul 16 23:54:06 2008 New Revision: 53714 URL: http://llvm.org/viewvc/llvm-project?rev=53714&view=rev Log: When lowering certain atomics, we need to copy the memoperand from the old atomic operation to the new one. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=53714&r1=53713&r2=53714&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jul 16 23:54:06 2008 @@ -6010,7 +6010,9 @@ for (int i=0; i <= lastAddrIndx; ++i) (*MIB).addOperand(*argOpers[i]); MIB.addReg(t2); - + assert(bInstr->hasOneMemOperand() && "Unexpected number of memoperand"); + (*MIB).addMemOperand(*F, *bInstr->memoperands_begin()); + MIB = BuildMI(newMBB, TII->get(X86::MOV32rr), destOper.getReg()); MIB.addReg(X86::EAX); @@ -6107,6 +6109,8 @@ for (int i=0; i <= lastAddrIndx; ++i) (*MIB).addOperand(*argOpers[i]); MIB.addReg(t3); + assert(mInstr->hasOneMemOperand() && "Unexpected number of memoperand"); + (*MIB).addMemOperand(*F, *mInstr->memoperands_begin()); MIB = BuildMI(newMBB, TII->get(X86::MOV32rr), destOper.getReg()); MIB.addReg(X86::EAX); From sabre at nondot.org Thu Jul 17 01:07:20 2008 From: sabre at nondot.org (Chris Lattner) Date: Thu, 17 Jul 2008 06:07:20 -0000 Subject: [llvm-commits] [llvm] r53715 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-07-16-fsub.ll Message-ID: <200807170607.m6H67KtE032342@zion.cs.uiuc.edu> Author: lattner Date: Thu Jul 17 01:07:20 2008 New Revision: 53715 URL: http://llvm.org/viewvc/llvm-project?rev=53715&view=rev Log: Fix PR2553 Added: llvm/trunk/test/Transforms/InstCombine/2008-07-16-fsub.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=53715&r1=53714&r2=53715&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Thu Jul 17 01:07:20 2008 @@ -2255,7 +2255,8 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) { Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); - if (Op0 == Op1) // sub X, X -> 0 + if (Op0 == Op1 && // sub X, X -> 0 + !I.getType()->isFPOrFPVector()) return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); // If this is a 'B = x-(-A)', change to B = x+A... Added: llvm/trunk/test/Transforms/InstCombine/2008-07-16-fsub.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-07-16-fsub.ll?rev=53715&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/2008-07-16-fsub.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/2008-07-16-fsub.ll Thu Jul 17 01:07:20 2008 @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep sub +; PR2553 + +define double @test(double %X) nounwind { + ; fsub of self can't be optimized away. + %Y = sub double %X, %X + ret double %Y +} From clattner at apple.com Thu Jul 17 01:31:46 2008 From: clattner at apple.com (Chris Lattner) Date: Wed, 16 Jul 2008 23:31:46 -0700 Subject: [llvm-commits] [llvm] r53712 - /llvm/trunk/lib/Transforms/Utils/InlineCost.cpp In-Reply-To: <5016A063-74AC-4E29-93B4-EA42EB53E7AC@mac.com> References: <5016A063-74AC-4E29-93B4-EA42EB53E7AC@mac.com> Message-ID: <16BAE590-1D6A-44C0-98E7-ED68808A716D@apple.com> On Jul 16, 2008, at 7:17 PM, Gabor Greif wrote: >> Hi Evan, >> >>> + // Calls often compile into many machine instructions. >> Bump up their >>> + // cost to reflect this. >>> + if (!isa(II)) >>> + NumInsts += 5; >> >> I suppose you could also add in the number of operands in order >> to vaguely reflect the cost of inlining a call with many parameters. > > Or even better, the number of operands that are actually *used*. This is the cost of inlining a function that contains a call, so it should be proportional to the number of operands passed. 4+NumOperands seems like a reasonable (if totally ad-hoc) cost to me. -Chris From matthijs at stdin.nl Thu Jul 17 06:59:53 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Thu, 17 Jul 2008 11:59:53 -0000 Subject: [llvm-commits] [llvm] r53716 - in /llvm/trunk: lib/Transforms/IPO/GlobalOpt.cpp test/Transforms/GlobalOpt/2008-07-17-addrspace.ll Message-ID: <200807171159.m6HBxsmX022535@zion.cs.uiuc.edu> Author: matthijs Date: Thu Jul 17 06:59:53 2008 New Revision: 53716 URL: http://llvm.org/viewvc/llvm-project?rev=53716&view=rev Log: Make GlobalOpt preserve address spaces when scalar replacing aggregate globals. Added: llvm/trunk/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=53716&r1=53715&r2=53716&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Thu Jul 17 06:59:53 2008 @@ -486,7 +486,8 @@ GlobalVariable::InternalLinkage, In, GV->getName()+"."+utostr(i), (Module *)NULL, - GV->isThreadLocal()); + GV->isThreadLocal(), + GV->getType()->getAddressSpace()); Globals.insert(GV, NGV); NewGlobals.push_back(NGV); @@ -520,7 +521,8 @@ GlobalVariable::InternalLinkage, In, GV->getName()+"."+utostr(i), (Module *)NULL, - GV->isThreadLocal()); + GV->isThreadLocal(), + GV->getType()->getAddressSpace()); Globals.insert(GV, NGV); NewGlobals.push_back(NGV); Added: llvm/trunk/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll?rev=53716&view=auto ============================================================================== --- llvm/trunk/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll (added) +++ llvm/trunk/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll Thu Jul 17 06:59:53 2008 @@ -0,0 +1,28 @@ +; This test lets globalopt split the global struct and array into different +; values. This used to crash, because globalopt forgot to put the new var in the +; same address space as the old one. + +; RUN: llvm-as < %s | opt -globalopt | llvm-dis > %t +; Check that the new global values still have their address space +; RUN: cat %t | grep global.*addrspace + + at struct = internal global { i32, i32 } zeroinitializer addrspace(1) + at array = internal global [ 2 x i32 ] zeroinitializer addrspace(1) + +define i32 @foo() { + %A = load i32 addrspace(1) * getelementptr ({ i32, i32 } addrspace(1) * @struct, i32 0, i32 0) + %B = load i32 addrspace(1) * getelementptr ([ 2 x i32 ] addrspace(1) * @array, i32 0, i32 0) + ; Use the loaded values, so they won't get removed completely + %R = add i32 %A, %B + ret i32 %R +} + +; We put stores in a different function, so that the global variables won't get +; optimized away completely. +define void @bar(i32 %R) { + store i32 %R, i32 addrspace(1) * getelementptr ([ 2 x i32 ] addrspace(1) * @array, i32 0, i32 0) + store i32 %R, i32 addrspace(1) * getelementptr ({ i32, i32 } addrspace(1) * @struct, i32 0, i32 0) + ret void +} + + From baldrick at free.fr Thu Jul 17 10:55:16 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 17 Jul 2008 15:55:16 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53717 - /llvm-gcc-4.2/trunk/gcc/ada/init.c Message-ID: <200807171555.m6HFtGIN030286@zion.cs.uiuc.edu> Author: baldrick Date: Thu Jul 17 10:55:14 2008 New Revision: 53717 URL: http://llvm.org/viewvc/llvm-project?rev=53717&view=rev Log: Remove the fake system__restrictions__run_time_restrictions. Without it, the Ada front-end cannot be compiled with GNAT GPL editions earlier than 2007. However with it you can get a nasty warning when linking executables. This warning is the reason that most of the Ada gcc regression tests fail. Modified: llvm-gcc-4.2/trunk/gcc/ada/init.c Modified: llvm-gcc-4.2/trunk/gcc/ada/init.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ada/init.c?rev=53717&r1=53716&r2=53717&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/ada/init.c (original) +++ llvm-gcc-4.2/trunk/gcc/ada/init.c Thu Jul 17 10:55:14 2008 @@ -96,9 +96,8 @@ char __gl_queuing_policy = ' '; char __gl_task_dispatching_policy = ' '; /* LLVM local begin */ -char *__gl_priority_specific_dispatching __attribute__ ((weak)); -int __gl_num_specific_dispatching __attribute__ ((weak)); -char system__restrictions__run_time_restrictions[0] __attribute__ ((weak)); +char *__gl_priority_specific_dispatching __attribute__ ((weak)); +int __gl_num_specific_dispatching __attribute__ ((weak)); /* LLVM local end */ char *__gl_restrictions = 0; char *__gl_interrupt_states = 0; From baldrick at free.fr Thu Jul 17 11:26:13 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 17 Jul 2008 16:26:13 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53718 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Message-ID: <200807171626.m6HGQDTe031279@zion.cs.uiuc.edu> Author: baldrick Date: Thu Jul 17 11:26:10 2008 New Revision: 53718 URL: http://llvm.org/viewvc/llvm-project?rev=53718&view=rev Log: Be a bit more careful when dealing with types of humongous size: don't assume that the size fits into an unsigned. This fixes the Ada gcc regression test frame_overflow.adb. Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=53718&r1=53717&r2=53718&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Thu Jul 17 11:26:10 2008 @@ -352,7 +352,7 @@ assert(!(TypeSizeInBits & 7) && "A type with a non-byte size!"); assert(DECL_SIZE(field_decl) && "Bitfield with no bit size!"); - unsigned FieldSizeInBits = TREE_INT_CST_LOW(DECL_SIZE(field_decl)); + uint64_t FieldSizeInBits = getInt64(DECL_SIZE(field_decl), true); if (FieldSizeInBits < TypeSizeInBits) // Not wide enough to hold the entire type - treat as a bitfield. return true; @@ -506,11 +506,11 @@ /// getFieldOffsetInBits - Return the offset (in bits) of a FIELD_DECL in a /// structure. -static unsigned getFieldOffsetInBits(tree Field) { +static uint64_t getFieldOffsetInBits(tree Field) { assert(DECL_FIELD_BIT_OFFSET(Field) != 0 && DECL_FIELD_OFFSET(Field) != 0); - unsigned Result = TREE_INT_CST_LOW(DECL_FIELD_BIT_OFFSET(Field)); + uint64_t Result = getInt64(DECL_FIELD_BIT_OFFSET(Field), true); if (TREE_CODE(DECL_FIELD_OFFSET(Field)) == INTEGER_CST) - Result += TREE_INT_CST_LOW(DECL_FIELD_OFFSET(Field))*8; + Result += getInt64(DECL_FIELD_OFFSET(Field), true)*8; return Result; } @@ -1806,9 +1806,9 @@ Info.allFieldsAreNotBitFields(); // Get the starting offset in the record. - unsigned StartOffsetInBits = getFieldOffsetInBits(Field); + uint64_t StartOffsetInBits = getFieldOffsetInBits(Field); assert((StartOffsetInBits & 7) == 0 && "Non-bit-field has non-byte offset!"); - unsigned StartOffsetInBytes = StartOffsetInBits/8; + uint64_t StartOffsetInBytes = StartOffsetInBits/8; const Type *Ty = ConvertType(getDeclaredType(Field)); @@ -1988,13 +1988,13 @@ if (!isa(Ty) || TYPE_SIZE(type) == 0) return Ty; } - + if (TYPE_SIZE(type) == 0) { // Forward declaration? const Type *Ty = OpaqueType::get(); TheModule->addTypeName(GetTypeName("struct.", orig_type), Ty); return TypeDB.setType(type, Ty); } - + // Note that we are compiling a struct now. bool OldConvertingStruct = ConvertingStruct; ConvertingStruct = true; @@ -2006,7 +2006,7 @@ // Alter any fields that appear to represent base classes so their lists // of fields bear some resemblance to reality. FixBaseClassFields(type); - + // Convert over all of the elements of the struct. bool retryAsPackedStruct = false; for (tree Field = TYPE_FIELDS(type); Field; Field = TREE_CHAIN(Field)) { @@ -2015,10 +2015,10 @@ break; } } - + if (retryAsPackedStruct) { delete Info; - Info = new StructTypeConversionInfo(*TheTarget, TYPE_ALIGN_UNIT(type), + Info = new StructTypeConversionInfo(*TheTarget, TYPE_ALIGN_UNIT(type), true); for (tree Field = TYPE_FIELDS(type); Field; Field = TREE_CHAIN(Field)) { if (DecodeStructFields(Field, *Info) == false) { @@ -2030,21 +2030,21 @@ // If the LLVM struct requires explicit tail padding to be the same size as // the GCC struct, insert tail padding now. This handles, e.g., "{}" in C++. if (TYPE_SIZE(type) && TREE_CODE(TYPE_SIZE(type)) == INTEGER_CST) { - uint64_t GCCTypeSize = ((uint64_t)TREE_INT_CST_LOW(TYPE_SIZE(type))+7)/8; + uint64_t GCCTypeSize = getInt64(TYPE_SIZE_UNIT(type), true); uint64_t LLVMStructSize = Info->getSizeAsLLVMStruct(); if (LLVMStructSize > GCCTypeSize) { Info->RemoveExtraBytes(); LLVMStructSize = Info->getSizeAsLLVMStruct(); } - + if (LLVMStructSize != GCCTypeSize) { assert(LLVMStructSize < GCCTypeSize && "LLVM type size doesn't match GCC type size!"); uint64_t LLVMLastElementEnd = Info->getNewElementByteOffset(1); // If only one byte is needed then insert i8. - if (GCCTypeSize-LLVMLastElementEnd == 1) + if (GCCTypeSize-LLVMLastElementEnd == 1) Info->addElement(Type::Int8Ty, 1, 1); else { if ( ((GCCTypeSize-LLVMStructSize) % 4) == 0) { @@ -2054,19 +2054,19 @@ Info->addElement(PadTy, GCCTypeSize - LLVMLastElementEnd, Int32ArraySize, true /* Padding Element */); } else { - const Type *PadTy = + const Type *PadTy = ArrayType::get(Type::Int8Ty, GCCTypeSize-LLVMStructSize); - Info->addElement(PadTy, GCCTypeSize - LLVMLastElementEnd, - GCCTypeSize - LLVMLastElementEnd, + Info->addElement(PadTy, GCCTypeSize - LLVMLastElementEnd, + GCCTypeSize - LLVMLastElementEnd, true /* Padding Element */); - + } } } } else Info->RemoveExtraBytes(); - - + + // Now that the LLVM struct is finalized, figure out a safe place to index to // and set index values for each FieldDecl that doesn't start at a variable // offset. @@ -2074,7 +2074,7 @@ for (tree Field = TYPE_FIELDS(type); Field; Field = TREE_CHAIN(Field)) if (TREE_CODE(Field) == FIELD_DECL && TREE_CODE(DECL_FIELD_OFFSET(Field)) == INTEGER_CST) { - unsigned FieldOffsetInBits = getFieldOffsetInBits(Field); + uint64_t FieldOffsetInBits = getFieldOffsetInBits(Field); tree FieldType = getDeclaredType(Field); // If this is a bitfield, we may want to adjust the FieldOffsetInBits to @@ -2093,8 +2093,7 @@ CurFieldNo = 0; // Skip 'int:0', which just affects layout. - unsigned FieldSizeInBits = TREE_INT_CST_LOW(DECL_SIZE(Field)); - if (FieldSizeInBits == 0) + if (integer_zerop(DECL_SIZE(Field))) continue; } @@ -2103,35 +2102,35 @@ bool isZeroSizeField = !TYPE_SIZE(FieldType) || integer_zerop(TYPE_SIZE(FieldType)); - unsigned FieldNo = + unsigned FieldNo = Info->getLLVMFieldFor(FieldOffsetInBits, CurFieldNo, isZeroSizeField); SetFieldIndex(Field, FieldNo); } // Put the original gcc struct back the way it was; necessary to prevent the // binfo-walking code in cp/class from getting confused. - RestoreBaseClassFields(type); + RestoreBaseClassFields(type); const Type *ResultTy = Info->getLLVMType(); StructTypeInfoMap[type] = Info; - + const OpaqueType *OldTy = cast_or_null(GET_TYPE_LLVM(type)); TypeDB.setType(type, ResultTy); - + // If there was a forward declaration for this type that is now resolved, // refine anything that used it to the new type. if (OldTy) const_cast(OldTy)->refineAbstractTypeTo(ResultTy); - + // Finally, set the name for the type. TheModule->addTypeName(GetTypeName("struct.", orig_type), GET_TYPE_LLVM(type)); - + // We have finished converting this struct. See if the is the outer-most // struct being converted by ConvertType. ConvertingStruct = OldConvertingStruct; if (!ConvertingStruct) { - + // If this is the outer-most level of structness, resolve any pointers // that were deferred. while (!PointersToReresolve.empty()) { @@ -2146,7 +2145,7 @@ } } } - + return GET_TYPE_LLVM(type); } @@ -2160,7 +2159,7 @@ if (!isa(Ty) || TYPE_SIZE(type) == 0) return Ty; } - + if (TYPE_SIZE(type) == 0) { // Forward declaraion? const Type *Ty = OpaqueType::get(); TheModule->addTypeName(GetTypeName("union.", orig_type), Ty); @@ -2173,7 +2172,7 @@ // Find the type with the largest aligment, and if we have multiple types with // the same alignment, select one with largest size. If type with max. align - // is smaller then other types then we will add padding later on anyway to + // is smaller then other types then we will add padding later on anyway to // match union size. const TargetData &TD = getTargetData(); const Type *UnionTy = 0; @@ -2210,7 +2209,7 @@ if (TREE_CODE(TheGccTy) == BOOLEAN_TYPE && TYPE_SIZE_UNIT(TheGccTy) && - DECL_SIZE_UNIT(Field) && + DECL_SIZE_UNIT(Field) && TREE_CODE(DECL_SIZE_UNIT(Field)) == INTEGER_CST && TREE_CODE(TYPE_SIZE_UNIT(TheGccTy)) == INTEGER_CST && TREE_INT_CST_LOW(TYPE_SIZE_UNIT(TheGccTy)) > @@ -2276,7 +2275,7 @@ // has larger alignment than the largest member does, thus requires tail // padding. if (TYPE_SIZE(type) && TREE_CODE(TYPE_SIZE(type)) == INTEGER_CST) { - unsigned GCCTypeSize = ((unsigned)TREE_INT_CST_LOW(TYPE_SIZE(type))+7)/8; + uint64_t GCCTypeSize = getInt64(TYPE_SIZE_UNIT(type), true); if (EltSize != GCCTypeSize) { assert(EltSize < GCCTypeSize && @@ -2297,11 +2296,11 @@ // refine anything that used it to the new type. if (OldTy) const_cast(OldTy)->refineAbstractTypeTo(ResultTy); - + // Finally, set the name for the type. TheModule->addTypeName(GetTypeName("struct.", orig_type), GET_TYPE_LLVM(type)); - + // We have finished converting this union. See if the is the outer-most // union being converted by ConvertType. ConvertingStruct = OldConvertingStruct; @@ -2320,9 +2319,8 @@ } } } - + return GET_TYPE_LLVM(type); } /* LLVM LOCAL end (ENTIRE FILE!) */ - From natebegeman at mac.com Thu Jul 17 11:51:21 2008 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 17 Jul 2008 16:51:21 -0000 Subject: [llvm-commits] [llvm] r53719 - in /llvm/trunk: include/llvm/IntrinsicsX86.td lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h lib/Target/X86/X86InstrFormats.td lib/Target/X86/X86InstrSSE.td Message-ID: <200807171651.m6HGpMCL032077@zion.cs.uiuc.edu> Author: sampo Date: Thu Jul 17 11:51:19 2008 New Revision: 53719 URL: http://llvm.org/viewvc/llvm-project?rev=53719&view=rev Log: SSE codegen for vsetcc nodes Modified: llvm/trunk/include/llvm/IntrinsicsX86.td llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h llvm/trunk/lib/Target/X86/X86InstrFormats.td llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/include/llvm/IntrinsicsX86.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=53719&r1=53718&r2=53719&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicsX86.td (original) +++ llvm/trunk/include/llvm/IntrinsicsX86.td Thu Jul 17 11:51:19 2008 @@ -744,6 +744,9 @@ def int_x86_sse41_pcmpeqq : GCCBuiltin<"__builtin_ia32_pcmpeqq">, Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem, Commutative]>; + def int_x86_sse42_pcmpgtq : GCCBuiltin<"__builtin_ia32_pcmpgtq">, + Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty], + [IntrNoMem]>; def int_x86_sse41_pmaxsb : GCCBuiltin<"__builtin_ia32_pmaxsb128">, Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem, Commutative]>; Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=53719&r1=53718&r2=53719&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Jul 17 11:51:19 2008 @@ -620,7 +620,7 @@ setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v4f32, Custom); setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4f32, Custom); setOperationAction(ISD::SELECT, MVT::v4f32, Custom); - setOperationAction(ISD::VSETCC, MVT::v4f32, Legal); + setOperationAction(ISD::VSETCC, MVT::v4f32, Custom); } if (Subtarget->hasSSE2()) { @@ -646,11 +646,10 @@ setOperationAction(ISD::FSQRT, MVT::v2f64, Legal); setOperationAction(ISD::FNEG, MVT::v2f64, Custom); - setOperationAction(ISD::VSETCC, MVT::v2f64, Legal); - setOperationAction(ISD::VSETCC, MVT::v16i8, Legal); - setOperationAction(ISD::VSETCC, MVT::v8i16, Legal); - setOperationAction(ISD::VSETCC, MVT::v4i32, Legal); - setOperationAction(ISD::VSETCC, MVT::v2i64, Legal); + setOperationAction(ISD::VSETCC, MVT::v2f64, Custom); + setOperationAction(ISD::VSETCC, MVT::v16i8, Custom); + setOperationAction(ISD::VSETCC, MVT::v8i16, Custom); + setOperationAction(ISD::VSETCC, MVT::v4i32, Custom); setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v16i8, Custom); setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v8i16, Custom); @@ -728,6 +727,10 @@ } } + if (Subtarget->hasSSE42()) { + setOperationAction(ISD::VSETCC, MVT::v2i64, Custom); + } + // We want to custom lower some of our intrinsics. setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom); @@ -4685,6 +4688,113 @@ } } +SDOperand X86TargetLowering::LowerVSETCC(SDOperand Op, SelectionDAG &DAG) { + SDOperand Cond; + SDOperand Op0 = Op.getOperand(0); + SDOperand Op1 = Op.getOperand(1); + SDOperand CC = Op.getOperand(2); + MVT VT = Op.getValueType(); + ISD::CondCode SetCCOpcode = cast(CC)->get(); + bool isFP = Op.getOperand(1).getValueType().isFloatingPoint(); + + if (isFP) { + unsigned SSECC = 8; + unsigned Opc = Op0.getValueType() == MVT::v4f32 ? X86ISD::CMPPS : + X86ISD::CMPPD; + bool Swap = false; + + switch (SetCCOpcode) { + default: break; + case ISD::SETEQ: SSECC = 0; break; + case ISD::SETOGT: + case ISD::SETGT: Swap = true; // Fallthrough + case ISD::SETLT: + case ISD::SETOLT: SSECC = 1; break; + case ISD::SETOGE: + case ISD::SETGE: Swap = true; // Fallthrough + case ISD::SETLE: + case ISD::SETOLE: SSECC = 2; break; + case ISD::SETUO: SSECC = 3; break; + case ISD::SETONE: + case ISD::SETNE: SSECC = 4; break; + case ISD::SETULE: Swap = true; + case ISD::SETUGE: SSECC = 5; break; + case ISD::SETULT: Swap = true; + case ISD::SETUGT: SSECC = 6; break; + case ISD::SETO: SSECC = 7; break; + } + if (Swap) + std::swap(Op0, Op1); + + // In the one special case we can't handle, emit two comparisons. + if (SSECC == 8) { + SDOperand UNORD, EQ; + + assert(SetCCOpcode == ISD::SETUEQ && "Illegal FP comparison"); + + UNORD = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(3, MVT::i8)); + EQ = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(0, MVT::i8)); + return DAG.getNode(ISD::OR, VT, UNORD, EQ); + } + // Handle all other FP comparisons here. + return DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(SSECC, MVT::i8)); + } + + // We are handling one of the integer comparisons here. Since SSE only has + // GT and EQ comparisons for integer, swapping operands and multiple + // operations may be required for some comparisons. + unsigned Opc = 0, EQOpc = 0, GTOpc = 0; + bool Swap = false, Invert = false, FlipSigns = false; + + switch (VT.getSimpleVT()) { + default: break; + case MVT::v16i8: EQOpc = X86ISD::PCMPEQB; GTOpc = X86ISD::PCMPGTB; break; + case MVT::v8i16: EQOpc = X86ISD::PCMPEQW; GTOpc = X86ISD::PCMPGTW; break; + case MVT::v4i32: EQOpc = X86ISD::PCMPEQD; GTOpc = X86ISD::PCMPGTD; break; + case MVT::v2i64: EQOpc = X86ISD::PCMPEQQ; GTOpc = X86ISD::PCMPGTQ; break; + } + + switch (SetCCOpcode) { + default: break; + case ISD::SETNE: Invert = true; + case ISD::SETEQ: Opc = EQOpc; break; + case ISD::SETLT: Swap = true; + case ISD::SETGT: Opc = GTOpc; break; + case ISD::SETGE: Swap = true; + case ISD::SETLE: Opc = GTOpc; Invert = true; break; + case ISD::SETULT: Swap = true; + case ISD::SETUGT: Opc = GTOpc; FlipSigns = true; break; + case ISD::SETUGE: Swap = true; + case ISD::SETULE: Opc = GTOpc; FlipSigns = true; Invert = true; break; + } + if (Swap) + std::swap(Op0, Op1); + + // Since SSE has no unsigned integer comparisons, we need to flip the sign + // bits of the inputs before performing those operations. + if (FlipSigns) { + MVT EltVT = VT.getVectorElementType(); + SDOperand SignBit = DAG.getConstant(EltVT.getIntegerVTSignBit(), EltVT); + std::vector SignBits(VT.getVectorNumElements(), SignBit); + SDOperand SignVec = DAG.getNode(ISD::BUILD_VECTOR, VT, &SignBits[0], + SignBits.size()); + Op0 = DAG.getNode(ISD::XOR, VT, Op0, SignVec); + Op1 = DAG.getNode(ISD::XOR, VT, Op1, SignVec); + } + + SDOperand Result = DAG.getNode(Opc, VT, Op0, Op1); + + // If the logical-not of the result is required, perform that now. + if (Invert) { + MVT EltVT = VT.getVectorElementType(); + SDOperand NegOne = DAG.getConstant(EltVT.getIntegerVTBitMask(), EltVT); + std::vector NegOnes(VT.getVectorNumElements(), NegOne); + SDOperand NegOneV = DAG.getNode(ISD::BUILD_VECTOR, VT, &NegOnes[0], + NegOnes.size()); + Result = DAG.getNode(ISD::XOR, VT, Result, NegOneV); + } + return Result; +} SDOperand X86TargetLowering::LowerSELECT(SDOperand Op, SelectionDAG &DAG) { bool addTest = true; @@ -5728,6 +5838,7 @@ case ISD::FNEG: return LowerFNEG(Op, DAG); case ISD::FCOPYSIGN: return LowerFCOPYSIGN(Op, DAG); case ISD::SETCC: return LowerSETCC(Op, DAG); + case ISD::VSETCC: return LowerVSETCC(Op, DAG); case ISD::SELECT: return LowerSELECT(Op, DAG); case ISD::BRCOND: return LowerBRCOND(Op, DAG); case ISD::JumpTable: return LowerJumpTable(Op, DAG); @@ -5819,6 +5930,16 @@ case X86ISD::VZEXT_LOAD: return "X86ISD::VZEXT_LOAD"; case X86ISD::VSHL: return "X86ISD::VSHL"; case X86ISD::VSRL: return "X86ISD::VSRL"; + case X86ISD::CMPPD: return "X86ISD::CMPPD"; + case X86ISD::CMPPS: return "X86ISD::CMPPS"; + case X86ISD::PCMPEQB: return "X86ISD::PCMPEQB"; + case X86ISD::PCMPEQW: return "X86ISD::PCMPEQW"; + case X86ISD::PCMPEQD: return "X86ISD::PCMPEQD"; + case X86ISD::PCMPEQQ: return "X86ISD::PCMPEQQ"; + case X86ISD::PCMPGTB: return "X86ISD::PCMPGTB"; + case X86ISD::PCMPGTW: return "X86ISD::PCMPGTW"; + case X86ISD::PCMPGTD: return "X86ISD::PCMPGTD"; + case X86ISD::PCMPGTQ: return "X86ISD::PCMPGTQ"; } } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=53719&r1=53718&r2=53719&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Thu Jul 17 11:51:19 2008 @@ -208,7 +208,14 @@ VZEXT_LOAD, // VSHL, VSRL - Vector logical left / right shift. - VSHL, VSRL + VSHL, VSRL, + + // CMPPD, CMPPS - Vector double/float comparison. + CMPPD, CMPPS, + + // PCMP* - Vector integer comparisons. + PCMPEQB, PCMPEQW, PCMPEQD, PCMPEQQ, + PCMPGTB, PCMPGTW, PCMPGTD, PCMPGTQ }; } @@ -521,6 +528,7 @@ SDOperand LowerFNEG(SDOperand Op, SelectionDAG &DAG); SDOperand LowerFCOPYSIGN(SDOperand Op, SelectionDAG &DAG); SDOperand LowerSETCC(SDOperand Op, SelectionDAG &DAG); + SDOperand LowerVSETCC(SDOperand Op, SelectionDAG &DAG); SDOperand LowerSELECT(SDOperand Op, SelectionDAG &DAG); SDOperand LowerBRCOND(SDOperand Op, SelectionDAG &DAG); SDOperand LowerMEMSET(SDOperand Op, SelectionDAG &DAG); Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFormats.td?rev=53719&r1=53718&r2=53719&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFormats.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFormats.td Thu Jul 17 11:51:19 2008 @@ -215,6 +215,12 @@ list pattern> : Ii8, TA, Requires<[HasSSE41]>; +// SSE4.2 Instruction Templates: +// +// SS428I - SSE 4.2 instructions with T8 prefix. +class SS428I o, Format F, dag outs, dag ins, string asm, + list pattern> + : I, T8, Requires<[HasSSE42]>; // X86-64 Instruction templates... // Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=53719&r1=53718&r2=53719&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Thu Jul 17 11:51:19 2008 @@ -20,6 +20,8 @@ def SDTX86FPShiftOp : SDTypeProfile<1, 2, [ SDTCisSameAs<0, 1>, SDTCisFP<0>, SDTCisInt<2> ]>; +def SDTX86VFCMP : SDTypeProfile<1, 3, [SDTCisInt<0>, SDTCisSameAs<1, 2>, + SDTCisFP<1>, SDTCisVT<3, i8>]>; def X86fmin : SDNode<"X86ISD::FMIN", SDTFPBinOp>; def X86fmax : SDNode<"X86ISD::FMAX", SDTFPBinOp>; @@ -53,6 +55,16 @@ [SDNPHasChain, SDNPMayLoad]>; def X86vshl : SDNode<"X86ISD::VSHL", SDTIntShiftOp>; def X86vshr : SDNode<"X86ISD::VSRL", SDTIntShiftOp>; +def X86cmpps : SDNode<"X86ISD::CMPPS", SDTX86VFCMP>; +def X86cmppd : SDNode<"X86ISD::CMPPD", SDTX86VFCMP>; +def X86pcmpeqb : SDNode<"X86ISD::PCMPEQB", SDTIntBinOp, [SDNPCommutative]>; +def X86pcmpeqw : SDNode<"X86ISD::PCMPEQW", SDTIntBinOp, [SDNPCommutative]>; +def X86pcmpeqd : SDNode<"X86ISD::PCMPEQD", SDTIntBinOp, [SDNPCommutative]>; +def X86pcmpeqq : SDNode<"X86ISD::PCMPEQQ", SDTIntBinOp, [SDNPCommutative]>; +def X86pcmpgtb : SDNode<"X86ISD::PCMPGTB", SDTIntBinOp>; +def X86pcmpgtw : SDNode<"X86ISD::PCMPGTW", SDTIntBinOp>; +def X86pcmpgtd : SDNode<"X86ISD::PCMPGTD", SDTIntBinOp>; +def X86pcmpgtq : SDNode<"X86ISD::PCMPGTQ", SDTIntBinOp>; //===----------------------------------------------------------------------===// // SSE Complex Patterns @@ -163,22 +175,6 @@ return getI32Imm(N->getValue() >> 3); }]>; -def SSE_CC_imm : SDNodeXFormget()) { - default: Val = 0; assert(0 && "Unexpected CondCode"); break; - case ISD::SETOEQ: Val = 0; break; - case ISD::SETOLT: Val = 1; break; - case ISD::SETOLE: Val = 2; break; - case ISD::SETUO: Val = 3; break; - case ISD::SETONE: Val = 4; break; - case ISD::SETOGE: Val = 5; break; - case ISD::SETOGT: Val = 6; break; - case ISD::SETO: Val = 7; break; - } - return getI8Imm(Val); -}]>; - // SHUFFLE_get_shuf_imm xform function: convert vector_shuffle mask to PSHUF*, // SHUFP* etc. imm. def SHUFFLE_get_shuf_imm : SDNodeXForm; } -def : Pat<(v4i32 (vsetcc (v4f32 VR128:$src1), VR128:$src2, cond:$cc)), - (CMPPSrri VR128:$src1, VR128:$src2, (SSE_CC_imm cond:$cc))>; -def : Pat<(v4i32 (vsetcc (v4f32 VR128:$src1), (memop addr:$src2), cond:$cc)), - (CMPPSrmi VR128:$src1, addr:$src2, (SSE_CC_imm cond:$cc))>; +def : Pat<(v4i32 (X86cmpps (v4f32 VR128:$src1), VR128:$src2, imm:$cc)), + (CMPPSrri VR128:$src1, VR128:$src2, imm:$cc)>; +def : Pat<(v4i32 (X86cmpps (v4f32 VR128:$src1), (memop addr:$src2), imm:$cc)), + (CMPPSrmi VR128:$src1, addr:$src2, imm:$cc)>; // Shuffle and unpack instructions let Constraints = "$src1 = $dst" in { @@ -1725,10 +1721,10 @@ [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, (memop addr:$src), imm:$cc))]>; } -def : Pat<(v2i64 (vsetcc (v2f64 VR128:$src1), VR128:$src2, cond:$cc)), - (CMPPDrri VR128:$src1, VR128:$src2, (SSE_CC_imm cond:$cc))>; -def : Pat<(v2i64 (vsetcc (v2f64 VR128:$src1), (memop addr:$src2), cond:$cc)), - (CMPPDrmi VR128:$src1, addr:$src2, (SSE_CC_imm cond:$cc))>; +def : Pat<(v2i64 (X86cmppd VR128:$src1, VR128:$src2, imm:$cc)), + (CMPPDrri VR128:$src1, VR128:$src2, imm:$cc)>; +def : Pat<(v2i64 (X86cmppd VR128:$src1, (memop addr:$src2), imm:$cc)), + (CMPPDrmi VR128:$src1, addr:$src2, imm:$cc)>; // Shuffle and unpack instructions let Constraints = "$src1 = $dst" in { @@ -1994,30 +1990,30 @@ defm PCMPGTW : PDI_binop_rm_int<0x65, "pcmpgtw", int_x86_sse2_pcmpgt_w>; defm PCMPGTD : PDI_binop_rm_int<0x66, "pcmpgtd", int_x86_sse2_pcmpgt_d>; -def : Pat<(v16i8 (vsetcc (v16i8 VR128:$src1), VR128:$src2, SETEQ)), +def : Pat<(v16i8 (X86pcmpeqb VR128:$src1, VR128:$src2)), (PCMPEQBrr VR128:$src1, VR128:$src2)>; -def : Pat<(v16i8 (vsetcc (v16i8 VR128:$src1), (memop addr:$src2), SETEQ)), +def : Pat<(v16i8 (X86pcmpeqb VR128:$src1, (memop addr:$src2))), (PCMPEQBrm VR128:$src1, addr:$src2)>; -def : Pat<(v8i16 (vsetcc (v8i16 VR128:$src1), VR128:$src2, SETEQ)), +def : Pat<(v8i16 (X86pcmpeqw VR128:$src1, VR128:$src2)), (PCMPEQWrr VR128:$src1, VR128:$src2)>; -def : Pat<(v8i16 (vsetcc (v8i16 VR128:$src1), (memop addr:$src2), SETEQ)), +def : Pat<(v8i16 (X86pcmpeqw VR128:$src1, (memop addr:$src2))), (PCMPEQWrm VR128:$src1, addr:$src2)>; -def : Pat<(v4i32 (vsetcc (v4i32 VR128:$src1), VR128:$src2, SETEQ)), +def : Pat<(v4i32 (X86pcmpeqd VR128:$src1, VR128:$src2)), (PCMPEQDrr VR128:$src1, VR128:$src2)>; -def : Pat<(v4i32 (vsetcc (v4i32 VR128:$src1), (memop addr:$src2), SETEQ)), +def : Pat<(v4i32 (X86pcmpeqd VR128:$src1, (memop addr:$src2))), (PCMPEQDrm VR128:$src1, addr:$src2)>; -def : Pat<(v16i8 (vsetcc (v16i8 VR128:$src1), VR128:$src2, SETGT)), +def : Pat<(v16i8 (X86pcmpgtb VR128:$src1, VR128:$src2)), (PCMPGTBrr VR128:$src1, VR128:$src2)>; -def : Pat<(v16i8 (vsetcc (v16i8 VR128:$src1), (memop addr:$src2), SETGT)), +def : Pat<(v16i8 (X86pcmpgtb VR128:$src1, (memop addr:$src2))), (PCMPGTBrm VR128:$src1, addr:$src2)>; -def : Pat<(v8i16 (vsetcc (v8i16 VR128:$src1), VR128:$src2, SETGT)), +def : Pat<(v8i16 (X86pcmpgtw VR128:$src1, VR128:$src2)), (PCMPGTWrr VR128:$src1, VR128:$src2)>; -def : Pat<(v8i16 (vsetcc (v8i16 VR128:$src1), (memop addr:$src2), SETGT)), +def : Pat<(v8i16 (X86pcmpgtw VR128:$src1, (memop addr:$src2))), (PCMPGTWrm VR128:$src1, addr:$src2)>; -def : Pat<(v4i32 (vsetcc (v4i32 VR128:$src1), VR128:$src2, SETGT)), +def : Pat<(v4i32 (X86pcmpgtd VR128:$src1, VR128:$src2)), (PCMPGTDrr VR128:$src1, VR128:$src2)>; -def : Pat<(v4i32 (vsetcc (v4i32 VR128:$src1), (memop addr:$src2), SETGT)), +def : Pat<(v4i32 (X86pcmpgtd VR128:$src1, (memop addr:$src2))), (PCMPGTDrm VR128:$src1, addr:$src2)>; @@ -3258,6 +3254,11 @@ defm PMAXUW : SS41I_binop_rm_int<0x3E, "pmaxuw", int_x86_sse41_pmaxuw, 1>; +def : Pat<(v2i64 (X86pcmpeqq VR128:$src1, VR128:$src2)), + (PCMPEQQrr VR128:$src1, VR128:$src2)>; +def : Pat<(v2i64 (X86pcmpeqq VR128:$src1, (memop addr:$src2))), + (PCMPEQQrm VR128:$src1, addr:$src2)>; + /// SS41I_binop_rm_int - Simple SSE 4.1 binary operator let Constraints = "$src1 = $dst" in { @@ -3555,3 +3556,30 @@ def MOVNTDQArm : SS48I<0x2A, MRMSrcMem, (outs VR128:$dst), (ins i128mem:$src), "movntdqa\t{$src, $dst|$dst, $src}", [(set VR128:$dst, (int_x86_sse41_movntdqa addr:$src))]>; + +/// SS42I_binop_rm_int - Simple SSE 4.2 binary operator +let Constraints = "$src1 = $dst" in { + multiclass SS42I_binop_rm_int opc, string OpcodeStr, + Intrinsic IntId128, bit Commutable = 0> { + def rr : SS428I, + OpSize { + let isCommutable = Commutable; + } + def rm : SS428I, OpSize; + } +} + +defm PCMPGTQ : SS41I_binop_rm_int<0x37, "pcmpgtq", int_x86_sse42_pcmpgtq>; + +def : Pat<(v2i64 (X86pcmpgtq VR128:$src1, VR128:$src2)), + (PCMPGTQrr VR128:$src1, VR128:$src2)>; +def : Pat<(v2i64 (X86pcmpgtq VR128:$src1, (memop addr:$src2))), + (PCMPGTQrm VR128:$src1, addr:$src2)>; From natebegeman at mac.com Thu Jul 17 12:04:58 2008 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 17 Jul 2008 17:04:58 -0000 Subject: [llvm-commits] [llvm] r53720 - /llvm/trunk/lib/Target/X86/X86InstrSSE.td Message-ID: <200807171704.m6HH4w3F032631@zion.cs.uiuc.edu> Author: sampo Date: Thu Jul 17 12:04:58 2008 New Revision: 53720 URL: http://llvm.org/viewvc/llvm-project?rev=53720&view=rev Log: Fix a typo in last commit Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=53720&r1=53719&r2=53720&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Thu Jul 17 12:04:58 2008 @@ -3577,7 +3577,7 @@ } } -defm PCMPGTQ : SS41I_binop_rm_int<0x37, "pcmpgtq", int_x86_sse42_pcmpgtq>; +defm PCMPGTQ : SS42I_binop_rm_int<0x37, "pcmpgtq", int_x86_sse42_pcmpgtq>; def : Pat<(v2i64 (X86pcmpgtq VR128:$src1, VR128:$src2)), (PCMPGTQrr VR128:$src1, VR128:$src2)>; From baldrick at free.fr Thu Jul 17 12:06:04 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 17 Jul 2008 17:06:04 -0000 Subject: [llvm-commits] [llvm] r53721 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll test/CodeGen/Generic/APIntLoadStore.ll test/CodeGen/Generic/APIntParam.ll test/CodeGen/Generic/APIntSextParam.ll test/CodeGen/Generic/APIntZextParam.ll Message-ID: <200807171706.m6HH640d032678@zion.cs.uiuc.edu> Author: baldrick Date: Thu Jul 17 12:06:03 2008 New Revision: 53721 URL: http://llvm.org/viewvc/llvm-project?rev=53721&view=rev Log: Turn LegalizeTypes back off again for the moment: it is breaking Darwin bootstrap due to missing functionality. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll llvm/trunk/test/CodeGen/Generic/APIntParam.ll llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=53721&r1=53720&r2=53721&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jul 17 12:06:03 2008 @@ -52,7 +52,7 @@ static cl::opt EnableValueProp("enable-value-prop", cl::Hidden); static cl::opt -DisableLegalizeTypes("disable-legalize-types", cl::Hidden); +EnableLegalizeTypes("enable-legalize-types", cl::Hidden); #ifndef NDEBUG @@ -5296,16 +5296,14 @@ DOUT << "Optimized lowered selection DAG:\n"; DEBUG(DAG.dump()); - + // Second step, hack on the DAG until it only uses operations and types that // the target supports. - if (!DisableLegalizeTypes) {// Remove this some day. + if (EnableLegalizeTypes) {// Enable this some day. DAG.LegalizeTypes(); - DOUT << "Type legalized selection DAG:\n"; - DEBUG(DAG.dump()); // TODO: enable a dag combine pass here. } - + if (TimePassesIsEnabled) { NamedRegionTimer T("DAG Legalization", GroupName); DAG.Legalize(); Modified: llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll?rev=53721&r1=53720&r2=53721&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll (original) +++ llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll Thu Jul 17 12:06:03 2008 @@ -1,4 +1,6 @@ ; RUN: llvm-as < %s | llc -o - +; XFAIL: * +; Un-XFAIL this once LegalizeDAGTypes is turned on. target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" target triple = "i686-pc-linux-gnu" Modified: llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll?rev=53721&r1=53720&r2=53721&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll (original) +++ llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll Thu Jul 17 12:06:03 2008 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llc +; XFAIL: * @i1_l = external global i1 ; [#uses=1] @i1_s = external global i1 ; [#uses=1] @i2_l = external global i2 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/Generic/APIntParam.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/APIntParam.ll?rev=53721&r1=53720&r2=53721&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/APIntParam.ll (original) +++ llvm/trunk/test/CodeGen/Generic/APIntParam.ll Thu Jul 17 12:06:03 2008 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llc +; XFAIL: * @i1_s = external global i1 ; [#uses=1] @i2_s = external global i2 ; [#uses=1] @i3_s = external global i3 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll?rev=53721&r1=53720&r2=53721&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll (original) +++ llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll Thu Jul 17 12:06:03 2008 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llc +; XFAIL: * @i1_s = external global i1 ; [#uses=1] @i2_s = external global i2 ; [#uses=1] @i3_s = external global i3 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll?rev=53721&r1=53720&r2=53721&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll (original) +++ llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll Thu Jul 17 12:06:03 2008 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llc +; XFAIL: * @i1_s = external global i1 ; [#uses=1] @i2_s = external global i2 ; [#uses=1] @i3_s = external global i3 ; [#uses=1] From natebegeman at mac.com Thu Jul 17 12:21:14 2008 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 17 Jul 2008 17:21:14 -0000 Subject: [llvm-commits] [llvm] r53722 - /llvm/trunk/lib/Target/X86/README.txt Message-ID: <200807171721.m6HHLEWQ000700@zion.cs.uiuc.edu> Author: sampo Date: Thu Jul 17 12:21:14 2008 New Revision: 53722 URL: http://llvm.org/viewvc/llvm-project?rev=53722&view=rev Log: Remove unnecessary readme entry Modified: llvm/trunk/lib/Target/X86/README.txt Modified: llvm/trunk/lib/Target/X86/README.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README.txt?rev=53722&r1=53721&r2=53722&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/README.txt (original) +++ llvm/trunk/lib/Target/X86/README.txt Thu Jul 17 12:21:14 2008 @@ -1707,12 +1707,3 @@ ret it would be better to codegen as: x+~y (notl+addl) - -//===---------------------------------------------------------------------===// - -We should consider using __i686.get_pc_thunk.bx for MOVPC32r (used for PIC) -on targets that support it, such as Linux and similar targets, in place of -the call-a-label trick. It's said to be friendlier to branch-prediction -hardware because it pairs a ret with the call. - -//===---------------------------------------------------------------------===// From baldrick at free.fr Thu Jul 17 12:35:14 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 17 Jul 2008 17:35:14 -0000 Subject: [llvm-commits] [llvm] r53723 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h test/CodeGen/PowerPC/2008-07-17-Fneg.ll Message-ID: <200807171735.m6HHZEfI001172@zion.cs.uiuc.edu> Author: baldrick Date: Thu Jul 17 12:35:14 2008 New Revision: 53723 URL: http://llvm.org/viewvc/llvm-project?rev=53723&view=rev Log: LegalizeTypes support for what seems to be the only missing ppc long double operations: FNEG and FP_EXTEND. Added: llvm/trunk/test/CodeGen/PowerPC/2008-07-17-Fneg.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp?rev=53723&r1=53722&r2=53723&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Thu Jul 17 12:35:14 2008 @@ -531,6 +531,8 @@ case ISD::FADD: ExpandFloatRes_FADD(N, Lo, Hi); break; case ISD::FDIV: ExpandFloatRes_FDIV(N, Lo, Hi); break; case ISD::FMUL: ExpandFloatRes_FMUL(N, Lo, Hi); break; + case ISD::FNEG: ExpandFloatRes_FNEG(N, Lo, Hi); break; + case ISD::FP_EXTEND: ExpandFloatRes_FP_EXTEND(N, Lo, Hi); break; case ISD::FSUB: ExpandFloatRes_FSUB(N, Lo, Hi); break; case ISD::LOAD: ExpandFloatRes_LOAD(N, Lo, Hi); break; case ISD::SINT_TO_FP: @@ -609,6 +611,20 @@ Lo = Call.getOperand(0); Hi = Call.getOperand(1); } +void DAGTypeLegalizer::ExpandFloatRes_FNEG(SDNode *N, SDOperand &Lo, + SDOperand &Hi) { + GetExpandedFloat(N->getOperand(0), Lo, Hi); + Lo = DAG.getNode(ISD::FNEG, Lo.getValueType(), Lo); + Hi = DAG.getNode(ISD::FNEG, Hi.getValueType(), Hi); +} + +void DAGTypeLegalizer::ExpandFloatRes_FP_EXTEND(SDNode *N, SDOperand &Lo, + SDOperand &Hi) { + MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + Hi = DAG.getNode(ISD::FP_EXTEND, NVT, N->getOperand(0)); + Lo = DAG.getConstantFP(APFloat(APInt(NVT.getSizeInBits(), 0)), NVT); +} + void DAGTypeLegalizer::ExpandFloatRes_FSUB(SDNode *N, SDOperand &Lo, SDOperand &Hi) { SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=53723&r1=53722&r2=53723&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Thu Jul 17 12:35:14 2008 @@ -374,6 +374,8 @@ void ExpandFloatRes_FADD (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandFloatRes_FDIV (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandFloatRes_FMUL (SDNode *N, SDOperand &Lo, SDOperand &Hi); + void ExpandFloatRes_FNEG (SDNode *N, SDOperand &Lo, SDOperand &Hi); + void ExpandFloatRes_FP_EXTEND (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandFloatRes_FSUB (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandFloatRes_LOAD (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandFloatRes_XINT_TO_FP(SDNode *N, SDOperand &Lo, SDOperand &Hi); Added: llvm/trunk/test/CodeGen/PowerPC/2008-07-17-Fneg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2008-07-17-Fneg.ll?rev=53723&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/2008-07-17-Fneg.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/2008-07-17-Fneg.ll Thu Jul 17 12:35:14 2008 @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | llc +target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128" +target triple = "powerpc-apple-darwin9" + +define hidden i64 @__fixunstfdi(ppc_fp128 %a) nounwind { +entry: + br i1 false, label %bb3, label %bb4 + +bb3: ; preds = %entry + sub ppc_fp128 0xM80000000000000000000000000000000, 0xM00000000000000000000000000000000 ; :0 [#uses=1] + fptoui ppc_fp128 %0 to i32 ; :1 [#uses=1] + zext i32 %1 to i64 ; :2 [#uses=1] + sub i64 0, %2 ; :3 [#uses=1] + ret i64 %3 + +bb4: ; preds = %entry + ret i64 0 +} From gohman at apple.com Thu Jul 17 12:36:54 2008 From: gohman at apple.com (Dan Gohman) Date: Thu, 17 Jul 2008 10:36:54 -0700 Subject: [llvm-commits] [llvm] r53722 - /llvm/trunk/lib/Target/X86/README.txt In-Reply-To: <200807171721.m6HHLEWQ000700@zion.cs.uiuc.edu> References: <200807171721.m6HHLEWQ000700@zion.cs.uiuc.edu> Message-ID: <38FE9BBE-EB33-49DE-A119-BAB091A6C395@apple.com> On Jul 17, 2008, at 10:21 AM, Nate Begeman wrote: > Remove unnecessary readme entry > > -// > = > = > = > --------------------------------------------------------------------- > ===// > - > -We should consider using __i686.get_pc_thunk.bx for MOVPC32r (used > for PIC) > -on targets that support it, such as Linux and similar targets, in > place of > -the call-a-label trick. It's said to be friendlier to branch- > prediction > -hardware because it pairs a ret with the call. > - > -// > = > = > = > --------------------------------------------------------------------- > ===// Why is this unnecessary? Dan From clattner at apple.com Thu Jul 17 13:12:36 2008 From: clattner at apple.com (Chris Lattner) Date: Thu, 17 Jul 2008 11:12:36 -0700 Subject: [llvm-commits] [llvm] r53705 - in /llvm/trunk: include/llvm/Transforms/Utils/BasicBlockUtils.h lib/Transforms/Scalar/GVN.cpp lib/Transforms/Utils/BasicBlockUtils.cpp In-Reply-To: <200807170001.m6H01eL5021088@zion.cs.uiuc.edu> References: <200807170001.m6H01eL5021088@zion.cs.uiuc.edu> Message-ID: On Jul 16, 2008, at 5:01 PM, Owen Anderson wrote: > Author: resistor > Date: Wed Jul 16 19:01:40 2008 > New Revision: 53705 > > URL: http://llvm.org/viewvc/llvm-project?rev=53705&view=rev > Log: > Factor MergeBlockIntoPredecessor out into BasicBlockUtils. Great! Can simplifycfg and jump threading use this now? -Chris > > > Modified: > llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h > llvm/trunk/lib/Transforms/Scalar/GVN.cpp > llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp > > Modified: llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h?rev=53705&r1=53704&r2=53705&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h > (original) > +++ llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h Wed > Jul 16 19:01:40 2008 > @@ -25,6 +25,10 @@ > class Instruction; > class Pass; > > +/// MergeBlockIntoPredecessor - Attempts to merge a block into its > predecessor, > +/// if possible. The return value indicates success or failure. > +bool MergeBlockIntoPredecessor(BasicBlock* BB, Pass* P); > + > // ReplaceInstWithValue - Replace all uses of an instruction > (specified by BI) > // with a value, then remove and delete the original instruction. > // > > Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=53705&r1=53704&r2=53705&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) > +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Wed Jul 16 19:01:40 2008 > @@ -1125,7 +1125,10 @@ > for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ) { > BasicBlock* BB = FI; > ++FI; > - changed |= mergeBlockIntoPredecessor(BB); > + bool removedBlock = MergeBlockIntoPredecessor(BB, this); > + if (removedBlock) NumGVNBlocks++; > + > + changed |= removedBlock; > } > > while (shouldContinue) { > @@ -1336,56 +1339,6 @@ > return changed; > } > > -// mergeBlockIntoPredecessor - If this block is the only successor > -// of its predecessor, and the edge is non-critical, > -// fold it into that predecessor. > -bool GVN::mergeBlockIntoPredecessor(BasicBlock* BB) { > - // Can't merge the entry block. > - if (pred_begin(BB) == pred_end(BB)) return false; > - // Can't merge if there are multiple preds. > - if (++pred_begin(BB) != pred_end(BB)) return false; > - > - BasicBlock* PredBB = *pred_begin(BB); > - > - // Can't merge if the edge is critical. > - if (PredBB->getTerminator()->getNumSuccessors() != 1) return false; > - > - // Begin by getting rid of unneeded PHIs. > - while (PHINode *PN = dyn_cast(&BB->front())) { > - PN->replaceAllUsesWith(PN->getIncomingValue(0)); > - BB->getInstList().pop_front(); // Delete the phi node... > - } > - > - // Delete the unconditional branch from the predecessor... > - PredBB->getInstList().pop_back(); > - > - // Move all definitions in the successor to the predecessor... > - PredBB->getInstList().splice(PredBB->end(), BB->getInstList()); > - > - // Make all PHI nodes that referred to BB now refer to Pred as > their > - // source... > - BB->replaceAllUsesWith(PredBB); > - > - // Finally, erase the old block and update dominator info. > - DominatorTree& DT = getAnalysis(); > - DomTreeNode* DTN = DT[BB]; > - DomTreeNode* PredDTN = DT[PredBB]; > - > - if (DTN) { > - SmallPtrSet Children(DTN->begin(), DTN->end()); > - for (SmallPtrSet::iterator DI = > Children.begin(), > - DE = Children.end(); DI != DE; ++DI) > - DT.changeImmediateDominator(*DI, PredDTN); > - > - DT.eraseNode(BB); > - } > - > - BB->eraseFromParent(); > - > - NumGVNBlocks++; > - return true; > -} > - > // iterateOnFunction - Executes one iteration of GVN > bool GVN::iterateOnFunction(Function &F) { > // Clean out global sets from any previous functions > > Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=53705&r1=53704&r2=53705&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original) > +++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Wed Jul 16 > 19:01:40 2008 > @@ -23,6 +23,58 @@ > #include > using namespace llvm; > > +/// MergeBlockIntoPredecessor - Attempts to merge a block into its > predecessor, > +/// if possible. The return value indicates success or failure. > +bool llvm::MergeBlockIntoPredecessor(BasicBlock* BB, Pass* P) { > + // Can't merge the entry block. > + if (pred_begin(BB) == pred_end(BB)) return false; > + // Can't merge if there are multiple preds. > + if (++pred_begin(BB) != pred_end(BB)) return false; > + > + BasicBlock* PredBB = *pred_begin(BB); > + > + // Can't merge if the edge is critical. > + if (PredBB->getTerminator()->getNumSuccessors() != 1) return false; > + > + // Begin by getting rid of unneeded PHIs. > + while (PHINode *PN = dyn_cast(&BB->front())) { > + PN->replaceAllUsesWith(PN->getIncomingValue(0)); > + BB->getInstList().pop_front(); // Delete the phi node... > + } > + > + // Delete the unconditional branch from the predecessor... > + PredBB->getInstList().pop_back(); > + > + // Move all definitions in the successor to the predecessor... > + PredBB->getInstList().splice(PredBB->end(), BB->getInstList()); > + > + // Make all PHI nodes that referred to BB now refer to Pred as > their > + // source... > + BB->replaceAllUsesWith(PredBB); > + > + // Finally, erase the old block and update dominator info. > + if (P) { > + if (DominatorTree* DT = P- > >getAnalysisToUpdate()) { > + DomTreeNode* DTN = DT->getNode(BB); > + DomTreeNode* PredDTN = DT->getNode(PredBB); > + > + if (DTN) { > + SmallPtrSet Children(DTN->begin(), DTN- > >end()); > + for (SmallPtrSet::iterator DI = > Children.begin(), > + DE = Children.end(); DI != DE; ++DI) > + DT->changeImmediateDominator(*DI, PredDTN); > + > + DT->eraseNode(BB); > + } > + } > + } > + > + BB->eraseFromParent(); > + > + > + return true; > +} > + > /// ReplaceInstWithValue - Replace all uses of an instruction > (specified by BI) > /// with a value, then remove and delete the original instruction. > /// > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Thu Jul 17 13:41:20 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 17 Jul 2008 18:41:20 -0000 Subject: [llvm-commits] [llvm] r53727 - /llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h Message-ID: <200807171841.m6HIfK8o003617@zion.cs.uiuc.edu> Author: evancheng Date: Thu Jul 17 13:41:20 2008 New Revision: 53727 URL: http://llvm.org/viewvc/llvm-project?rev=53727&view=rev Log: Indentation. Modified: llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h Modified: llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h?rev=53727&r1=53726&r2=53727&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h (original) +++ llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h Thu Jul 17 13:41:20 2008 @@ -176,9 +176,9 @@ // If after the replacement this node is not used any more, // remove this dead node. if (Node->use_empty()) { // Don't delete EntryToken, etc. - ISelQueueUpdater ISQU(ISelQueue); - CurDAG->RemoveDeadNode(Node, &ISQU); - UpdateQueue(ISQU); + ISelQueueUpdater ISQU(ISelQueue); + CurDAG->RemoveDeadNode(Node, &ISQU); + UpdateQueue(ISQU); } } From gohman at apple.com Thu Jul 17 14:10:19 2008 From: gohman at apple.com (Dan Gohman) Date: Thu, 17 Jul 2008 19:10:19 -0000 Subject: [llvm-commits] [llvm] r53728 - in /llvm/trunk: include/llvm/CodeGen/ include/llvm/Support/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CellSPU/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/ test/CodeGen/PowerPC/ utils/TableGen/ Message-ID: <200807171910.m6HJAKgl004528@zion.cs.uiuc.edu> Author: djg Date: Thu Jul 17 14:10:17 2008 New Revision: 53728 URL: http://llvm.org/viewvc/llvm-project?rev=53728&view=rev Log: Add a new function, ReplaceAllUsesOfValuesWith, which handles bulk replacement of multiple values. This is slightly more efficient than doing multiple ReplaceAllUsesOfValueWith calls, and theoretically could be optimized even further. However, an important property of this new function is that it handles the case where the source value set and destination value set overlap. This makes it feasible for isel to use SelectNodeTo in many very common cases, which is advantageous because SelectNodeTo avoids a temporary node and it doesn't require CSEMap updates for users of values that don't change position. Revamp MorphNodeTo, which is what does all the work of SelectNodeTo, to handle operand lists more efficiently, and to correctly handle a number of corner cases to which its new wider use exposes it. This commit also includes a change to the encoding of post-isel opcodes in SDNodes; now instead of being sandwiched between the target-independent pre-isel opcodes and the target-dependent pre-isel opcodes, post-isel opcodes are now represented as negative values. This makes it possible to test if an opcode is pre-isel or post-isel without having to know the size of the current target's post-isel instruction set. These changes speed up llc overall by 3% and reduce memory usage by 10% on the InstructionCombining.cpp testcase with -fast and -regalloc=local. Modified: llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/include/llvm/Support/Allocator.h llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Modified: llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h (original) +++ llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h Thu Jul 17 14:10:17 2008 @@ -124,6 +124,17 @@ UpdateQueue(ISQU); } +/// ReplaceUses - replace all uses of the old nodes F with the use +/// of the new nodes T. +void ReplaceUses(const SDOperand *F, const SDOperand *T, + unsigned Num) DISABLE_INLINE { + ISelQueueUpdater ISQU(ISelQueue); + CurDAG->ReplaceAllUsesOfValuesWith(F, T, Num, &ISQU); + for (unsigned i = 0; i != Num; ++i) + setSelected(F[i].Val->getNodeId()); + UpdateQueue(ISQU); +} + /// ReplaceUses - replace all uses of the old node F with the use /// of the new node T. void ReplaceUses(SDNode *F, SDNode *T) DISABLE_INLINE { Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Thu Jul 17 14:10:17 2008 @@ -60,6 +60,10 @@ /// CSE with existing nodes with a duplicate is requested. FoldingSet CSEMap; + /// Allocator - Pool allocation for misc. objects that are created once per + /// SelectionDAG. + BumpPtrAllocator Allocator; + public: SelectionDAG(TargetLowering &tli, MachineFunction &mf, FunctionLoweringInfo &fli, MachineModuleInfo *mmi, @@ -457,8 +461,7 @@ /// SelectNodeTo - These are used for target selectors to *mutate* the /// specified node to have the specified return type, Target opcode, and /// operands. Note that target opcodes are stored as - /// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field. The 0th value - /// of the resultant node is returned. + /// ~TargetOpcode in the node opcode field. The resultant node is returned. SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT, SDOperand Op1); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT, @@ -481,6 +484,29 @@ SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, SDVTList VTs, const SDOperand *Ops, unsigned NumOps); + /// MorphNodeTo - These *mutate* the specified node to have the specified + /// return type, opcode, and operands. + SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT); + SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT, SDOperand Op1); + SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT, + SDOperand Op1, SDOperand Op2); + SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3); + SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT, + const SDOperand *Ops, unsigned NumOps); + SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT1, MVT VT2); + SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT1, + MVT VT2, const SDOperand *Ops, unsigned NumOps); + SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT1, + MVT VT2, MVT VT3, const SDOperand *Ops, unsigned NumOps); + SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT1, + MVT VT2, SDOperand Op1); + SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT1, + MVT VT2, SDOperand Op1, SDOperand Op2); + SDNode *MorphNodeTo(SDNode *N, unsigned Opc, MVT VT1, + MVT VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3); + SDNode *MorphNodeTo(SDNode *N, unsigned Opc, SDVTList VTs, + const SDOperand *Ops, unsigned NumOps); /// getTargetNode - These are used for target selectors to create a new node /// with specified return type(s), target opcode, and operands. @@ -565,6 +591,13 @@ void ReplaceAllUsesOfValueWith(SDOperand From, SDOperand To, DAGUpdateListener *UpdateListener = 0); + /// ReplaceAllUsesOfValuesWith - Like ReplaceAllUsesOfValueWith, but + /// for multiple values at once. This correctly handles the case where + /// there is an overlap between the From values and the To values. + void ReplaceAllUsesOfValuesWith(const SDOperand *From, const SDOperand *To, + unsigned Num, + DAGUpdateListener *UpdateListener = 0); + /// AssignTopologicalOrder - Assign a unique node id for each node in the DAG /// based on their topological order. It returns the maximum id and a vector /// of the SDNodes* in assigned order by reference. @@ -654,7 +687,7 @@ unsigned getMVTAlignment(MVT MemoryVT) const; // List of non-single value types. - std::list > VTList; + std::vector VTList; // Maps to auto-CSE operations. std::vector CondCodeNodes; Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Thu Jul 17 14:10:17 2008 @@ -846,7 +846,8 @@ inline const SDOperand &getOperand(unsigned i) const; inline uint64_t getConstantOperandVal(unsigned i) const; inline bool isTargetOpcode() const; - inline unsigned getTargetOpcode() const; + inline bool isMachineOpcode() const; + inline unsigned getMachineOpcode() const; /// reachesChainWithoutSideEffects - Return true if this operand (which must @@ -1028,7 +1029,7 @@ private: /// NodeType - The operation that this node performs. /// - unsigned short NodeType; + short NodeType; /// OperandsNeedDelete - This is true if OperandList was new[]'d. If true, /// then they will be delete[]'d when the node is destroyed. @@ -1072,11 +1073,27 @@ //===--------------------------------------------------------------------===// // Accessors // - unsigned getOpcode() const { return NodeType; } + + /// getOpcode - Return the SelectionDAG opcode value for this node. For + /// pre-isel nodes (those for which isMachineOpcode returns false), these + /// are the opcode values in the ISD and ISD namespaces. For + /// post-isel opcodes, see getMachineOpcode. + unsigned getOpcode() const { return (unsigned short)NodeType; } + + /// isTargetOpcode - Test if this node has a target-specific opcode (in the + /// ISD namespace). bool isTargetOpcode() const { return NodeType >= ISD::BUILTIN_OP_END; } - unsigned getTargetOpcode() const { - assert(isTargetOpcode() && "Not a target opcode!"); - return NodeType - ISD::BUILTIN_OP_END; + + /// isMachineOpcode - Test if this node has a post-isel opcode, directly + /// corresponding to a MachineInstr opcode. + bool isMachineOpcode() const { return NodeType < 0; } + + /// getMachineOpcode - This may only be called if isMachineOpcode returns + /// true. It returns the MachineInstr opcode value that the node's opcode + /// corresponds to. + unsigned getMachineOpcode() const { + assert(isMachineOpcode() && "Not a target opcode!"); + return ~NodeType; } size_t use_size() const { return std::distance(use_begin(), use_end()); } @@ -1314,17 +1331,9 @@ } /// DropOperands - Release the operands and set this node to have - /// zero operands. This should only be used by HandleSDNode to clear - /// its operand list. + /// zero operands. void DropOperands(); - /// MorphNodeTo - This frees the operands of the current node, resets the - /// opcode, types, and operands to the specified value. This should only be - /// used by the SelectionDAG class. - void MorphNodeTo(unsigned Opc, SDVTList L, - const SDOperand *Ops, unsigned NumOps, - SmallVectorImpl &DeadNodes); - void addUser(unsigned i, SDNode *User) { assert(User->OperandList[i].getUser() && "Node without parent"); addUse(User->OperandList[i]); @@ -1358,8 +1367,11 @@ inline bool SDOperand::isTargetOpcode() const { return Val->isTargetOpcode(); } -inline unsigned SDOperand::getTargetOpcode() const { - return Val->getTargetOpcode(); +inline bool SDOperand::isMachineOpcode() const { + return Val->isMachineOpcode(); +} +inline unsigned SDOperand::getMachineOpcode() const { + return Val->getMachineOpcode(); } inline bool SDOperand::hasOneUse() const { return Val->hasNUsesOfValue(1, ResNo); Modified: llvm/trunk/include/llvm/Support/Allocator.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Allocator.h?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Allocator.h (original) +++ llvm/trunk/include/llvm/Support/Allocator.h Thu Jul 17 14:10:17 2008 @@ -58,6 +58,11 @@ return static_cast(Allocate(sizeof(T),AlignOf::Alignment)); } + template + T *Allocate(size_t Num) { + return static_cast(Allocate(Num * sizeof(T), AlignOf::Alignment)); + } + void Deallocate(void * /*Ptr*/) {} void PrintStats() const; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Thu Jul 17 14:10:17 2008 @@ -63,8 +63,8 @@ return; unsigned ResNo = Use->getOperand(2).ResNo; - if (Def->isTargetOpcode()) { - const TargetInstrDesc &II = TII->get(Def->getTargetOpcode()); + if (Def->isMachineOpcode()) { + const TargetInstrDesc &II = TII->get(Def->getMachineOpcode()); if (ResNo >= II.getNumDefs() && II.ImplicitDefs[ResNo - II.getNumDefs()] == Reg) { PhysReg = Reg; @@ -167,8 +167,8 @@ SUnit *SU = &SUnits[su]; SDNode *MainNode = SU->Node; - if (MainNode->isTargetOpcode()) { - unsigned Opc = MainNode->getTargetOpcode(); + if (MainNode->isMachineOpcode()) { + unsigned Opc = MainNode->getMachineOpcode(); const TargetInstrDesc &TID = TII->get(Opc); for (unsigned i = 0; i != TID.getNumOperands(); ++i) { if (TID.getOperandConstraint(i, TOI::TIED_TO) != -1) { @@ -186,9 +186,9 @@ for (unsigned n = 0, e = SU->FlaggedNodes.size(); n != e; ++n) { SDNode *N = SU->FlaggedNodes[n]; - if (N->isTargetOpcode() && - TII->get(N->getTargetOpcode()).getImplicitDefs() && - CountResults(N) > TII->get(N->getTargetOpcode()).getNumDefs()) + if (N->isMachineOpcode() && + TII->get(N->getMachineOpcode()).getImplicitDefs() && + CountResults(N) > TII->get(N->getMachineOpcode()).getNumDefs()) SU->hasPhysRegDefs = true; for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { @@ -227,8 +227,8 @@ } SU->Latency = 0; - if (SU->Node->isTargetOpcode()) { - unsigned SchedClass = TII->get(SU->Node->getTargetOpcode()).getSchedClass(); + if (SU->Node->isMachineOpcode()) { + unsigned SchedClass = TII->get(SU->Node->getMachineOpcode()).getSchedClass(); const InstrStage *S = InstrItins.begin(SchedClass); const InstrStage *E = InstrItins.end(SchedClass); for (; S != E; ++S) @@ -236,8 +236,8 @@ } for (unsigned i = 0, e = SU->FlaggedNodes.size(); i != e; ++i) { SDNode *FNode = SU->FlaggedNodes[i]; - if (FNode->isTargetOpcode()) { - unsigned SchedClass = TII->get(FNode->getTargetOpcode()).getSchedClass(); + if (FNode->isMachineOpcode()) { + unsigned SchedClass = TII->get(FNode->getMachineOpcode()).getSchedClass(); const InstrStage *S = InstrItins.begin(SchedClass); const InstrStage *E = InstrItins.end(SchedClass); for (; S != E; ++S) @@ -501,7 +501,7 @@ void ScheduleDAG::CreateVirtualRegisters(SDNode *Node, MachineInstr *MI, const TargetInstrDesc &II, DenseMap &VRBaseMap) { - assert(Node->getTargetOpcode() != TargetInstrInfo::IMPLICIT_DEF && + assert(Node->getMachineOpcode() != TargetInstrInfo::IMPLICIT_DEF && "IMPLICIT_DEF should have been handled as a special case elsewhere!"); for (unsigned i = 0; i < II.getNumDefs(); ++i) { @@ -544,8 +544,8 @@ /// of the specified node. unsigned ScheduleDAG::getVR(SDOperand Op, DenseMap &VRBaseMap) { - if (Op.isTargetOpcode() && - Op.getTargetOpcode() == TargetInstrInfo::IMPLICIT_DEF) { + if (Op.isMachineOpcode() && + Op.getMachineOpcode() == TargetInstrInfo::IMPLICIT_DEF) { // Add an IMPLICIT_DEF instruction before every use. unsigned VReg = getDstOfOnlyCopyToRegUse(Op.Val, Op.ResNo); // IMPLICIT_DEF can produce any type of result so its TargetInstrDesc @@ -572,7 +572,7 @@ unsigned IIOpNum, const TargetInstrDesc *II, DenseMap &VRBaseMap) { - if (Op.isTargetOpcode()) { + if (Op.isMachineOpcode()) { // Note that this case is redundant with the final else block, but we // include it because it is the most common and it makes the logic // simpler here. @@ -704,7 +704,7 @@ void ScheduleDAG::EmitSubregNode(SDNode *Node, DenseMap &VRBaseMap) { unsigned VRBase = 0; - unsigned Opc = Node->getTargetOpcode(); + unsigned Opc = Node->getMachineOpcode(); // If the node is only used by a CopyToReg and the dest reg is a vreg, use // the CopyToReg'd destination register instead of creating a new vreg. @@ -799,8 +799,8 @@ void ScheduleDAG::EmitNode(SDNode *Node, bool IsClone, DenseMap &VRBaseMap) { // If machine instruction - if (Node->isTargetOpcode()) { - unsigned Opc = Node->getTargetOpcode(); + if (Node->isMachineOpcode()) { + unsigned Opc = Node->getMachineOpcode(); // Handle subreg insert/extract specially if (Opc == TargetInstrInfo::EXTRACT_SUBREG || Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Thu Jul 17 14:10:17 2008 @@ -206,7 +206,7 @@ // If this is a pseudo op, like copyfromreg, look to see if there is a // real target node flagged to it. If so, use the target node. for (unsigned i = 0, e = CurSUnit->FlaggedNodes.size(); - FoundNode->getOpcode() < ISD::BUILTIN_OP_END && i != e; ++i) + !FoundNode->isMachineOpcode() && i != e; ++i) FoundNode = CurSUnit->FlaggedNodes[i]; HazardRecognizer::HazardType HT = HazardRec->getHazardType(FoundNode); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Thu Jul 17 14:10:17 2008 @@ -216,7 +216,7 @@ SUnit *SU = Sequence[i]; if (!SU || !SU->Node) continue; if (SU->isCommutable) { - unsigned Opc = SU->Node->getTargetOpcode(); + unsigned Opc = SU->Node->getMachineOpcode(); const TargetInstrDesc &TID = TII->get(Opc); unsigned NumRes = TID.getNumDefs(); unsigned NumOps = TID.getNumOperands() - NumRes; @@ -678,7 +678,7 @@ assert(N->getNodeId() == -1 && "Node already inserted!"); N->setNodeId(NewSU->NodeNum); - const TargetInstrDesc &TID = TII->get(N->getTargetOpcode()); + const TargetInstrDesc &TID = TII->get(N->getMachineOpcode()); for (unsigned i = 0; i != TID.getNumOperands(); ++i) { if (TID.getOperandConstraint(i, TOI::TIED_TO) != -1) { NewSU->isTwoAddress = true; @@ -872,7 +872,7 @@ /// FIXME: Move to SelectionDAG? static MVT getPhysicalRegisterVT(SDNode *N, unsigned Reg, const TargetInstrInfo *TII) { - const TargetInstrDesc &TID = TII->get(N->getTargetOpcode()); + const TargetInstrDesc &TID = TII->get(N->getMachineOpcode()); assert(TID.ImplicitDefs && "Physical reg def must be in implicit def list!"); unsigned NumRes = TID.getNumDefs(); for (const unsigned *ImpDef = TID.getImplicitDefs(); *ImpDef; ++ImpDef) { @@ -913,9 +913,9 @@ for (unsigned i = 0, e = SU->FlaggedNodes.size()+1; i != e; ++i) { SDNode *Node = (i == 0) ? SU->Node : SU->FlaggedNodes[i-1]; - if (!Node || !Node->isTargetOpcode()) + if (!Node || !Node->isMachineOpcode()) continue; - const TargetInstrDesc &TID = TII->get(Node->getTargetOpcode()); + const TargetInstrDesc &TID = TII->get(Node->getMachineOpcode()); if (!TID.ImplicitDefs) continue; for (const unsigned *Reg = TID.ImplicitDefs; *Reg; ++Reg) { @@ -1673,7 +1673,7 @@ bool BURegReductionPriorityQueue::canClobber(const SUnit *SU, const SUnit *Op) { if (SU->isTwoAddress) { - unsigned Opc = SU->Node->getTargetOpcode(); + unsigned Opc = SU->Node->getMachineOpcode(); const TargetInstrDesc &TID = TII->get(Opc); unsigned NumRes = TID.getNumDefs(); unsigned NumOps = TID.getNumOperands() - NumRes; @@ -1709,11 +1709,11 @@ const TargetInstrInfo *TII, const TargetRegisterInfo *TRI) { SDNode *N = SuccSU->Node; - unsigned NumDefs = TII->get(N->getTargetOpcode()).getNumDefs(); - const unsigned *ImpDefs = TII->get(N->getTargetOpcode()).getImplicitDefs(); + unsigned NumDefs = TII->get(N->getMachineOpcode()).getNumDefs(); + const unsigned *ImpDefs = TII->get(N->getMachineOpcode()).getImplicitDefs(); assert(ImpDefs && "Caller should check hasPhysRegDefs"); const unsigned *SUImpDefs = - TII->get(SU->Node->getTargetOpcode()).getImplicitDefs(); + TII->get(SU->Node->getMachineOpcode()).getImplicitDefs(); if (!SUImpDefs) return false; for (unsigned i = NumDefs, e = N->getNumValues(); i != e; ++i) { @@ -1744,10 +1744,10 @@ continue; SDNode *Node = SU->Node; - if (!Node || !Node->isTargetOpcode() || SU->FlaggedNodes.size() > 0) + if (!Node || !Node->isMachineOpcode() || SU->FlaggedNodes.size() > 0) continue; - unsigned Opc = Node->getTargetOpcode(); + unsigned Opc = Node->getMachineOpcode(); const TargetInstrDesc &TID = TII->get(Opc); unsigned NumRes = TID.getNumDefs(); unsigned NumOps = TID.getNumOperands() - NumRes; @@ -1768,7 +1768,7 @@ // depth and height. if (SuccSU->Height < SU->Height && (SU->Height - SuccSU->Height) > 1) continue; - if (!SuccSU->Node || !SuccSU->Node->isTargetOpcode()) + if (!SuccSU->Node || !SuccSU->Node->isMachineOpcode()) continue; // Don't constrain nodes with physical register defs if the // predecessor can clobber them. @@ -1778,7 +1778,7 @@ } // Don't constraint extract_subreg / insert_subreg these may be // coalesced away. We don't them close to their uses. - unsigned SuccOpc = SuccSU->Node->getTargetOpcode(); + unsigned SuccOpc = SuccSU->Node->getMachineOpcode(); if (SuccOpc == TargetInstrInfo::EXTRACT_SUBREG || SuccOpc == TargetInstrInfo::INSERT_SUBREG) continue; @@ -1836,8 +1836,8 @@ bool td_ls_rr_sort::operator()(const SUnit *left, const SUnit *right) const { unsigned LPriority = SPQ->getNodePriority(left); unsigned RPriority = SPQ->getNodePriority(right); - bool LIsTarget = left->Node && left->Node->isTargetOpcode(); - bool RIsTarget = right->Node && right->Node->isTargetOpcode(); + bool LIsTarget = left->Node && left->Node->isMachineOpcode(); + bool RIsTarget = right->Node && right->Node->isMachineOpcode(); bool LIsFloater = LIsTarget && left->NumPreds == 0; bool RIsFloater = RIsTarget && right->NumPreds == 0; unsigned LBonus = (LimitedSumOfUnscheduledPredsOfSuccs(left,1) == 1) ? 2 : 0; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Jul 17 14:10:17 2008 @@ -197,8 +197,8 @@ SDOperand Zero; if (N->getOpcode() == ISD::DBG_LABEL) return true; - if (N->isTargetOpcode() && - N->getTargetOpcode() == TargetInstrInfo::DBG_LABEL) + if (N->isMachineOpcode() && + N->getMachineOpcode() == TargetInstrInfo::DBG_LABEL) return true; return false; } @@ -532,8 +532,7 @@ } void SelectionDAG::RemoveDeadNode(SDNode *N, DAGUpdateListener *UpdateListener){ - SmallVector DeadNodes; - DeadNodes.push_back(N); + SmallVector DeadNodes(1, N); RemoveDeadNodes(DeadNodes, UpdateListener); } @@ -3523,31 +3522,33 @@ } SDVTList SelectionDAG::getVTList(MVT VT1, MVT VT2) { - for (std::list >::iterator I = VTList.begin(), - E = VTList.end(); I != E; ++I) { - if (I->size() == 2 && (*I)[0] == VT1 && (*I)[1] == VT2) - return makeVTList(&(*I)[0], 2); - } - std::vector V; - V.push_back(VT1); - V.push_back(VT2); - VTList.push_front(V); - return makeVTList(&(*VTList.begin())[0], 2); -} -SDVTList SelectionDAG::getVTList(MVT VT1, MVT VT2, - MVT VT3) { - for (std::list >::iterator I = VTList.begin(), - E = VTList.end(); I != E; ++I) { - if (I->size() == 3 && (*I)[0] == VT1 && (*I)[1] == VT2 && - (*I)[2] == VT3) - return makeVTList(&(*I)[0], 3); - } - std::vector V; - V.push_back(VT1); - V.push_back(VT2); - V.push_back(VT3); - VTList.push_front(V); - return makeVTList(&(*VTList.begin())[0], 3); + for (std::vector::reverse_iterator I = VTList.rbegin(), + E = VTList.rend(); I != E; ++I) + if (I->NumVTs == 2 && I->VTs[0] == VT1 && I->VTs[1] == VT2) + return *I; + + MVT *Array = Allocator.Allocate(2); + Array[0] = VT1; + Array[1] = VT2; + SDVTList Result = makeVTList(Array, 2); + VTList.push_back(Result); + return Result; +} + +SDVTList SelectionDAG::getVTList(MVT VT1, MVT VT2, MVT VT3) { + for (std::vector::reverse_iterator I = VTList.rbegin(), + E = VTList.rend(); I != E; ++I) + if (I->NumVTs == 3 && I->VTs[0] == VT1 && I->VTs[1] == VT2 && + I->VTs[2] == VT3) + return *I; + + MVT *Array = Allocator.Allocate(3); + Array[0] = VT1; + Array[1] = VT2; + Array[2] = VT3; + SDVTList Result = makeVTList(Array, 3); + VTList.push_back(Result); + return Result; } SDVTList SelectionDAG::getVTList(const MVT *VTs, unsigned NumVTs) { @@ -3559,22 +3560,26 @@ default: break; } - for (std::list >::iterator I = VTList.begin(), - E = VTList.end(); I != E; ++I) { - if (I->size() != NumVTs || VTs[0] != (*I)[0] || VTs[1] != (*I)[1]) continue; + for (std::vector::reverse_iterator I = VTList.rbegin(), + E = VTList.rend(); I != E; ++I) { + if (I->NumVTs != NumVTs || VTs[0] != I->VTs[0] || VTs[1] != I->VTs[1]) + continue; bool NoMatch = false; for (unsigned i = 2; i != NumVTs; ++i) - if (VTs[i] != (*I)[i]) { + if (VTs[i] != I->VTs[i]) { NoMatch = true; break; } if (!NoMatch) - return makeVTList(&*I->begin(), NumVTs); + return *I; } - VTList.push_front(std::vector(VTs, VTs+NumVTs)); - return makeVTList(&*VTList.begin()->begin(), NumVTs); + MVT *Array = Allocator.Allocate(NumVTs); + std::copy(VTs, VTs+NumVTs, Array); + SDVTList Result = makeVTList(Array, NumVTs); + VTList.push_back(Result); + return Result; } @@ -3711,61 +3716,9 @@ return InN; } -/// MorphNodeTo - This frees the operands of the current node, resets the -/// opcode, types, and operands to the specified value. This should only be -/// used by the SelectionDAG class. -void SDNode::MorphNodeTo(unsigned Opc, SDVTList L, - const SDOperand *Ops, unsigned NumOps, - SmallVectorImpl &DeadNodes) { - NodeType = Opc; - ValueList = L.VTs; - NumValues = L.NumVTs; - - // Clear the operands list, updating used nodes to remove this from their - // use list. Keep track of any operands that become dead as a result. - SmallPtrSet DeadNodeSet; - for (op_iterator I = op_begin(), E = op_end(); I != E; ++I) { - SDNode *N = I->getVal(); - N->removeUser(std::distance(op_begin(), I), this); - if (N->use_empty()) - DeadNodeSet.insert(N); - } - - // If NumOps is larger than the # of operands we currently have, reallocate - // the operand list. - if (NumOps > NumOperands) { - if (OperandsNeedDelete) { - delete [] OperandList; - } - OperandList = new SDUse[NumOps]; - OperandsNeedDelete = true; - } - - // Assign the new operands. - NumOperands = NumOps; - - for (unsigned i = 0, e = NumOps; i != e; ++i) { - OperandList[i] = Ops[i]; - OperandList[i].setUser(this); - SDNode *N = OperandList[i].getVal(); - N->addUser(i, this); - DeadNodeSet.erase(N); - } - - // Clean up any nodes that are still dead after adding the uses for the - // new operands. - for (SmallPtrSet::iterator I = DeadNodeSet.begin(), - E = DeadNodeSet.end(); I != E; ++I) - DeadNodes.push_back(*I); -} - /// DropOperands - Release the operands and set this node to have -/// zero operands. This should only be used by HandleSDNode to clear -/// its operand list. +/// zero operands. void SDNode::DropOperands() { - assert(NodeType == ISD::HANDLENODE && - "DropOperands is for HANDLENODE only!"); - // Unlike the code in MorphNodeTo that does this, we don't need to // watch for dead nodes here. for (op_iterator I = op_begin(), E = op_end(); I != E; ++I) @@ -3774,112 +3727,257 @@ NumOperands = 0; } -/// SelectNodeTo - These are used for target selectors to *mutate* the -/// specified node to have the specified return type, Target opcode, and -/// operands. Note that target opcodes are stored as -/// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field. +/// SelectNodeTo - These are wrappers around MorphNodeTo that accept a +/// machine opcode. /// -/// Note that SelectNodeTo returns the resultant node. If there is already a -/// node of the specified opcode and operands, it returns that node instead of -/// the current one. -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc, MVT VT) { SDVTList VTs = getVTList(VT); - return SelectNodeTo(N, TargetOpc, VTs, 0, 0); + return SelectNodeTo(N, MachineOpc, VTs, 0, 0); } -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc, MVT VT, SDOperand Op1) { SDVTList VTs = getVTList(VT); SDOperand Ops[] = { Op1 }; - return SelectNodeTo(N, TargetOpc, VTs, Ops, 1); + return SelectNodeTo(N, MachineOpc, VTs, Ops, 1); } -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc, MVT VT, SDOperand Op1, SDOperand Op2) { SDVTList VTs = getVTList(VT); SDOperand Ops[] = { Op1, Op2 }; - return SelectNodeTo(N, TargetOpc, VTs, Ops, 2); + return SelectNodeTo(N, MachineOpc, VTs, Ops, 2); } -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc, MVT VT, SDOperand Op1, SDOperand Op2, SDOperand Op3) { SDVTList VTs = getVTList(VT); SDOperand Ops[] = { Op1, Op2, Op3 }; - return SelectNodeTo(N, TargetOpc, VTs, Ops, 3); + return SelectNodeTo(N, MachineOpc, VTs, Ops, 3); } -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc, MVT VT, const SDOperand *Ops, unsigned NumOps) { SDVTList VTs = getVTList(VT); - return SelectNodeTo(N, TargetOpc, VTs, Ops, NumOps); + return SelectNodeTo(N, MachineOpc, VTs, Ops, NumOps); } -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc, MVT VT1, MVT VT2, const SDOperand *Ops, unsigned NumOps) { SDVTList VTs = getVTList(VT1, VT2); - return SelectNodeTo(N, TargetOpc, VTs, Ops, NumOps); + return SelectNodeTo(N, MachineOpc, VTs, Ops, NumOps); } -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc, MVT VT1, MVT VT2) { SDVTList VTs = getVTList(VT1, VT2); - return SelectNodeTo(N, TargetOpc, VTs, (SDOperand *)0, 0); + return SelectNodeTo(N, MachineOpc, VTs, (SDOperand *)0, 0); } -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc, MVT VT1, MVT VT2, MVT VT3, const SDOperand *Ops, unsigned NumOps) { SDVTList VTs = getVTList(VT1, VT2, VT3); - return SelectNodeTo(N, TargetOpc, VTs, Ops, NumOps); + return SelectNodeTo(N, MachineOpc, VTs, Ops, NumOps); } -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc, MVT VT1, MVT VT2, SDOperand Op1) { SDVTList VTs = getVTList(VT1, VT2); SDOperand Ops[] = { Op1 }; - return SelectNodeTo(N, TargetOpc, VTs, Ops, 1); + return SelectNodeTo(N, MachineOpc, VTs, Ops, 1); } -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc, MVT VT1, MVT VT2, SDOperand Op1, SDOperand Op2) { SDVTList VTs = getVTList(VT1, VT2); SDOperand Ops[] = { Op1, Op2 }; - return SelectNodeTo(N, TargetOpc, VTs, Ops, 2); + return SelectNodeTo(N, MachineOpc, VTs, Ops, 2); } -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc, MVT VT1, MVT VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3) { SDVTList VTs = getVTList(VT1, VT2); SDOperand Ops[] = { Op1, Op2, Op3 }; - return SelectNodeTo(N, TargetOpc, VTs, Ops, 3); + return SelectNodeTo(N, MachineOpc, VTs, Ops, 3); } -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc, SDVTList VTs, const SDOperand *Ops, unsigned NumOps) { + return MorphNodeTo(N, ~MachineOpc, VTs, Ops, NumOps); +} + +SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, + MVT VT) { + SDVTList VTs = getVTList(VT); + return MorphNodeTo(N, Opc, VTs, 0, 0); +} + +SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, + MVT VT, SDOperand Op1) { + SDVTList VTs = getVTList(VT); + SDOperand Ops[] = { Op1 }; + return MorphNodeTo(N, Opc, VTs, Ops, 1); +} + +SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, + MVT VT, SDOperand Op1, + SDOperand Op2) { + SDVTList VTs = getVTList(VT); + SDOperand Ops[] = { Op1, Op2 }; + return MorphNodeTo(N, Opc, VTs, Ops, 2); +} + +SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, + MVT VT, SDOperand Op1, + SDOperand Op2, SDOperand Op3) { + SDVTList VTs = getVTList(VT); + SDOperand Ops[] = { Op1, Op2, Op3 }; + return MorphNodeTo(N, Opc, VTs, Ops, 3); +} + +SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, + MVT VT, const SDOperand *Ops, + unsigned NumOps) { + SDVTList VTs = getVTList(VT); + return MorphNodeTo(N, Opc, VTs, Ops, NumOps); +} + +SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, + MVT VT1, MVT VT2, const SDOperand *Ops, + unsigned NumOps) { + SDVTList VTs = getVTList(VT1, VT2); + return MorphNodeTo(N, Opc, VTs, Ops, NumOps); +} + +SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, + MVT VT1, MVT VT2) { + SDVTList VTs = getVTList(VT1, VT2); + return MorphNodeTo(N, Opc, VTs, (SDOperand *)0, 0); +} + +SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, + MVT VT1, MVT VT2, MVT VT3, + const SDOperand *Ops, unsigned NumOps) { + SDVTList VTs = getVTList(VT1, VT2, VT3); + return MorphNodeTo(N, Opc, VTs, Ops, NumOps); +} + +SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, + MVT VT1, MVT VT2, + SDOperand Op1) { + SDVTList VTs = getVTList(VT1, VT2); + SDOperand Ops[] = { Op1 }; + return MorphNodeTo(N, Opc, VTs, Ops, 1); +} + +SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, + MVT VT1, MVT VT2, + SDOperand Op1, SDOperand Op2) { + SDVTList VTs = getVTList(VT1, VT2); + SDOperand Ops[] = { Op1, Op2 }; + return MorphNodeTo(N, Opc, VTs, Ops, 2); +} + +SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, + MVT VT1, MVT VT2, + SDOperand Op1, SDOperand Op2, + SDOperand Op3) { + SDVTList VTs = getVTList(VT1, VT2); + SDOperand Ops[] = { Op1, Op2, Op3 }; + return MorphNodeTo(N, Opc, VTs, Ops, 3); +} + +/// MorphNodeTo - These *mutate* the specified node to have the specified +/// return type, opcode, and operands. +/// +/// Note that MorphNodeTo returns the resultant node. If there is already a +/// node of the specified opcode and operands, it returns that node instead of +/// the current one. +/// +/// Using MorphNodeTo is faster than creating a new node and swapping it in +/// with ReplaceAllUsesWith both because it often avoids allocating a new +/// node, and because it doesn't require CSE recalulation for any of +/// the node's users. +/// +SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc, + SDVTList VTs, const SDOperand *Ops, + unsigned NumOps) { // If an identical node already exists, use it. - FoldingSetNodeID ID; - AddNodeIDNode(ID, ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, NumOps); void *IP = 0; - if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return ON; + if (VTs.VTs[VTs.NumVTs-1] != MVT::Flag) { + FoldingSetNodeID ID; + AddNodeIDNode(ID, Opc, VTs, Ops, NumOps); + if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) + return ON; + } RemoveNodeFromCSEMaps(N); + // Start the morphing. + N->NodeType = Opc; + N->ValueList = VTs.VTs; + N->NumValues = VTs.NumVTs; + + // Clear the operands list, updating used nodes to remove this from their + // use list. Keep track of any operands that become dead as a result. + SmallPtrSet DeadNodeSet; + for (SDNode::op_iterator B = N->op_begin(), I = B, E = N->op_end(); + I != E; ++I) { + SDNode *Used = I->getVal(); + Used->removeUser(std::distance(B, I), N); + if (Used->use_empty()) + DeadNodeSet.insert(Used); + } + + // If NumOps is larger than the # of operands we currently have, reallocate + // the operand list. + if (NumOps > N->NumOperands) { + if (N->OperandsNeedDelete) + delete[] N->OperandList; + if (N->isMachineOpcode()) { + // We're creating a final node that will live unmorphed for the + // remainder of this SelectionDAG's duration, so we can allocate the + // operands directly out of the pool with no recycling metadata. + N->OperandList = Allocator.Allocate(NumOps); + N->OperandsNeedDelete = false; + } else { + N->OperandList = new SDUse[NumOps]; + N->OperandsNeedDelete = true; + } + } + + // Assign the new operands. + N->NumOperands = NumOps; + for (unsigned i = 0, e = NumOps; i != e; ++i) { + N->OperandList[i] = Ops[i]; + N->OperandList[i].setUser(N); + SDNode *ToUse = N->OperandList[i].getVal(); + ToUse->addUser(i, N); + DeadNodeSet.erase(ToUse); + } + + // Delete any nodes that are still dead after adding the uses for the + // new operands. SmallVector DeadNodes; - N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs, Ops, NumOps, DeadNodes); + for (SmallPtrSet::iterator I = DeadNodeSet.begin(), + E = DeadNodeSet.end(); I != E; ++I) + if ((*I)->use_empty()) + DeadNodes.push_back(*I); RemoveDeadNodes(DeadNodes); - CSEMap.InsertNode(N, IP); // Memoize the new node. + if (IP) + CSEMap.InsertNode(N, IP); // Memoize the new node. return N; } @@ -3891,70 +3989,70 @@ /// node of the specified opcode and operands, it returns that node instead of /// the current one. SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT) { - return getNode(ISD::BUILTIN_OP_END+Opcode, VT).Val; + return getNode(~Opcode, VT).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT, SDOperand Op1) { - return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1).Val; + return getNode(~Opcode, VT, Op1).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT, SDOperand Op1, SDOperand Op2) { - return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2).Val; + return getNode(~Opcode, VT, Op1, Op2).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT, SDOperand Op1, SDOperand Op2, SDOperand Op3) { - return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2, Op3).Val; + return getNode(~Opcode, VT, Op1, Op2, Op3).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT, const SDOperand *Ops, unsigned NumOps) { - return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops, NumOps).Val; + return getNode(~Opcode, VT, Ops, NumOps).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT1, MVT VT2) { const MVT *VTs = getNodeValueTypes(VT1, VT2); SDOperand Op; - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, &Op, 0).Val; + return getNode(~Opcode, VTs, 2, &Op, 0).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, SDOperand Op1) { const MVT *VTs = getNodeValueTypes(VT1, VT2); - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, &Op1, 1).Val; + return getNode(~Opcode, VTs, 2, &Op1, 1).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, SDOperand Op1, SDOperand Op2) { const MVT *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 2).Val; + return getNode(~Opcode, VTs, 2, Ops, 2).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3) { const MVT *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2, Op3 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 3).Val; + return getNode(~Opcode, VTs, 2, Ops, 3).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, const SDOperand *Ops, unsigned NumOps) { const MVT *VTs = getNodeValueTypes(VT1, VT2); - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, NumOps).Val; + return getNode(~Opcode, VTs, 2, Ops, NumOps).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, MVT VT3, SDOperand Op1, SDOperand Op2) { const MVT *VTs = getNodeValueTypes(VT1, VT2, VT3); SDOperand Ops[] = { Op1, Op2 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 2).Val; + return getNode(~Opcode, VTs, 3, Ops, 2).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, MVT VT3, SDOperand Op1, SDOperand Op2, SDOperand Op3) { const MVT *VTs = getNodeValueTypes(VT1, VT2, VT3); SDOperand Ops[] = { Op1, Op2, Op3 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 3).Val; + return getNode(~Opcode, VTs, 3, Ops, 3).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, MVT VT3, const SDOperand *Ops, unsigned NumOps) { const MVT *VTs = getNodeValueTypes(VT1, VT2, VT3); - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, NumOps).Val; + return getNode(~Opcode, VTs, 3, Ops, NumOps).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, MVT VT3, MVT VT4, @@ -3965,13 +4063,13 @@ VTList.push_back(VT3); VTList.push_back(VT4); const MVT *VTs = getNodeValueTypes(VTList); - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 4, Ops, NumOps).Val; + return getNode(~Opcode, VTs, 4, Ops, NumOps).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, const std::vector &ResultTys, const SDOperand *Ops, unsigned NumOps) { const MVT *VTs = getNodeValueTypes(ResultTys); - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, ResultTys.size(), + return getNode(~Opcode, VTs, ResultTys.size(), Ops, NumOps).Val; } @@ -4043,13 +4141,14 @@ /// void SelectionDAG::ReplaceAllUsesWith(SDNode *From, SDNode *To, DAGUpdateListener *UpdateListener) { - assert(From != To && "Cannot replace uses of with self"); - assert(From->getNumValues() == To->getNumValues() && + assert(From->getVTList().VTs == To->getVTList().VTs && + From->getNumValues() == To->getNumValues() && "Cannot use this version of ReplaceAllUsesWith!"); - if (From->getNumValues() == 1) // If possible, use the faster version. - return ReplaceAllUsesWith(SDOperand(From, 0), SDOperand(To, 0), - UpdateListener); - + + // Handle the trivial case. + if (From == To) + return; + while (!From->use_empty()) { SDNode::use_iterator UI = From->use_begin(); SDNode *U = UI->getUser(); @@ -4127,36 +4226,14 @@ } } -namespace { - /// ChainedSetUpdaterListener - This class is a DAGUpdateListener that removes - /// any deleted nodes from the set passed into its constructor and recursively - /// notifies another update listener if specified. - class ChainedSetUpdaterListener : - public SelectionDAG::DAGUpdateListener { - SmallSetVector &Set; - SelectionDAG::DAGUpdateListener *Chain; - public: - ChainedSetUpdaterListener(SmallSetVector &set, - SelectionDAG::DAGUpdateListener *chain) - : Set(set), Chain(chain) {} - - virtual void NodeDeleted(SDNode *N, SDNode *E) { - Set.remove(N); - if (Chain) Chain->NodeDeleted(N, E); - } - virtual void NodeUpdated(SDNode *N) { - if (Chain) Chain->NodeUpdated(N); - } - }; -} - /// ReplaceAllUsesOfValueWith - Replace any uses of From with To, leaving /// uses of other values produced by From.Val alone. The Deleted vector is /// handled the same way as for ReplaceAllUsesWith. void SelectionDAG::ReplaceAllUsesOfValueWith(SDOperand From, SDOperand To, DAGUpdateListener *UpdateListener){ - assert(From != To && "Cannot replace a value with itself"); - + // Handle the really simple, really trivial case efficiently. + if (From == To) return; + // Handle the simple, trivial, case efficiently. if (From.Val->getNumValues() == 1) { ReplaceAllUsesWith(From, To, UpdateListener); @@ -4174,11 +4251,6 @@ Users.insert(User); } - // When one of the recursive merges deletes nodes from the graph, we need to - // make sure that UpdateListener is notified *and* that the node is removed - // from Users if present. CSUL does this. - ChainedSetUpdaterListener CSUL(Users, UpdateListener); - while (!Users.empty()) { // We know that this user uses some value of From. If it is the right // value, update it. @@ -4217,10 +4289,74 @@ // If there was already an existing matching node, use ReplaceAllUsesWith // to replace the dead one with the existing one. This can cause - // recursive merging of other unrelated nodes down the line. The merging - // can cause deletion of nodes that used the old value. To handle this, we - // use CSUL to remove them from the Users set. - ReplaceAllUsesWith(User, Existing, &CSUL); + // recursive merging of other unrelated nodes down the line. + ReplaceAllUsesWith(User, Existing, UpdateListener); + + // User is now dead. Notify a listener if present. + if (UpdateListener) UpdateListener->NodeDeleted(User, Existing); + DeleteNodeNotInCSEMaps(User); + } +} + +/// ReplaceAllUsesOfValuesWith - Replace any uses of From with To, leaving +/// uses of other values produced by From.Val alone. The same value may +/// appear in both the From and To list. The Deleted vector is +/// handled the same way as for ReplaceAllUsesWith. +void SelectionDAG::ReplaceAllUsesOfValuesWith(const SDOperand *From, + const SDOperand *To, + unsigned Num, + DAGUpdateListener *UpdateListener){ + // Handle the simple, trivial case efficiently. + if (Num == 1) + return ReplaceAllUsesOfValueWith(*From, *To, UpdateListener); + + SmallVector, 16> Users; + for (unsigned i = 0; i != Num; ++i) + for (SDNode::use_iterator UI = From[i].Val->use_begin(), + E = From[i].Val->use_end(); UI != E; ++UI) + Users.push_back(std::make_pair(UI->getUser(), i)); + + while (!Users.empty()) { + // We know that this user uses some value of From. If it is the right + // value, update it. + SDNode *User = Users.back().first; + unsigned i = Users.back().second; + Users.pop_back(); + + // Scan for an operand that matches From. + SDNode::op_iterator Op = User->op_begin(), E = User->op_end(); + for (; Op != E; ++Op) + if (*Op == From[i]) break; + + // If there are no matches, the user must use some other result of From. + if (Op == E) continue; + + // Okay, we know this user needs to be updated. Remove its old self + // from the CSE maps. + RemoveNodeFromCSEMaps(User); + + // Update all operands that match "From" in case there are multiple uses. + for (; Op != E; ++Op) { + if (*Op == From[i]) { + From[i].Val->removeUser(Op-User->op_begin(), User); + *Op = To[i]; + Op->setUser(User); + To[i].Val->addUser(Op-User->op_begin(), User); + } + } + + // Now that we have modified User, add it back to the CSE maps. If it + // already exists there, recursively merge the results together. + SDNode *Existing = AddNonLeafNodeToCSEMaps(User); + if (!Existing) { + if (UpdateListener) UpdateListener->NodeUpdated(User); + continue; // Continue on to next user. + } + + // If there was already an existing matching node, use ReplaceAllUsesWith + // to replace the dead one with the existing one. This can cause + // recursive merging of other unrelated nodes down the line. + ReplaceAllUsesWith(User, Existing, UpdateListener); // User is now dead. Notify a listener if present. if (UpdateListener) UpdateListener->NodeDeleted(User, Existing); @@ -4507,21 +4643,25 @@ default: if (getOpcode() < ISD::BUILTIN_OP_END) return "<>"; - else { - if (G) { + if (isMachineOpcode()) { + if (G) if (const TargetInstrInfo *TII = G->getTarget().getInstrInfo()) - if (getOpcode()-ISD::BUILTIN_OP_END < TII->getNumOpcodes()) - return TII->get(getOpcode()-ISD::BUILTIN_OP_END).getName(); - - TargetLowering &TLI = G->getTargetLoweringInfo(); - const char *Name = - TLI.getTargetNodeName(getOpcode()); - if (Name) return Name; - } - + if (getMachineOpcode() < TII->getNumOpcodes()) + return TII->get(getMachineOpcode()).getName(); + return "<>"; + } + if (G) { + TargetLowering &TLI = G->getTargetLoweringInfo(); + const char *Name = TLI.getTargetNodeName(getOpcode()); + if (Name) return Name; return "<>"; } + return "<>"; +#ifndef NDEBUG + case ISD::DELETED_NODE: + return "<>"; +#endif case ISD::PREFETCH: return "Prefetch"; case ISD::MEMBARRIER: return "MemBarrier"; case ISD::ATOMIC_CMP_SWAP: return "AtomicCmpSwap"; Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Thu Jul 17 14:10:17 2008 @@ -530,9 +530,8 @@ SDNode *ARMDAGToDAGISel::Select(SDOperand Op) { SDNode *N = Op.Val; - unsigned Opcode = N->getOpcode(); - if (Opcode >= ISD::BUILTIN_OP_END && Opcode < ARMISD::FIRST_NUMBER) + if (N->isMachineOpcode()) return NULL; // Already selected. switch (N->getOpcode()) { Modified: llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Thu Jul 17 14:10:17 2008 @@ -244,8 +244,7 @@ // target-specific node if it hasn't already been changed. SDNode *AlphaDAGToDAGISel::Select(SDOperand Op) { SDNode *N = Op.Val; - if (N->getOpcode() >= ISD::BUILTIN_OP_END && - N->getOpcode() < AlphaISD::FIRST_NUMBER) { + if (N->isMachineOpcode()) { return NULL; // Already selected. } Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Thu Jul 17 14:10:17 2008 @@ -587,7 +587,7 @@ MVT OpVT = Op.getValueType(); SDOperand Ops[8]; - if (Opc >= ISD::BUILTIN_OP_END && Opc < SPUISD::FIRST_NUMBER) { + if (N->isMachineOpcode()) { return NULL; // Already selected. } else if (Opc == ISD::FrameIndex) { // Selects to (add $sp, FI * stackSlotSize) Modified: llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp Thu Jul 17 14:10:17 2008 @@ -305,8 +305,7 @@ // target-specific node if it hasn't already been changed. SDNode *IA64DAGToDAGISel::Select(SDOperand Op) { SDNode *N = Op.Val; - if (N->getOpcode() >= ISD::BUILTIN_OP_END && - N->getOpcode() < IA64ISD::FIRST_NUMBER) + if (N->isMachineOpcode()) return NULL; // Already selected. switch (N->getOpcode()) { Modified: llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp Thu Jul 17 14:10:17 2008 @@ -205,7 +205,7 @@ #endif // If we have a custom node, we already have selected! - if (Opcode >= ISD::BUILTIN_OP_END && Opcode < MipsISD::FIRST_NUMBER) { + if (Node->isMachineOpcode()) { #ifndef NDEBUG DOUT << std::string(Indent-2, ' ') << "== "; DEBUG(Node->dump(CurDAG)); Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp Thu Jul 17 14:10:17 2008 @@ -239,7 +239,7 @@ #endif // If we have a custom node, we already have selected! - if (Opcode >= ISD::BUILTIN_OP_END && Opcode < PIC16ISD::FIRST_NUMBER) { + if (Node->isMachineOpcode()) { #ifndef NDEBUG DOUT << std::string(Indent-2, ' ') << "== "; DEBUG(Node->dump(CurDAG)); Modified: llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp Thu Jul 17 14:10:17 2008 @@ -64,11 +64,11 @@ bool &isFirst, bool &isSingle, bool &isCracked, bool &isLoad, bool &isStore) { - if (Opcode < ISD::BUILTIN_OP_END) { + if ((int)Opcode >= 0) { isFirst = isSingle = isCracked = isLoad = isStore = false; return PPCII::PPC970_Pseudo; } - Opcode -= ISD::BUILTIN_OP_END; + Opcode = ~Opcode; const TargetInstrDesc &TID = TII.get(Opcode); @@ -125,7 +125,7 @@ GetInstrType(Node->getOpcode(), isFirst, isSingle, isCracked, isLoad, isStore); if (InstrType == PPCII::PPC970_Pseudo) return NoHazard; - unsigned Opcode = Node->getOpcode()-ISD::BUILTIN_OP_END; + unsigned Opcode = Node->getMachineOpcode(); // We can only issue a PPC970_First/PPC970_Single instruction (such as // crand/mtspr/etc) if this is the first cycle of the dispatch group. @@ -223,7 +223,7 @@ GetInstrType(Node->getOpcode(), isFirst, isSingle, isCracked, isLoad, isStore); if (InstrType == PPCII::PPC970_Pseudo) return; - unsigned Opcode = Node->getOpcode()-ISD::BUILTIN_OP_END; + unsigned Opcode = Node->getMachineOpcode(); // Update structural hazard information. if (Opcode == PPC::MTCTR) HasCTRSet = true; Modified: llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Thu Jul 17 14:10:17 2008 @@ -775,8 +775,7 @@ // target-specific node if it hasn't already been changed. SDNode *PPCDAGToDAGISel::Select(SDOperand Op) { SDNode *N = Op.Val; - if (N->getOpcode() >= ISD::BUILTIN_OP_END && - N->getOpcode() < PPCISD::FIRST_NUMBER) + if (N->isMachineOpcode()) return NULL; // Already selected. switch (N->getOpcode()) { @@ -962,7 +961,8 @@ AddToISelQueue(Offset); SDOperand Ops[] = { Offset, Base, Chain }; // FIXME: PPC64 - return CurDAG->getTargetNode(Opcode, MVT::i32, MVT::i32, + return CurDAG->getTargetNode(Opcode, LD->getValueType(0), + PPCLowering.getPointerTy(), MVT::Other, Ops, 3); } else { assert(0 && "R+R preindex loads not supported yet!"); Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Thu Jul 17 14:10:17 2008 @@ -137,8 +137,7 @@ SDNode *SparcDAGToDAGISel::Select(SDOperand Op) { SDNode *N = Op.Val; - if (N->getOpcode() >= ISD::BUILTIN_OP_END && - N->getOpcode() < SPISD::FIRST_NUMBER) + if (N->isMachineOpcode()) return NULL; // Already selected. switch (N->getOpcode()) { Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Thu Jul 17 14:10:17 2008 @@ -1159,7 +1159,7 @@ Indent += 2; #endif - if (Opcode >= ISD::BUILTIN_OP_END && Opcode < X86ISD::FIRST_NUMBER) { + if (Node->isMachineOpcode()) { #ifndef NDEBUG DOUT << std::string(Indent-2, ' ') << "== "; DEBUG(Node->dump(CurDAG)); Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Thu Jul 17 14:10:17 2008 @@ -2239,11 +2239,11 @@ bool X86InstrInfo::unfoldMemoryOperand(SelectionDAG &DAG, SDNode *N, SmallVectorImpl &NewNodes) const { - if (!N->isTargetOpcode()) + if (!N->isMachineOpcode()) return false; DenseMap >::iterator I = - MemOp2RegOpTable.find((unsigned*)N->getTargetOpcode()); + MemOp2RegOpTable.find((unsigned*)N->getMachineOpcode()); if (I == MemOp2RegOpTable.end()) return false; unsigned Opc = I->second.first; Modified: llvm/trunk/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll Thu Jul 17 14:10:17 2008 @@ -1,7 +1,7 @@ ; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin | \ -; RUN: grep {stw r2, 32751} +; RUN: grep {stw r3, 32751} ; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin | \ -; RUN: grep {stw r2, 32751} +; RUN: grep {stw r3, 32751} ; RUN: llvm-as < %s | llc -march=ppc64 -mtriple=powerpc-apple-darwin | \ ; RUN: grep {std r2, 9024} Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=53728&r1=53727&r2=53728&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Thu Jul 17 14:10:17 2008 @@ -1157,7 +1157,8 @@ if (!isRoot) Code += "), 0"; - bool NeedReplace = false; + std::vector ReplaceFroms; + std::vector ReplaceTos; if (!isRoot) { NodeOps.push_back("Tmp" + utostr(ResNo)); } else { @@ -1176,33 +1177,35 @@ if (FoldedChains.size() > 0) { std::string Code; - for (unsigned j = 0, e = FoldedChains.size(); j < e; j++) - After.push_back("ReplaceUses(SDOperand(" + - FoldedChains[j].first + ".Val, " + - utostr(FoldedChains[j].second) + - "), SDOperand(ResNode, " + - utostr(NumResults+NumDstRegs) + "));"); - NeedReplace = true; + for (unsigned j = 0, e = FoldedChains.size(); j < e; j++) { + ReplaceFroms.push_back("SDOperand(" + + FoldedChains[j].first + ".Val, " + + utostr(FoldedChains[j].second) + + ")"); + ReplaceTos.push_back("SDOperand(ResNode, " + + utostr(NumResults+NumDstRegs) + ")"); + } } if (NodeHasOutFlag) { if (FoldedFlag.first != "") { - After.push_back("ReplaceUses(SDOperand(" + FoldedFlag.first + - ".Val, " + - utostr(FoldedFlag.second) + "), InFlag);"); + ReplaceFroms.push_back("SDOperand(" + FoldedFlag.first + ".Val, " + + utostr(FoldedFlag.second) + ")"); + ReplaceTos.push_back("InFlag"); } else { assert(NodeHasProperty(Pattern, SDNPOutFlag, CGP)); - After.push_back("ReplaceUses(SDOperand(N.Val, " + - utostr(NumPatResults + (unsigned)InputHasChain) - +"), InFlag);"); + ReplaceFroms.push_back("SDOperand(N.Val, " + + utostr(NumPatResults + (unsigned)InputHasChain) + + ")"); + ReplaceTos.push_back("InFlag"); } - NeedReplace = true; } - if (NeedReplace && InputHasChain) { - After.push_back("ReplaceUses(SDOperand(N.Val, " + - utostr(NumPatResults) + "), SDOperand(" + ChainName - + ".Val, " + ChainName + ".ResNo" + "));"); + if (!ReplaceFroms.empty() && InputHasChain) { + ReplaceFroms.push_back("SDOperand(N.Val, " + + utostr(NumPatResults) + ")"); + ReplaceTos.push_back("SDOperand(" + ChainName + ".Val, " + + ChainName + ".ResNo" + ")"); ChainAssignmentNeeded |= NodeHasChain; } @@ -1211,13 +1214,15 @@ ; } else if (InputHasChain && !NodeHasChain) { // One of the inner node produces a chain. - if (NodeHasOutFlag) - After.push_back("ReplaceUses(SDOperand(N.Val, " + - utostr(NumPatResults+1) + - "), SDOperand(ResNode, N.ResNo-1));"); - After.push_back("ReplaceUses(SDOperand(N.Val, " + - utostr(NumPatResults) + "), " + ChainName + ");"); - NeedReplace = true; + if (NodeHasOutFlag) { + ReplaceFroms.push_back("SDOperand(N.Val, " + + utostr(NumPatResults+1) + + ")"); + ReplaceTos.push_back("SDOperand(ResNode, N.ResNo-1)"); + } + ReplaceFroms.push_back("SDOperand(N.Val, " + + utostr(NumPatResults) + ")"); + ReplaceTos.push_back(ChainName); } } @@ -1234,21 +1239,31 @@ After.push_front(ChainAssign); } - // Use getTargetNode or SelectNodeTo? The safe choice is getTargetNode, - // but SelectNodeTo can be faster. - // - // SelectNodeTo is not safe in a non-root context, or if there is any - // replacement of results needed. + if (ReplaceFroms.size() == 1) { + After.push_back("ReplaceUses(" + ReplaceFroms[0] + ", " + + ReplaceTos[0] + ");"); + } else if (!ReplaceFroms.empty()) { + After.push_back("const SDOperand Froms[] = {"); + for (unsigned i = 0, e = ReplaceFroms.size(); i != e; ++i) + After.push_back(" " + ReplaceFroms[i] + (i + 1 != e ? "," : "")); + After.push_back("};"); + After.push_back("const SDOperand Tos[] = {"); + for (unsigned i = 0, e = ReplaceFroms.size(); i != e; ++i) + After.push_back(" " + ReplaceTos[i] + (i + 1 != e ? "," : "")); + After.push_back("};"); + After.push_back("ReplaceUses(Froms, Tos, " + + itostr(ReplaceFroms.size()) + ");"); + } + + // We prefer to use SelectNodeTo since it avoids allocation when + // possible and it avoids CSE map recalculation for the node's + // users, however it's tricky to use in a non-root context. // - // SelectNodeTo is not profitable if it would require a dynamically - // allocated operand list in a situation where getTargetNode would be - // able to reuse a co-allocated operand list (as in a unary, binary or - // ternary SDNode, for example). + // We also don't use if the pattern replacement is being used to + // jettison a chain result, since morphing the node in place + // would leave users of the chain dangling. // - if (!isRoot || NeedReplace || - (!IsVariadic && AllOps.size() < 4 && - Pattern->getNumChildren() + InputHasChain + NodeHasInFlag < - AllOps.size())) { + if (!isRoot || (InputHasChain && !NodeHasChain)) { Code = "CurDAG->getTargetNode(" + Code; } else { Code = "CurDAG->SelectNodeTo(N.Val, " + Code; @@ -1952,9 +1967,7 @@ OS << "// The main instruction selector code.\n" << "SDNode *SelectCode(SDOperand N) {\n" - << " if (N.getOpcode() >= ISD::BUILTIN_OP_END &&\n" - << " N.getOpcode() < (ISD::BUILTIN_OP_END+" << InstNS - << "INSTRUCTION_LIST_END)) {\n" + << " if (N.isMachineOpcode()) {\n" << " return NULL; // Already selected.\n" << " }\n\n" << " MVT::SimpleValueType NVT = N.Val->getValueType(0).getSimpleVT();\n" From baldrick at free.fr Thu Jul 17 14:28:42 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 17 Jul 2008 19:28:42 -0000 Subject: [llvm-commits] [llvm] r53729 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200807171928.m6HJSgcm005135@zion.cs.uiuc.edu> Author: baldrick Date: Thu Jul 17 14:28:41 2008 New Revision: 53729 URL: http://llvm.org/viewvc/llvm-project?rev=53729&view=rev Log: Use a legal type for elements of the vector_shuffle mask. These are just indices into the shuffled vector so their type is unrelated to the type of the shuffled elements (which is what was being used before). This fixes vec_shuffle-11.ll when using LegalizeTypes. What seems to have happened is that Dan's recent change r53687, which corrected the result type of the shuffle, somehow caused LegalizeTypes to notice that the mask operand was a BUILD_VECTOR with a legal type but elements of an illegal type (i64). LegalizeTypes legalized this by introducing a new BUILD_VECTOR of i32 and bitcasting it to the old type. But the mask operand is not supposed to be a bitcast but a straight BUILD_VECTOR of constants, causing a crash. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=53729&r1=53728&r2=53729&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Jul 17 14:28:41 2008 @@ -5046,9 +5046,9 @@ if (!isa(Elt)) return SDOperand(); else if (cast(Elt)->isAllOnesValue()) - IdxOps.push_back(DAG.getConstant(i, EVT)); + IdxOps.push_back(DAG.getConstant(i, TLI.getPointerTy())); else if (cast(Elt)->isNullValue()) - IdxOps.push_back(DAG.getConstant(NumElts, EVT)); + IdxOps.push_back(DAG.getConstant(NumElts, TLI.getPointerTy())); else return SDOperand(); } @@ -5066,7 +5066,8 @@ std::vector ZeroOps(NumElts, DAG.getConstant(0, EVT)); Ops.push_back(DAG.getNode(ISD::BUILD_VECTOR, VT, &ZeroOps[0], ZeroOps.size())); - Ops.push_back(DAG.getNode(ISD::BUILD_VECTOR, VT, + Ops.push_back(DAG.getNode(ISD::BUILD_VECTOR, + MVT::getVectorVT(TLI.getPointerTy(), NumElts), &IdxOps[0], IdxOps.size())); SDOperand Result = DAG.getNode(ISD::VECTOR_SHUFFLE, VT, &Ops[0], Ops.size()); From resistor at mac.com Thu Jul 17 14:41:00 2008 From: resistor at mac.com (Owen Anderson) Date: Thu, 17 Jul 2008 19:41:00 -0000 Subject: [llvm-commits] [llvm] r53730 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200807171941.m6HJf0wx005511@zion.cs.uiuc.edu> Author: resistor Date: Thu Jul 17 14:41:00 2008 New Revision: 53730 URL: http://llvm.org/viewvc/llvm-project?rev=53730&view=rev Log: Enable PRE. My last batch of changes fixed the miscompile. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=53730&r1=53729&r2=53730&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Thu Jul 17 14:41:00 2008 @@ -44,7 +44,7 @@ STATISTIC(NumGVNBlocks, "Number of blocks merged"); static cl::opt EnablePRE("enable-pre", - cl::init(false), cl::Hidden); + cl::init(true), cl::Hidden); //===----------------------------------------------------------------------===// // ValueTable Class From resistor at mac.com Thu Jul 17 14:42:29 2008 From: resistor at mac.com (Owen Anderson) Date: Thu, 17 Jul 2008 19:42:29 -0000 Subject: [llvm-commits] [llvm] r53731 - in /llvm/trunk: include/llvm/Transforms/Utils/BasicBlockUtils.h lib/Transforms/Utils/BasicBlockUtils.cpp Message-ID: <200807171942.m6HJgT55005561@zion.cs.uiuc.edu> Author: resistor Date: Thu Jul 17 14:42:29 2008 New Revision: 53731 URL: http://llvm.org/viewvc/llvm-project?rev=53731&view=rev Log: Make MergeBlockIntoPredecessor more aggressive when the same successor appears more than once. Modified: llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Modified: llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h?rev=53731&r1=53730&r2=53731&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h Thu Jul 17 14:42:29 2008 @@ -27,7 +27,7 @@ /// MergeBlockIntoPredecessor - Attempts to merge a block into its predecessor, /// if possible. The return value indicates success or failure. -bool MergeBlockIntoPredecessor(BasicBlock* BB, Pass* P); +bool MergeBlockIntoPredecessor(BasicBlock* BB, Pass* P = 0); // ReplaceInstWithValue - Replace all uses of an instruction (specified by BI) // with a value, then remove and delete the original instruction. Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=53731&r1=53730&r2=53731&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Thu Jul 17 14:42:29 2008 @@ -26,15 +26,30 @@ /// MergeBlockIntoPredecessor - Attempts to merge a block into its predecessor, /// if possible. The return value indicates success or failure. bool llvm::MergeBlockIntoPredecessor(BasicBlock* BB, Pass* P) { + pred_iterator PI(pred_begin(BB)), PE(pred_end(BB)); // Can't merge the entry block. if (pred_begin(BB) == pred_end(BB)) return false; - // Can't merge if there are multiple preds. - if (++pred_begin(BB) != pred_end(BB)) return false; - BasicBlock* PredBB = *pred_begin(BB); + BasicBlock *PredBB = *PI++; + for (; PI != PE; ++PI) // Search all predecessors, see if they are all same + if (*PI != PredBB) { + PredBB = 0; // There are multiple different predecessors... + break; + } - // Can't merge if the edge is critical. - if (PredBB->getTerminator()->getNumSuccessors() != 1) return false; + // Can't merge if there are multiple predecessors. + if (!PredBB) return false; + + succ_iterator SI(succ_begin(PredBB)), SE(succ_end(PredBB)); + BasicBlock* OnlySucc = BB; + for (; SI != SE; ++SI) + if (*SI != OnlySucc) { + OnlySucc = 0; // There are multiple distinct successors! + break; + } + + // Can't merge if there are multiple successors. + if (!OnlySucc) return false; // Begin by getting rid of unneeded PHIs. while (PHINode *PN = dyn_cast(&BB->front())) { @@ -52,6 +67,10 @@ // source... BB->replaceAllUsesWith(PredBB); + // Inherit predecessors name if it exists. + if (!PredBB->hasName()) + PredBB->takeName(BB); + // Finally, erase the old block and update dominator info. if (P) { if (DominatorTree* DT = P->getAnalysisToUpdate()) { From evan.cheng at apple.com Thu Jul 17 14:48:04 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 17 Jul 2008 19:48:04 -0000 Subject: [llvm-commits] [llvm] r53733 - /llvm/trunk/test/CodeGen/X86/vec_shuffle-11.ll Message-ID: <200807171948.m6HJm49R005746@zion.cs.uiuc.edu> Author: evancheng Date: Thu Jul 17 14:48:04 2008 New Revision: 53733 URL: http://llvm.org/viewvc/llvm-project?rev=53733&view=rev Log: Add nounwind. Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-11.ll Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-11.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-11.ll?rev=53733&r1=53732&r2=53733&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-11.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-11.ll Thu Jul 17 14:48:04 2008 @@ -1,7 +1,7 @@ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin | not grep mov -define <4 x i32> @test() { +define <4 x i32> @test() nounwind { %tmp131 = call <2 x i64> @llvm.x86.sse2.psrl.dq( <2 x i64> < i64 -1, i64 -1 >, i32 96 ) ; <<2 x i64>> [#uses=1] %tmp137 = bitcast <2 x i64> %tmp131 to <4 x i32> ; <<4 x i32>> [#uses=1] %tmp138 = and <4 x i32> %tmp137, bitcast (<2 x i64> < i64 -1, i64 -1 > to <4 x i32>) ; <<4 x i32>> [#uses=1] From evan.cheng at apple.com Thu Jul 17 14:48:53 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 17 Jul 2008 19:48:53 -0000 Subject: [llvm-commits] [llvm] r53734 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/X86/2008-07-16-CoalescerCrash.ll Message-ID: <200807171948.m6HJmrM3005782@zion.cs.uiuc.edu> Author: evancheng Date: Thu Jul 17 14:48:53 2008 New Revision: 53734 URL: http://llvm.org/viewvc/llvm-project?rev=53734&view=rev Log: Subreg live interval valno may not have a corresponding def machineinstr since it's less precise. Added: llvm/trunk/test/CodeGen/X86/2008-07-16-CoalescerCrash.ll Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=53734&r1=53733&r2=53734&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Thu Jul 17 14:48:53 2008 @@ -1327,7 +1327,7 @@ // Re-compute it. MachineInstr *DefMI = li_->getInstructionFromIndex(LR->start); unsigned SrcReg, DstReg; - if (tii_->isMoveInstr(*DefMI, SrcReg, DstReg) && + if (DefMI && tii_->isMoveInstr(*DefMI, SrcReg, DstReg) && DstReg == li.reg && SrcReg == Reg) { // Cache computed info. LR->valno->def = LR->start; Added: llvm/trunk/test/CodeGen/X86/2008-07-16-CoalescerCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-07-16-CoalescerCrash.ll?rev=53734&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-07-16-CoalescerCrash.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-07-16-CoalescerCrash.ll Thu Jul 17 14:48:53 2008 @@ -0,0 +1,34 @@ +; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin + + %struct.SV = type { i8*, i64, i64 } +@"\01LC25" = external constant [8 x i8] ; <[8 x i8]*> [#uses=1] + +declare void @Perl_sv_catpvf(%struct.SV*, i8*, ...) nounwind + +declare fastcc i64 @Perl_utf8n_to_uvuni(i8*, i64, i64*, i64) nounwind + +define fastcc i8* @Perl_pv_uni_display(%struct.SV* %dsv, i8* %spv, i64 %len, i64 %pvlim, i64 %flags) nounwind { +entry: + br i1 false, label %bb, label %bb40 + +bb: ; preds = %entry + tail call fastcc i64 @Perl_utf8n_to_uvuni( i8* null, i64 13, i64* null, i64 255 ) nounwind ; :0 [#uses=1] + br i1 false, label %bb6, label %bb33 + +bb6: ; preds = %bb + br i1 false, label %bb30, label %bb31 + +bb30: ; preds = %bb6 + unreachable + +bb31: ; preds = %bb6 + icmp eq i8 0, 0 ; :1 [#uses=0] + br label %bb33 + +bb33: ; preds = %bb31, %bb + tail call void (%struct.SV*, i8*, ...)* @Perl_sv_catpvf( %struct.SV* %dsv, i8* getelementptr ([8 x i8]* @"\01LC25", i32 0, i64 0), i64 %0 ) nounwind + unreachable + +bb40: ; preds = %entry + ret i8* null +} From clattner at apple.com Thu Jul 17 14:55:11 2008 From: clattner at apple.com (Chris Lattner) Date: Thu, 17 Jul 2008 12:55:11 -0700 Subject: [llvm-commits] [llvm] r52537 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp In-Reply-To: <20080715144754.GD26592@katherina.student.utwente.nl> References: <200806201516.m5KFGkRv024435@zion.cs.uiuc.edu> <20080702161624.GI7287@katherina.student.utwente.nl> <192117C6-9780-4C96-9F1F-E055FFC033FE@apple.com> <20080715144754.GD26592@katherina.student.utwente.nl> Message-ID: On Jul 15, 2008, at 7:47 AM, Matthijs Kooijman wrote: > Hi Chris, > >> I still think it would be preferable to lower this into: >> >> %S = call i32 @foo() >> %t = insertvalue {i32} undef, 0, i32 %S >> call void @bar({ i32 } %t) >> >> This is not an "optimization" by itself persay, but it *is* a >> canonicalization, and it is useful to have canonical forms for code. > I've restructured the code a bit and it now does exactly this. This > is mainly > due to making deadargelim less smart: Instead of trying to replace all > extractvalue instructions that use the result of a function, it now > simply > rebuilds the old struct that was returned (with undef gaps wherever > the unused > values were). This allows instcombine to turn the result into the > above. > >>> However, I'm not really sure this is worth the effort. Perhaps this >>> should be done in a different pass, really? >> Why in a different pass? > Because I didn't think I could fit it into deadargelim elegantly. > But it > worked out after all :-) Very nice Matthijs! -Chris From resistor at mac.com Thu Jul 17 15:00:46 2008 From: resistor at mac.com (Owen Anderson) Date: Thu, 17 Jul 2008 20:00:46 -0000 Subject: [llvm-commits] [llvm] r53735 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Message-ID: <200807172000.m6HK0lnM006138@zion.cs.uiuc.edu> Author: resistor Date: Thu Jul 17 15:00:46 2008 New Revision: 53735 URL: http://llvm.org/viewvc/llvm-project?rev=53735&view=rev Log: Use MergeBlockIntoPredecessor to simplify some code. Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=53735&r1=53734&r2=53735&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Thu Jul 17 15:00:46 2008 @@ -2036,6 +2036,12 @@ // pred, and if there is only one distinct successor of the predecessor, and // if there are no PHI nodes. // + if (MergeBlockIntoPredecessor(BB)) + return true; + + // Otherwise, if this block only has a single predecessor, and if that block + // is a conditional branch, see if we can hoist any code from this block up + // into our predecessor. pred_iterator PI(pred_begin(BB)), PE(pred_end(BB)); BasicBlock *OnlyPred = *PI++; for (; PI != PE; ++PI) // Search all predecessors, see if they are all same @@ -2043,57 +2049,7 @@ OnlyPred = 0; // There are multiple different predecessors... break; } - - BasicBlock *OnlySucc = 0; - if (OnlyPred && OnlyPred != BB && // Don't break self loops - OnlyPred->getTerminator()->getOpcode() != Instruction::Invoke) { - // Check to see if there is only one distinct successor... - succ_iterator SI(succ_begin(OnlyPred)), SE(succ_end(OnlyPred)); - OnlySucc = BB; - for (; SI != SE; ++SI) - if (*SI != OnlySucc) { - OnlySucc = 0; // There are multiple distinct successors! - break; - } - } - - if (OnlySucc) { - DOUT << "Merging: " << *BB << "into: " << *OnlyPred; - - // Resolve any PHI nodes at the start of the block. They are all - // guaranteed to have exactly one entry if they exist, unless there are - // multiple duplicate (but guaranteed to be equal) entries for the - // incoming edges. This occurs when there are multiple edges from - // OnlyPred to OnlySucc. - // - while (PHINode *PN = dyn_cast(&BB->front())) { - PN->replaceAllUsesWith(PN->getIncomingValue(0)); - BB->getInstList().pop_front(); // Delete the phi node. - } - - // Delete the unconditional branch from the predecessor. - OnlyPred->getInstList().pop_back(); - - // Move all definitions in the successor to the predecessor. - OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList()); - - // Make all PHI nodes that referred to BB now refer to Pred as their - // source. - BB->replaceAllUsesWith(OnlyPred); - - // Inherit predecessors name if it exists. - if (!OnlyPred->hasName()) - OnlyPred->takeName(BB); - - // Erase basic block from the function. - M->getBasicBlockList().erase(BB); - - return true; - } - - // Otherwise, if this block only has a single predecessor, and if that block - // is a conditional branch, see if we can hoist any code from this block up - // into our predecessor. + if (OnlyPred) if (BranchInst *BI = dyn_cast(OnlyPred->getTerminator())) if (BI->isConditional()) { @@ -2101,6 +2057,7 @@ BasicBlock *OtherBB = BI->getSuccessor(BI->getSuccessor(0) == BB); PI = pred_begin(OtherBB); ++PI; + if (PI == pred_end(OtherBB)) { // We have a conditional branch to two blocks that are only reachable // from the condbr. We know that the condbr dominates the two blocks, @@ -2108,7 +2065,7 @@ // blocks. If so, we can hoist it up to the branching block. Changed |= HoistThenElseCodeToIf(BI); } else { - OnlySucc = NULL; + BasicBlock* OnlySucc = NULL; for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI) { if (!OnlySucc) From dpatel at apple.com Thu Jul 17 15:03:32 2008 From: dpatel at apple.com (Devang Patel) Date: Thu, 17 Jul 2008 20:03:32 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53736 - in /llvm-gcc-4.2/trunk/gcc: Makefile.in version.c Message-ID: <200807172003.m6HK3X51006264@zion.cs.uiuc.edu> Author: dpatel Date: Thu Jul 17 15:03:32 2008 New Revision: 53736 URL: http://llvm.org/viewvc/llvm-project?rev=53736&view=rev Log: Print svn revision number in version string. Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in llvm-gcc-4.2/trunk/gcc/version.c Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/Makefile.in?rev=53736&r1=53735&r2=53736&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/Makefile.in (original) +++ llvm-gcc-4.2/trunk/gcc/Makefile.in Thu Jul 17 15:03:32 2008 @@ -802,6 +802,10 @@ DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\"" DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\"" +# LLVM LOCAL begin svn version +SVNVER_c := $(shell svnversion $(abs_srcdir) ) +SVNVER_s := "\"$(if $(SVNVER_c), $(SVNVER_c))\"" +# LLVM LOCAL end svn version # Shorthand variables for dependency lists. TARGET_H = $(TM_H) target.h insn-modes.h MACHMODE_H = machmode.h mode-classes.def insn-modes.h @@ -2048,10 +2052,14 @@ dumpvers: dumpvers.c -version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) +# LLVM LOCAL begin svn version +.PHONY: version.o +version.o: $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ + -DSVNVER=$(SVNVER_s) \ -DDEVPHASE=$(DEVPHASE_s) -c $(srcdir)/version.c $(OUTPUT_OPTION) +# LLVM LOCAL endn svn version gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) bitmap.h $(TREE_H) $(RTL_H) \ Modified: llvm-gcc-4.2/trunk/gcc/version.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/version.c?rev=53736&r1=53735&r2=53736&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/version.c (original) +++ llvm-gcc-4.2/trunk/gcc/version.c Thu Jul 17 15:03:32 2008 @@ -33,4 +33,4 @@ /* The complete version string, assembled from several pieces. BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */ -const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX; +const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX SVNVER; From gohman at apple.com Thu Jul 17 16:12:16 2008 From: gohman at apple.com (Dan Gohman) Date: Thu, 17 Jul 2008 21:12:16 -0000 Subject: [llvm-commits] [llvm] r53738 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Message-ID: <200807172112.m6HLCGfH008412@zion.cs.uiuc.edu> Author: djg Date: Thu Jul 17 16:12:16 2008 New Revision: 53738 URL: http://llvm.org/viewvc/llvm-project?rev=53738&view=rev Log: When printing MemOperand nodes, only use print() for PseudoSourceValue values, which never have names. Use getName() for all other values, because we want to print just a short summary of the value, not the entire instruction. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=53738&r1=53737&r2=53738&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Thu Jul 17 16:12:16 2008 @@ -19,6 +19,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineModuleInfo.h" +#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/GraphWriter.h" @@ -155,13 +156,19 @@ else Op += ""; } else if (const MemOperandSDNode *M = dyn_cast(Node)) { - if (M->MO.getValue()) { + const Value *V = M->MO.getValue(); + Op += '<'; + if (!V) { + Op += "(unknown)"; + } else if (const PseudoSourceValue *PSV = dyn_cast(V)) { + // PseudoSourceValues don't have names, so use their print method. std::ostringstream SS; M->MO.getValue()->print(SS); - Op += "<" + SS.str() + "+" + itostr(M->MO.getOffset()) + ">"; + Op += SS.str(); } else { - Op += "<(unknown)+" + itostr(M->MO.getOffset()) + ">"; + Op += V->getName(); } + Op += '+' + itostr(M->MO.getOffset()) + '>'; } else if (const ARG_FLAGSSDNode *N = dyn_cast(Node)) { Op = Op + " AF=" + N->getArgFlags().getArgFlagsString(); } else if (const VTSDNode *N = dyn_cast(Node)) { From dpatel at apple.com Thu Jul 17 17:35:53 2008 From: dpatel at apple.com (Devang Patel) Date: Thu, 17 Jul 2008 22:35:53 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53741 - in /llvm-gcc-4.2/trunk/gcc: Makefile.in version.c Message-ID: <200807172235.m6HMZr4H011445@zion.cs.uiuc.edu> Author: dpatel Date: Thu Jul 17 17:35:53 2008 New Revision: 53741 URL: http://llvm.org/viewvc/llvm-project?rev=53741&view=rev Log: Undo previous check-in. Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in llvm-gcc-4.2/trunk/gcc/version.c Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/Makefile.in?rev=53741&r1=53740&r2=53741&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/Makefile.in (original) +++ llvm-gcc-4.2/trunk/gcc/Makefile.in Thu Jul 17 17:35:53 2008 @@ -802,10 +802,6 @@ DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\"" DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\"" -# LLVM LOCAL begin svn version -SVNVER_c := $(shell svnversion $(abs_srcdir) ) -SVNVER_s := "\"$(if $(SVNVER_c), $(SVNVER_c))\"" -# LLVM LOCAL end svn version # Shorthand variables for dependency lists. TARGET_H = $(TM_H) target.h insn-modes.h MACHMODE_H = machmode.h mode-classes.def insn-modes.h @@ -2052,14 +2048,10 @@ dumpvers: dumpvers.c -# LLVM LOCAL begin svn version -.PHONY: version.o -version.o: +version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ - -DSVNVER=$(SVNVER_s) \ -DDEVPHASE=$(DEVPHASE_s) -c $(srcdir)/version.c $(OUTPUT_OPTION) -# LLVM LOCAL endn svn version gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) bitmap.h $(TREE_H) $(RTL_H) \ Modified: llvm-gcc-4.2/trunk/gcc/version.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/version.c?rev=53741&r1=53740&r2=53741&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/version.c (original) +++ llvm-gcc-4.2/trunk/gcc/version.c Thu Jul 17 17:35:53 2008 @@ -33,4 +33,4 @@ /* The complete version string, assembled from several pieces. BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */ -const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX SVNVER; +const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX; From wangmp at apple.com Thu Jul 17 17:56:56 2008 From: wangmp at apple.com (Mon P Wang) Date: Thu, 17 Jul 2008 15:56:56 -0700 Subject: [llvm-commits] Intrinsic address space patch Message-ID: Here is a patch to enable intrinsic to have pointers to different address spaces. This changes overloaded intrinsics with pointer arguments to pass also an address space as part of their name. For example, atomic.load.add.i32 => atomic.load.add.i32.p0i32 The above syntax indicates that the result is i32 with a pointer argument to address space 0 (generic address space) whose domain type is i32. The patch here doesn't include the documentation change but that will be included as part of the checkin. Let me know if you have any comments. -- Mon Ping -------------- next part -------------- A non-text attachment was scrubbed... Name: addrspace.patch Type: application/octet-stream Size: 11958 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080717/f26a81be/attachment.obj From gohman at apple.com Thu Jul 17 18:49:46 2008 From: gohman at apple.com (Dan Gohman) Date: Thu, 17 Jul 2008 23:49:46 -0000 Subject: [llvm-commits] [llvm] r53746 - in /llvm/trunk: include/llvm/CodeGen/MachineBasicBlock.h lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/LowerSubregs.cpp lib/CodeGen/MachineBasicBlock.cpp lib/CodeGen/MachineInstr.cpp Message-ID: <200807172349.m6HNnkbD013616@zion.cs.uiuc.edu> Author: djg Date: Thu Jul 17 18:49:46 2008 New Revision: 53746 URL: http://llvm.org/viewvc/llvm-project?rev=53746&view=rev Log: Re-introduce LeakDetector support for MachineInstrs and MachineBasicBlocks. Fix a leak that this turned up in LowerSubregs.cpp. And, comment a leak in LiveIntervalAnalysis.cpp. Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/LowerSubregs.cpp llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp llvm/trunk/lib/CodeGen/MachineInstr.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=53746&r1=53745&r2=53746&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Thu Jul 17 18:49:46 2008 @@ -67,7 +67,7 @@ explicit MachineBasicBlock(MachineFunction &mf, const BasicBlock *bb); - ~MachineBasicBlock() {} + ~MachineBasicBlock(); // MachineBasicBlocks are allocated and owned by MachineFunction. friend class MachineFunction; Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=53746&r1=53745&r2=53746&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Thu Jul 17 18:49:46 2008 @@ -1585,9 +1585,9 @@ if (ReMatDefMI && isReMaterializable(li, VNI, ReMatDefMI, dummy)) { // Remember how to remat the def of this val#. ReMatOrigDefs[VN] = ReMatDefMI; - // Original def may be modified so we have to make a copy here. vrm must - // delete these! - ReMatDefs[VN] = ReMatDefMI = mf_->CloneMachineInstr(ReMatDefMI); + // Original def may be modified so we have to make a copy here. + // FIXME: This is a memory leak. vrm should delete these! + ReMatDefs[VN] = mf_->CloneMachineInstr(ReMatDefMI); bool CanDelete = true; if (VNI->hasPHIKill) { Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=53746&r1=53745&r2=53746&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original) +++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Thu Jul 17 18:49:46 2008 @@ -80,7 +80,7 @@ } DOUT << "\n"; - MBB->remove(MI); + MBB->erase(MI); return true; } @@ -119,7 +119,7 @@ #endif DOUT << "\n"; - MBB->remove(MI); + MBB->erase(MI); return true; } @@ -164,7 +164,7 @@ } DOUT << "\n"; - MBB->remove(MI); + MBB->erase(MI); return true; } Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=53746&r1=53745&r2=53746&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Thu Jul 17 18:49:46 2008 @@ -18,6 +18,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetInstrDesc.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Support/LeakDetector.h" #include using namespace llvm; @@ -26,6 +27,10 @@ Insts.getTraits().Parent = this; } +MachineBasicBlock::~MachineBasicBlock() { + LeakDetector::removeGarbageObject(this); +} + std::ostream& llvm::operator<<(std::ostream &OS, const MachineBasicBlock &MBB) { MBB.print(OS); return OS; @@ -46,11 +51,14 @@ MachineRegisterInfo &RegInfo = MF.getRegInfo(); for (MachineBasicBlock::iterator I = N->begin(), E = N->end(); I != E; ++I) I->AddRegOperandsToUseLists(RegInfo); + + LeakDetector::removeGarbageObject(N); } void alist_traits::removeNodeFromList(MachineBasicBlock* N) { N->getParent()->removeFromMBBNumbering(N->Number); N->Number = -1; + LeakDetector::addGarbageObject(N); } @@ -65,6 +73,8 @@ // use/def lists. MachineFunction *MF = Parent->getParent(); N->AddRegOperandsToUseLists(MF->getRegInfo()); + + LeakDetector::removeGarbageObject(N); } /// removeNodeFromList (MI) - When we remove an instruction from a basic block @@ -77,6 +87,8 @@ N->RemoveRegOperandsFromUseLists(); N->setParent(0); + + LeakDetector::addGarbageObject(N); } /// transferNodesFromList (MI) - When moving a range of instructions from one Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=53746&r1=53745&r2=53746&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Thu Jul 17 18:49:46 2008 @@ -21,6 +21,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetInstrDesc.h" #include "llvm/Target/TargetRegisterInfo.h" +#include "llvm/Support/LeakDetector.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Streams.h" #include @@ -257,6 +258,8 @@ /// TID NULL and no operands. MachineInstr::MachineInstr() : TID(0), NumImplicitOps(0), Parent(0) { + // Make sure that we get added to a machine basicblock + LeakDetector::addGarbageObject(this); } void MachineInstr::addImplicitDefUseOperands() { @@ -283,6 +286,8 @@ Operands.reserve(NumImplicitOps + TID->getNumOperands()); if (!NoImp) addImplicitDefUseOperands(); + // Make sure that we get added to a machine basicblock + LeakDetector::addGarbageObject(this); } /// MachineInstr ctor - Work exactly the same as the ctor above, except that the @@ -300,6 +305,8 @@ NumImplicitOps++; Operands.reserve(NumImplicitOps + TID->getNumOperands()); addImplicitDefUseOperands(); + // Make sure that we get added to a machine basicblock + LeakDetector::addGarbageObject(this); MBB->push_back(this); // Add instruction to end of basic block! } @@ -326,6 +333,7 @@ } MachineInstr::~MachineInstr() { + LeakDetector::removeGarbageObject(this); assert(MemOperands.empty() && "MachineInstr being deleted with live memoperands!"); #ifndef NDEBUG From daniel at zuster.org Thu Jul 17 14:46:55 2008 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 17 Jul 2008 19:46:55 -0000 Subject: [llvm-commits] [llvm] r53732 - /llvm/trunk/README.txt Message-ID: <200807171946.m6HJktTb005700@zion.cs.uiuc.edu> Author: ddunbar Date: Thu Jul 17 14:46:54 2008 New Revision: 53732 URL: http://llvm.org/viewvc/llvm-project?rev=53732&view=rev Log: test commit access Modified: llvm/trunk/README.txt Modified: llvm/trunk/README.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/README.txt?rev=53732&r1=53731&r2=53732&view=diff ============================================================================== --- llvm/trunk/README.txt (original) +++ llvm/trunk/README.txt Thu Jul 17 14:46:54 2008 @@ -11,3 +11,5 @@ Please see the HTML documentation provided in docs/index.html for further assistance with LLVM. + + From krister.walfridsson at gmail.com Thu Jul 17 15:51:51 2008 From: krister.walfridsson at gmail.com (Krister Walfridsson) Date: Thu, 17 Jul 2008 22:51:51 +0200 (CEST) Subject: [llvm-commits] [patch] enable pic in llvm-gcc-4.2 for NetBSD Message-ID: The PIC support in llvm works fine for NetBSD too, so the -fPIC flag may be enabled in NetBSD's llvm-gcc-4.2 configuration as in the attached patch. /Krister -------------- next part -------------- Index: gcc/config/netbsd-elf.h =================================================================== --- gcc/config/netbsd-elf.h (revision 53688) +++ gcc/config/netbsd-elf.h (working copy) @@ -92,3 +92,16 @@ %{rdynamic:-export-dynamic} \ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \ %{static:-static}}" + +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM + +/* Yes, we're supporting PIC codegen for NetBSD targets! */ +#define LLVM_SET_TARGET_OPTIONS(argvec) \ + if (flag_pic) \ + argvec.push_back ("--relocation-model=pic"); \ + else \ + argvec.push_back ("--relocation-model=static"); + +#endif +/* LLVM LOCAL end */ From sabre at nondot.org Fri Jul 18 00:23:39 2008 From: sabre at nondot.org (Chris Lattner) Date: Fri, 18 Jul 2008 05:23:39 -0000 Subject: [llvm-commits] [llvm] r53749 - /llvm/trunk/lib/VMCore/Verifier.cpp Message-ID: <200807180523.m6I5Ndax023557@zion.cs.uiuc.edu> Author: lattner Date: Fri Jul 18 00:23:39 2008 New Revision: 53749 URL: http://llvm.org/viewvc/llvm-project?rev=53749&view=rev Log: verify limits-fndefn.c from the GCC testsuite before the heat death of the universe, fixing an O(N^2) problem in the size of a basic block. Modified: llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=53749&r1=53748&r2=53749&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Fri Jul 18 00:23:39 2008 @@ -1239,7 +1239,7 @@ } // Definition must dominate use unless use is unreachable! - Assert2(DT->dominates(Op, &I) || + Assert2(InstsInThisBlock.count(Op) || DT->dominates(Op, &I) || !DT->dominates(&BB->getParent()->getEntryBlock(), BB), "Instruction does not dominate all uses!", Op, &I); } else { From isanbard at gmail.com Fri Jul 18 04:25:18 2008 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 18 Jul 2008 02:25:18 -0700 Subject: [llvm-commits] [llvm] r53749 - /llvm/trunk/lib/VMCore/Verifier.cpp In-Reply-To: <200807180523.m6I5Ndax023557@zion.cs.uiuc.edu> References: <200807180523.m6I5Ndax023557@zion.cs.uiuc.edu> Message-ID: <2FA456A0-95CB-4864-A458-78C22A9EE24D@gmail.com> On Jul 17, 2008, at 10:23 PM, Chris Lattner wrote: > Author: lattner > Date: Fri Jul 18 00:23:39 2008 > New Revision: 53749 > > URL: http://llvm.org/viewvc/llvm-project?rev=53749&view=rev > Log: > verify limits-fndefn.c from the GCC testsuite before the > heat death of the universe, fixing an O(N^2) problem in the > size of a basic block. > It's not known if Hubble's constant is -1, 0, or 1. So it's premature to assume that there will be a "heat death" of the universe. There could be a big crunch. :-P -bw > Modified: > llvm/trunk/lib/VMCore/Verifier.cpp > > Modified: llvm/trunk/lib/VMCore/Verifier.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=53749&r1=53748&r2=53749&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/Verifier.cpp (original) > +++ llvm/trunk/lib/VMCore/Verifier.cpp Fri Jul 18 00:23:39 2008 > @@ -1239,7 +1239,7 @@ > } > > // Definition must dominate use unless use is unreachable! > - Assert2(DT->dominates(Op, &I) || > + Assert2(InstsInThisBlock.count(Op) || DT->dominates(Op, &I) > || > !DT->dominates(&BB->getParent()->getEntryBlock(), BB), > "Instruction does not dominate all uses!", Op, &I); > } else { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Fri Jul 18 11:44:49 2008 From: gohman at apple.com (Dan Gohman) Date: Fri, 18 Jul 2008 16:44:49 -0000 Subject: [llvm-commits] [llvm] r53757 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Message-ID: <200807181644.m6IGinGt022659@zion.cs.uiuc.edu> Author: djg Date: Fri Jul 18 11:44:49 2008 New Revision: 53757 URL: http://llvm.org/viewvc/llvm-project?rev=53757&view=rev Log: Revert r53735. It broke SPEC 464.h264ref. Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=53757&r1=53756&r2=53757&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Fri Jul 18 11:44:49 2008 @@ -2036,12 +2036,6 @@ // pred, and if there is only one distinct successor of the predecessor, and // if there are no PHI nodes. // - if (MergeBlockIntoPredecessor(BB)) - return true; - - // Otherwise, if this block only has a single predecessor, and if that block - // is a conditional branch, see if we can hoist any code from this block up - // into our predecessor. pred_iterator PI(pred_begin(BB)), PE(pred_end(BB)); BasicBlock *OnlyPred = *PI++; for (; PI != PE; ++PI) // Search all predecessors, see if they are all same @@ -2049,7 +2043,57 @@ OnlyPred = 0; // There are multiple different predecessors... break; } - + + BasicBlock *OnlySucc = 0; + if (OnlyPred && OnlyPred != BB && // Don't break self loops + OnlyPred->getTerminator()->getOpcode() != Instruction::Invoke) { + // Check to see if there is only one distinct successor... + succ_iterator SI(succ_begin(OnlyPred)), SE(succ_end(OnlyPred)); + OnlySucc = BB; + for (; SI != SE; ++SI) + if (*SI != OnlySucc) { + OnlySucc = 0; // There are multiple distinct successors! + break; + } + } + + if (OnlySucc) { + DOUT << "Merging: " << *BB << "into: " << *OnlyPred; + + // Resolve any PHI nodes at the start of the block. They are all + // guaranteed to have exactly one entry if they exist, unless there are + // multiple duplicate (but guaranteed to be equal) entries for the + // incoming edges. This occurs when there are multiple edges from + // OnlyPred to OnlySucc. + // + while (PHINode *PN = dyn_cast(&BB->front())) { + PN->replaceAllUsesWith(PN->getIncomingValue(0)); + BB->getInstList().pop_front(); // Delete the phi node. + } + + // Delete the unconditional branch from the predecessor. + OnlyPred->getInstList().pop_back(); + + // Move all definitions in the successor to the predecessor. + OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList()); + + // Make all PHI nodes that referred to BB now refer to Pred as their + // source. + BB->replaceAllUsesWith(OnlyPred); + + // Inherit predecessors name if it exists. + if (!OnlyPred->hasName()) + OnlyPred->takeName(BB); + + // Erase basic block from the function. + M->getBasicBlockList().erase(BB); + + return true; + } + + // Otherwise, if this block only has a single predecessor, and if that block + // is a conditional branch, see if we can hoist any code from this block up + // into our predecessor. if (OnlyPred) if (BranchInst *BI = dyn_cast(OnlyPred->getTerminator())) if (BI->isConditional()) { @@ -2057,7 +2101,6 @@ BasicBlock *OtherBB = BI->getSuccessor(BI->getSuccessor(0) == BB); PI = pred_begin(OtherBB); ++PI; - if (PI == pred_end(OtherBB)) { // We have a conditional branch to two blocks that are only reachable // from the condbr. We know that the condbr dominates the two blocks, @@ -2065,7 +2108,7 @@ // blocks. If so, we can hoist it up to the branching block. Changed |= HoistThenElseCodeToIf(BI); } else { - BasicBlock* OnlySucc = NULL; + OnlySucc = NULL; for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI) { if (!OnlySucc) From gohman at apple.com Fri Jul 18 11:48:16 2008 From: gohman at apple.com (Dan Gohman) Date: Fri, 18 Jul 2008 09:48:16 -0700 Subject: [llvm-commits] [llvm] r53735 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp In-Reply-To: <200807172000.m6HK0lnM006138@zion.cs.uiuc.edu> References: <200807172000.m6HK0lnM006138@zion.cs.uiuc.edu> Message-ID: <80BB40A3-96B0-4247-9E1A-72073C94EB64@apple.com> Hi Owen, I reverted this because it causes an ICE in SPEC 464.h264ref. Can you investigate? Thanks, Dan On Jul 17, 2008, at 1:00 PM, Owen Anderson wrote: > Author: resistor > Date: Thu Jul 17 15:00:46 2008 > New Revision: 53735 > > URL: http://llvm.org/viewvc/llvm-project?rev=53735&view=rev > Log: > Use MergeBlockIntoPredecessor to simplify some code. > > Modified: > llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp > > Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=53735&r1=53734&r2=53735&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original) > +++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Thu Jul 17 > 15:00:46 2008 > @@ -2036,6 +2036,12 @@ > // pred, and if there is only one distinct successor of the > predecessor, and > // if there are no PHI nodes. > // > + if (MergeBlockIntoPredecessor(BB)) > + return true; > + > + // Otherwise, if this block only has a single predecessor, and if > that block > + // is a conditional branch, see if we can hoist any code from > this block up > + // into our predecessor. > pred_iterator PI(pred_begin(BB)), PE(pred_end(BB)); > BasicBlock *OnlyPred = *PI++; > for (; PI != PE; ++PI) // Search all predecessors, see if they > are all same > @@ -2043,57 +2049,7 @@ > OnlyPred = 0; // There are multiple different > predecessors... > break; > } > - > - BasicBlock *OnlySucc = 0; > - if (OnlyPred && OnlyPred != BB && // Don't break self loops > - OnlyPred->getTerminator()->getOpcode() != > Instruction::Invoke) { > - // Check to see if there is only one distinct successor... > - succ_iterator SI(succ_begin(OnlyPred)), SE(succ_end(OnlyPred)); > - OnlySucc = BB; > - for (; SI != SE; ++SI) > - if (*SI != OnlySucc) { > - OnlySucc = 0; // There are multiple distinct successors! > - break; > - } > - } > - > - if (OnlySucc) { > - DOUT << "Merging: " << *BB << "into: " << *OnlyPred; > - > - // Resolve any PHI nodes at the start of the block. They are all > - // guaranteed to have exactly one entry if they exist, unless > there are > - // multiple duplicate (but guaranteed to be equal) entries for > the > - // incoming edges. This occurs when there are multiple edges > from > - // OnlyPred to OnlySucc. > - // > - while (PHINode *PN = dyn_cast(&BB->front())) { > - PN->replaceAllUsesWith(PN->getIncomingValue(0)); > - BB->getInstList().pop_front(); // Delete the phi node. > - } > - > - // Delete the unconditional branch from the predecessor. > - OnlyPred->getInstList().pop_back(); > - > - // Move all definitions in the successor to the predecessor. > - OnlyPred->getInstList().splice(OnlyPred->end(), BB- > >getInstList()); > - > - // Make all PHI nodes that referred to BB now refer to Pred as > their > - // source. > - BB->replaceAllUsesWith(OnlyPred); > - > - // Inherit predecessors name if it exists. > - if (!OnlyPred->hasName()) > - OnlyPred->takeName(BB); > - > - // Erase basic block from the function. > - M->getBasicBlockList().erase(BB); > - > - return true; > - } > - > - // Otherwise, if this block only has a single predecessor, and if > that block > - // is a conditional branch, see if we can hoist any code from > this block up > - // into our predecessor. > + > if (OnlyPred) > if (BranchInst *BI = dyn_cast(OnlyPred- > >getTerminator())) > if (BI->isConditional()) { > @@ -2101,6 +2057,7 @@ > BasicBlock *OtherBB = BI->getSuccessor(BI->getSuccessor(0) > == BB); > PI = pred_begin(OtherBB); > ++PI; > + > if (PI == pred_end(OtherBB)) { > // We have a conditional branch to two blocks that are > only reachable > // from the condbr. We know that the condbr dominates the > two blocks, > @@ -2108,7 +2065,7 @@ > // blocks. If so, we can hoist it up to the branching > block. > Changed |= HoistThenElseCodeToIf(BI); > } else { > - OnlySucc = NULL; > + BasicBlock* OnlySucc = NULL; > for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); > SI != SE; ++SI) { > if (!OnlySucc) > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From tbrethou at cs.uiuc.edu Fri Jul 18 12:39:02 2008 From: tbrethou at cs.uiuc.edu (Tanya Lattner) Date: Fri, 18 Jul 2008 12:39:02 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/students.php Message-ID: <200807181739.m6IHd2JN024403@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg: students.php updated: 1.2 -> 1.3 --- Log message: Close student funding. --- Diffs of the changes: (+3 -0) students.php | 3 +++ 1 files changed, 3 insertions(+) Index: llvm-www/devmtg/students.php diff -u llvm-www/devmtg/students.php:1.2 llvm-www/devmtg/students.php:1.3 --- llvm-www/devmtg/students.php:1.2 Sun May 25 02:28:33 2008 +++ llvm-www/devmtg/students.php Fri Jul 18 12:38:08 2008 @@ -241,6 +241,9 @@
LLVM Developers' Meeting - Student Funding Request
+Student Funding is closed for this year. +exit; + Changes in directory llvm-www/devmtg: students.php updated: 1.3 -> 1.4 --- Log message: Use php to exit. --- Diffs of the changes: (+2 -1) students.php | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-www/devmtg/students.php diff -u llvm-www/devmtg/students.php:1.3 llvm-www/devmtg/students.php:1.4 --- llvm-www/devmtg/students.php:1.3 Fri Jul 18 12:38:08 2008 +++ llvm-www/devmtg/students.php Fri Jul 18 12:38:58 2008 @@ -242,7 +242,8 @@
LLVM Developers' Meeting - Student Funding Request
Student Funding is closed for this year. -exit; + + Changes in directory llvm-www/devmtg: talk.php updated: 1.3 -> 1.4 --- Log message: Close talk proposal requests. --- Diffs of the changes: (+3 -0) talk.php | 3 +++ 1 files changed, 3 insertions(+) Index: llvm-www/devmtg/talk.php diff -u llvm-www/devmtg/talk.php:1.3 llvm-www/devmtg/talk.php:1.4 --- llvm-www/devmtg/talk.php:1.3 Sun May 25 02:28:33 2008 +++ llvm-www/devmtg/talk.php Fri Jul 18 12:40:13 2008 @@ -203,6 +203,9 @@
LLVM Developers' Meeting - Talk Proposal
+Talk proposals are closed for this year. + + Author: resistor Date: Fri Jul 18 12:46:41 2008 New Revision: 53760 URL: http://llvm.org/viewvc/llvm-project?rev=53760&view=rev Log: Add some checks that got lost in the shuffle. This fixes 464.h264ref. Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=53760&r1=53759&r2=53760&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Fri Jul 18 12:46:41 2008 @@ -39,6 +39,10 @@ // Can't merge if there are multiple predecessors. if (!PredBB) return false; + // Don't break self-loops. + if (PredBB == BB) return false; + // Don't break invokes. + if (isa(PredBB->getTerminator())) return false; succ_iterator SI(succ_begin(PredBB)), SE(succ_end(PredBB)); BasicBlock* OnlySucc = BB; From resistor at mac.com Fri Jul 18 12:49:43 2008 From: resistor at mac.com (Owen Anderson) Date: Fri, 18 Jul 2008 17:49:43 -0000 Subject: [llvm-commits] [llvm] r53761 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Message-ID: <200807181749.m6IHnhkb024765@zion.cs.uiuc.edu> Author: resistor Date: Fri Jul 18 12:49:43 2008 New Revision: 53761 URL: http://llvm.org/viewvc/llvm-project?rev=53761&view=rev Log: Reapply r53735. My last patch fixed the failures Dan observed. Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=53761&r1=53760&r2=53761&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Fri Jul 18 12:49:43 2008 @@ -2036,6 +2036,12 @@ // pred, and if there is only one distinct successor of the predecessor, and // if there are no PHI nodes. // + if (MergeBlockIntoPredecessor(BB)) + return true; + + // Otherwise, if this block only has a single predecessor, and if that block + // is a conditional branch, see if we can hoist any code from this block up + // into our predecessor. pred_iterator PI(pred_begin(BB)), PE(pred_end(BB)); BasicBlock *OnlyPred = *PI++; for (; PI != PE; ++PI) // Search all predecessors, see if they are all same @@ -2043,57 +2049,7 @@ OnlyPred = 0; // There are multiple different predecessors... break; } - - BasicBlock *OnlySucc = 0; - if (OnlyPred && OnlyPred != BB && // Don't break self loops - OnlyPred->getTerminator()->getOpcode() != Instruction::Invoke) { - // Check to see if there is only one distinct successor... - succ_iterator SI(succ_begin(OnlyPred)), SE(succ_end(OnlyPred)); - OnlySucc = BB; - for (; SI != SE; ++SI) - if (*SI != OnlySucc) { - OnlySucc = 0; // There are multiple distinct successors! - break; - } - } - - if (OnlySucc) { - DOUT << "Merging: " << *BB << "into: " << *OnlyPred; - - // Resolve any PHI nodes at the start of the block. They are all - // guaranteed to have exactly one entry if they exist, unless there are - // multiple duplicate (but guaranteed to be equal) entries for the - // incoming edges. This occurs when there are multiple edges from - // OnlyPred to OnlySucc. - // - while (PHINode *PN = dyn_cast(&BB->front())) { - PN->replaceAllUsesWith(PN->getIncomingValue(0)); - BB->getInstList().pop_front(); // Delete the phi node. - } - - // Delete the unconditional branch from the predecessor. - OnlyPred->getInstList().pop_back(); - - // Move all definitions in the successor to the predecessor. - OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList()); - - // Make all PHI nodes that referred to BB now refer to Pred as their - // source. - BB->replaceAllUsesWith(OnlyPred); - - // Inherit predecessors name if it exists. - if (!OnlyPred->hasName()) - OnlyPred->takeName(BB); - - // Erase basic block from the function. - M->getBasicBlockList().erase(BB); - - return true; - } - - // Otherwise, if this block only has a single predecessor, and if that block - // is a conditional branch, see if we can hoist any code from this block up - // into our predecessor. + if (OnlyPred) if (BranchInst *BI = dyn_cast(OnlyPred->getTerminator())) if (BI->isConditional()) { @@ -2101,6 +2057,7 @@ BasicBlock *OtherBB = BI->getSuccessor(BI->getSuccessor(0) == BB); PI = pred_begin(OtherBB); ++PI; + if (PI == pred_end(OtherBB)) { // We have a conditional branch to two blocks that are only reachable // from the condbr. We know that the condbr dominates the two blocks, @@ -2108,7 +2065,7 @@ // blocks. If so, we can hoist it up to the branching block. Changed |= HoistThenElseCodeToIf(BI); } else { - OnlySucc = NULL; + BasicBlock* OnlySucc = NULL; for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI) { if (!OnlySucc) From resistor at mac.com Fri Jul 18 13:03:38 2008 From: resistor at mac.com (Owen Anderson) Date: Fri, 18 Jul 2008 18:03:38 -0000 Subject: [llvm-commits] [llvm] r53762 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200807181803.m6II3cAD025206@zion.cs.uiuc.edu> Author: resistor Date: Fri Jul 18 13:03:38 2008 New Revision: 53762 URL: http://llvm.org/viewvc/llvm-project?rev=53762&view=rev Log: Make PRE actually handle critical edges (by splitting them). Confirmed that bootstrap passes with this change. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=53762&r1=53761&r2=53762&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri Jul 18 13:03:38 2008 @@ -1136,8 +1136,11 @@ changed |= shouldContinue; } - if (EnablePRE) - changed |= performPRE(F); + if (EnablePRE) { + bool PREChanged = false; + while (PREChanged = performPRE(F)) + changed |= PREChanged; + } return changed; } @@ -1336,7 +1339,7 @@ I = toSplit.begin(), E = toSplit.end(); I != E; ++I) SplitCriticalEdge(I->first, I->second, this); - return changed; + return changed || toSplit.size(); } // iterateOnFunction - Executes one iteration of GVN From kremenek at apple.com Fri Jul 18 13:17:10 2008 From: kremenek at apple.com (Ted Kremenek) Date: Fri, 18 Jul 2008 18:17:10 -0000 Subject: [llvm-commits] [llvm] r53764 - /llvm/tags/checker/checker-63/ Message-ID: <200807181817.m6IIHAFT025616@zion.cs.uiuc.edu> Author: kremenek Date: Fri Jul 18 13:17:10 2008 New Revision: 53764 URL: http://llvm.org/viewvc/llvm-project?rev=53764&view=rev Log: Tagging checker-63. Added: llvm/tags/checker/checker-63/ - copied from r53763, llvm/trunk/ From gohman at apple.com Fri Jul 18 13:28:56 2008 From: gohman at apple.com (Dan Gohman) Date: Fri, 18 Jul 2008 18:28:56 -0000 Subject: [llvm-commits] [llvm] r53766 - /llvm/trunk/lib/CodeGen/VirtRegMap.cpp Message-ID: <200807181828.m6IISuIp025978@zion.cs.uiuc.edu> Author: djg Date: Fri Jul 18 13:28:56 2008 New Revision: 53766 URL: http://llvm.org/viewvc/llvm-project?rev=53766&view=rev Log: Fix a LocalSpiller leak. This fixes tramp3d-v4. Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=53766&r1=53765&r2=53766&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original) +++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Fri Jul 18 13:28:56 2008 @@ -971,6 +971,7 @@ InvalidateKills(MI, RegKills, KillOps); VRM.RemoveMachineInstrFromMaps(&MI); MBB.erase(&MI); + MF.DeleteMachineInstr(NewMI); return true; } MF.DeleteMachineInstr(NewMI); From gohman at apple.com Fri Jul 18 13:43:12 2008 From: gohman at apple.com (Dan Gohman) Date: Fri, 18 Jul 2008 18:43:12 -0000 Subject: [llvm-commits] [llvm] r53767 - in /llvm/trunk: lib/Target/CBackend/CBackend.cpp test/CodeGen/CBackend/2007-02-23-NameConflicts.ll test/CodeGen/CBackend/pr2408.ll Message-ID: <200807181843.m6IIhCLb026368@zion.cs.uiuc.edu> Author: djg Date: Fri Jul 18 13:43:12 2008 New Revision: 53767 URL: http://llvm.org/viewvc/llvm-project?rev=53767&view=rev Log: In the CBackend, use casts to force integer add, subtract, and multiply to be done as unsigned, so that they have well defined behavior on overflow. This fixes PR2408. Added: llvm/trunk/test/CodeGen/CBackend/pr2408.ll Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp llvm/trunk/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=53767&r1=53766&r2=53767&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Fri Jul 18 13:43:12 2008 @@ -1116,6 +1116,13 @@ const Type *Ty = CE->getOperand(0)->getType(); bool TypeIsSigned = false; switch (CE->getOpcode()) { + case Instruction::Add: + case Instruction::Sub: + case Instruction::Mul: + // We need to cast integer arithmetic so that it is always performed + // as unsigned, to avoid undefined behavior on overflow. + if (!Ty->isIntOrIntVector()) break; + // FALL THROUGH case Instruction::LShr: case Instruction::URem: case Instruction::UDiv: NeedsExplicitCast = true; break; @@ -1174,6 +1181,13 @@ default: // for most instructions, it doesn't matter break; + case Instruction::Add: + case Instruction::Sub: + case Instruction::Mul: + // We need to cast integer arithmetic so that it is always performed + // as unsigned, to avoid undefined behavior on overflow. + if (!OpTy->isIntOrIntVector()) break; + // FALL THROUGH case Instruction::LShr: case Instruction::UDiv: case Instruction::URem: @@ -1294,6 +1308,13 @@ bool CWriter::writeInstructionCast(const Instruction &I) { const Type *Ty = I.getOperand(0)->getType(); switch (I.getOpcode()) { + case Instruction::Add: + case Instruction::Sub: + case Instruction::Mul: + // We need to cast integer arithmetic so that it is always performed + // as unsigned, to avoid undefined behavior on overflow. + if (!Ty->isIntOrIntVector()) break; + // FALL THROUGH case Instruction::LShr: case Instruction::URem: case Instruction::UDiv: @@ -1334,6 +1355,13 @@ default: // for most instructions, it doesn't matter break; + case Instruction::Add: + case Instruction::Sub: + case Instruction::Mul: + // We need to cast integer arithmetic so that it is always performed + // as unsigned, to avoid undefined behavior on overflow. + if (!OpTy->isIntOrIntVector()) break; + // FALL THROUGH case Instruction::LShr: case Instruction::UDiv: case Instruction::URem: // Cast to unsigned first Modified: llvm/trunk/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll?rev=53767&r1=53766&r2=53767&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll (original) +++ llvm/trunk/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll Fri Jul 18 13:43:12 2008 @@ -1,7 +1,8 @@ ; PR1164 ; RUN: llvm-as < %s | llc -march=c | grep {llvm_cbe_A = \\*llvm_cbe_G;} ; RUN: llvm-as < %s | llc -march=c | grep {llvm_cbe_B = \\*(<mp_0_1);} -; RUN: llvm-as < %s | llc -march=c | grep {return (llvm_cbe_A + llvm_cbe_B);} +; RUN: llvm-as < %s | llc -march=c | grep {return (((unsigned int )(((unsigned int )llvm_cbe_A) + ((unsigned int )llvm_cbe_B))));} + @G = global i32 123 @ltmp_0_1 = global i32 123 Added: llvm/trunk/test/CodeGen/CBackend/pr2408.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CBackend/pr2408.ll?rev=53767&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/CBackend/pr2408.ll (added) +++ llvm/trunk/test/CodeGen/CBackend/pr2408.ll Fri Jul 18 13:43:12 2008 @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | llc -march=c | grep {\\* ((unsigned int )} +; PR2408 + +define i32 @a(i32 %a) { +entry: + %shr = ashr i32 %a, 0 ; [#uses=1] + %shr2 = ashr i32 2, 0 ; [#uses=1] + %mul = mul i32 %shr, %shr2 ; [#uses=1] + %shr4 = ashr i32 2, 0 ; [#uses=1] + %div = sdiv i32 %mul, %shr4 ; [#uses=1] + ret i32 %div +} From baldrick at free.fr Fri Jul 18 15:12:05 2008 From: baldrick at free.fr (Duncan Sands) Date: Fri, 18 Jul 2008 20:12:05 -0000 Subject: [llvm-commits] [llvm] r53768 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200807182012.m6IKC5bC029130@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 18 15:12:05 2008 New Revision: 53768 URL: http://llvm.org/viewvc/llvm-project?rev=53768&view=rev Log: Revert 53729, after waking up in the middle of the night realising that it was wrong :) I think the reason the same type was being used for the shufflevec of indices as for the actual indices is so that if one of them needs splitting then so does the other. After my patch it might be that the indices need splitting but not the rest, yet there is no good way of handling that. I think the right solution is to not have the shufflevec be an operand at all: just have it be the list of numbers it actually is, stored as extra info in the node. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=53768&r1=53767&r2=53768&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Jul 18 15:12:05 2008 @@ -5046,9 +5046,9 @@ if (!isa(Elt)) return SDOperand(); else if (cast(Elt)->isAllOnesValue()) - IdxOps.push_back(DAG.getConstant(i, TLI.getPointerTy())); + IdxOps.push_back(DAG.getConstant(i, EVT)); else if (cast(Elt)->isNullValue()) - IdxOps.push_back(DAG.getConstant(NumElts, TLI.getPointerTy())); + IdxOps.push_back(DAG.getConstant(NumElts, EVT)); else return SDOperand(); } @@ -5066,8 +5066,7 @@ std::vector ZeroOps(NumElts, DAG.getConstant(0, EVT)); Ops.push_back(DAG.getNode(ISD::BUILD_VECTOR, VT, &ZeroOps[0], ZeroOps.size())); - Ops.push_back(DAG.getNode(ISD::BUILD_VECTOR, - MVT::getVectorVT(TLI.getPointerTy(), NumElts), + Ops.push_back(DAG.getNode(ISD::BUILD_VECTOR, VT, &IdxOps[0], IdxOps.size())); SDOperand Result = DAG.getNode(ISD::VECTOR_SHUFFLE, VT, &Ops[0], Ops.size()); From tbrethou at cs.uiuc.edu Fri Jul 18 16:01:31 2008 From: tbrethou at cs.uiuc.edu (Tanya Lattner) Date: Fri, 18 Jul 2008 16:01:31 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/index.php Message-ID: <200807182101.m6IL1VId030695@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg: index.php updated: 1.13 -> 1.14 --- Log message: Add list of talks. --- Diffs of the changes: (+18 -5) index.php | 23 ++++++++++++++++++----- 1 files changed, 18 insertions(+), 5 deletions(-) Index: llvm-www/devmtg/index.php diff -u llvm-www/devmtg/index.php:1.13 llvm-www/devmtg/index.php:1.14 --- llvm-www/devmtg/index.php:1.13 Fri Jun 6 16:45:44 2008 +++ llvm-www/devmtg/index.php Fri Jul 18 16:00:35 2008 @@ -100,14 +100,27 @@
Agenda
-

Volunteer to give a talk! (All talk proposals must be received by June 30, 2008)

+

The meeting is tentatively scheduled between 8:00 AM and 5:00 PM Pacific Time.

-

The schedule of talks has not yet been determined. If you are interested in -speaking, please let -us know what topic you'd like to present.

+

Below is a list of the selected talks. A more formal schedule will be posted soon.

+ + + + + + + + + + + + + + +
Adobe Image Foundation and Adobe PixelBender: Our Usage of LLVMChuck Rose III, Adobe
Cell BackendScott Michel, Aerospace
ClangCodeGen Overview and Focus on SelectionDAGsDan Gohman, Apple
Finding Bugs with Source Code AnalysisTed Kremenek, Apple
Building an Efficient JIT with LLVMNate Begeman, Apple
llvm2c - New LLVM Compiler DriverAnton Korobeynikov, Saint Petersburg State University.
LLVM Hardware Backend with HW/SW Codesign ToolchainTim Sander, University Darmstadt
Register AllocationEvan Cheng, Apple
Targeting the Adobe Flash Virtual Machine with LLVMScott Peterson, Adobe
The VMKit Project - Building a JVM and .Net implementation on top of LLVMNicolas Geoffray, University of Pierre et Marie Curie, France
Building a JIT compiler for PHP in 2 daysNuno Lopes, Instituto Superior Tecnico
SVA: Using LLVM to Provide Memory Safety for the Entire Software StackJohn Criswell, University of Illinois at Urbana-Champaign
Getting There
From tonic at nondot.org Fri Jul 18 16:01:46 2008 From: tonic at nondot.org (Tanya Lattner) Date: Fri, 18 Jul 2008 16:01:46 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/index.php Message-ID: <200807182101.m6IL1kPk030713@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg: index.php updated: 1.14 -> 1.15 --- Log message: Add border. --- Diffs of the changes: (+1 -1) index.php | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-www/devmtg/index.php diff -u llvm-www/devmtg/index.php:1.14 llvm-www/devmtg/index.php:1.15 --- llvm-www/devmtg/index.php:1.14 Fri Jul 18 16:00:35 2008 +++ llvm-www/devmtg/index.php Fri Jul 18 16:01:27 2008 @@ -107,7 +107,7 @@

Below is a list of the selected talks. A more formal schedule will be posted soon.

- +
From tonic at nondot.org Fri Jul 18 16:02:27 2008 From: tonic at nondot.org (Tanya Lattner) Date: Fri, 18 Jul 2008 16:02:27 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/index.php Message-ID: <200807182102.m6IL2RCD030758@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg: index.php updated: 1.15 -> 1.16 --- Log message: Fix typo. --- Diffs of the changes: (+2 -1) index.php | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-www/devmtg/index.php diff -u llvm-www/devmtg/index.php:1.15 llvm-www/devmtg/index.php:1.16 --- llvm-www/devmtg/index.php:1.15 Fri Jul 18 16:01:27 2008 +++ llvm-www/devmtg/index.php Fri Jul 18 16:02:08 2008 @@ -110,7 +110,8 @@
Adobe Image Foundation and Adobe PixelBender: Our Usage of LLVMChuck Rose III, Adobe
Cell BackendScott Michel, Aerospace
ClangCodeGen Overview and Focus on SelectionDAGsDan Gohman, Apple
- + + From baldrick at free.fr Fri Jul 18 16:06:03 2008 From: baldrick at free.fr (Duncan Sands) Date: Fri, 18 Jul 2008 21:06:03 -0000 Subject: [llvm-commits] [llvm] r53771 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200807182106.m6IL63QW030875@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 18 16:06:02 2008 New Revision: 53771 URL: http://llvm.org/viewvc/llvm-project?rev=53771&view=rev Log: Supress a gcc-4.3 warning. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=53771&r1=53770&r2=53771&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri Jul 18 16:06:02 2008 @@ -1138,7 +1138,7 @@ if (EnablePRE) { bool PREChanged = false; - while (PREChanged = performPRE(F)) + while ((PREChanged = performPRE(F))) changed |= PREChanged; } From baldrick at free.fr Fri Jul 18 16:07:41 2008 From: baldrick at free.fr (Duncan Sands) Date: Fri, 18 Jul 2008 21:07:41 -0000 Subject: [llvm-commits] [llvm] r53772 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Message-ID: <200807182107.m6IL7gfd030933@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 18 16:07:41 2008 New Revision: 53772 URL: http://llvm.org/viewvc/llvm-project?rev=53772&view=rev Log: Eliminate unused variable. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=53772&r1=53771&r2=53772&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Fri Jul 18 16:07:41 2008 @@ -160,7 +160,7 @@ Op += '<'; if (!V) { Op += "(unknown)"; - } else if (const PseudoSourceValue *PSV = dyn_cast(V)) { + } else if (isa(V)) { // PseudoSourceValues don't have names, so use their print method. std::ostringstream SS; M->MO.getValue()->print(SS); From baldrick at free.fr Fri Jul 18 16:18:48 2008 From: baldrick at free.fr (Duncan Sands) Date: Fri, 18 Jul 2008 21:18:48 -0000 Subject: [llvm-commits] [llvm] r53773 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h test/CodeGen/ARM/2008-07-17-Fdiv.ll Message-ID: <200807182118.m6ILImcb031318@zion.cs.uiuc.edu> Author: baldrick Date: Fri Jul 18 16:18:48 2008 New Revision: 53773 URL: http://llvm.org/viewvc/llvm-project?rev=53773&view=rev Log: Softfloat support for FDIV. Patch by Richard Pennington. Added: llvm/trunk/test/CodeGen/ARM/2008-07-17-Fdiv.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp?rev=53773&r1=53772&r2=53773&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Fri Jul 18 16:18:48 2008 @@ -61,6 +61,7 @@ break; case ISD::FADD: R = SoftenFloatRes_FADD(N); break; case ISD::FCOPYSIGN: R = SoftenFloatRes_FCOPYSIGN(N); break; + case ISD::FDIV: R = SoftenFloatRes_FDIV(N); break; case ISD::FMUL: R = SoftenFloatRes_FMUL(N); break; case ISD::FP_EXTEND: R = SoftenFloatRes_FP_EXTEND(N); break; case ISD::FP_ROUND: R = SoftenFloatRes_FP_ROUND(N); break; @@ -146,6 +147,18 @@ return DAG.getNode(ISD::OR, LVT, LHS, SignBit); } +SDOperand DAGTypeLegalizer::SoftenFloatRes_FDIV(SDNode *N) { + MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + SDOperand Ops[2] = { GetSoftenedFloat(N->getOperand(0)), + GetSoftenedFloat(N->getOperand(1)) }; + return MakeLibCall(GetFPLibCall(N->getValueType(0), + RTLIB::DIV_F32, + RTLIB::DIV_F64, + RTLIB::DIV_F80, + RTLIB::DIV_PPCF128), + NVT, Ops, 2, false); +} + SDOperand DAGTypeLegalizer::SoftenFloatRes_FMUL(SDNode *N) { MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); SDOperand Ops[2] = { GetSoftenedFloat(N->getOperand(0)), Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=53773&r1=53772&r2=53773&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Fri Jul 18 16:18:48 2008 @@ -336,6 +336,7 @@ SDOperand SoftenFloatRes_ConstantFP(ConstantFPSDNode *N); SDOperand SoftenFloatRes_FADD(SDNode *N); SDOperand SoftenFloatRes_FCOPYSIGN(SDNode *N); + SDOperand SoftenFloatRes_FDIV(SDNode *N); SDOperand SoftenFloatRes_FMUL(SDNode *N); SDOperand SoftenFloatRes_FP_EXTEND(SDNode *N); SDOperand SoftenFloatRes_FP_ROUND(SDNode *N); Added: llvm/trunk/test/CodeGen/ARM/2008-07-17-Fdiv.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2008-07-17-Fdiv.ll?rev=53773&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2008-07-17-Fdiv.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2008-07-17-Fdiv.ll Fri Jul 18 16:18:48 2008 @@ -0,0 +1,6 @@ +; RUN: llvm-as < %s | llc -march=arm + +define float @f(float %a, float %b) nounwind { + %tmp = fdiv float %a, %b + ret float %tmp +} From dpatel at apple.com Fri Jul 18 17:59:45 2008 From: dpatel at apple.com (Devang Patel) Date: Fri, 18 Jul 2008 22:59:45 -0000 Subject: [llvm-commits] [llvm] r53774 - in /llvm/trunk/tools/lto-bugpoint: ./ LTOBugPoint.cpp LTOBugPoint.h Makefile lto-bugpoint.cpp Message-ID: <200807182259.m6IMxjjG002121@zion.cs.uiuc.edu> Author: dpatel Date: Fri Jul 18 17:59:45 2008 New Revision: 53774 URL: http://llvm.org/viewvc/llvm-project?rev=53774&view=rev Log: Start writing lto-bugpoint tool. Added: llvm/trunk/tools/lto-bugpoint/ llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp llvm/trunk/tools/lto-bugpoint/LTOBugPoint.h llvm/trunk/tools/lto-bugpoint/Makefile llvm/trunk/tools/lto-bugpoint/lto-bugpoint.cpp Added: llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp?rev=53774&view=auto ============================================================================== --- llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp (added) +++ llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp Fri Jul 18 17:59:45 2008 @@ -0,0 +1,28 @@ +//===- LTOBugPoint.cpp - Top-Level LTO BugPoint class ---------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This class contains all of the shared state and information that is used by +// the LTO BugPoint tool to track down bit code files that cause errors. +// +//===----------------------------------------------------------------------===// + +#include "LTOBugPoint.h" + +LTOBugPoint::LTOBugPoint(std::istream &args, std::istream &ins) { + + // Read linker options. Order is important here. + std::string option; + while (getline(args, option)) + LinkerOptions.push_back(option); + + // Read linker input files. Order is important here. + std::string inFile; + while(getline(ins, inFile)) + LinkerInputFiles.push_back(inFile); +} Added: llvm/trunk/tools/lto-bugpoint/LTOBugPoint.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto-bugpoint/LTOBugPoint.h?rev=53774&view=auto ============================================================================== --- llvm/trunk/tools/lto-bugpoint/LTOBugPoint.h (added) +++ llvm/trunk/tools/lto-bugpoint/LTOBugPoint.h Fri Jul 18 17:59:45 2008 @@ -0,0 +1,30 @@ +//===- LTOBugPoint.h - Top-Level LTO BugPoint class -------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This class contains all of the shared state and information that is used by +// the LTO BugPoint tool to track down bit code files that cause errors. +// +//===----------------------------------------------------------------------===// + +#include "llvm/ADT/SmallVector.h" +#include +#include + +class LTOBugPoint { + public: + + LTOBugPoint(std::istream &args, std::istream &ins); + + private: + /// LinkerInputFiles - This is a list of linker input files. Once populated + /// this list is not modified. + llvm::SmallVector LinkerInputFiles; + llvm::SmallVector LinkerOptions; + +}; Added: llvm/trunk/tools/lto-bugpoint/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto-bugpoint/Makefile?rev=53774&view=auto ============================================================================== --- llvm/trunk/tools/lto-bugpoint/Makefile (added) +++ llvm/trunk/tools/lto-bugpoint/Makefile Fri Jul 18 17:59:45 2008 @@ -0,0 +1,15 @@ +##===- tools/lto-bugpoint/Makefile -------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## +LEVEL = ../.. + +TOOLNAME = lto-bugpoint + +REQUIRES_EH := 1 + +include $(LEVEL)/Makefile.common Added: llvm/trunk/tools/lto-bugpoint/lto-bugpoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto-bugpoint/lto-bugpoint.cpp?rev=53774&view=auto ============================================================================== --- llvm/trunk/tools/lto-bugpoint/lto-bugpoint.cpp (added) +++ llvm/trunk/tools/lto-bugpoint/lto-bugpoint.cpp Fri Jul 18 17:59:45 2008 @@ -0,0 +1,67 @@ +//===- lto-bugpoing.cpp - The lto-bugpoint driver -------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// lto-bugpoint tool identifies minmal set of bitcode files that is causing +// failure when Link Time Optimization is enabled. The failure is identified +// using developer provided validation script. +// +//===----------------------------------------------------------------------===// + +#include "LTOBugPoint.h" +#include +#include + +int main(int argc, char **argv) { + try { + + if (argc != 4) { + std::cerr << "Invalid number of lto-bugpoint arguments!\n"; + return 1; + } + + std::ios::openmode input_mode = std::ios::in; + + // First argument is linker command line options file. This text file + // is a list of linker command line options, one option per line. + // First line always list the absolute path to invoke the linker. + std::istream *LinkerArgsFile = new std::ifstream(argv[1], input_mode); + if (!LinkerArgsFile->good()) { + std::cerr << argv[0] << ": error opening " << argv[1] << "!\n"; + return 1; + } + + // Second argment is a text file that includes the linker input + // file paths, one input file path per line. + std::istream *LinkerInputsFile = new std::ifstream(argv[2], input_mode); + if (!LinkerInputsFile->good()) { + std::cerr << argv[0] << ": error opening " << argv[2] << "!\n"; + delete LinkerArgsFile; + return 1; + } + + // Third argument is absolute path to the validation script. This + // script is used to validate LTO error under investigation. + std::istream *ValidationScriptFile = new std::ifstream(argv[3], input_mode); + if (!ValidationScriptFile->good()) { + std::cerr << argv[0] << ": error opening " << argv[3] << "!\n"; + delete LinkerArgsFile; + delete LinkerInputsFile; + return 1; + } + + LTOBugPoint bugFinder(*LinkerArgsFile, *LinkerInputsFile); + + return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + } + return 1; +} From dpatel at apple.com Fri Jul 18 18:46:41 2008 From: dpatel at apple.com (Devang Patel) Date: Fri, 18 Jul 2008 23:46:41 -0000 Subject: [llvm-commits] [llvm] r53777 - in /llvm/trunk/tools/lto-bugpoint: LTOBugPoint.cpp LTOBugPoint.h Makefile lto-bugpoint.cpp Message-ID: <200807182346.m6INkfO8003635@zion.cs.uiuc.edu> Author: dpatel Date: Fri Jul 18 18:46:41 2008 New Revision: 53777 URL: http://llvm.org/viewvc/llvm-project?rev=53777&view=rev Log: If all linker input files are native object files then lto-bugpoint is not useful. Modified: llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp llvm/trunk/tools/lto-bugpoint/LTOBugPoint.h llvm/trunk/tools/lto-bugpoint/Makefile llvm/trunk/tools/lto-bugpoint/lto-bugpoint.cpp Modified: llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp?rev=53777&r1=53776&r2=53777&view=diff ============================================================================== --- llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp (original) +++ llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp Fri Jul 18 18:46:41 2008 @@ -13,7 +13,12 @@ //===----------------------------------------------------------------------===// #include "LTOBugPoint.h" +#include "llvm/Support/SystemUtils.h" +#include "llvm/System/Path.h" +#include +/// LTOBugPoint -- Constructor. Popuate list of linker options and +/// list of linker input files. LTOBugPoint::LTOBugPoint(std::istream &args, std::istream &ins) { // Read linker options. Order is important here. @@ -26,3 +31,27 @@ while(getline(ins, inFile)) LinkerInputFiles.push_back(inFile); } + +/// findTroubleMakers - Find minimum set of input files that causes error +/// identified by the script. +bool +LTOBugPoint::findTroubleMakers(llvm::SmallVector &TroubleMakers, + std::string &Script) { + + // First, build native object files set. + bool bitcodeFileSeen = false; + for(llvm::SmallVector::iterator I = LinkerInputFiles.begin(), + E = LinkerInputFiles.end(); I != E; ++I) { + std::string &path = *I; + if (llvm::sys::Path(path.c_str()).isBitcodeFile()) + bitcodeFileSeen = true; + } + + if (!bitcodeFileSeen) { + std::cerr << "lto-bugpoint: Error: Unable to help!"; + std::cerr << " Need at least one input file that contains llvm bitcode\n"; + return false; + } + + return true; +} Modified: llvm/trunk/tools/lto-bugpoint/LTOBugPoint.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto-bugpoint/LTOBugPoint.h?rev=53777&r1=53776&r2=53777&view=diff ============================================================================== --- llvm/trunk/tools/lto-bugpoint/LTOBugPoint.h (original) +++ llvm/trunk/tools/lto-bugpoint/LTOBugPoint.h Fri Jul 18 18:46:41 2008 @@ -21,10 +21,22 @@ LTOBugPoint(std::istream &args, std::istream &ins); + /// findTroubleMakers - Find minimum set of input files that causes error + /// identified by the script. + bool findTroubleMakers(llvm::SmallVector &TroubleMakers, + std::string &Script); private: /// LinkerInputFiles - This is a list of linker input files. Once populated /// this list is not modified. llvm::SmallVector LinkerInputFiles; + + /// LinkerOptions - List of linker command line options. llvm::SmallVector LinkerOptions; + /// NativeInputFiles - This is a list of input files that are not llvm + /// bitcode files. The order in this list is important. The a file + /// in LinkerInputFiles at index 4 is a llvm bitcode file then the file + /// at index 4 in NativeInputFiles is corresponding native object file. + llvm::SmallVector NativeInputFiles; + }; Modified: llvm/trunk/tools/lto-bugpoint/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto-bugpoint/Makefile?rev=53777&r1=53776&r2=53777&view=diff ============================================================================== --- llvm/trunk/tools/lto-bugpoint/Makefile (original) +++ llvm/trunk/tools/lto-bugpoint/Makefile Fri Jul 18 18:46:41 2008 @@ -10,6 +10,8 @@ TOOLNAME = lto-bugpoint +LINK_COMPONENTS := system + REQUIRES_EH := 1 include $(LEVEL)/Makefile.common Modified: llvm/trunk/tools/lto-bugpoint/lto-bugpoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto-bugpoint/lto-bugpoint.cpp?rev=53777&r1=53776&r2=53777&view=diff ============================================================================== --- llvm/trunk/tools/lto-bugpoint/lto-bugpoint.cpp (original) +++ llvm/trunk/tools/lto-bugpoint/lto-bugpoint.cpp Fri Jul 18 18:46:41 2008 @@ -47,16 +47,13 @@ // Third argument is absolute path to the validation script. This // script is used to validate LTO error under investigation. - std::istream *ValidationScriptFile = new std::ifstream(argv[3], input_mode); - if (!ValidationScriptFile->good()) { - std::cerr << argv[0] << ": error opening " << argv[3] << "!\n"; - delete LinkerArgsFile; - delete LinkerInputsFile; - return 1; - } - + std::string ValidationScript = argv[3]; LTOBugPoint bugFinder(*LinkerArgsFile, *LinkerInputsFile); + llvm::SmallVector TroubleMakers; + if (!bugFinder.findTroubleMakers(TroubleMakers, ValidationScript)) + return 1; + return 0; } catch (const std::string& msg) { std::cerr << argv[0] << ": " << msg << "\n"; From dpatel at apple.com Fri Jul 18 18:47:27 2008 From: dpatel at apple.com (Devang Patel) Date: Fri, 18 Jul 2008 23:47:27 -0000 Subject: [llvm-commits] [llvm] r53778 - /llvm/trunk/tools/lto/Makefile Message-ID: <200807182347.m6INlRL2003670@zion.cs.uiuc.edu> Author: dpatel Date: Fri Jul 18 18:47:27 2008 New Revision: 53778 URL: http://llvm.org/viewvc/llvm-project?rev=53778&view=rev Log: typo. Modified: llvm/trunk/tools/lto/Makefile Modified: llvm/trunk/tools/lto/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/Makefile?rev=53778&r1=53777&r2=53778&view=diff ============================================================================== --- llvm/trunk/tools/lto/Makefile (original) +++ llvm/trunk/tools/lto/Makefile Fri Jul 18 18:47:27 2008 @@ -1,4 +1,4 @@ -##===- tools/lto2/Makefile ---------------------------------*- Makefile -*-===## +##===- tools/lto/Makefile ----------------------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # @@ -12,7 +12,7 @@ # Include this here so we can get the configuration of the targets # that have been configured for construction. We have to do this -# early so we can set up LINK_COMPONENTS before includeing Makefile.rules +# early so we can set up LINK_COMPONENTS before including Makefile.rules include $(LEVEL)/Makefile.config LINK_LIBS_IN_SHARED = 1 From evan.cheng at apple.com Fri Jul 18 19:37:25 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 19 Jul 2008 00:37:25 -0000 Subject: [llvm-commits] [llvm] r53779 - in /llvm/trunk/lib/CodeGen: LiveIntervalAnalysis.cpp MachineInstr.cpp Message-ID: <200807190037.m6J0bPiP005151@zion.cs.uiuc.edu> Author: evancheng Date: Fri Jul 18 19:37:25 2008 New Revision: 53779 URL: http://llvm.org/viewvc/llvm-project?rev=53779&view=rev Log: Fix a memory leak in LiveIntervalAnalysis. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/MachineInstr.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=53779&r1=53778&r2=53779&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Fri Jul 18 19:37:25 2008 @@ -72,8 +72,11 @@ r2iMap_.clear(); // Release VNInfo memroy regions after all VNInfo objects are dtor'd. VNInfoAllocator.Reset(); - for (unsigned i = 0, e = ClonedMIs.size(); i != e; ++i) - mf_->DeleteMachineInstr(ClonedMIs[i]); + while (!ClonedMIs.empty()) { + MachineInstr *MI = ClonedMIs.back(); + ClonedMIs.pop_back(); + mf_->DeleteMachineInstr(MI); + } } void LiveIntervals::computeNumbering() { @@ -1586,8 +1589,9 @@ // Remember how to remat the def of this val#. ReMatOrigDefs[VN] = ReMatDefMI; // Original def may be modified so we have to make a copy here. - // FIXME: This is a memory leak. vrm should delete these! - ReMatDefs[VN] = mf_->CloneMachineInstr(ReMatDefMI); + MachineInstr *Clone = mf_->CloneMachineInstr(ReMatDefMI); + ClonedMIs.push_back(Clone); + ReMatDefs[VN] = Clone; bool CanDelete = true; if (VNI->hasPHIKill) { Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=53779&r1=53778&r2=53779&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Fri Jul 18 19:37:25 2008 @@ -312,16 +312,14 @@ /// MachineInstr ctor - Copies MachineInstr arg exactly /// -MachineInstr::MachineInstr(MachineFunction &MF, const MachineInstr &MI) { - TID = &MI.getDesc(); - NumImplicitOps = MI.NumImplicitOps; +MachineInstr::MachineInstr(MachineFunction &MF, const MachineInstr &MI) + : TID(&MI.getDesc()), NumImplicitOps(0), Parent(0) { Operands.reserve(MI.getNumOperands()); // Add operands - for (unsigned i = 0; i != MI.getNumOperands(); ++i) { - Operands.push_back(MI.getOperand(i)); - Operands.back().ParentMI = this; - } + for (unsigned i = 0; i != MI.getNumOperands(); ++i) + addOperand(MI.getOperand(i)); + NumImplicitOps = MI.NumImplicitOps; // Add memory operands. for (alist::const_iterator i = MI.memoperands_begin(), From kledzik at apple.com Fri Jul 18 19:58:08 2008 From: kledzik at apple.com (Nick Kledzik) Date: Sat, 19 Jul 2008 00:58:08 -0000 Subject: [llvm-commits] [llvm] r53780 - /llvm/trunk/tools/lto/LTOModule.cpp Message-ID: <200807190058.m6J0w8pl005786@zion.cs.uiuc.edu> Author: kledzik Date: Fri Jul 18 19:58:07 2008 New Revision: 53780 URL: http://llvm.org/viewvc/llvm-project?rev=53780&view=rev Log: tentative definitions are default visibility Modified: llvm/trunk/tools/lto/LTOModule.cpp Modified: llvm/trunk/tools/lto/LTOModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOModule.cpp?rev=53780&r1=53779&r2=53780&view=diff ============================================================================== --- llvm/trunk/tools/lto/LTOModule.cpp (original) +++ llvm/trunk/tools/lto/LTOModule.cpp Fri Jul 18 19:58:07 2008 @@ -225,7 +225,7 @@ if ( def->hasHiddenVisibility() ) attr |= LTO_SYMBOL_SCOPE_HIDDEN; else if ( def->hasExternalLinkage() || def->hasWeakLinkage() - || def->hasLinkOnceLinkage() ) + || def->hasLinkOnceLinkage() || def->hasCommonLinkage() ) attr |= LTO_SYMBOL_SCOPE_DEFAULT; else attr |= LTO_SYMBOL_SCOPE_INTERNAL; From isanbard at gmail.com Fri Jul 18 20:16:10 2008 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 19 Jul 2008 01:16:10 -0000 Subject: [llvm-commits] [llvm] r53781 - /llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp Message-ID: <200807190116.m6J1GBWC006284@zion.cs.uiuc.edu> Author: void Date: Fri Jul 18 20:16:10 2008 New Revision: 53781 URL: http://llvm.org/viewvc/llvm-project?rev=53781&view=rev Log: Pull r53780 into Gaz: >From Nick: I found another case like Devang's hasLinkOnceLinkage(). It affects code that has a tentative definition in llvm bitcode and a reference in mach-o file. Modified: llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp Modified: llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp?rev=53781&r1=53780&r2=53781&view=diff ============================================================================== --- llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp (original) +++ llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp Fri Jul 18 20:16:10 2008 @@ -225,7 +225,7 @@ if ( def->hasHiddenVisibility() ) attr |= LTO_SYMBOL_SCOPE_HIDDEN; else if ( def->hasExternalLinkage() || def->hasWeakLinkage() - || def->hasLinkOnceLinkage() ) + || def->hasLinkOnceLinkage() || def->hasCommonLinkage() ) attr |= LTO_SYMBOL_SCOPE_DEFAULT; else attr |= LTO_SYMBOL_SCOPE_INTERNAL; From asl at math.spbu.ru Sat Jul 19 00:52:45 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 19 Jul 2008 05:52:45 -0000 Subject: [llvm-commits] [llvm] r53782 - /llvm/trunk/include/llvm/ADT/alist_node.h Message-ID: <200807190552.m6J5qjY4014365@zion.cs.uiuc.edu> Author: asl Date: Sat Jul 19 00:52:44 2008 New Revision: 53782 URL: http://llvm.org/viewvc/llvm-project?rev=53782&view=rev Log: Remove bogus assertion. This unbreaks mingw, where ConstantSDNode has alignment 8 and LoadSDNode (used as LargestT template) - 4. Modified: llvm/trunk/include/llvm/ADT/alist_node.h Modified: llvm/trunk/include/llvm/ADT/alist_node.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/alist_node.h?rev=53782&r1=53781&r2=53782&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/alist_node.h (original) +++ llvm/trunk/include/llvm/ADT/alist_node.h Sat Jul 19 00:52:44 2008 @@ -47,16 +47,12 @@ template SubClass *getElement(SubClass *) { assert(sizeof(SubClass) <= sizeof(LargestT)); - assert(unsigned(AlignOf::Alignment) <= - unsigned(AlignOf::Alignment)); return reinterpret_cast(&Storage.Bytes); } template const SubClass *getElement(SubClass *) const { assert(sizeof(SubClass) <= sizeof(LargestT)); - assert(unsigned(AlignOf::Alignment) <= - unsigned(AlignOf::Alignment)); return reinterpret_cast(&Storage.Bytes); } From asl at math.spbu.ru Sat Jul 19 01:30:51 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 19 Jul 2008 06:30:51 -0000 Subject: [llvm-commits] [llvm] r53784 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Message-ID: <200807190630.m6J6UpXK015577@zion.cs.uiuc.edu> Author: asl Date: Sat Jul 19 01:30:51 2008 New Revision: 53784 URL: http://llvm.org/viewvc/llvm-project?rev=53784&view=rev Log: Use aligned stack spills, where possible. This fixes PR2549. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=53784&r1=53783&r2=53784&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Sat Jul 19 01:30:51 2008 @@ -1697,7 +1697,7 @@ } static unsigned getStoreRegOpcode(const TargetRegisterClass *RC, - unsigned StackAlign) { + bool isStackAligned) { unsigned Opc = 0; if (RC == &X86::GR64RegClass) { Opc = X86::MOV64mr; @@ -1722,9 +1722,8 @@ } else if (RC == &X86::FR64RegClass) { Opc = X86::MOVSDmr; } else if (RC == &X86::VR128RegClass) { - // FIXME: Use movaps once we are capable of selectively - // aligning functions that spill SSE registers on 16-byte boundaries. - Opc = StackAlign >= 16 ? X86::MOVAPSmr : X86::MOVUPSmr; + // If stack is realigned we can use aligned stores. + Opc = isStackAligned ? X86::MOVAPSmr : X86::MOVUPSmr; } else if (RC == &X86::VR64RegClass) { Opc = X86::MMX_MOVQ64mr; } else { @@ -1739,7 +1738,8 @@ MachineBasicBlock::iterator MI, unsigned SrcReg, bool isKill, int FrameIdx, const TargetRegisterClass *RC) const { - unsigned Opc = getStoreRegOpcode(RC, RI.getStackAlignment()); + const MachineFunction &MF = *MBB.getParent(); + unsigned Opc = getStoreRegOpcode(RC, RI.needsStackRealignment(MF)); addFrameReference(BuildMI(MBB, MI, get(Opc)), FrameIdx) .addReg(SrcReg, false, false, isKill); } @@ -1749,7 +1749,7 @@ SmallVectorImpl &Addr, const TargetRegisterClass *RC, SmallVectorImpl &NewMIs) const { - unsigned Opc = getStoreRegOpcode(RC, RI.getStackAlignment()); + unsigned Opc = getStoreRegOpcode(RC, RI.needsStackRealignment(MF)); MachineInstrBuilder MIB = BuildMI(MF, get(Opc)); for (unsigned i = 0, e = Addr.size(); i != e; ++i) MIB = X86InstrAddOperand(MIB, Addr[i]); @@ -1758,7 +1758,7 @@ } static unsigned getLoadRegOpcode(const TargetRegisterClass *RC, - unsigned StackAlign) { + bool isStackAligned) { unsigned Opc = 0; if (RC == &X86::GR64RegClass) { Opc = X86::MOV64rm; @@ -1783,9 +1783,8 @@ } else if (RC == &X86::FR64RegClass) { Opc = X86::MOVSDrm; } else if (RC == &X86::VR128RegClass) { - // FIXME: Use movaps once we are capable of selectively - // aligning functions that spill SSE registers on 16-byte boundaries. - Opc = StackAlign >= 16 ? X86::MOVAPSrm : X86::MOVUPSrm; + // If stack is realigned we can use aligned loads. + Opc = isStackAligned ? X86::MOVAPSrm : X86::MOVUPSrm; } else if (RC == &X86::VR64RegClass) { Opc = X86::MMX_MOVQ64rm; } else { @@ -1797,10 +1796,11 @@ } void X86InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI, - unsigned DestReg, int FrameIdx, - const TargetRegisterClass *RC) const{ - unsigned Opc = getLoadRegOpcode(RC, RI.getStackAlignment()); + MachineBasicBlock::iterator MI, + unsigned DestReg, int FrameIdx, + const TargetRegisterClass *RC) const{ + const MachineFunction &MF = *MBB.getParent(); + unsigned Opc = getLoadRegOpcode(RC, RI.needsStackRealignment(MF)); addFrameReference(BuildMI(MBB, MI, get(Opc), DestReg), FrameIdx); } @@ -1808,7 +1808,7 @@ SmallVectorImpl &Addr, const TargetRegisterClass *RC, SmallVectorImpl &NewMIs) const { - unsigned Opc = getLoadRegOpcode(RC, RI.getStackAlignment()); + unsigned Opc = getLoadRegOpcode(RC, RI.needsStackRealignment(MF)); MachineInstrBuilder MIB = BuildMI(MF, get(Opc), DestReg); for (unsigned i = 0, e = Addr.size(); i != e; ++i) MIB = X86InstrAddOperand(MIB, Addr[i]); @@ -2272,10 +2272,12 @@ // Emit the load instruction. SDNode *Load = 0; + const MachineFunction &MF = DAG.getMachineFunction(); if (FoldedLoad) { MVT VT = *RC->vt_begin(); - Load = DAG.getTargetNode(getLoadRegOpcode(RC, RI.getStackAlignment()), VT, - MVT::Other, &AddrOps[0], AddrOps.size()); + Load = DAG.getTargetNode(getLoadRegOpcode(RC, RI.needsStackRealignment(MF)), + VT, MVT::Other, + &AddrOps[0], AddrOps.size()); NewNodes.push_back(Load); } @@ -2304,8 +2306,10 @@ AddrOps.pop_back(); AddrOps.push_back(SDOperand(NewNode, 0)); AddrOps.push_back(Chain); - SDNode *Store = DAG.getTargetNode(getStoreRegOpcode(DstRC, RI.getStackAlignment()), - MVT::Other, &AddrOps[0], AddrOps.size()); + SDNode *Store = + DAG.getTargetNode(getStoreRegOpcode(DstRC, + RI.needsStackRealignment(MF)), + MVT::Other, &AddrOps[0], AddrOps.size()); NewNodes.push_back(Store); } From asl at math.spbu.ru Sat Jul 19 01:31:12 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 19 Jul 2008 06:31:12 -0000 Subject: [llvm-commits] [llvm] r53785 - /llvm/trunk/test/CodeGen/X86/2008-07-19-movups-spills.ll Message-ID: <200807190631.m6J6VC4M015602@zion.cs.uiuc.edu> Author: asl Date: Sat Jul 19 01:31:12 2008 New Revision: 53785 URL: http://llvm.org/viewvc/llvm-project?rev=53785&view=rev Log: Testcase for PR2549 Added: llvm/trunk/test/CodeGen/X86/2008-07-19-movups-spills.ll Added: llvm/trunk/test/CodeGen/X86/2008-07-19-movups-spills.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-07-19-movups-spills.ll?rev=53785&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-07-19-movups-spills.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-07-19-movups-spills.ll Sat Jul 19 01:31:12 2008 @@ -0,0 +1,636 @@ +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux -realign-stack=1 | grep movaps | count 76 +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux -realign-stack=0 | grep movaps | count 1 +; PR2539 + +external global <4 x float>, align 1 ; <<4 x float>*>:0 [#uses=2] +external global <4 x float>, align 1 ; <<4 x float>*>:1 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:2 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:3 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:4 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:5 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:6 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:7 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:8 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:9 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:10 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:11 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:12 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:13 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:14 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:15 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:16 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:17 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:18 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:19 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:20 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:21 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:22 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:23 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:24 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:25 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:26 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:27 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:28 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:29 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:30 [#uses=1] +external global <4 x float>, align 1 ; <<4 x float>*>:31 [#uses=1] + +declare void @abort() + +define void @""() { + load <4 x float>* @0, align 1 ; <<4 x float>>:1 [#uses=2] + load <4 x float>* @1, align 1 ; <<4 x float>>:2 [#uses=3] + load <4 x float>* @2, align 1 ; <<4 x float>>:3 [#uses=4] + load <4 x float>* @3, align 1 ; <<4 x float>>:4 [#uses=5] + load <4 x float>* @4, align 1 ; <<4 x float>>:5 [#uses=6] + load <4 x float>* @5, align 1 ; <<4 x float>>:6 [#uses=7] + load <4 x float>* @6, align 1 ; <<4 x float>>:7 [#uses=8] + load <4 x float>* @7, align 1 ; <<4 x float>>:8 [#uses=9] + load <4 x float>* @8, align 1 ; <<4 x float>>:9 [#uses=10] + load <4 x float>* @9, align 1 ; <<4 x float>>:10 [#uses=11] + load <4 x float>* @10, align 1 ; <<4 x float>>:11 [#uses=12] + load <4 x float>* @11, align 1 ; <<4 x float>>:12 [#uses=13] + load <4 x float>* @12, align 1 ; <<4 x float>>:13 [#uses=14] + load <4 x float>* @13, align 1 ; <<4 x float>>:14 [#uses=15] + load <4 x float>* @14, align 1 ; <<4 x float>>:15 [#uses=16] + load <4 x float>* @15, align 1 ; <<4 x float>>:16 [#uses=17] + load <4 x float>* @16, align 1 ; <<4 x float>>:17 [#uses=18] + load <4 x float>* @17, align 1 ; <<4 x float>>:18 [#uses=19] + load <4 x float>* @18, align 1 ; <<4 x float>>:19 [#uses=20] + load <4 x float>* @19, align 1 ; <<4 x float>>:20 [#uses=21] + load <4 x float>* @20, align 1 ; <<4 x float>>:21 [#uses=22] + load <4 x float>* @21, align 1 ; <<4 x float>>:22 [#uses=23] + load <4 x float>* @22, align 1 ; <<4 x float>>:23 [#uses=24] + load <4 x float>* @23, align 1 ; <<4 x float>>:24 [#uses=25] + load <4 x float>* @24, align 1 ; <<4 x float>>:25 [#uses=26] + load <4 x float>* @25, align 1 ; <<4 x float>>:26 [#uses=27] + load <4 x float>* @26, align 1 ; <<4 x float>>:27 [#uses=28] + load <4 x float>* @27, align 1 ; <<4 x float>>:28 [#uses=29] + load <4 x float>* @28, align 1 ; <<4 x float>>:29 [#uses=30] + load <4 x float>* @29, align 1 ; <<4 x float>>:30 [#uses=31] + load <4 x float>* @30, align 1 ; <<4 x float>>:31 [#uses=32] + load <4 x float>* @31, align 1 ; <<4 x float>>:32 [#uses=33] + mul <4 x float> %1, %1 ; <<4 x float>>:33 [#uses=1] + mul <4 x float> %33, %2 ; <<4 x float>>:34 [#uses=1] + mul <4 x float> %34, %3 ; <<4 x float>>:35 [#uses=1] + mul <4 x float> %35, %4 ; <<4 x float>>:36 [#uses=1] + mul <4 x float> %36, %5 ; <<4 x float>>:37 [#uses=1] + mul <4 x float> %37, %6 ; <<4 x float>>:38 [#uses=1] + mul <4 x float> %38, %7 ; <<4 x float>>:39 [#uses=1] + mul <4 x float> %39, %8 ; <<4 x float>>:40 [#uses=1] + mul <4 x float> %40, %9 ; <<4 x float>>:41 [#uses=1] + mul <4 x float> %41, %10 ; <<4 x float>>:42 [#uses=1] + mul <4 x float> %42, %11 ; <<4 x float>>:43 [#uses=1] + mul <4 x float> %43, %12 ; <<4 x float>>:44 [#uses=1] + mul <4 x float> %44, %13 ; <<4 x float>>:45 [#uses=1] + mul <4 x float> %45, %14 ; <<4 x float>>:46 [#uses=1] + mul <4 x float> %46, %15 ; <<4 x float>>:47 [#uses=1] + mul <4 x float> %47, %16 ; <<4 x float>>:48 [#uses=1] + mul <4 x float> %48, %17 ; <<4 x float>>:49 [#uses=1] + mul <4 x float> %49, %18 ; <<4 x float>>:50 [#uses=1] + mul <4 x float> %50, %19 ; <<4 x float>>:51 [#uses=1] + mul <4 x float> %51, %20 ; <<4 x float>>:52 [#uses=1] + mul <4 x float> %52, %21 ; <<4 x float>>:53 [#uses=1] + mul <4 x float> %53, %22 ; <<4 x float>>:54 [#uses=1] + mul <4 x float> %54, %23 ; <<4 x float>>:55 [#uses=1] + mul <4 x float> %55, %24 ; <<4 x float>>:56 [#uses=1] + mul <4 x float> %56, %25 ; <<4 x float>>:57 [#uses=1] + mul <4 x float> %57, %26 ; <<4 x float>>:58 [#uses=1] + mul <4 x float> %58, %27 ; <<4 x float>>:59 [#uses=1] + mul <4 x float> %59, %28 ; <<4 x float>>:60 [#uses=1] + mul <4 x float> %60, %29 ; <<4 x float>>:61 [#uses=1] + mul <4 x float> %61, %30 ; <<4 x float>>:62 [#uses=1] + mul <4 x float> %62, %31 ; <<4 x float>>:63 [#uses=1] + mul <4 x float> %63, %32 ; <<4 x float>>:64 [#uses=3] + mul <4 x float> %2, %2 ; <<4 x float>>:65 [#uses=1] + mul <4 x float> %65, %3 ; <<4 x float>>:66 [#uses=1] + mul <4 x float> %66, %4 ; <<4 x float>>:67 [#uses=1] + mul <4 x float> %67, %5 ; <<4 x float>>:68 [#uses=1] + mul <4 x float> %68, %6 ; <<4 x float>>:69 [#uses=1] + mul <4 x float> %69, %7 ; <<4 x float>>:70 [#uses=1] + mul <4 x float> %70, %8 ; <<4 x float>>:71 [#uses=1] + mul <4 x float> %71, %9 ; <<4 x float>>:72 [#uses=1] + mul <4 x float> %72, %10 ; <<4 x float>>:73 [#uses=1] + mul <4 x float> %73, %11 ; <<4 x float>>:74 [#uses=1] + mul <4 x float> %74, %12 ; <<4 x float>>:75 [#uses=1] + mul <4 x float> %75, %13 ; <<4 x float>>:76 [#uses=1] + mul <4 x float> %76, %14 ; <<4 x float>>:77 [#uses=1] + mul <4 x float> %77, %15 ; <<4 x float>>:78 [#uses=1] + mul <4 x float> %78, %16 ; <<4 x float>>:79 [#uses=1] + mul <4 x float> %79, %17 ; <<4 x float>>:80 [#uses=1] + mul <4 x float> %80, %18 ; <<4 x float>>:81 [#uses=1] + mul <4 x float> %81, %19 ; <<4 x float>>:82 [#uses=1] + mul <4 x float> %82, %20 ; <<4 x float>>:83 [#uses=1] + mul <4 x float> %83, %21 ; <<4 x float>>:84 [#uses=1] + mul <4 x float> %84, %22 ; <<4 x float>>:85 [#uses=1] + mul <4 x float> %85, %23 ; <<4 x float>>:86 [#uses=1] + mul <4 x float> %86, %24 ; <<4 x float>>:87 [#uses=1] + mul <4 x float> %87, %25 ; <<4 x float>>:88 [#uses=1] + mul <4 x float> %88, %26 ; <<4 x float>>:89 [#uses=1] + mul <4 x float> %89, %27 ; <<4 x float>>:90 [#uses=1] + mul <4 x float> %90, %28 ; <<4 x float>>:91 [#uses=1] + mul <4 x float> %91, %29 ; <<4 x float>>:92 [#uses=1] + mul <4 x float> %92, %30 ; <<4 x float>>:93 [#uses=1] + mul <4 x float> %93, %31 ; <<4 x float>>:94 [#uses=1] + mul <4 x float> %94, %32 ; <<4 x float>>:95 [#uses=1] + mul <4 x float> %3, %3 ; <<4 x float>>:96 [#uses=1] + mul <4 x float> %96, %4 ; <<4 x float>>:97 [#uses=1] + mul <4 x float> %97, %5 ; <<4 x float>>:98 [#uses=1] + mul <4 x float> %98, %6 ; <<4 x float>>:99 [#uses=1] + mul <4 x float> %99, %7 ; <<4 x float>>:100 [#uses=1] + mul <4 x float> %100, %8 ; <<4 x float>>:101 [#uses=1] + mul <4 x float> %101, %9 ; <<4 x float>>:102 [#uses=1] + mul <4 x float> %102, %10 ; <<4 x float>>:103 [#uses=1] + mul <4 x float> %103, %11 ; <<4 x float>>:104 [#uses=1] + mul <4 x float> %104, %12 ; <<4 x float>>:105 [#uses=1] + mul <4 x float> %105, %13 ; <<4 x float>>:106 [#uses=1] + mul <4 x float> %106, %14 ; <<4 x float>>:107 [#uses=1] + mul <4 x float> %107, %15 ; <<4 x float>>:108 [#uses=1] + mul <4 x float> %108, %16 ; <<4 x float>>:109 [#uses=1] + mul <4 x float> %109, %17 ; <<4 x float>>:110 [#uses=1] + mul <4 x float> %110, %18 ; <<4 x float>>:111 [#uses=1] + mul <4 x float> %111, %19 ; <<4 x float>>:112 [#uses=1] + mul <4 x float> %112, %20 ; <<4 x float>>:113 [#uses=1] + mul <4 x float> %113, %21 ; <<4 x float>>:114 [#uses=1] + mul <4 x float> %114, %22 ; <<4 x float>>:115 [#uses=1] + mul <4 x float> %115, %23 ; <<4 x float>>:116 [#uses=1] + mul <4 x float> %116, %24 ; <<4 x float>>:117 [#uses=1] + mul <4 x float> %117, %25 ; <<4 x float>>:118 [#uses=1] + mul <4 x float> %118, %26 ; <<4 x float>>:119 [#uses=1] + mul <4 x float> %119, %27 ; <<4 x float>>:120 [#uses=1] + mul <4 x float> %120, %28 ; <<4 x float>>:121 [#uses=1] + mul <4 x float> %121, %29 ; <<4 x float>>:122 [#uses=1] + mul <4 x float> %122, %30 ; <<4 x float>>:123 [#uses=1] + mul <4 x float> %123, %31 ; <<4 x float>>:124 [#uses=1] + mul <4 x float> %124, %32 ; <<4 x float>>:125 [#uses=1] + mul <4 x float> %4, %4 ; <<4 x float>>:126 [#uses=1] + mul <4 x float> %126, %5 ; <<4 x float>>:127 [#uses=1] + mul <4 x float> %127, %6 ; <<4 x float>>:128 [#uses=1] + mul <4 x float> %128, %7 ; <<4 x float>>:129 [#uses=1] + mul <4 x float> %129, %8 ; <<4 x float>>:130 [#uses=1] + mul <4 x float> %130, %9 ; <<4 x float>>:131 [#uses=1] + mul <4 x float> %131, %10 ; <<4 x float>>:132 [#uses=1] + mul <4 x float> %132, %11 ; <<4 x float>>:133 [#uses=1] + mul <4 x float> %133, %12 ; <<4 x float>>:134 [#uses=1] + mul <4 x float> %134, %13 ; <<4 x float>>:135 [#uses=1] + mul <4 x float> %135, %14 ; <<4 x float>>:136 [#uses=1] + mul <4 x float> %136, %15 ; <<4 x float>>:137 [#uses=1] + mul <4 x float> %137, %16 ; <<4 x float>>:138 [#uses=1] + mul <4 x float> %138, %17 ; <<4 x float>>:139 [#uses=1] + mul <4 x float> %139, %18 ; <<4 x float>>:140 [#uses=1] + mul <4 x float> %140, %19 ; <<4 x float>>:141 [#uses=1] + mul <4 x float> %141, %20 ; <<4 x float>>:142 [#uses=1] + mul <4 x float> %142, %21 ; <<4 x float>>:143 [#uses=1] + mul <4 x float> %143, %22 ; <<4 x float>>:144 [#uses=1] + mul <4 x float> %144, %23 ; <<4 x float>>:145 [#uses=1] + mul <4 x float> %145, %24 ; <<4 x float>>:146 [#uses=1] + mul <4 x float> %146, %25 ; <<4 x float>>:147 [#uses=1] + mul <4 x float> %147, %26 ; <<4 x float>>:148 [#uses=1] + mul <4 x float> %148, %27 ; <<4 x float>>:149 [#uses=1] + mul <4 x float> %149, %28 ; <<4 x float>>:150 [#uses=1] + mul <4 x float> %150, %29 ; <<4 x float>>:151 [#uses=1] + mul <4 x float> %151, %30 ; <<4 x float>>:152 [#uses=1] + mul <4 x float> %152, %31 ; <<4 x float>>:153 [#uses=1] + mul <4 x float> %153, %32 ; <<4 x float>>:154 [#uses=1] + mul <4 x float> %5, %5 ; <<4 x float>>:155 [#uses=1] + mul <4 x float> %155, %6 ; <<4 x float>>:156 [#uses=1] + mul <4 x float> %156, %7 ; <<4 x float>>:157 [#uses=1] + mul <4 x float> %157, %8 ; <<4 x float>>:158 [#uses=1] + mul <4 x float> %158, %9 ; <<4 x float>>:159 [#uses=1] + mul <4 x float> %159, %10 ; <<4 x float>>:160 [#uses=1] + mul <4 x float> %160, %11 ; <<4 x float>>:161 [#uses=1] + mul <4 x float> %161, %12 ; <<4 x float>>:162 [#uses=1] + mul <4 x float> %162, %13 ; <<4 x float>>:163 [#uses=1] + mul <4 x float> %163, %14 ; <<4 x float>>:164 [#uses=1] + mul <4 x float> %164, %15 ; <<4 x float>>:165 [#uses=1] + mul <4 x float> %165, %16 ; <<4 x float>>:166 [#uses=1] + mul <4 x float> %166, %17 ; <<4 x float>>:167 [#uses=1] + mul <4 x float> %167, %18 ; <<4 x float>>:168 [#uses=1] + mul <4 x float> %168, %19 ; <<4 x float>>:169 [#uses=1] + mul <4 x float> %169, %20 ; <<4 x float>>:170 [#uses=1] + mul <4 x float> %170, %21 ; <<4 x float>>:171 [#uses=1] + mul <4 x float> %171, %22 ; <<4 x float>>:172 [#uses=1] + mul <4 x float> %172, %23 ; <<4 x float>>:173 [#uses=1] + mul <4 x float> %173, %24 ; <<4 x float>>:174 [#uses=1] + mul <4 x float> %174, %25 ; <<4 x float>>:175 [#uses=1] + mul <4 x float> %175, %26 ; <<4 x float>>:176 [#uses=1] + mul <4 x float> %176, %27 ; <<4 x float>>:177 [#uses=1] + mul <4 x float> %177, %28 ; <<4 x float>>:178 [#uses=1] + mul <4 x float> %178, %29 ; <<4 x float>>:179 [#uses=1] + mul <4 x float> %179, %30 ; <<4 x float>>:180 [#uses=1] + mul <4 x float> %180, %31 ; <<4 x float>>:181 [#uses=1] + mul <4 x float> %181, %32 ; <<4 x float>>:182 [#uses=1] + mul <4 x float> %6, %6 ; <<4 x float>>:183 [#uses=1] + mul <4 x float> %183, %7 ; <<4 x float>>:184 [#uses=1] + mul <4 x float> %184, %8 ; <<4 x float>>:185 [#uses=1] + mul <4 x float> %185, %9 ; <<4 x float>>:186 [#uses=1] + mul <4 x float> %186, %10 ; <<4 x float>>:187 [#uses=1] + mul <4 x float> %187, %11 ; <<4 x float>>:188 [#uses=1] + mul <4 x float> %188, %12 ; <<4 x float>>:189 [#uses=1] + mul <4 x float> %189, %13 ; <<4 x float>>:190 [#uses=1] + mul <4 x float> %190, %14 ; <<4 x float>>:191 [#uses=1] + mul <4 x float> %191, %15 ; <<4 x float>>:192 [#uses=1] + mul <4 x float> %192, %16 ; <<4 x float>>:193 [#uses=1] + mul <4 x float> %193, %17 ; <<4 x float>>:194 [#uses=1] + mul <4 x float> %194, %18 ; <<4 x float>>:195 [#uses=1] + mul <4 x float> %195, %19 ; <<4 x float>>:196 [#uses=1] + mul <4 x float> %196, %20 ; <<4 x float>>:197 [#uses=1] + mul <4 x float> %197, %21 ; <<4 x float>>:198 [#uses=1] + mul <4 x float> %198, %22 ; <<4 x float>>:199 [#uses=1] + mul <4 x float> %199, %23 ; <<4 x float>>:200 [#uses=1] + mul <4 x float> %200, %24 ; <<4 x float>>:201 [#uses=1] + mul <4 x float> %201, %25 ; <<4 x float>>:202 [#uses=1] + mul <4 x float> %202, %26 ; <<4 x float>>:203 [#uses=1] + mul <4 x float> %203, %27 ; <<4 x float>>:204 [#uses=1] + mul <4 x float> %204, %28 ; <<4 x float>>:205 [#uses=1] + mul <4 x float> %205, %29 ; <<4 x float>>:206 [#uses=1] + mul <4 x float> %206, %30 ; <<4 x float>>:207 [#uses=1] + mul <4 x float> %207, %31 ; <<4 x float>>:208 [#uses=1] + mul <4 x float> %208, %32 ; <<4 x float>>:209 [#uses=1] + mul <4 x float> %7, %7 ; <<4 x float>>:210 [#uses=1] + mul <4 x float> %210, %8 ; <<4 x float>>:211 [#uses=1] + mul <4 x float> %211, %9 ; <<4 x float>>:212 [#uses=1] + mul <4 x float> %212, %10 ; <<4 x float>>:213 [#uses=1] + mul <4 x float> %213, %11 ; <<4 x float>>:214 [#uses=1] + mul <4 x float> %214, %12 ; <<4 x float>>:215 [#uses=1] + mul <4 x float> %215, %13 ; <<4 x float>>:216 [#uses=1] + mul <4 x float> %216, %14 ; <<4 x float>>:217 [#uses=1] + mul <4 x float> %217, %15 ; <<4 x float>>:218 [#uses=1] + mul <4 x float> %218, %16 ; <<4 x float>>:219 [#uses=1] + mul <4 x float> %219, %17 ; <<4 x float>>:220 [#uses=1] + mul <4 x float> %220, %18 ; <<4 x float>>:221 [#uses=1] + mul <4 x float> %221, %19 ; <<4 x float>>:222 [#uses=1] + mul <4 x float> %222, %20 ; <<4 x float>>:223 [#uses=1] + mul <4 x float> %223, %21 ; <<4 x float>>:224 [#uses=1] + mul <4 x float> %224, %22 ; <<4 x float>>:225 [#uses=1] + mul <4 x float> %225, %23 ; <<4 x float>>:226 [#uses=1] + mul <4 x float> %226, %24 ; <<4 x float>>:227 [#uses=1] + mul <4 x float> %227, %25 ; <<4 x float>>:228 [#uses=1] + mul <4 x float> %228, %26 ; <<4 x float>>:229 [#uses=1] + mul <4 x float> %229, %27 ; <<4 x float>>:230 [#uses=1] + mul <4 x float> %230, %28 ; <<4 x float>>:231 [#uses=1] + mul <4 x float> %231, %29 ; <<4 x float>>:232 [#uses=1] + mul <4 x float> %232, %30 ; <<4 x float>>:233 [#uses=1] + mul <4 x float> %233, %31 ; <<4 x float>>:234 [#uses=1] + mul <4 x float> %234, %32 ; <<4 x float>>:235 [#uses=1] + mul <4 x float> %8, %8 ; <<4 x float>>:236 [#uses=1] + mul <4 x float> %236, %9 ; <<4 x float>>:237 [#uses=1] + mul <4 x float> %237, %10 ; <<4 x float>>:238 [#uses=1] + mul <4 x float> %238, %11 ; <<4 x float>>:239 [#uses=1] + mul <4 x float> %239, %12 ; <<4 x float>>:240 [#uses=1] + mul <4 x float> %240, %13 ; <<4 x float>>:241 [#uses=1] + mul <4 x float> %241, %14 ; <<4 x float>>:242 [#uses=1] + mul <4 x float> %242, %15 ; <<4 x float>>:243 [#uses=1] + mul <4 x float> %243, %16 ; <<4 x float>>:244 [#uses=1] + mul <4 x float> %244, %17 ; <<4 x float>>:245 [#uses=1] + mul <4 x float> %245, %18 ; <<4 x float>>:246 [#uses=1] + mul <4 x float> %246, %19 ; <<4 x float>>:247 [#uses=1] + mul <4 x float> %247, %20 ; <<4 x float>>:248 [#uses=1] + mul <4 x float> %248, %21 ; <<4 x float>>:249 [#uses=1] + mul <4 x float> %249, %22 ; <<4 x float>>:250 [#uses=1] + mul <4 x float> %250, %23 ; <<4 x float>>:251 [#uses=1] + mul <4 x float> %251, %24 ; <<4 x float>>:252 [#uses=1] + mul <4 x float> %252, %25 ; <<4 x float>>:253 [#uses=1] + mul <4 x float> %253, %26 ; <<4 x float>>:254 [#uses=1] + mul <4 x float> %254, %27 ; <<4 x float>>:255 [#uses=1] + mul <4 x float> %255, %28 ; <<4 x float>>:256 [#uses=1] + mul <4 x float> %256, %29 ; <<4 x float>>:257 [#uses=1] + mul <4 x float> %257, %30 ; <<4 x float>>:258 [#uses=1] + mul <4 x float> %258, %31 ; <<4 x float>>:259 [#uses=1] + mul <4 x float> %259, %32 ; <<4 x float>>:260 [#uses=1] + mul <4 x float> %9, %9 ; <<4 x float>>:261 [#uses=1] + mul <4 x float> %261, %10 ; <<4 x float>>:262 [#uses=1] + mul <4 x float> %262, %11 ; <<4 x float>>:263 [#uses=1] + mul <4 x float> %263, %12 ; <<4 x float>>:264 [#uses=1] + mul <4 x float> %264, %13 ; <<4 x float>>:265 [#uses=1] + mul <4 x float> %265, %14 ; <<4 x float>>:266 [#uses=1] + mul <4 x float> %266, %15 ; <<4 x float>>:267 [#uses=1] + mul <4 x float> %267, %16 ; <<4 x float>>:268 [#uses=1] + mul <4 x float> %268, %17 ; <<4 x float>>:269 [#uses=1] + mul <4 x float> %269, %18 ; <<4 x float>>:270 [#uses=1] + mul <4 x float> %270, %19 ; <<4 x float>>:271 [#uses=1] + mul <4 x float> %271, %20 ; <<4 x float>>:272 [#uses=1] + mul <4 x float> %272, %21 ; <<4 x float>>:273 [#uses=1] + mul <4 x float> %273, %22 ; <<4 x float>>:274 [#uses=1] + mul <4 x float> %274, %23 ; <<4 x float>>:275 [#uses=1] + mul <4 x float> %275, %24 ; <<4 x float>>:276 [#uses=1] + mul <4 x float> %276, %25 ; <<4 x float>>:277 [#uses=1] + mul <4 x float> %277, %26 ; <<4 x float>>:278 [#uses=1] + mul <4 x float> %278, %27 ; <<4 x float>>:279 [#uses=1] + mul <4 x float> %279, %28 ; <<4 x float>>:280 [#uses=1] + mul <4 x float> %280, %29 ; <<4 x float>>:281 [#uses=1] + mul <4 x float> %281, %30 ; <<4 x float>>:282 [#uses=1] + mul <4 x float> %282, %31 ; <<4 x float>>:283 [#uses=1] + mul <4 x float> %283, %32 ; <<4 x float>>:284 [#uses=1] + mul <4 x float> %10, %10 ; <<4 x float>>:285 [#uses=1] + mul <4 x float> %285, %11 ; <<4 x float>>:286 [#uses=1] + mul <4 x float> %286, %12 ; <<4 x float>>:287 [#uses=1] + mul <4 x float> %287, %13 ; <<4 x float>>:288 [#uses=1] + mul <4 x float> %288, %14 ; <<4 x float>>:289 [#uses=1] + mul <4 x float> %289, %15 ; <<4 x float>>:290 [#uses=1] + mul <4 x float> %290, %16 ; <<4 x float>>:291 [#uses=1] + mul <4 x float> %291, %17 ; <<4 x float>>:292 [#uses=1] + mul <4 x float> %292, %18 ; <<4 x float>>:293 [#uses=1] + mul <4 x float> %293, %19 ; <<4 x float>>:294 [#uses=1] + mul <4 x float> %294, %20 ; <<4 x float>>:295 [#uses=1] + mul <4 x float> %295, %21 ; <<4 x float>>:296 [#uses=1] + mul <4 x float> %296, %22 ; <<4 x float>>:297 [#uses=1] + mul <4 x float> %297, %23 ; <<4 x float>>:298 [#uses=1] + mul <4 x float> %298, %24 ; <<4 x float>>:299 [#uses=1] + mul <4 x float> %299, %25 ; <<4 x float>>:300 [#uses=1] + mul <4 x float> %300, %26 ; <<4 x float>>:301 [#uses=1] + mul <4 x float> %301, %27 ; <<4 x float>>:302 [#uses=1] + mul <4 x float> %302, %28 ; <<4 x float>>:303 [#uses=1] + mul <4 x float> %303, %29 ; <<4 x float>>:304 [#uses=1] + mul <4 x float> %304, %30 ; <<4 x float>>:305 [#uses=1] + mul <4 x float> %305, %31 ; <<4 x float>>:306 [#uses=1] + mul <4 x float> %306, %32 ; <<4 x float>>:307 [#uses=1] + mul <4 x float> %11, %11 ; <<4 x float>>:308 [#uses=1] + mul <4 x float> %308, %12 ; <<4 x float>>:309 [#uses=1] + mul <4 x float> %309, %13 ; <<4 x float>>:310 [#uses=1] + mul <4 x float> %310, %14 ; <<4 x float>>:311 [#uses=1] + mul <4 x float> %311, %15 ; <<4 x float>>:312 [#uses=1] + mul <4 x float> %312, %16 ; <<4 x float>>:313 [#uses=1] + mul <4 x float> %313, %17 ; <<4 x float>>:314 [#uses=1] + mul <4 x float> %314, %18 ; <<4 x float>>:315 [#uses=1] + mul <4 x float> %315, %19 ; <<4 x float>>:316 [#uses=1] + mul <4 x float> %316, %20 ; <<4 x float>>:317 [#uses=1] + mul <4 x float> %317, %21 ; <<4 x float>>:318 [#uses=1] + mul <4 x float> %318, %22 ; <<4 x float>>:319 [#uses=1] + mul <4 x float> %319, %23 ; <<4 x float>>:320 [#uses=1] + mul <4 x float> %320, %24 ; <<4 x float>>:321 [#uses=1] + mul <4 x float> %321, %25 ; <<4 x float>>:322 [#uses=1] + mul <4 x float> %322, %26 ; <<4 x float>>:323 [#uses=1] + mul <4 x float> %323, %27 ; <<4 x float>>:324 [#uses=1] + mul <4 x float> %324, %28 ; <<4 x float>>:325 [#uses=1] + mul <4 x float> %325, %29 ; <<4 x float>>:326 [#uses=1] + mul <4 x float> %326, %30 ; <<4 x float>>:327 [#uses=1] + mul <4 x float> %327, %31 ; <<4 x float>>:328 [#uses=1] + mul <4 x float> %328, %32 ; <<4 x float>>:329 [#uses=1] + mul <4 x float> %12, %12 ; <<4 x float>>:330 [#uses=1] + mul <4 x float> %330, %13 ; <<4 x float>>:331 [#uses=1] + mul <4 x float> %331, %14 ; <<4 x float>>:332 [#uses=1] + mul <4 x float> %332, %15 ; <<4 x float>>:333 [#uses=1] + mul <4 x float> %333, %16 ; <<4 x float>>:334 [#uses=1] + mul <4 x float> %334, %17 ; <<4 x float>>:335 [#uses=1] + mul <4 x float> %335, %18 ; <<4 x float>>:336 [#uses=1] + mul <4 x float> %336, %19 ; <<4 x float>>:337 [#uses=1] + mul <4 x float> %337, %20 ; <<4 x float>>:338 [#uses=1] + mul <4 x float> %338, %21 ; <<4 x float>>:339 [#uses=1] + mul <4 x float> %339, %22 ; <<4 x float>>:340 [#uses=1] + mul <4 x float> %340, %23 ; <<4 x float>>:341 [#uses=1] + mul <4 x float> %341, %24 ; <<4 x float>>:342 [#uses=1] + mul <4 x float> %342, %25 ; <<4 x float>>:343 [#uses=1] + mul <4 x float> %343, %26 ; <<4 x float>>:344 [#uses=1] + mul <4 x float> %344, %27 ; <<4 x float>>:345 [#uses=1] + mul <4 x float> %345, %28 ; <<4 x float>>:346 [#uses=1] + mul <4 x float> %346, %29 ; <<4 x float>>:347 [#uses=1] + mul <4 x float> %347, %30 ; <<4 x float>>:348 [#uses=1] + mul <4 x float> %348, %31 ; <<4 x float>>:349 [#uses=1] + mul <4 x float> %349, %32 ; <<4 x float>>:350 [#uses=1] + mul <4 x float> %13, %13 ; <<4 x float>>:351 [#uses=1] + mul <4 x float> %351, %14 ; <<4 x float>>:352 [#uses=1] + mul <4 x float> %352, %15 ; <<4 x float>>:353 [#uses=1] + mul <4 x float> %353, %16 ; <<4 x float>>:354 [#uses=1] + mul <4 x float> %354, %17 ; <<4 x float>>:355 [#uses=1] + mul <4 x float> %355, %18 ; <<4 x float>>:356 [#uses=1] + mul <4 x float> %356, %19 ; <<4 x float>>:357 [#uses=1] + mul <4 x float> %357, %20 ; <<4 x float>>:358 [#uses=1] + mul <4 x float> %358, %21 ; <<4 x float>>:359 [#uses=1] + mul <4 x float> %359, %22 ; <<4 x float>>:360 [#uses=1] + mul <4 x float> %360, %23 ; <<4 x float>>:361 [#uses=1] + mul <4 x float> %361, %24 ; <<4 x float>>:362 [#uses=1] + mul <4 x float> %362, %25 ; <<4 x float>>:363 [#uses=1] + mul <4 x float> %363, %26 ; <<4 x float>>:364 [#uses=1] + mul <4 x float> %364, %27 ; <<4 x float>>:365 [#uses=1] + mul <4 x float> %365, %28 ; <<4 x float>>:366 [#uses=1] + mul <4 x float> %366, %29 ; <<4 x float>>:367 [#uses=1] + mul <4 x float> %367, %30 ; <<4 x float>>:368 [#uses=1] + mul <4 x float> %368, %31 ; <<4 x float>>:369 [#uses=1] + mul <4 x float> %369, %32 ; <<4 x float>>:370 [#uses=1] + mul <4 x float> %14, %14 ; <<4 x float>>:371 [#uses=1] + mul <4 x float> %371, %15 ; <<4 x float>>:372 [#uses=1] + mul <4 x float> %372, %16 ; <<4 x float>>:373 [#uses=1] + mul <4 x float> %373, %17 ; <<4 x float>>:374 [#uses=1] + mul <4 x float> %374, %18 ; <<4 x float>>:375 [#uses=1] + mul <4 x float> %375, %19 ; <<4 x float>>:376 [#uses=1] + mul <4 x float> %376, %20 ; <<4 x float>>:377 [#uses=1] + mul <4 x float> %377, %21 ; <<4 x float>>:378 [#uses=1] + mul <4 x float> %378, %22 ; <<4 x float>>:379 [#uses=1] + mul <4 x float> %379, %23 ; <<4 x float>>:380 [#uses=1] + mul <4 x float> %380, %24 ; <<4 x float>>:381 [#uses=1] + mul <4 x float> %381, %25 ; <<4 x float>>:382 [#uses=1] + mul <4 x float> %382, %26 ; <<4 x float>>:383 [#uses=1] + mul <4 x float> %383, %27 ; <<4 x float>>:384 [#uses=1] + mul <4 x float> %384, %28 ; <<4 x float>>:385 [#uses=1] + mul <4 x float> %385, %29 ; <<4 x float>>:386 [#uses=1] + mul <4 x float> %386, %30 ; <<4 x float>>:387 [#uses=1] + mul <4 x float> %387, %31 ; <<4 x float>>:388 [#uses=1] + mul <4 x float> %388, %32 ; <<4 x float>>:389 [#uses=1] + mul <4 x float> %15, %15 ; <<4 x float>>:390 [#uses=1] + mul <4 x float> %390, %16 ; <<4 x float>>:391 [#uses=1] + mul <4 x float> %391, %17 ; <<4 x float>>:392 [#uses=1] + mul <4 x float> %392, %18 ; <<4 x float>>:393 [#uses=1] + mul <4 x float> %393, %19 ; <<4 x float>>:394 [#uses=1] + mul <4 x float> %394, %20 ; <<4 x float>>:395 [#uses=1] + mul <4 x float> %395, %21 ; <<4 x float>>:396 [#uses=1] + mul <4 x float> %396, %22 ; <<4 x float>>:397 [#uses=1] + mul <4 x float> %397, %23 ; <<4 x float>>:398 [#uses=1] + mul <4 x float> %398, %24 ; <<4 x float>>:399 [#uses=1] + mul <4 x float> %399, %25 ; <<4 x float>>:400 [#uses=1] + mul <4 x float> %400, %26 ; <<4 x float>>:401 [#uses=1] + mul <4 x float> %401, %27 ; <<4 x float>>:402 [#uses=1] + mul <4 x float> %402, %28 ; <<4 x float>>:403 [#uses=1] + mul <4 x float> %403, %29 ; <<4 x float>>:404 [#uses=1] + mul <4 x float> %404, %30 ; <<4 x float>>:405 [#uses=1] + mul <4 x float> %405, %31 ; <<4 x float>>:406 [#uses=1] + mul <4 x float> %406, %32 ; <<4 x float>>:407 [#uses=1] + mul <4 x float> %16, %16 ; <<4 x float>>:408 [#uses=1] + mul <4 x float> %408, %17 ; <<4 x float>>:409 [#uses=1] + mul <4 x float> %409, %18 ; <<4 x float>>:410 [#uses=1] + mul <4 x float> %410, %19 ; <<4 x float>>:411 [#uses=1] + mul <4 x float> %411, %20 ; <<4 x float>>:412 [#uses=1] + mul <4 x float> %412, %21 ; <<4 x float>>:413 [#uses=1] + mul <4 x float> %413, %22 ; <<4 x float>>:414 [#uses=1] + mul <4 x float> %414, %23 ; <<4 x float>>:415 [#uses=1] + mul <4 x float> %415, %24 ; <<4 x float>>:416 [#uses=1] + mul <4 x float> %416, %25 ; <<4 x float>>:417 [#uses=1] + mul <4 x float> %417, %26 ; <<4 x float>>:418 [#uses=1] + mul <4 x float> %418, %27 ; <<4 x float>>:419 [#uses=1] + mul <4 x float> %419, %28 ; <<4 x float>>:420 [#uses=1] + mul <4 x float> %420, %29 ; <<4 x float>>:421 [#uses=1] + mul <4 x float> %421, %30 ; <<4 x float>>:422 [#uses=1] + mul <4 x float> %422, %31 ; <<4 x float>>:423 [#uses=1] + mul <4 x float> %423, %32 ; <<4 x float>>:424 [#uses=1] + mul <4 x float> %17, %17 ; <<4 x float>>:425 [#uses=1] + mul <4 x float> %425, %18 ; <<4 x float>>:426 [#uses=1] + mul <4 x float> %426, %19 ; <<4 x float>>:427 [#uses=1] + mul <4 x float> %427, %20 ; <<4 x float>>:428 [#uses=1] + mul <4 x float> %428, %21 ; <<4 x float>>:429 [#uses=1] + mul <4 x float> %429, %22 ; <<4 x float>>:430 [#uses=1] + mul <4 x float> %430, %23 ; <<4 x float>>:431 [#uses=1] + mul <4 x float> %431, %24 ; <<4 x float>>:432 [#uses=1] + mul <4 x float> %432, %25 ; <<4 x float>>:433 [#uses=1] + mul <4 x float> %433, %26 ; <<4 x float>>:434 [#uses=1] + mul <4 x float> %434, %27 ; <<4 x float>>:435 [#uses=1] + mul <4 x float> %435, %28 ; <<4 x float>>:436 [#uses=1] + mul <4 x float> %436, %29 ; <<4 x float>>:437 [#uses=1] + mul <4 x float> %437, %30 ; <<4 x float>>:438 [#uses=1] + mul <4 x float> %438, %31 ; <<4 x float>>:439 [#uses=1] + mul <4 x float> %439, %32 ; <<4 x float>>:440 [#uses=1] + mul <4 x float> %18, %18 ; <<4 x float>>:441 [#uses=1] + mul <4 x float> %441, %19 ; <<4 x float>>:442 [#uses=1] + mul <4 x float> %442, %20 ; <<4 x float>>:443 [#uses=1] + mul <4 x float> %443, %21 ; <<4 x float>>:444 [#uses=1] + mul <4 x float> %444, %22 ; <<4 x float>>:445 [#uses=1] + mul <4 x float> %445, %23 ; <<4 x float>>:446 [#uses=1] + mul <4 x float> %446, %24 ; <<4 x float>>:447 [#uses=1] + mul <4 x float> %447, %25 ; <<4 x float>>:448 [#uses=1] + mul <4 x float> %448, %26 ; <<4 x float>>:449 [#uses=1] + mul <4 x float> %449, %27 ; <<4 x float>>:450 [#uses=1] + mul <4 x float> %450, %28 ; <<4 x float>>:451 [#uses=1] + mul <4 x float> %451, %29 ; <<4 x float>>:452 [#uses=1] + mul <4 x float> %452, %30 ; <<4 x float>>:453 [#uses=1] + mul <4 x float> %453, %31 ; <<4 x float>>:454 [#uses=1] + mul <4 x float> %454, %32 ; <<4 x float>>:455 [#uses=1] + mul <4 x float> %19, %19 ; <<4 x float>>:456 [#uses=1] + mul <4 x float> %456, %20 ; <<4 x float>>:457 [#uses=1] + mul <4 x float> %457, %21 ; <<4 x float>>:458 [#uses=1] + mul <4 x float> %458, %22 ; <<4 x float>>:459 [#uses=1] + mul <4 x float> %459, %23 ; <<4 x float>>:460 [#uses=1] + mul <4 x float> %460, %24 ; <<4 x float>>:461 [#uses=1] + mul <4 x float> %461, %25 ; <<4 x float>>:462 [#uses=1] + mul <4 x float> %462, %26 ; <<4 x float>>:463 [#uses=1] + mul <4 x float> %463, %27 ; <<4 x float>>:464 [#uses=1] + mul <4 x float> %464, %28 ; <<4 x float>>:465 [#uses=1] + mul <4 x float> %465, %29 ; <<4 x float>>:466 [#uses=1] + mul <4 x float> %466, %30 ; <<4 x float>>:467 [#uses=1] + mul <4 x float> %467, %31 ; <<4 x float>>:468 [#uses=1] + mul <4 x float> %468, %32 ; <<4 x float>>:469 [#uses=1] + mul <4 x float> %20, %20 ; <<4 x float>>:470 [#uses=1] + mul <4 x float> %470, %21 ; <<4 x float>>:471 [#uses=1] + mul <4 x float> %471, %22 ; <<4 x float>>:472 [#uses=1] + mul <4 x float> %472, %23 ; <<4 x float>>:473 [#uses=1] + mul <4 x float> %473, %24 ; <<4 x float>>:474 [#uses=1] + mul <4 x float> %474, %25 ; <<4 x float>>:475 [#uses=1] + mul <4 x float> %475, %26 ; <<4 x float>>:476 [#uses=1] + mul <4 x float> %476, %27 ; <<4 x float>>:477 [#uses=1] + mul <4 x float> %477, %28 ; <<4 x float>>:478 [#uses=1] + mul <4 x float> %478, %29 ; <<4 x float>>:479 [#uses=1] + mul <4 x float> %479, %30 ; <<4 x float>>:480 [#uses=1] + mul <4 x float> %480, %31 ; <<4 x float>>:481 [#uses=1] + mul <4 x float> %481, %32 ; <<4 x float>>:482 [#uses=1] + mul <4 x float> %21, %21 ; <<4 x float>>:483 [#uses=1] + mul <4 x float> %483, %22 ; <<4 x float>>:484 [#uses=1] + mul <4 x float> %484, %23 ; <<4 x float>>:485 [#uses=1] + mul <4 x float> %485, %24 ; <<4 x float>>:486 [#uses=1] + mul <4 x float> %486, %25 ; <<4 x float>>:487 [#uses=1] + mul <4 x float> %487, %26 ; <<4 x float>>:488 [#uses=1] + mul <4 x float> %488, %27 ; <<4 x float>>:489 [#uses=1] + mul <4 x float> %489, %28 ; <<4 x float>>:490 [#uses=1] + mul <4 x float> %490, %29 ; <<4 x float>>:491 [#uses=1] + mul <4 x float> %491, %30 ; <<4 x float>>:492 [#uses=1] + mul <4 x float> %492, %31 ; <<4 x float>>:493 [#uses=1] + mul <4 x float> %493, %32 ; <<4 x float>>:494 [#uses=1] + mul <4 x float> %22, %22 ; <<4 x float>>:495 [#uses=1] + mul <4 x float> %495, %23 ; <<4 x float>>:496 [#uses=1] + mul <4 x float> %496, %24 ; <<4 x float>>:497 [#uses=1] + mul <4 x float> %497, %25 ; <<4 x float>>:498 [#uses=1] + mul <4 x float> %498, %26 ; <<4 x float>>:499 [#uses=1] + mul <4 x float> %499, %27 ; <<4 x float>>:500 [#uses=1] + mul <4 x float> %500, %28 ; <<4 x float>>:501 [#uses=1] + mul <4 x float> %501, %29 ; <<4 x float>>:502 [#uses=1] + mul <4 x float> %502, %30 ; <<4 x float>>:503 [#uses=1] + mul <4 x float> %503, %31 ; <<4 x float>>:504 [#uses=1] + mul <4 x float> %504, %32 ; <<4 x float>>:505 [#uses=1] + mul <4 x float> %23, %23 ; <<4 x float>>:506 [#uses=1] + mul <4 x float> %506, %24 ; <<4 x float>>:507 [#uses=1] + mul <4 x float> %507, %25 ; <<4 x float>>:508 [#uses=1] + mul <4 x float> %508, %26 ; <<4 x float>>:509 [#uses=1] + mul <4 x float> %509, %27 ; <<4 x float>>:510 [#uses=1] + mul <4 x float> %510, %28 ; <<4 x float>>:511 [#uses=1] + mul <4 x float> %511, %29 ; <<4 x float>>:512 [#uses=1] + mul <4 x float> %512, %30 ; <<4 x float>>:513 [#uses=1] + mul <4 x float> %513, %31 ; <<4 x float>>:514 [#uses=1] + mul <4 x float> %514, %32 ; <<4 x float>>:515 [#uses=1] + mul <4 x float> %24, %24 ; <<4 x float>>:516 [#uses=1] + mul <4 x float> %516, %25 ; <<4 x float>>:517 [#uses=1] + mul <4 x float> %517, %26 ; <<4 x float>>:518 [#uses=1] + mul <4 x float> %518, %27 ; <<4 x float>>:519 [#uses=1] + mul <4 x float> %519, %28 ; <<4 x float>>:520 [#uses=1] + mul <4 x float> %520, %29 ; <<4 x float>>:521 [#uses=1] + mul <4 x float> %521, %30 ; <<4 x float>>:522 [#uses=1] + mul <4 x float> %522, %31 ; <<4 x float>>:523 [#uses=1] + mul <4 x float> %523, %32 ; <<4 x float>>:524 [#uses=1] + mul <4 x float> %25, %25 ; <<4 x float>>:525 [#uses=1] + mul <4 x float> %525, %26 ; <<4 x float>>:526 [#uses=1] + mul <4 x float> %526, %27 ; <<4 x float>>:527 [#uses=1] + mul <4 x float> %527, %28 ; <<4 x float>>:528 [#uses=1] + mul <4 x float> %528, %29 ; <<4 x float>>:529 [#uses=1] + mul <4 x float> %529, %30 ; <<4 x float>>:530 [#uses=1] + mul <4 x float> %530, %31 ; <<4 x float>>:531 [#uses=1] + mul <4 x float> %531, %32 ; <<4 x float>>:532 [#uses=1] + mul <4 x float> %26, %26 ; <<4 x float>>:533 [#uses=1] + mul <4 x float> %533, %27 ; <<4 x float>>:534 [#uses=1] + mul <4 x float> %534, %28 ; <<4 x float>>:535 [#uses=1] + mul <4 x float> %535, %29 ; <<4 x float>>:536 [#uses=1] + mul <4 x float> %536, %30 ; <<4 x float>>:537 [#uses=1] + mul <4 x float> %537, %31 ; <<4 x float>>:538 [#uses=1] + mul <4 x float> %538, %32 ; <<4 x float>>:539 [#uses=1] + mul <4 x float> %27, %27 ; <<4 x float>>:540 [#uses=1] + mul <4 x float> %540, %28 ; <<4 x float>>:541 [#uses=1] + mul <4 x float> %541, %29 ; <<4 x float>>:542 [#uses=1] + mul <4 x float> %542, %30 ; <<4 x float>>:543 [#uses=1] + mul <4 x float> %543, %31 ; <<4 x float>>:544 [#uses=1] + mul <4 x float> %544, %32 ; <<4 x float>>:545 [#uses=1] + mul <4 x float> %28, %28 ; <<4 x float>>:546 [#uses=1] + mul <4 x float> %546, %29 ; <<4 x float>>:547 [#uses=1] + mul <4 x float> %547, %30 ; <<4 x float>>:548 [#uses=1] + mul <4 x float> %548, %31 ; <<4 x float>>:549 [#uses=1] + mul <4 x float> %549, %32 ; <<4 x float>>:550 [#uses=1] + mul <4 x float> %29, %29 ; <<4 x float>>:551 [#uses=1] + mul <4 x float> %551, %30 ; <<4 x float>>:552 [#uses=1] + mul <4 x float> %552, %31 ; <<4 x float>>:553 [#uses=1] + mul <4 x float> %553, %32 ; <<4 x float>>:554 [#uses=1] + mul <4 x float> %30, %30 ; <<4 x float>>:555 [#uses=1] + mul <4 x float> %555, %31 ; <<4 x float>>:556 [#uses=1] + mul <4 x float> %556, %32 ; <<4 x float>>:557 [#uses=1] + mul <4 x float> %31, %31 ; <<4 x float>>:558 [#uses=1] + mul <4 x float> %558, %32 ; <<4 x float>>:559 [#uses=1] + mul <4 x float> %32, %32 ; <<4 x float>>:560 [#uses=1] + add <4 x float> %64, %64 ; <<4 x float>>:561 [#uses=1] + add <4 x float> %561, %64 ; <<4 x float>>:562 [#uses=1] + add <4 x float> %562, %95 ; <<4 x float>>:563 [#uses=1] + add <4 x float> %563, %125 ; <<4 x float>>:564 [#uses=1] + add <4 x float> %564, %154 ; <<4 x float>>:565 [#uses=1] + add <4 x float> %565, %182 ; <<4 x float>>:566 [#uses=1] + add <4 x float> %566, %209 ; <<4 x float>>:567 [#uses=1] + add <4 x float> %567, %235 ; <<4 x float>>:568 [#uses=1] + add <4 x float> %568, %260 ; <<4 x float>>:569 [#uses=1] + add <4 x float> %569, %284 ; <<4 x float>>:570 [#uses=1] + add <4 x float> %570, %307 ; <<4 x float>>:571 [#uses=1] + add <4 x float> %571, %329 ; <<4 x float>>:572 [#uses=1] + add <4 x float> %572, %350 ; <<4 x float>>:573 [#uses=1] + add <4 x float> %573, %370 ; <<4 x float>>:574 [#uses=1] + add <4 x float> %574, %389 ; <<4 x float>>:575 [#uses=1] + add <4 x float> %575, %407 ; <<4 x float>>:576 [#uses=1] + add <4 x float> %576, %424 ; <<4 x float>>:577 [#uses=1] + add <4 x float> %577, %440 ; <<4 x float>>:578 [#uses=1] + add <4 x float> %578, %455 ; <<4 x float>>:579 [#uses=1] + add <4 x float> %579, %469 ; <<4 x float>>:580 [#uses=1] + add <4 x float> %580, %482 ; <<4 x float>>:581 [#uses=1] + add <4 x float> %581, %494 ; <<4 x float>>:582 [#uses=1] + add <4 x float> %582, %505 ; <<4 x float>>:583 [#uses=1] + add <4 x float> %583, %515 ; <<4 x float>>:584 [#uses=1] + add <4 x float> %584, %524 ; <<4 x float>>:585 [#uses=1] + add <4 x float> %585, %532 ; <<4 x float>>:586 [#uses=1] + add <4 x float> %586, %539 ; <<4 x float>>:587 [#uses=1] + add <4 x float> %587, %545 ; <<4 x float>>:588 [#uses=1] + add <4 x float> %588, %550 ; <<4 x float>>:589 [#uses=1] + add <4 x float> %589, %554 ; <<4 x float>>:590 [#uses=1] + add <4 x float> %590, %557 ; <<4 x float>>:591 [#uses=1] + add <4 x float> %591, %559 ; <<4 x float>>:592 [#uses=1] + add <4 x float> %592, %560 ; <<4 x float>>:593 [#uses=1] + store <4 x float> %593, <4 x float>* @0, align 1 + ret void +} From asl at math.spbu.ru Sat Jul 19 06:26:27 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 19 Jul 2008 15:26:27 +0400 Subject: [llvm-commits] [llvm] r53781 - /llvm/branches/Apple/Gaz/tools/lto/LTOModule.cpp In-Reply-To: <200807190116.m6J1GBWC006284@zion.cs.uiuc.edu> References: <200807190116.m6J1GBWC006284@zion.cs.uiuc.edu> Message-ID: <1216466787.3231.73.camel@localhost> Hi, Bill > I found another case like Devang's hasLinkOnceLinkage(). It affects code that > has a tentative definition in llvm bitcode and a reference in mach-o file. Few weeks ago I added isWeakForLinker() helper which is really useful in these cases. :) -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From asl at math.spbu.ru Sat Jul 19 08:14:16 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 19 Jul 2008 13:14:16 -0000 Subject: [llvm-commits] [llvm] r53786 - in /llvm/trunk: include/llvm/Target/ELFTargetAsmInfo.h lib/Target/ELFTargetAsmInfo.cpp Message-ID: <200807191314.m6JDEGot006055@zion.cs.uiuc.edu> Author: asl Date: Sat Jul 19 08:14:11 2008 New Revision: 53786 URL: http://llvm.org/viewvc/llvm-project?rev=53786&view=rev Log: Add TargetAsmInfo for all ELF-based targets Added: llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Added: llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h?rev=53786&view=auto ============================================================================== --- llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h (added) +++ llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h Sat Jul 19 08:14:11 2008 @@ -0,0 +1,38 @@ +//===---- ELFTargetAsmInfo.h - ELF asm properties ---------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines target asm properties related what form asm statements +// should take in general on ELF-based targets +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ELF_TARGET_ASM_INFO_H +#define LLVM_ELF_TARGET_ASM_INFO_H + +#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/Target/TargetMachine.h" + +namespace llvm { + class GlobalValue; + class GlobalVariable; + + class ELFTargetAsmInfo: public TargetAsmInfo { + explicit ELFTargetAsmInfo(const TargetMachine &TM); + + virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const; + virtual std::string PrintSectionFlags(unsigned flags) const; + const Section* MergeableConstSection(const GlobalVariable *GV) const; + const Section* MergeableStringSection(const GlobalVariable *GV) const; + protected: + const TargetMachine* ETM; + }; +} + + +#endif // LLVM_ELF_TARGET_ASM_INFO_H Added: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=53786&view=auto ============================================================================== --- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (added) +++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Sat Jul 19 08:14:11 2008 @@ -0,0 +1,164 @@ +//===-- ELFTargetAsmInfo.cpp - ELF asm properties ---------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines target asm properties related what form asm statements +// should take in general on ELF-based targets +// +//===----------------------------------------------------------------------===// + +#include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" +#include "llvm/Function.h" +#include "llvm/GlobalVariable.h" +#include "llvm/ADT/StringExtras.h" +#include "llvm/Target/ELFTargetAsmInfo.h" +#include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetData.h" + +using namespace llvm; + +ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM) { + ETM = &TM; + + TextSection_ = getUnnamedSection("\t.text", SectionFlags::Code); + DataSection_ = getUnnamedSection("\t.data", SectionFlags::Writeable); + BSSSection_ = getUnnamedSection("\t.bss", + SectionFlags::Writeable | SectionFlags::BSS); + ReadOnlySection_ = getNamedSection("\t.rodata", SectionFlags::None); + TLSDataSection_ = getNamedSection("\t.tdata", + SectionFlags::Writeable | SectionFlags::TLS); + TLSBSSSection_ = getNamedSection("\t.tbss", + SectionFlags::Writeable | SectionFlags::TLS | SectionFlags::BSS); + +} + +const Section* +ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { + SectionKind::Kind Kind = SectionKindForGlobal(GV); + + if (const Function *F = dyn_cast(GV)) { + switch (F->getLinkage()) { + default: assert(0 && "Unknown linkage type!"); + case Function::InternalLinkage: + case Function::DLLExportLinkage: + case Function::ExternalLinkage: + return getTextSection_(); + case Function::WeakLinkage: + case Function::LinkOnceLinkage: + std::string Name = UniqueSectionForGlobal(GV, Kind); + unsigned Flags = SectionFlagsForGlobal(GV, Name.c_str()); + return getNamedSection(Name.c_str(), Flags); + } + } else if (const GlobalVariable *GVar = dyn_cast(GV)) { + if (GVar->isWeakForLinker()) { + std::string Name = UniqueSectionForGlobal(GVar, Kind); + unsigned Flags = SectionFlagsForGlobal(GVar, Name.c_str()); + return getNamedSection(Name.c_str(), Flags); + } else { + switch (Kind) { + case SectionKind::Data: + return getDataSection_(); + case SectionKind::BSS: + // ELF targets usually have BSS sections + return getBSSSection_(); + case SectionKind::ROData: + return getReadOnlySection_(); + case SectionKind::RODataMergeStr: + return MergeableStringSection(GVar); + case SectionKind::RODataMergeConst: + return MergeableConstSection(GVar); + case SectionKind::ThreadData: + // ELF targets usually support TLS stuff + return getTLSDataSection_(); + case SectionKind::ThreadBSS: + return getTLSBSSSection_(); + default: + assert(0 && "Unsuported section kind for global"); + } + } + } else + assert(0 && "Unsupported global"); +} + +const Section* +ELFTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const { + const TargetData *TD = ETM->getTargetData(); + Constant *C = cast(GV)->getInitializer(); + const Type *Type = C->getType(); + + // FIXME: string here is temporary, until stuff will fully land in. + // We cannot use {Four,Eight,Sixteen}ByteConstantSection here, since it's + // currently directly used by asmprinter. + unsigned Size = TD->getABITypeSize(Type); + if (Size == 4 || Size == 8 || Size == 16) { + std::string Name = ".rodata.cst" + utostr(Size); + + return getNamedSection(Name.c_str(), + SectionFlags::setEntitySize(SectionFlags::Mergeable, + Size)); + } + + return getReadOnlySection_(); +} + +const Section* +ELFTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const { + const TargetData *TD = ETM->getTargetData(); + Constant *C = cast(GV)->getInitializer(); + const ConstantArray *CVA = cast(C); + const Type *Type = CVA->getType()->getElementType(); + + unsigned Size = TD->getABITypeSize(Type); + if (Size <= 16) { + // We also need alignment here + const TargetData *TD = ETM->getTargetData(); + unsigned Align = TD->getPreferredAlignment(GV); + if (Align < Size) + Align = Size; + + std::string Name = getCStringSection() + utostr(Size) + '.' + utostr(Align); + unsigned Flags = SectionFlags::setEntitySize(SectionFlags::Mergeable | + SectionFlags::Strings, + Size); + return getNamedSection(Name.c_str(), Flags); + } + + return getReadOnlySection_(); +} + +std::string ELFTargetAsmInfo::PrintSectionFlags(unsigned flags) const { + std::string Flags = ",\""; + + if (!(flags & SectionFlags::Debug)) + Flags += 'a'; + if (flags & SectionFlags::Code) + Flags += 'x'; + if (flags & SectionFlags::Writeable) + Flags += 'w'; + if (flags & SectionFlags::Mergeable) + Flags += 'M'; + if (flags & SectionFlags::Strings) + Flags += 'S'; + if (flags & SectionFlags::TLS) + Flags += 'T'; + + Flags += "\""; + + // FIXME: There can be exceptions here + if (flags & SectionFlags::BSS) + Flags += ", at nobits"; + else + Flags += ", at progbits"; + + if (unsigned entitySize = SectionFlags::getEntitySize(flags)) + Flags += "," + utostr(entitySize); + + return Flags; +} + From asl at math.spbu.ru Sat Jul 19 08:14:46 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 19 Jul 2008 13:14:46 -0000 Subject: [llvm-commits] [llvm] r53787 - in /llvm/trunk: include/llvm/Target/DarwinTargetAsmInfo.h lib/Target/DarwinTargetAsmInfo.cpp Message-ID: <200807191314.m6JDEkiL006080@zion.cs.uiuc.edu> Author: asl Date: Sat Jul 19 08:14:46 2008 New Revision: 53787 URL: http://llvm.org/viewvc/llvm-project?rev=53787&view=rev Log: Add TargetAsmInfo stuff for all darwin-based targets Added: llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Added: llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h?rev=53787&view=auto ============================================================================== --- llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h (added) +++ llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h Sat Jul 19 08:14:46 2008 @@ -0,0 +1,43 @@ +//===---- DarwinTargetAsmInfo.h - Darwin asm properties ---------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines target asm properties related what form asm statements +// should take in general on Darwin-based targets +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ELF_TARGET_ASM_INFO_H +#define LLVM_ELF_TARGET_ASM_INFO_H + +#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/Target/TargetMachine.h" + +namespace llvm { + class GlobalValue; + class GlobalVariable; + + class DarwinTargetAsmInfo: public TargetAsmInfo { + const Section* TextCoalSection; + const Section* ConstDataCoalSection; + const Section* ConstDataSection; + const Section* DataCoalSection; + + explicit DarwinTargetAsmInfo(const TargetMachine &TM); + virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const; + virtual std::string UniqueSectionForGlobal(const GlobalValue* GV, + SectionKind::Kind kind) const; + const Section* MergeableConstSection(const GlobalVariable *GV) const; + const Section* MergeableStringSection(const GlobalVariable *GV) const; + protected: + const TargetMachine* ETM; + }; +} + + +#endif // LLVM_ELF_TARGET_ASM_INFO_H Added: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=53787&view=auto ============================================================================== --- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (added) +++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Sat Jul 19 08:14:46 2008 @@ -0,0 +1,129 @@ +//===-- DarwinTargetAsmInfo.cpp - Darwin asm properties ---------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines target asm properties related what form asm statements +// should take in general on Darwin-based targets +// +//===----------------------------------------------------------------------===// + +#include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" +#include "llvm/Function.h" +#include "llvm/GlobalVariable.h" +#include "llvm/ADT/StringExtras.h" +#include "llvm/Target/DarwinTargetAsmInfo.h" +#include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetData.h" + +using namespace llvm; + +DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM) { + ETM = &TM; + + CStringSection_ = getUnnamedSection("\t.cstring", + SectionFlags::Mergeable | SectionFlags::Strings); + FourByteConstantSection_ = getUnnamedSection("\t.literal4\n", + SectionFlags::Mergeable); + EightByteConstantSection_ = getUnnamedSection("\t.literal8\n", + SectionFlags::Mergeable); + // FIXME: Check for 64 bit + SixteenByteConstantSection_ = getUnnamedSection("\t.literal16\n", + SectionFlags::Mergeable); + ReadOnlySection_ = getUnnamedSection("\t.const\n", SectionFlags::None); + + // FIXME: These should be named sections, really. + TextCoalSection = + getUnnamedSection(".section __TEXT,__textcoal_nt,coalesced,pure_instructions", + SectionFlags::Code); + ConstDataCoalSection = + getUnnamedSection(".section __DATA,__const_coal,coalesced", + SectionFlags::None); + ConstDataSection = getUnnamedSection(".const_data", SectionFlags::None); + DataCoalSection = getUnnamedSection(".section __DATA,__datacoal_nt,coalesced", + SectionFlags::Writeable); +} + +const Section* +DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { + SectionKind::Kind Kind = SectionKindForGlobal(GV); + bool isWeak = GV->isWeakForLinker(); + bool isNonStatic = (ETM->getRelocationModel() != Reloc::Static); + + switch (Kind) { + case SectionKind::Text: + if (isWeak) + return TextCoalSection; + else + return getTextSection_(); + case SectionKind::Data: + case SectionKind::ThreadData: + case SectionKind::BSS: + case SectionKind::ThreadBSS: + if (cast(GV)->isConstant()) + return (isWeak ? ConstDataCoalSection : ConstDataSection); + else + return (isWeak ? DataCoalSection : getDataSection_()); + case SectionKind::ROData: + return (isWeak ? ConstDataCoalSection : + (isNonStatic ? ConstDataSection : getReadOnlySection_())); + case SectionKind::RODataMergeStr: + return (isWeak ? + ConstDataCoalSection : + MergeableStringSection(cast(GV))); + case SectionKind::RODataMergeConst: + return (isWeak ? + ConstDataCoalSection: + MergeableConstSection(cast(GV))); + default: + assert(0 && "Unsuported section kind for global"); + } + + // FIXME: Do we have any extra special weird cases? +} + +const Section* +DarwinTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const { + const TargetData *TD = ETM->getTargetData(); + Constant *C = cast(GV)->getInitializer(); + const Type *Type = cast(C)->getType()->getElementType(); + + unsigned Size = TD->getABITypeSize(Type); + if (Size) { + const TargetData *TD = ETM->getTargetData(); + unsigned Align = TD->getPreferredAlignment(GV); + if (Align <= 32) + return getCStringSection_(); + } + + return getReadOnlySection_(); +} + +const Section* +DarwinTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const { + const TargetData *TD = ETM->getTargetData(); + Constant *C = cast(GV)->getInitializer(); + + unsigned Size = TD->getABITypeSize(C->getType()); + if (Size == 4) + return FourByteConstantSection_; + else if (Size == 8) + return EightByteConstantSection_; + // FIXME: 64 bit + /*else if (Size == 16 && ETM->getSubtarget().is64Bit()) + return SixteenByteConstantSection_;*/ + + return getReadOnlySection_(); +} + +std::string +DarwinTargetAsmInfo::UniqueSectionForGlobal(const GlobalValue* GV, + SectionKind::Kind kind) const { + assert(0 && "Darwin does not use unique sections"); + return ""; +} From asl at math.spbu.ru Sat Jul 19 08:15:22 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 19 Jul 2008 13:15:22 -0000 Subject: [llvm-commits] [llvm] r53788 - in /llvm/trunk: include/llvm/Target/DarwinTargetAsmInfo.h include/llvm/Target/ELFTargetAsmInfo.h lib/Target/DarwinTargetAsmInfo.cpp lib/Target/X86/X86TargetAsmInfo.cpp lib/Target/X86/X86TargetAsmInfo.h Message-ID: <200807191315.m6JDFM1t006115@zion.cs.uiuc.edu> Author: asl Date: Sat Jul 19 08:15:21 2008 New Revision: 53788 URL: http://llvm.org/viewvc/llvm-project?rev=53788&view=rev Log: Use generic ELFTargetAsmInfo and DarwinTargetAsmInfo for X86 code Modified: llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h Modified: llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h?rev=53788&r1=53787&r2=53788&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h (original) +++ llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h Sat Jul 19 08:15:21 2008 @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_ELF_TARGET_ASM_INFO_H -#define LLVM_ELF_TARGET_ASM_INFO_H +#ifndef LLVM_DARWIN_TARGET_ASM_INFO_H +#define LLVM_DARWIN_TARGET_ASM_INFO_H #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetMachine.h" @@ -22,7 +22,7 @@ class GlobalValue; class GlobalVariable; - class DarwinTargetAsmInfo: public TargetAsmInfo { + struct DarwinTargetAsmInfo: public virtual TargetAsmInfo { const Section* TextCoalSection; const Section* ConstDataCoalSection; const Section* ConstDataSection; @@ -35,9 +35,9 @@ const Section* MergeableConstSection(const GlobalVariable *GV) const; const Section* MergeableStringSection(const GlobalVariable *GV) const; protected: - const TargetMachine* ETM; + const TargetMachine* DTM; }; } -#endif // LLVM_ELF_TARGET_ASM_INFO_H +#endif // LLVM_DARWIN_TARGET_ASM_INFO_H Modified: llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h?rev=53788&r1=53787&r2=53788&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h (original) +++ llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h Sat Jul 19 08:15:21 2008 @@ -22,7 +22,7 @@ class GlobalValue; class GlobalVariable; - class ELFTargetAsmInfo: public TargetAsmInfo { + struct ELFTargetAsmInfo: public virtual TargetAsmInfo { explicit ELFTargetAsmInfo(const TargetMachine &TM); virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const; Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=53788&r1=53787&r2=53788&view=diff ============================================================================== --- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Sat Jul 19 08:15:21 2008 @@ -24,7 +24,7 @@ using namespace llvm; DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM) { - ETM = &TM; + DTM = &TM; CStringSection_ = getUnnamedSection("\t.cstring", SectionFlags::Mergeable | SectionFlags::Strings); @@ -53,7 +53,7 @@ DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { SectionKind::Kind Kind = SectionKindForGlobal(GV); bool isWeak = GV->isWeakForLinker(); - bool isNonStatic = (ETM->getRelocationModel() != Reloc::Static); + bool isNonStatic = (DTM->getRelocationModel() != Reloc::Static); switch (Kind) { case SectionKind::Text: @@ -89,13 +89,13 @@ const Section* DarwinTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const { - const TargetData *TD = ETM->getTargetData(); + const TargetData *TD = DTM->getTargetData(); Constant *C = cast(GV)->getInitializer(); const Type *Type = cast(C)->getType()->getElementType(); unsigned Size = TD->getABITypeSize(Type); if (Size) { - const TargetData *TD = ETM->getTargetData(); + const TargetData *TD = DTM->getTargetData(); unsigned Align = TD->getPreferredAlignment(GV); if (Align <= 32) return getCStringSection_(); @@ -106,7 +106,7 @@ const Section* DarwinTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const { - const TargetData *TD = ETM->getTargetData(); + const TargetData *TD = DTM->getTargetData(); Constant *C = cast(GV)->getInitializer(); unsigned Size = TD->getABITypeSize(C->getType()); @@ -115,7 +115,7 @@ else if (Size == 8) return EightByteConstantSection_; // FIXME: 64 bit - /*else if (Size == 16 && ETM->getSubtarget().is64Bit()) + /*else if (Size == 16 && DTM->getSubtarget().is64Bit()) return SixteenByteConstantSection_;*/ return getReadOnlySection_(); Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=53788&r1=53787&r2=53788&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Sat Jul 19 08:15:21 2008 @@ -39,7 +39,6 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) { const X86Subtarget *Subtarget = &TM.getSubtarget(); - X86TM = &TM; AsmTransCBE = x86_asm_table; @@ -75,7 +74,6 @@ return true; } - bool X86TargetAsmInfo::ExpandInlineAsm(CallInst *CI) const { InlineAsm *IA = cast(CI->getCalledValue()); std::vector Constraints = IA->ParseConstraints(); @@ -127,8 +125,8 @@ } X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM): - X86TargetAsmInfo(TM) { - bool is64Bit = X86TM->getSubtarget().is64Bit(); + X86TargetAsmInfo(TM), DarwinTargetAsmInfo(TM) { + bool is64Bit = DTM->getSubtarget().is64Bit(); AlignmentIsInBytes = false; TextAlignFillValue = 0x90; @@ -139,38 +137,19 @@ PrivateGlobalPrefix = "L"; // Marker for constant pool idxs BSSSection = 0; // no BSS section. ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill - if (X86TM->getRelocationModel() != Reloc::Static) + if (DTM->getRelocationModel() != Reloc::Static) ConstantPoolSection = "\t.const_data"; else ConstantPoolSection = "\t.const\n"; JumpTableDataSection = "\t.const\n"; CStringSection = "\t.cstring"; - CStringSection_ = getUnnamedSection("\t.cstring", - SectionFlags::Mergeable | SectionFlags::Strings); FourByteConstantSection = "\t.literal4\n"; - FourByteConstantSection_ = getUnnamedSection("\t.literal4\n", - SectionFlags::Mergeable); EightByteConstantSection = "\t.literal8\n"; - EightByteConstantSection_ = getUnnamedSection("\t.literal8\n", - SectionFlags::Mergeable); // FIXME: Why don't always use this section? if (is64Bit) { SixteenByteConstantSection = "\t.literal16\n"; - SixteenByteConstantSection_ = getUnnamedSection("\t.literal16\n", - SectionFlags::Mergeable); } ReadOnlySection = "\t.const\n"; - ReadOnlySection_ = getUnnamedSection("\t.const\n", SectionFlags::None); - // FIXME: These should be named sections, really. - TextCoalSection = - getUnnamedSection(".section __TEXT,__textcoal_nt,coalesced,pure_instructions", - SectionFlags::Code); - ConstDataCoalSection = - getUnnamedSection(".section __DATA,__const_coal,coalesced", - SectionFlags::None); - ConstDataSection = getUnnamedSection(".const_data", SectionFlags::None); - DataCoalSection = getUnnamedSection(".section __DATA,__datacoal_nt,coalesced", - SectionFlags::Writeable); LCOMMDirective = "\t.lcomm\t"; SwitchToSectionDirective = "\t.section "; @@ -245,97 +224,9 @@ return DW_EH_PE_absptr; } -const Section* -X86DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { - SectionKind::Kind Kind = SectionKindForGlobal(GV); - bool isWeak = GV->isWeakForLinker(); - bool isNonStatic = (X86TM->getRelocationModel() != Reloc::Static); - - switch (Kind) { - case SectionKind::Text: - if (isWeak) - return TextCoalSection; - else - return getTextSection_(); - case SectionKind::Data: - case SectionKind::ThreadData: - case SectionKind::BSS: - case SectionKind::ThreadBSS: - if (cast(GV)->isConstant()) - return (isWeak ? ConstDataCoalSection : ConstDataSection); - else - return (isWeak ? DataCoalSection : getDataSection_()); - case SectionKind::ROData: - return (isWeak ? ConstDataCoalSection : - (isNonStatic ? ConstDataSection : getReadOnlySection_())); - case SectionKind::RODataMergeStr: - return (isWeak ? - ConstDataCoalSection : - MergeableStringSection(cast(GV))); - case SectionKind::RODataMergeConst: - return (isWeak ? - ConstDataCoalSection: - MergeableConstSection(cast(GV))); - default: - assert(0 && "Unsuported section kind for global"); - } - - // FIXME: Do we have any extra special weird cases? -} - -const Section* -X86DarwinTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const { - const TargetData *TD = X86TM->getTargetData(); - Constant *C = cast(GV)->getInitializer(); - const Type *Type = cast(C)->getType()->getElementType(); - - unsigned Size = TD->getABITypeSize(Type); - if (Size) { - const TargetData *TD = X86TM->getTargetData(); - unsigned Align = TD->getPreferredAlignment(GV); - if (Align <= 32) - return getCStringSection_(); - } - - return getReadOnlySection_(); -} - -const Section* -X86DarwinTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const { - const TargetData *TD = X86TM->getTargetData(); - Constant *C = cast(GV)->getInitializer(); - - unsigned Size = TD->getABITypeSize(C->getType()); - if (Size == 4) - return FourByteConstantSection_; - else if (Size == 8) - return EightByteConstantSection_; - else if (Size == 16 && X86TM->getSubtarget().is64Bit()) - return SixteenByteConstantSection_; - - return getReadOnlySection_(); -} - -std::string -X86DarwinTargetAsmInfo::UniqueSectionForGlobal(const GlobalValue* GV, - SectionKind::Kind kind) const { - assert(0 && "Darwin does not use unique sections"); - return ""; -} - X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM): - X86TargetAsmInfo(TM) { - bool is64Bit = X86TM->getSubtarget().is64Bit(); - - TextSection_ = getUnnamedSection("\t.text", SectionFlags::Code); - DataSection_ = getUnnamedSection("\t.data", SectionFlags::Writeable); - BSSSection_ = getUnnamedSection("\t.bss", - SectionFlags::Writeable | SectionFlags::BSS); - ReadOnlySection_ = getNamedSection("\t.rodata", SectionFlags::None); - TLSDataSection_ = getNamedSection("\t.tdata", - SectionFlags::Writeable | SectionFlags::TLS); - TLSBSSSection_ = getNamedSection("\t.tbss", - SectionFlags::Writeable | SectionFlags::TLS | SectionFlags::BSS); + X86TargetAsmInfo(TM), ELFTargetAsmInfo(TM) { + bool is64Bit = ETM->getSubtarget().is64Bit(); ReadOnlySection = ".rodata"; FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\", at progbits,4"; @@ -373,17 +264,17 @@ DwarfExceptionSection = "\t.section\t.gcc_except_table,\"a\", at progbits"; // On Linux we must declare when we can use a non-executable stack. - if (X86TM->getSubtarget().isLinux()) + if (ETM->getSubtarget().isLinux()) NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\", at progbits"; } unsigned X86ELFTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, bool Global) const { - CodeModel::Model CM = X86TM->getCodeModel(); - bool is64Bit = X86TM->getSubtarget().is64Bit(); + CodeModel::Model CM = ETM->getCodeModel(); + bool is64Bit = ETM->getSubtarget().is64Bit(); - if (X86TM->getRelocationModel() == Reloc::PIC_) { + if (ETM->getRelocationModel() == Reloc::PIC_) { unsigned Format = 0; if (!is64Bit) @@ -416,132 +307,10 @@ } } -const Section* -X86ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { - SectionKind::Kind Kind = SectionKindForGlobal(GV); - - if (const Function *F = dyn_cast(GV)) { - switch (F->getLinkage()) { - default: assert(0 && "Unknown linkage type!"); - case Function::InternalLinkage: - case Function::DLLExportLinkage: - case Function::ExternalLinkage: - return getTextSection_(); - case Function::WeakLinkage: - case Function::LinkOnceLinkage: - std::string Name = UniqueSectionForGlobal(GV, Kind); - unsigned Flags = SectionFlagsForGlobal(GV, Name.c_str()); - return getNamedSection(Name.c_str(), Flags); - } - } else if (const GlobalVariable *GVar = dyn_cast(GV)) { - if (GVar->isWeakForLinker()) { - std::string Name = UniqueSectionForGlobal(GVar, Kind); - unsigned Flags = SectionFlagsForGlobal(GVar, Name.c_str()); - return getNamedSection(Name.c_str(), Flags); - } else { - switch (Kind) { - case SectionKind::Data: - return getDataSection_(); - case SectionKind::BSS: - // ELF targets usually have BSS sections - return getBSSSection_(); - case SectionKind::ROData: - return getReadOnlySection_(); - case SectionKind::RODataMergeStr: - return MergeableStringSection(GVar); - case SectionKind::RODataMergeConst: - return MergeableConstSection(GVar); - case SectionKind::ThreadData: - // ELF targets usually support TLS stuff - return getTLSDataSection_(); - case SectionKind::ThreadBSS: - return getTLSBSSSection_(); - default: - assert(0 && "Unsuported section kind for global"); - } - } - } else - assert(0 && "Unsupported global"); -} - -const Section* -X86ELFTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const { - const TargetData *TD = X86TM->getTargetData(); - Constant *C = cast(GV)->getInitializer(); - const Type *Type = C->getType(); - - // FIXME: string here is temporary, until stuff will fully land in. - // We cannot use {Four,Eight,Sixteen}ByteConstantSection here, since it's - // currently directly used by asmprinter. - unsigned Size = TD->getABITypeSize(Type); - if (Size == 4 || Size == 8 || Size == 16) { - std::string Name = ".rodata.cst" + utostr(Size); - - return getNamedSection(Name.c_str(), - SectionFlags::setEntitySize(SectionFlags::Mergeable, - Size)); - } - - return getReadOnlySection_(); -} - -const Section* -X86ELFTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const { - const TargetData *TD = X86TM->getTargetData(); - Constant *C = cast(GV)->getInitializer(); - const ConstantArray *CVA = cast(C); - const Type *Type = CVA->getType()->getElementType(); - - unsigned Size = TD->getABITypeSize(Type); - if (Size <= 16) { - // We also need alignment here - const TargetData *TD = X86TM->getTargetData(); - unsigned Align = TD->getPreferredAlignment(GV); - if (Align < Size) - Align = Size; - - std::string Name = getCStringSection() + utostr(Size) + '.' + utostr(Align); - unsigned Flags = SectionFlags::setEntitySize(SectionFlags::Mergeable | - SectionFlags::Strings, - Size); - return getNamedSection(Name.c_str(), Flags); - } - - return getReadOnlySection_(); -} - -std::string X86ELFTargetAsmInfo::PrintSectionFlags(unsigned flags) const { - std::string Flags = ",\""; - - if (!(flags & SectionFlags::Debug)) - Flags += 'a'; - if (flags & SectionFlags::Code) - Flags += 'x'; - if (flags & SectionFlags::Writeable) - Flags += 'w'; - if (flags & SectionFlags::Mergeable) - Flags += 'M'; - if (flags & SectionFlags::Strings) - Flags += 'S'; - if (flags & SectionFlags::TLS) - Flags += 'T'; - - Flags += "\""; - - // FIXME: There can be exceptions here - if (flags & SectionFlags::BSS) - Flags += ", at nobits"; - else - Flags += ", at progbits"; - - if (unsigned entitySize = SectionFlags::getEntitySize(flags)) - Flags += "," + utostr(entitySize); - - return Flags; -} - X86COFFTargetAsmInfo::X86COFFTargetAsmInfo(const X86TargetMachine &TM): X86TargetAsmInfo(TM) { + X86TM = &TM; + GlobalPrefix = "_"; LCOMMDirective = "\t.lcomm\t"; COMMDirectiveTakesAlignment = false; Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h?rev=53788&r1=53787&r2=53788&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h Sat Jul 19 08:15:21 2008 @@ -15,6 +15,8 @@ #define X86TARGETASMINFO_H #include "llvm/Target/TargetAsmInfo.h" +#include "llvm/Target/ELFTargetAsmInfo.h" +#include "llvm/Target/DarwinTargetAsmInfo.h" namespace llvm { @@ -22,42 +24,27 @@ class X86TargetMachine; class GlobalVariable; - struct X86TargetAsmInfo : public TargetAsmInfo { + struct X86TargetAsmInfo : public virtual TargetAsmInfo { explicit X86TargetAsmInfo(const X86TargetMachine &TM); virtual bool ExpandInlineAsm(CallInst *CI) const; private: bool LowerToBSwap(CallInst *CI) const; - protected: - const X86TargetMachine* X86TM; }; - struct X86DarwinTargetAsmInfo : public X86TargetAsmInfo { - const Section* TextCoalSection; - const Section* ConstDataCoalSection; - const Section* ConstDataSection; - const Section* DataCoalSection; - + struct X86DarwinTargetAsmInfo : public X86TargetAsmInfo, + public DarwinTargetAsmInfo { explicit X86DarwinTargetAsmInfo(const X86TargetMachine &TM); virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason, bool Global) const; - virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const; - virtual std::string UniqueSectionForGlobal(const GlobalValue* GV, - SectionKind::Kind kind) const; - const Section* MergeableConstSection(const GlobalVariable *GV) const; - const Section* MergeableStringSection(const GlobalVariable *GV) const; }; - struct X86ELFTargetAsmInfo : public X86TargetAsmInfo { + struct X86ELFTargetAsmInfo : public X86TargetAsmInfo, + public ELFTargetAsmInfo { explicit X86ELFTargetAsmInfo(const X86TargetMachine &TM); virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason, bool Global) const; - - virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const; - virtual std::string PrintSectionFlags(unsigned flags) const; - const Section* MergeableConstSection(const GlobalVariable *GV) const; - const Section* MergeableStringSection(const GlobalVariable *GV) const ; }; struct X86COFFTargetAsmInfo : public X86TargetAsmInfo { @@ -67,6 +54,8 @@ virtual std::string UniqueSectionForGlobal(const GlobalValue* GV, SectionKind::Kind kind) const; virtual std::string PrintSectionFlags(unsigned flags) const; + protected: + const X86TargetMachine *X86TM; }; struct X86WinTargetAsmInfo : public X86TargetAsmInfo { From asl at math.spbu.ru Sat Jul 19 08:15:47 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 19 Jul 2008 13:15:47 -0000 Subject: [llvm-commits] [llvm] r53789 - in /llvm/trunk/lib/Target: DarwinTargetAsmInfo.cpp X86/X86TargetAsmInfo.cpp Message-ID: <200807191315.m6JDFlg6006141@zion.cs.uiuc.edu> Author: asl Date: Sat Jul 19 08:15:46 2008 New Revision: 53789 URL: http://llvm.org/viewvc/llvm-project?rev=53789&view=rev Log: Fix a FIXME :) Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=53789&r1=53788&r2=53789&view=diff ============================================================================== --- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Sat Jul 19 08:15:46 2008 @@ -32,9 +32,9 @@ SectionFlags::Mergeable); EightByteConstantSection_ = getUnnamedSection("\t.literal8\n", SectionFlags::Mergeable); - // FIXME: Check for 64 bit - SixteenByteConstantSection_ = getUnnamedSection("\t.literal16\n", - SectionFlags::Mergeable); + // Note: 16-byte constant section is subtarget specific and should be provided + // there. + ReadOnlySection_ = getUnnamedSection("\t.const\n", SectionFlags::None); // FIXME: These should be named sections, really. @@ -114,9 +114,8 @@ return FourByteConstantSection_; else if (Size == 8) return EightByteConstantSection_; - // FIXME: 64 bit - /*else if (Size == 16 && DTM->getSubtarget().is64Bit()) - return SixteenByteConstantSection_;*/ + else if (Size == 16 && SixteenByteConstantSection_) + return SixteenByteConstantSection_; return getReadOnlySection_(); } Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=53789&r1=53788&r2=53789&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Sat Jul 19 08:15:46 2008 @@ -148,6 +148,8 @@ // FIXME: Why don't always use this section? if (is64Bit) { SixteenByteConstantSection = "\t.literal16\n"; + SixteenByteConstantSection_ = getUnnamedSection("\t.literal16\n", + SectionFlags::Mergeable); } ReadOnlySection = "\t.const\n"; From asl at math.spbu.ru Sat Jul 19 08:16:12 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 19 Jul 2008 13:16:12 -0000 Subject: [llvm-commits] [llvm] r53790 - in /llvm/trunk/lib/Target: DarwinTargetAsmInfo.cpp Mips/MipsAsmPrinter.cpp Mips/MipsTargetAsmInfo.cpp Mips/MipsTargetAsmInfo.h Message-ID: <200807191316.m6JDGCNO006165@zion.cs.uiuc.edu> Author: asl Date: Sat Jul 19 08:16:11 2008 New Revision: 53790 URL: http://llvm.org/viewvc/llvm-project?rev=53790&view=rev Log: Switch MIPS to new ELFTargetAsmInfo. Add few FIXMEs. Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=53790&r1=53789&r2=53790&view=diff ============================================================================== --- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Sat Jul 19 08:16:11 2008 @@ -32,6 +32,7 @@ SectionFlags::Mergeable); EightByteConstantSection_ = getUnnamedSection("\t.literal8\n", SectionFlags::Mergeable); + // Note: 16-byte constant section is subtarget specific and should be provided // there. Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=53790&r1=53789&r2=53790&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Sat Jul 19 08:16:11 2008 @@ -58,12 +58,13 @@ return "Mips Assembly Printer"; } + virtual std::string getSectionForFunction(const Function &F) const; void printOperand(const MachineInstr *MI, int opNum); void printMemOperand(const MachineInstr *MI, int opNum, const char *Modifier = 0); void printFCCOperand(const MachineInstr *MI, int opNum, const char *Modifier = 0); - + void printModuleLevelGV(const GlobalVariable* GVar); unsigned int getSavedRegsBitmask(bool isFloat, MachineFunction &MF); void printHex32(unsigned int Value); @@ -73,7 +74,7 @@ void emitFrameDirective(MachineFunction &MF); void emitMaskDirective(MachineFunction &MF); void emitFMaskDirective(MachineFunction &MF); - + bool printInstruction(const MachineInstr *MI); // autogenerated. bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M); @@ -241,13 +242,18 @@ return NULL; } +// Substitute old hook with new one temporary +std::string MipsAsmPrinter::getSectionForFunction(const Function &F) const { + return TAI->SectionForGlobal(&F); +} + /// Emit the directives used by GAS on the start of functions void MipsAsmPrinter:: emitFunctionStart(MachineFunction &MF) { // Print out the label for the function. const Function *F = MF.getFunction(); - SwitchToTextSection(getSectionForFunction(*F).c_str(), F); + SwitchToTextSection(TAI->SectionForGlobal(F).c_str()); // 2 bits aligned EmitAlignment(2, F); @@ -467,146 +473,113 @@ return false; // success } -bool MipsAsmPrinter:: -doFinalization(Module &M) -{ +void MipsAsmPrinter:: +printModuleLevelGV(const GlobalVariable* GVar) { const TargetData *TD = TM.getTargetData(); - // Print out module-level global variables here. - for (Module::const_global_iterator I = M.global_begin(), - E = M.global_end(); I != E; ++I) + if (!GVar->hasInitializer()) + return; // External global require no code - // External global require no code - if (I->hasInitializer()) { - - // Check to see if this is a special global - // used by LLVM, if so, emit it. - if (EmitSpecialLLVMGlobal(I)) - continue; - - O << "\n\n"; - std::string name = Mang->getValueName(I); - Constant *C = I->getInitializer(); - const Type *CTy = C->getType(); - unsigned Size = TD->getABITypeSize(CTy); - bool printSizeAndType = true; - - // A data structure or array is aligned in memory to the largest - // alignment boundary required by any data type inside it (this matches - // the Preferred Type Alignment). For integral types, the alignment is - // the type size. - //unsigned Align = TD->getPreferredAlignmentLog(I); - //unsigned Align = TD->getPrefTypeAlignment(C->getType()); - unsigned Align; - if (CTy->getTypeID() == Type::IntegerTyID || - CTy->getTypeID() == Type::VoidTyID) { - assert(!(Size & (Size-1)) && "Alignment is not a power of two!"); - Align = Log2_32(Size); - } else - Align = TD->getPreferredTypeAlignmentShift(CTy); - - // Is this correct ? - if (C->isNullValue() && (I->hasLinkOnceLinkage() || - I->hasInternalLinkage() || I->hasWeakLinkage() || - I->hasCommonLinkage())) - { - if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. + // Check to see if this is a special global used by LLVM, if so, emit it. + if (EmitSpecialLLVMGlobal(GVar)) + return; - if (!NoZerosInBSS && TAI->getBSSSection()) - SwitchToDataSection(TAI->getBSSSection(), I); + O << "\n\n"; + std::string SectionName = TAI->SectionForGlobal(GVar); + std::string name = Mang->getValueName(GVar); + Constant *C = GVar->getInitializer(); + const Type *CTy = C->getType(); + unsigned Size = TD->getABITypeSize(CTy); + bool printSizeAndType = true; + + // A data structure or array is aligned in memory to the largest + // alignment boundary required by any data type inside it (this matches + // the Preferred Type Alignment). For integral types, the alignment is + // the type size. + //unsigned Align = TD->getPreferredAlignmentLog(I); + //unsigned Align = TD->getPrefTypeAlignment(C->getType()); + unsigned Align; + if (CTy->getTypeID() == Type::IntegerTyID || + CTy->getTypeID() == Type::VoidTyID) { + assert(!(Size & (Size-1)) && "Alignment is not a power of two!"); + Align = Log2_32(Size); + } else + Align = TD->getPreferredTypeAlignmentShift(CTy); + + // FIXME: ELF supports visibility + + SwitchToDataSection(SectionName.c_str()); + + if (C->isNullValue() && !GVar->hasSection()) { + if (!GVar->isThreadLocal() && + (GVar->hasInternalLinkage() || GVar->isWeakForLinker())) { + if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. + + if (GVar->hasInternalLinkage()) { + if (TAI->getLCOMMDirective()) + O << TAI->getLCOMMDirective() << name << ',' << Size; else - SwitchToDataSection(TAI->getDataSection(), I); - - if (I->hasInternalLinkage()) { - if (TAI->getLCOMMDirective()) - O << TAI->getLCOMMDirective() << name << "," << Size; - else - O << "\t.local\t" << name << "\n"; - } else { - O << TAI->getCOMMDirective() << name << "," << Size; - // The .comm alignment in bytes. - if (TAI->getCOMMDirectiveTakesAlignment()) - O << "," << (1 << Align); - } - + O << "\t.local\t" << name << '\n'; } else { + O << TAI->getCOMMDirective() << name << ',' << Size; + // The .comm alignment in bytes. + if (TAI->getCOMMDirectiveTakesAlignment()) + O << ',' << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align); + } + O << '\n'; + return; + } + } + switch (GVar->getLinkage()) { + case GlobalValue::LinkOnceLinkage: + case GlobalValue::CommonLinkage: + case GlobalValue::WeakLinkage: + // FIXME: Verify correct for weak. + // Nonnull linkonce -> weak + O << "\t.weak " << name << "\n"; + break; + case GlobalValue::AppendingLinkage: + // FIXME: appending linkage variables should go into a section of their name + // or something. For now, just emit them as external. + case GlobalValue::ExternalLinkage: + // If external or appending, declare as a global symbol + O << TAI->getGlobalDirective() << name << "\n"; + // Fall Through + case GlobalValue::InternalLinkage: + break; + case GlobalValue::GhostLinkage: + cerr << "Should not have any unmaterialized functions!\n"; + abort(); + case GlobalValue::DLLImportLinkage: + cerr << "DLLImport linkage is not supported by this target!\n"; + abort(); + case GlobalValue::DLLExportLinkage: + cerr << "DLLExport linkage is not supported by this target!\n"; + abort(); + default: + assert(0 && "Unknown linkage type!"); + } + + if (Align) + O << "\t.align " << Align << "\n"; - switch (I->getLinkage()) - { - case GlobalValue::LinkOnceLinkage: - case GlobalValue::CommonLinkage: - case GlobalValue::WeakLinkage: - // FIXME: Verify correct for weak. - // Nonnull linkonce -> weak - O << "\t.weak " << name << "\n"; - SwitchToDataSection("", I); - O << "\t.section\t\".llvm.linkonce.d." << name - << "\",\"aw\", at progbits\n"; - break; - case GlobalValue::AppendingLinkage: - // FIXME: appending linkage variables - // should go into a section of their name or - // something. For now, just emit them as external. - case GlobalValue::ExternalLinkage: - // If external or appending, declare as a global symbol - O << TAI->getGlobalDirective() << name << "\n"; - // Fall Through - case GlobalValue::InternalLinkage: - // FIXME: special handling for ".ctors" & ".dtors" sections - if (I->hasSection() && (I->getSection() == ".ctors" || - I->getSection() == ".dtors")) { - std::string SectionName = ".section " + I->getSection(); - SectionName += ",\"aw\",%progbits"; - SwitchToDataSection(SectionName.c_str()); - } else { - if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection()) - SwitchToDataSection(TAI->getBSSSection(), I); - else if (!I->isConstant()) - SwitchToDataSection(TAI->getDataSection(), I); - else { - // Read-only data. We have two possible scenary here - // 1) Readonly section for strings (char arrays). - // 2) for other types. - if (TAI->getReadOnlySection()) { - const ConstantArray *CVA = dyn_cast(C); - if (CVA && CVA->isString()) { - std::string SectionName = "\t.section\t.rodata.str1.4," - "\"aMS\", at progbits,1"; - SwitchToDataSection(SectionName.c_str()); - printSizeAndType = false; - break; - } - SwitchToDataSection(TAI->getReadOnlySection(), I); - } else - SwitchToDataSection(TAI->getDataSection(), I); - } - } - break; - case GlobalValue::GhostLinkage: - cerr << "Should not have any unmaterialized functions!\n"; - abort(); - case GlobalValue::DLLImportLinkage: - cerr << "DLLImport linkage is not supported by this target!\n"; - abort(); - case GlobalValue::DLLExportLinkage: - cerr << "DLLExport linkage is not supported by this target!\n"; - abort(); - default: - assert(0 && "Unknown linkage type!"); - } - - if (Align) - O << "\t.align " << Align << "\n"; - - if (TAI->hasDotTypeDotSizeDirective() && printSizeAndType) { - O << "\t.type " << name << ", at object\n"; - O << "\t.size " << name << "," << Size << "\n"; - } - O << name << ":\n"; - EmitGlobalConstant(C); - } + if (TAI->hasDotTypeDotSizeDirective() && printSizeAndType) { + O << "\t.type " << name << ", at object\n"; + O << "\t.size " << name << "," << Size << "\n"; } + O << name << ":\n"; + EmitGlobalConstant(C); +} + +bool MipsAsmPrinter:: +doFinalization(Module &M) +{ + // Print out module-level global variables here. + for (Module::const_global_iterator I = M.global_begin(), + E = M.global_end(); I != E; ++I) + printModuleLevelGV(I); + O << "\n"; return AsmPrinter::doFinalization(M); Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp?rev=53790&r1=53789&r2=53790&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Sat Jul 19 08:16:11 2008 @@ -16,7 +16,8 @@ using namespace llvm; -MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM) { +MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM): + ELFTargetAsmInfo(TM) { AlignmentIsInBytes = false; COMMDirectiveTakesAlignment = true; @@ -33,7 +34,7 @@ if (!TM.getSubtarget().hasABICall()) JumpTableDirective = "\t.word\t"; - else + else JumpTableDirective = "\t.gpword\t"; } Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h?rev=53790&r1=53789&r2=53790&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h Sat Jul 19 08:16:11 2008 @@ -15,13 +15,14 @@ #define MIPSTARGETASMINFO_H #include "llvm/Target/TargetAsmInfo.h" +#include "llvm/Target/ELFTargetAsmInfo.h" namespace llvm { // Forward declaration. class MipsTargetMachine; - struct MipsTargetAsmInfo : public TargetAsmInfo { + struct MipsTargetAsmInfo : public ELFTargetAsmInfo { explicit MipsTargetAsmInfo(const MipsTargetMachine &TM); }; From asl at math.spbu.ru Sat Jul 19 08:16:32 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 19 Jul 2008 13:16:32 -0000 Subject: [llvm-commits] [llvm] r53791 - /llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Message-ID: <200807191316.m6JDGXOw006197@zion.cs.uiuc.edu> Author: asl Date: Sat Jul 19 08:16:32 2008 New Revision: 53791 URL: http://llvm.org/viewvc/llvm-project?rev=53791&view=rev Log: Use chars, where possible Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=53791&r1=53790&r2=53791&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Sat Jul 19 08:16:32 2008 @@ -138,18 +138,18 @@ int StackSize = MF.getFrameInfo()->getStackSize(); int Offset = (!MipsFI->getTopSavedRegOffset()) ? 0 : (-(StackSize-MipsFI->getTopSavedRegOffset())); - + #ifndef NDEBUG - DOUT << "--> emitMaskDirective" << "\n"; - DOUT << "StackSize : " << StackSize << "\n"; - DOUT << "getTopSavedReg : " << MipsFI->getTopSavedRegOffset() << "\n"; + DOUT << "--> emitMaskDirective" << '\n'; + DOUT << "StackSize : " << StackSize << '\n'; + DOUT << "getTopSavedReg : " << MipsFI->getTopSavedRegOffset() << '\n'; DOUT << "Offset : " << Offset << "\n\n"; #endif unsigned int Bitmask = getSavedRegsBitmask(false, MF); O << "\t.mask \t"; printHex32(Bitmask); - O << "," << Offset << "\n"; + O << ',' << Offset << '\n'; } /// TODO: Mask Directive for Floating Point @@ -160,7 +160,7 @@ O << "\t.fmask\t"; printHex32(Bitmask); - O << ",0" << "\n"; + O << ",0" << '\n'; } // Create a bitmask with all callee saved registers for CPU @@ -219,10 +219,10 @@ unsigned stackSize = MF.getFrameInfo()->getStackSize(); - O << "\t.frame\t" << "$" << LowercaseString(RI.get(stackReg).AsmName) - << "," << stackSize << "," - << "$" << LowercaseString(RI.get(returnReg).AsmName) - << "\n"; + O << "\t.frame\t" << '$' << LowercaseString(RI.get(stackReg).AsmName) + << ',' << stackSize << ',' + << '$' << LowercaseString(RI.get(returnReg).AsmName) + << '\n'; } /// Emit Set directives. @@ -258,8 +258,8 @@ // 2 bits aligned EmitAlignment(2, F); - O << "\t.globl\t" << CurrentFnName << "\n"; - O << "\t.ent\t" << CurrentFnName << "\n"; + O << "\t.globl\t" << CurrentFnName << '\n'; + O << "\t.ent\t" << CurrentFnName << '\n'; if ((TAI->hasDotTypeDotSizeDirective()) && Subtarget->isLinux()) O << "\t.type\t" << CurrentFnName << ", @function\n"; @@ -270,7 +270,7 @@ emitMaskDirective(MF); emitFMaskDirective(MF); - O << "\n"; + O << '\n'; } /// Emit the directives used by GAS on the end of functions @@ -283,9 +283,9 @@ O << "\t.set\tmacro\n"; O << "\t.set\treorder\n"; - O << "\t.end\t" << CurrentFnName << "\n"; + O << "\t.end\t" << CurrentFnName << '\n'; if (TAI->hasDotTypeDotSizeDirective() && !Subtarget->isLinux()) - O << "\t.size\t" << CurrentFnName << ", .-" << CurrentFnName << "\n"; + O << "\t.size\t" << CurrentFnName << ", .-" << CurrentFnName << '\n'; } /// runOnMachineFunction - This uses the printMachineInstruction() @@ -383,9 +383,9 @@ { case MachineOperand::MO_Register: if (TargetRegisterInfo::isPhysicalRegister(MO.getReg())) - O << "$" << LowercaseString (RI.get(MO.getReg()).AsmName); + O << '$' << LowercaseString (RI.get(MO.getReg()).AsmName); else - O << "$" << MO.getReg(); + O << '$' << MO.getReg(); break; case MachineOperand::MO_Immediate: @@ -460,15 +460,15 @@ Mang = new Mangler(M); // Tell the assembler which ABI we are using - O << "\t.section .mdebug." << emitCurrentABIString() << "\n"; + O << "\t.section .mdebug." << emitCurrentABIString() << '\n'; // TODO: handle O64 ABI if (Subtarget->isABI_EABI()) O << "\t.section .gcc_compiled_long" << - (Subtarget->isGP32bit() ? "32" : "64") << "\n"; + (Subtarget->isGP32bit() ? "32" : "64") << '\n'; // return to previous section - O << "\t.previous" << "\n"; + O << "\t.previous" << '\n'; return false; // success } @@ -536,14 +536,14 @@ case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak. // Nonnull linkonce -> weak - O << "\t.weak " << name << "\n"; + O << "\t.weak " << name << '\n'; break; case GlobalValue::AppendingLinkage: // FIXME: appending linkage variables should go into a section of their name // or something. For now, just emit them as external. case GlobalValue::ExternalLinkage: // If external or appending, declare as a global symbol - O << TAI->getGlobalDirective() << name << "\n"; + O << TAI->getGlobalDirective() << name << '\n'; // Fall Through case GlobalValue::InternalLinkage: break; @@ -561,11 +561,11 @@ } if (Align) - O << "\t.align " << Align << "\n"; + O << "\t.align " << Align << '\n'; if (TAI->hasDotTypeDotSizeDirective() && printSizeAndType) { O << "\t.type " << name << ", at object\n"; - O << "\t.size " << name << "," << Size << "\n"; + O << "\t.size " << name << ',' << Size << '\n'; } O << name << ":\n"; @@ -580,7 +580,7 @@ E = M.global_end(); I != E; ++I) printModuleLevelGV(I); - O << "\n"; + O << '\n'; return AsmPrinter::doFinalization(M); } From wmatyjewicz at fastmail.fm Sat Jul 19 08:26:16 2008 From: wmatyjewicz at fastmail.fm (Wojciech Matyjewicz) Date: Sat, 19 Jul 2008 13:26:16 -0000 Subject: [llvm-commits] [llvm] r53792 - in /llvm/trunk/test/Analysis/ScalarEvolution: 2007-07-15-NegativeStride.ll 2007-09-27-LargeStepping.ll 2008-05-25-NegativeStepToZero.ll SolveQuadraticEquation.ll trip-count.ll Message-ID: <200807191326.m6JDQGrI006518@zion.cs.uiuc.edu> Author: wmat Date: Sat Jul 19 08:26:15 2008 New Revision: 53792 URL: http://llvm.org/viewvc/llvm-project?rev=53792&view=rev Log: While testing particular algorithms to compute loop iteration count the brute force evaluation (ComputeIterationCountExhaustively) should be turned off. It doesn't apply to trip-count2.ll because this file tests the brute force evaluation. The test for PR2364 (2008-05-25-NegativeStepToZero.ll) currently fails showing that the patch for this bug doesn't work. I'll fix it in a few hours with a patch for PR2088. Modified: llvm/trunk/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll llvm/trunk/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll llvm/trunk/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll llvm/trunk/test/Analysis/ScalarEvolution/trip-count.ll Modified: llvm/trunk/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll?rev=53792&r1=53791&r2=53792&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll Sat Jul 19 08:26:15 2008 @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep {Loop bb: 100 iterations} +; RUN: llvm-as < %s | opt -analyze -scalar-evolution \ +; RUN: -scalar-evolution-max-iterations=0 | grep {Loop bb: 100 iterations} ; PR1533 @array = weak global [101 x i32] zeroinitializer, align 32 ; <[100 x i32]*> [#uses=1] Modified: llvm/trunk/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll?rev=53792&r1=53791&r2=53792&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll Sat Jul 19 08:26:15 2008 @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep {13 iterations} +; RUN: llvm-as < %s | opt -analyze -scalar-evolution \ +; RUN: -scalar-evolution-max-iterations=0 | grep {13 iterations} ; PR1706 define i32 @f() { Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll?rev=53792&r1=53791&r2=53792&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll Sat Jul 19 08:26:15 2008 @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep {61 iterations} +; RUN: llvm-as < %s | opt -analyze -scalar-evolution \ +; RUN: -scalar-evolution-max-iterations=0 | grep {61 iterations} ; PR2364 define i32 @func_6() nounwind { Modified: llvm/trunk/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll?rev=53792&r1=53791&r2=53792&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll Sat Jul 19 08:26:15 2008 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution | \ -; RUN: grep {100 iterations} +; RUN: llvm-as < %s | opt -analyze -scalar-evolution \ +; RUN: -scalar-evolution-max-iterations=0 | grep {100 iterations} ; PR1101 @A = weak global [1000 x i32] zeroinitializer, align 32 Modified: llvm/trunk/test/Analysis/ScalarEvolution/trip-count.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/trip-count.ll?rev=53792&r1=53791&r2=53792&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/trip-count.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/trip-count.ll Sat Jul 19 08:26:15 2008 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution | \ -; RUN: grep {10000 iterations} +; RUN: llvm-as < %s | opt -analyze -scalar-evolution \ +; RUN: -scalar-evolution-max-iterations=0 | grep {10000 iterations} ; PR1101 @A = weak global [1000 x i32] zeroinitializer, align 32 From nicholas at mxc.ca Sat Jul 19 10:52:11 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Sat, 19 Jul 2008 15:52:11 -0000 Subject: [llvm-commits] [llvm] r53793 - /llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll Message-ID: <200807191552.m6JFqC9M011143@zion.cs.uiuc.edu> Author: nicholas Date: Sat Jul 19 10:52:06 2008 New Revision: 53793 URL: http://llvm.org/viewvc/llvm-project?rev=53793&view=rev Log: XFAIL this test. Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll?rev=53793&r1=53792&r2=53793&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll Sat Jul 19 10:52:06 2008 @@ -1,6 +1,7 @@ ; RUN: llvm-as < %s | opt -analyze -scalar-evolution \ ; RUN: -scalar-evolution-max-iterations=0 | grep {61 iterations} ; PR2364 +; XFAIL: * define i32 @func_6() nounwind { entry: From baldrick at free.fr Sat Jul 19 11:26:04 2008 From: baldrick at free.fr (Duncan Sands) Date: Sat, 19 Jul 2008 16:26:04 -0000 Subject: [llvm-commits] [llvm] r53794 - /llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200807191626.m6JGQ4ft012182@zion.cs.uiuc.edu> Author: baldrick Date: Sat Jul 19 11:26:02 2008 New Revision: 53794 URL: http://llvm.org/viewvc/llvm-project?rev=53794&view=rev Log: Make sure custom lowering for LegalizeTypes returns a node with the right number of return values. This fixes codegen of Generic/cast-fp.ll, Generic/fp_to_int.ll and PowerPC/multiple-return-values.ll when using -march=ppc32 -mattr=+64bit. Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=53794&r1=53793&r2=53794&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Sat Jul 19 11:26:02 2008 @@ -2855,7 +2855,7 @@ SDOperand Src = Op.getOperand(0); if (Src.getValueType() == MVT::f32) Src = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Src); - + SDOperand Tmp; switch (Op.getValueType().getSimpleVT()) { default: assert(0 && "Unhandled FP_TO_SINT type in custom expander!"); @@ -2866,10 +2866,10 @@ Tmp = DAG.getNode(PPCISD::FCTIDZ, MVT::f64, Src); break; } - + // Convert the FP value to an int value through memory. SDOperand FIPtr = DAG.CreateStackTemporary(MVT::f64); - + // Emit a store to the stack slot. SDOperand Chain = DAG.getStore(DAG.getEntryNode(), Tmp, FIPtr, NULL, 0); @@ -3907,7 +3907,13 @@ SDNode *PPCTargetLowering::ReplaceNodeResults(SDNode *N, SelectionDAG &DAG) { switch (N->getOpcode()) { default: assert(0 && "Wasn't expecting to be able to lower this!"); - case ISD::FP_TO_SINT: return LowerFP_TO_SINT(SDOperand(N, 0), DAG).Val; + case ISD::FP_TO_SINT: { + SDOperand Res = LowerFP_TO_SINT(SDOperand(N, 0), DAG); + // Use MERGE_VALUES to drop the chain result value and get a node with one + // result. This requires turning off getMergeValues simplification, since + // otherwise it will give us Res back. + return DAG.getMergeValues(&Res, 1, false).Val; + } } } From isanbard at gmail.com Sat Jul 19 13:12:58 2008 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 19 Jul 2008 18:12:58 -0000 Subject: [llvm-commits] [llvm] r53795 - /llvm/branches/Apple/Gaz/lib/CodeGen/DwarfWriter.cpp Message-ID: <200807191812.m6JICwWB015447@zion.cs.uiuc.edu> Author: void Date: Sat Jul 19 13:12:56 2008 New Revision: 53795 URL: http://llvm.org/viewvc/llvm-project?rev=53795&view=rev Log: If .loc and .file aren't used, always emit the "debug_line" section. This requires at least one entry in the line matrix. So if there's nothing to emit into the matrix, emit an end of matrix value anyway. Modified: llvm/branches/Apple/Gaz/lib/CodeGen/DwarfWriter.cpp Modified: llvm/branches/Apple/Gaz/lib/CodeGen/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/lib/CodeGen/DwarfWriter.cpp?rev=53795&r1=53794&r2=53795&view=diff ============================================================================== --- llvm/branches/Apple/Gaz/lib/CodeGen/DwarfWriter.cpp (original) +++ llvm/branches/Apple/Gaz/lib/CodeGen/DwarfWriter.cpp Sat Jul 19 13:12:56 2008 @@ -2253,12 +2253,28 @@ } } + /// EmitEndOfLineMatrix - Emit the last address of the section and the end of + /// the line matrix. + /// + void EmitEndOfLineMatrix(unsigned SectionEnd) { + // Define last address of section. + Asm->EmitInt8(0); Asm->EOL("Extended Op"); + Asm->EmitInt8(TD->getPointerSize() + 1); Asm->EOL("Op size"); + Asm->EmitInt8(DW_LNE_set_address); Asm->EOL("DW_LNE_set_address"); + EmitReference("section_end", SectionEnd); Asm->EOL("Section end label"); + + // Mark end of matrix. + Asm->EmitInt8(0); Asm->EOL("DW_LNE_end_sequence"); + Asm->EmitULEB128Bytes(1); Asm->EOL(); + Asm->EmitInt8(1); Asm->EOL(); + } + /// EmitDebugLines - Emit source line information. /// void EmitDebugLines() { - // If there are no lines to emit (such as when we're using .loc directives - // to emit .debug_line information) don't emit a .debug_line header. - if (SectionSourceLines.empty()) + // If the target is using .loc/.file, the assembler will be emitting the + // .debug_line table automatically. + if (TAI->hasDotLocAndDotFile()) return; // Minimum line delta, thus ranging from -10..(255-10). @@ -2330,7 +2346,9 @@ EmitLabel("line_prolog_end", 0); // A sequence for each text section. - for (unsigned j = 0, M = SectionSourceLines.size(); j < M; ++j) { + unsigned SecSrcLinesSize = SectionSourceLines.size(); + + for (unsigned j = 0; j < SecSrcLinesSize; ++j) { // Isolate current sections line info. const std::vector &LineInfos = SectionSourceLines[j]; @@ -2398,17 +2416,14 @@ } } - // Define last address of section. - Asm->EmitInt8(0); Asm->EOL("Extended Op"); - Asm->EmitInt8(TD->getPointerSize() + 1); Asm->EOL("Op size"); - Asm->EmitInt8(DW_LNE_set_address); Asm->EOL("DW_LNE_set_address"); - EmitReference("section_end", j + 1); Asm->EOL("Section end label"); - - // Mark end of matrix. - Asm->EmitInt8(0); Asm->EOL("DW_LNE_end_sequence"); - Asm->EmitULEB128Bytes(1); Asm->EOL(); - Asm->EmitInt8(1); Asm->EOL(); + EmitEndOfLineMatrix(j + 1); } + + if (SecSrcLinesSize == 0) + // Because we're emitting a debug_line section, we still need a line + // table. The linker and friends expect it to exist. If there's nothing to + // put into it, emit an empty table. + EmitEndOfLineMatrix(1); EmitLabel("line_end", 0); From kremenek at apple.com Sat Jul 19 14:34:27 2008 From: kremenek at apple.com (Ted Kremenek) Date: Sat, 19 Jul 2008 19:34:27 -0000 Subject: [llvm-commits] [llvm] r53798 - /llvm/tags/checker/checker-64/ Message-ID: <200807191934.m6JJYRoW017957@zion.cs.uiuc.edu> Author: kremenek Date: Sat Jul 19 14:34:27 2008 New Revision: 53798 URL: http://llvm.org/viewvc/llvm-project?rev=53798&view=rev Log: Tagging checker-64. Added: llvm/tags/checker/checker-64/ - copied from r53797, llvm/trunk/ From asl at math.spbu.ru Sat Jul 19 16:44:58 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 19 Jul 2008 21:44:58 -0000 Subject: [llvm-commits] [llvm] r53801 - in /llvm/trunk/lib/Target/PowerPC: PPCTargetAsmInfo.cpp PPCTargetAsmInfo.h PPCTargetMachine.cpp Message-ID: <200807192144.m6JLiwVc022003@zion.cs.uiuc.edu> Author: asl Date: Sat Jul 19 16:44:57 2008 New Revision: 53801 URL: http://llvm.org/viewvc/llvm-project?rev=53801&view=rev Log: Unbreak build: 'DarwinTargetAsmInfo' was already taken as PPC TAI flavour. Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=53801&r1=53800&r2=53801&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Sat Jul 19 16:44:57 2008 @@ -32,7 +32,7 @@ AssemblerDialect = TM.getSubtargetImpl()->getAsmFlavor(); } -DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM) +PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) : PPCTargetAsmInfo(TM) { PCSymbol = "."; @@ -93,8 +93,9 @@ /// format used for encoding pointers in exception handling data. Reason is /// 0 for data, 1 for code labels, 2 for function pointers. Global is true /// if the symbol can be relocated. -unsigned DarwinTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, - bool Global) const { +unsigned +PPCDarwinTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, + bool Global) const { if (Reason == DwarfEncoding::Functions && Global) return (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4); else if (Reason == DwarfEncoding::CodeLabels || !Global) @@ -104,7 +105,7 @@ } -LinuxTargetAsmInfo::LinuxTargetAsmInfo(const PPCTargetMachine &TM) +PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) : PPCTargetAsmInfo(TM) { CommentString = "#"; @@ -155,8 +156,9 @@ /// format used for encoding pointers in exception handling data. Reason is /// 0 for data, 1 for code labels, 2 for function pointers. Global is true /// if the symbol can be relocated. -unsigned LinuxTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, - bool Global) const { +unsigned +PPCLinuxTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, + bool Global) const { // We really need to write something here. return TargetAsmInfo::PreferredEHDataFormat(Reason, Global); } Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h?rev=53801&r1=53800&r2=53801&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h Sat Jul 19 16:44:57 2008 @@ -25,14 +25,14 @@ explicit PPCTargetAsmInfo(const PPCTargetMachine &TM); }; - struct DarwinTargetAsmInfo : public PPCTargetAsmInfo { - explicit DarwinTargetAsmInfo(const PPCTargetMachine &TM); + struct PPCDarwinTargetAsmInfo : public PPCTargetAsmInfo { + explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM); virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason, bool Global) const; }; - struct LinuxTargetAsmInfo : public PPCTargetAsmInfo { - explicit LinuxTargetAsmInfo(const PPCTargetMachine &TM); + struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo { + explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM); virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason, bool Global) const; }; Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=53801&r1=53800&r2=53801&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Sat Jul 19 16:44:57 2008 @@ -27,9 +27,9 @@ const TargetAsmInfo *PPCTargetMachine::createTargetAsmInfo() const { if (Subtarget.isDarwin()) - return new DarwinTargetAsmInfo(*this); + return new PPCDarwinTargetAsmInfo(*this); else - return new LinuxTargetAsmInfo(*this); + return new PPCLinuxTargetAsmInfo(*this); } unsigned PPC32TargetMachine::getJITMatchQuality() { From isanbard at gmail.com Sat Jul 19 19:11:19 2008 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 20 Jul 2008 00:11:19 -0000 Subject: [llvm-commits] [llvm] r53803 - /llvm/trunk/lib/CodeGen/DwarfWriter.cpp Message-ID: <200807200011.m6K0BJv0026490@zion.cs.uiuc.edu> Author: void Date: Sat Jul 19 19:11:19 2008 New Revision: 53803 URL: http://llvm.org/viewvc/llvm-project?rev=53803&view=rev Log: Pull r53795 from Gaz into mainline: If .loc and .file aren't used, always emit the "debug_line" section. This requires at least one entry in the line matrix. So if there's nothing to emit into the matrix, emit an end of matrix value anyway. Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=53803&r1=53802&r2=53803&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Sat Jul 19 19:11:19 2008 @@ -2253,12 +2253,28 @@ } } + /// EmitEndOfLineMatrix - Emit the last address of the section and the end of + /// the line matrix. + /// + void EmitEndOfLineMatrix(unsigned SectionEnd) { + // Define last address of section. + Asm->EmitInt8(0); Asm->EOL("Extended Op"); + Asm->EmitInt8(TD->getPointerSize() + 1); Asm->EOL("Op size"); + Asm->EmitInt8(DW_LNE_set_address); Asm->EOL("DW_LNE_set_address"); + EmitReference("section_end", SectionEnd); Asm->EOL("Section end label"); + + // Mark end of matrix. + Asm->EmitInt8(0); Asm->EOL("DW_LNE_end_sequence"); + Asm->EmitULEB128Bytes(1); Asm->EOL(); + Asm->EmitInt8(1); Asm->EOL(); + } + /// EmitDebugLines - Emit source line information. /// void EmitDebugLines() { - // If there are no lines to emit (such as when we're using .loc directives - // to emit .debug_line information) don't emit a .debug_line header. - if (SectionSourceLines.empty()) + // If the target is using .loc/.file, the assembler will be emitting the + // .debug_line table automatically. + if (TAI->hasDotLocAndDotFile()) return; // Minimum line delta, thus ranging from -10..(255-10). @@ -2330,7 +2346,9 @@ EmitLabel("line_prolog_end", 0); // A sequence for each text section. - for (unsigned j = 0, M = SectionSourceLines.size(); j < M; ++j) { + unsigned SecSrcLinesSize = SectionSourceLines.size(); + + for (unsigned j = 0; j < SecSrcLinesSize; ++j) { // Isolate current sections line info. const std::vector &LineInfos = SectionSourceLines[j]; @@ -2398,17 +2416,14 @@ } } - // Define last address of section. - Asm->EmitInt8(0); Asm->EOL("Extended Op"); - Asm->EmitInt8(TD->getPointerSize() + 1); Asm->EOL("Op size"); - Asm->EmitInt8(DW_LNE_set_address); Asm->EOL("DW_LNE_set_address"); - EmitReference("section_end", j + 1); Asm->EOL("Section end label"); - - // Mark end of matrix. - Asm->EmitInt8(0); Asm->EOL("DW_LNE_end_sequence"); - Asm->EmitULEB128Bytes(1); Asm->EOL(); - Asm->EmitInt8(1); Asm->EOL(); + EmitEndOfLineMatrix(j + 1); } + + if (SecSrcLinesSize == 0) + // Because we're emitting a debug_line section, we still need a line + // table. The linker and friends expect it to exist. If there's nothing to + // put into it, emit an empty table. + EmitEndOfLineMatrix(1); EmitLabel("line_end", 0); From isanbard at gmail.com Sat Jul 19 19:15:40 2008 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 20 Jul 2008 00:15:40 -0000 Subject: [llvm-commits] [llvm] r53804 - /llvm/tags/Apple/llvmCore-2056/ Message-ID: <200807200015.m6K0Fe0H026620@zion.cs.uiuc.edu> Author: void Date: Sat Jul 19 19:15:39 2008 New Revision: 53804 URL: http://llvm.org/viewvc/llvm-project?rev=53804&view=rev Log: Creating llvmCore-2056 tag from Gaz branch Added: llvm/tags/Apple/llvmCore-2056/ - copied from r53803, llvm/branches/Apple/Gaz/ From isanbard at gmail.com Sat Jul 19 19:16:06 2008 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 20 Jul 2008 00:16:06 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53805 - /llvm-gcc-4.2/tags/Apple/llvmCore-2056/ Message-ID: <200807200016.m6K0G6OT026643@zion.cs.uiuc.edu> Author: void Date: Sat Jul 19 19:16:06 2008 New Revision: 53805 URL: http://llvm.org/viewvc/llvm-project?rev=53805&view=rev Log: Creating llvmgcc42-2056 tag from Gaz branch Added: llvm-gcc-4.2/tags/Apple/llvmCore-2056/ - copied from r53804, llvm-gcc-4.2/branches/Apple/Gaz/ From isanbard at gmail.com Sat Jul 19 19:22:51 2008 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 20 Jul 2008 00:22:51 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r53806 - in /llvm-gcc-4.2/tags/Apple: llvmCore-2056/ llvmgcc42-2056/ Message-ID: <200807200022.m6K0MpE0026867@zion.cs.uiuc.edu> Author: void Date: Sat Jul 19 19:22:51 2008 New Revision: 53806 URL: http://llvm.org/viewvc/llvm-project?rev=53806&view=rev Log: Wrong name for tag Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2056/ - copied from r53805, llvm-gcc-4.2/tags/Apple/llvmCore-2056/ Removed: llvm-gcc-4.2/tags/Apple/llvmCore-2056/ From isanbard at gmail.com Sat Jul 19 21:32:23 2008 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 20 Jul 2008 02:32:23 -0000 Subject: [llvm-commits] [llvm] r53807 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/mmx-pinsrw.ll Message-ID: <200807200232.m6K2WNAk030666@zion.cs.uiuc.edu> Author: void Date: Sat Jul 19 21:32:23 2008 New Revision: 53807 URL: http://llvm.org/viewvc/llvm-project?rev=53807&view=rev Log: Fix for first part of PR2562. Generate the "pinsrw" instruction for inserts into v4i16 vectors. Added: llvm/trunk/test/CodeGen/X86/mmx-pinsrw.ll Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=53807&r1=53806&r2=53807&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sat Jul 19 21:32:23 2008 @@ -604,6 +604,8 @@ setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v8i8, Custom); setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v4i16, Custom); setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v1i64, Custom); + + setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v4i16, Custom); } if (Subtarget->hasSSE1()) { Added: llvm/trunk/test/CodeGen/X86/mmx-pinsrw.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/mmx-pinsrw.ll?rev=53807&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/mmx-pinsrw.ll (added) +++ llvm/trunk/test/CodeGen/X86/mmx-pinsrw.ll Sat Jul 19 21:32:23 2008 @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep pinsrw | count 1 +; PR2562 + +external global i16 ; :0 [#uses=1] +external global <4 x i16> ; <<4 x i16>*>:1 [#uses=2] + +declare void @abort() + +define void @""() { + load i16* @0 ; :1 [#uses=1] + load <4 x i16>* @1 ; <<4 x i16>>:2 [#uses=1] + insertelement <4 x i16> %2, i16 %1, i32 0 ; <<4 x i16>>:3 [#uses=1] + store <4 x i16> %3, <4 x i16>* @1 + ret void +} From wmatyjewicz at fastmail.fm Sun Jul 20 10:55:15 2008 From: wmatyjewicz at fastmail.fm (Wojciech Matyjewicz) Date: Sun, 20 Jul 2008 15:55:15 -0000 Subject: [llvm-commits] [llvm] r53810 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp lib/Support/APInt.cpp test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll test/Analysis/ScalarEvolution/2008-07-19-InfiniteLoop.ll test/Analysis/ScalarEvolution/2008-07-19-WrappingIV.ll Message-ID: <200807201555.m6KFtFoR025101@zion.cs.uiuc.edu> Author: wmat Date: Sun Jul 20 10:55:14 2008 New Revision: 53810 URL: http://llvm.org/viewvc/llvm-project?rev=53810&view=rev Log: Fix PR2088. Use modulo linear equation solver to compute loop iteration count. Added: llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-InfiniteLoop.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-WrappingIV.ll Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp llvm/trunk/lib/Support/APInt.cpp llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=53810&r1=53809&r2=53810&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sun Jul 20 10:55:14 2008 @@ -78,6 +78,8 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/Streams.h" #include "llvm/ADT/Statistic.h" +//TMP: +#include "llvm/Support/Debug.h" #include #include #include @@ -2461,6 +2463,53 @@ return UnknownValue; } +/// SolveLinEquationWithOverflow - Finds the minimum unsigned root of the +/// following equation: +/// +/// A * X = B (mod N) +/// +/// where N = 2^BW and BW is the common bit width of A and B. The signedness of +/// A and B isn't important. +/// +/// If the equation does not have a solution, SCEVCouldNotCompute is returned. +static SCEVHandle SolveLinEquationWithOverflow(const APInt &A, const APInt &B, + ScalarEvolution &SE) { + uint32_t BW = A.getBitWidth(); + assert(BW == B.getBitWidth() && "Bit widths must be the same."); + assert(A != 0 && "A must be non-zero."); + + // 1. D = gcd(A, N) + // + // The gcd of A and N may have only one prime factor: 2. The number of + // trailing zeros in A is its multiplicity + uint32_t Mult2 = A.countTrailingZeros(); + // D = 2^Mult2 + + // 2. Check if B is divisible by D. + // + // B is divisible by D if and only if the multiplicity of prime factor 2 for B + // is not less than multiplicity of this prime factor for D. + if (B.countTrailingZeros() < Mult2) + return new SCEVCouldNotCompute(); + + // 3. Compute I: the multiplicative inverse of (A / D) in arithmetic + // modulo (N / D). + // + // (N / D) may need BW+1 bits in its representation. Hence, we'll use this + // bit width during computations. + APInt AD = A.lshr(Mult2).zext(BW + 1); // AD = A / D + APInt Mod(BW + 1, 0); + Mod.set(BW - Mult2); // Mod = N / D + APInt I = AD.multiplicativeInverse(Mod); + + // 4. Compute the minimum unsigned root of the equation: + // I * (B / D) mod (N / D) + APInt Result = (I * B.lshr(Mult2).zext(BW + 1)).urem(Mod); + + // The result is guaranteed to be less than 2^BW so we may truncate it to BW + // bits. + return SE.getConstant(Result.trunc(BW)); +} /// SolveQuadraticEquation - Find the roots of the quadratic equation for the /// given quadratic chrec {L,+,M,+,N}. This returns either the two roots (which @@ -2533,36 +2582,36 @@ return UnknownValue; if (AddRec->isAffine()) { - // If this is an affine expression the execution count of this branch is - // equal to: + // If this is an affine expression, the execution count of this branch is + // the minimum unsigned root of the following equation: + // + // Start + Step*N = 0 (mod 2^BW) + // + // equivalent to: // - // (0 - Start/Step) iff Start % Step == 0 + // Step*N = -Start (mod 2^BW) // + // where BW is the common bit width of Start and Step. + // Get the initial value for the loop. SCEVHandle Start = getSCEVAtScope(AddRec->getStart(), L->getParentLoop()); if (isa(Start)) return UnknownValue; - SCEVHandle Step = AddRec->getOperand(1); - Step = getSCEVAtScope(Step, L->getParentLoop()); + SCEVHandle Step = getSCEVAtScope(AddRec->getOperand(1), L->getParentLoop()); - // Figure out if Start % Step == 0. - // FIXME: We should add DivExpr and RemExpr operations to our AST. if (SCEVConstant *StepC = dyn_cast(Step)) { - if (StepC->getValue()->equalsInt(1)) // N % 1 == 0 - return SE.getNegativeSCEV(Start); // 0 - Start/1 == -Start - if (StepC->getValue()->isAllOnesValue()) // N % -1 == 0 - return Start; // 0 - Start/-1 == Start - - // Check to see if Start is divisible by SC with no remainder. - if (SCEVConstant *StartC = dyn_cast(Start)) { - ConstantInt *StartCC = StartC->getValue(); - Constant *StartNegC = ConstantExpr::getNeg(StartCC); - Constant *Rem = ConstantExpr::getURem(StartNegC, StepC->getValue()); - if (Rem->isNullValue()) { - Constant *Result = ConstantExpr::getUDiv(StartNegC,StepC->getValue()); - return SE.getUnknown(Result); - } - } + // For now we handle only constant steps. + + // First, handle unitary steps. + if (StepC->getValue()->equalsInt(1)) // 1*N = -Start (mod 2^BW), so: + return SE.getNegativeSCEV(Start); // N = -Start (as unsigned) + if (StepC->getValue()->isAllOnesValue()) // -1*N = -Start (mod 2^BW), so: + return Start; // N = Start (as unsigned) + + // Then, try to solve the above equation provided that Start is constant. + if (SCEVConstant *StartC = dyn_cast(Start)) + return SolveLinEquationWithOverflow(StepC->getValue()->getValue(), + -StartC->getValue()->getValue(),SE); } } else if (AddRec->isQuadratic() && AddRec->getType()->isInteger()) { // If this is a quadratic (3-term) AddRec {L,+,M,+,N}, find the roots of Modified: llvm/trunk/lib/Support/APInt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=53810&r1=53809&r2=53810&view=diff ============================================================================== --- llvm/trunk/lib/Support/APInt.cpp (original) +++ llvm/trunk/lib/Support/APInt.cpp Sun Jul 20 10:55:14 2008 @@ -1466,7 +1466,7 @@ // The next-to-last t is the multiplicative inverse. However, we are // interested in a positive inverse. Calcuate a positive one from a negative // one if necessary. A simple addition of the modulo suffices because - // abs(t[i]) is known to less than *this/2 (see the link above). + // abs(t[i]) is known to be less than *this/2 (see the link above). return t[i].isNegative() ? t[i] + modulo : t[i]; } Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll?rev=53810&r1=53809&r2=53810&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll Sun Jul 20 10:55:14 2008 @@ -1,7 +1,6 @@ ; RUN: llvm-as < %s | opt -analyze -scalar-evolution \ ; RUN: -scalar-evolution-max-iterations=0 | grep {61 iterations} ; PR2364 -; XFAIL: * define i32 @func_6() nounwind { entry: Added: llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-InfiniteLoop.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-InfiniteLoop.ll?rev=53810&view=auto ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-InfiniteLoop.ll (added) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-InfiniteLoop.ll Sun Jul 20 10:55:14 2008 @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | opt -analyze -scalar-evolution \ +; RUN: -scalar-evolution-max-iterations=0 | grep Unpredictable +; PR2088 + +define void @fun() { +entry: + br label %loop +loop: + %i = phi i8 [ 0, %entry ], [ %i.next, %loop ] + %i.next = add i8 %i, 4 + %cond = icmp ne i8 %i.next, 6 + br i1 %cond, label %loop, label %exit +exit: + ret void +} Added: llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-WrappingIV.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-WrappingIV.ll?rev=53810&view=auto ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-WrappingIV.ll (added) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-WrappingIV.ll Sun Jul 20 10:55:14 2008 @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | opt -analyze -scalar-evolution \ +; RUN: -scalar-evolution-max-iterations=0 | grep {113 iterations} +; PR2088 + +define void @fun() { +entry: + br label %loop +loop: + %i = phi i8 [ 0, %entry ], [ %i.next, %loop ] + %i.next = add i8 %i, 18 + %cond = icmp ne i8 %i.next, 4 + br i1 %cond, label %loop, label %exit +exit: + ret void +} From cedric.venet at laposte.net Sun Jul 20 07:04:56 2008 From: cedric.venet at laposte.net (Cedric Venet) Date: Sun, 20 Jul 2008 12:04:56 -0000 Subject: [llvm-commits] [llvm] r53809 - /llvm/trunk/win32/Target/Target.vcproj Message-ID: <200807201204.m6KC4vE4017675@zion.cs.uiuc.edu> Author: venet Date: Sun Jul 20 07:04:49 2008 New Revision: 53809 URL: http://llvm.org/viewvc/llvm-project?rev=53809&view=rev Log: Updated VC++ projects Modified: llvm/trunk/win32/Target/Target.vcproj Modified: llvm/trunk/win32/Target/Target.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/Target/Target.vcproj?rev=53809&r1=53808&r2=53809&view=diff ============================================================================== --- llvm/trunk/win32/Target/Target.vcproj (original) +++ llvm/trunk/win32/Target/Target.vcproj Sun Jul 20 07:04:49 2008 @@ -305,6 +305,14 @@ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > + + + + From wmatyjewicz at fastmail.fm Sun Jul 20 12:35:33 2008 From: wmatyjewicz at fastmail.fm (Wojciech Matyjewicz) Date: Sun, 20 Jul 2008 17:35:33 -0000 Subject: [llvm-commits] [llvm] r53811 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <200807201735.m6KHZX09028039@zion.cs.uiuc.edu> Author: wmat Date: Sun Jul 20 12:35:32 2008 New Revision: 53811 URL: http://llvm.org/viewvc/llvm-project?rev=53811&view=rev Log: This header isn't necessary now. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=53811&r1=53810&r2=53811&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sun Jul 20 12:35:32 2008 @@ -78,8 +78,6 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/Streams.h" #include "llvm/ADT/Statistic.h" -//TMP: -#include "llvm/Support/Debug.h" #include #include #include From sabre at nondot.org Sun Jul 20 16:06:31 2008 From: sabre at nondot.org (Chris Lattner) Date: Sun, 20 Jul 2008 16:06:31 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2008-05-CoVaC.html 2008-05-CoVaC.pdf Message-ID: <200807202106.m6KL6V0q003089@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2008-05-CoVaC.html added (r1.1) 2008-05-CoVaC.pdf added (r1.1) --- Log message: new paper. --- Diffs of the changes: (+3171 -0) 2008-05-CoVaC.html | 55 2008-05-CoVaC.pdf | 3116 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 3171 insertions(+) Index: llvm-www/pubs/2008-05-CoVaC.html diff -c /dev/null llvm-www/pubs/2008-05-CoVaC.html:1.1 *** /dev/null Sun Jul 20 16:05:48 2008 --- llvm-www/pubs/2008-05-CoVaC.html Sun Jul 20 16:05:38 2008 *************** *** 0 **** --- 1,55 ---- + + + + + + CoVaC: Compiler Validation by Program Analysis of + the Cross-Product + + + +
+ CoVaC: Compiler Validation by Program Analysis of the Cross-Product +
+
+ Anna Zaks and Amir Pnueli +
+ +

Abstract:

+
+ The paper presents a deductive framework for proving program equivalence + and its application to automatic veri???cation of transformations performed + by optimizing compilers. To leverage existing program analysis techniques, + we reduce the equivalence checking problem to + analysis of one system - a cross-product of the two input programs. We + show how the approach can be effectively used for checking equivalence of + consonant (i.e., structurally similar) programs. Finally, we report on the + prototype tool that applies the developed methodology to verify that a + compiler optimization run preserves the program semantics. Unlike existing + frameworks, CoVaC accommodates absence of compiler annotations + and handles most of the classical intraprocedural optimizations such as + constant folding, reassociation, common subexpression elimination, code + motion, dead code elimination, branch optimizations, and others. +
+ +

Bibtex:

+
+ @inproceedings{ZP2008,
+       Author = {Anna Zaks and Amir Pnueli},
+       Title = {{CoVaC}: Compiler Validation by Program Analysis of
+ the Cross-Product},
+       Booktitle = {International Symposium on Formal Methods (FM 2008)},
+       Address = {Turku, Finland},
+       Month = {May},
+       Year = 2008
+ }
+ 
+ +

Download:

+ + + + Index: llvm-www/pubs/2008-05-CoVaC.pdf diff -c /dev/null llvm-www/pubs/2008-05-CoVaC.pdf:1.1 *** /dev/null Sun Jul 20 16:06:31 2008 --- llvm-www/pubs/2008-05-CoVaC.pdf Sun Jul 20 16:05:38 2008 *************** *** 0 **** --- 1,3611 ---- + %PDF-1.2 + 9 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F1 + /FontDescriptor 8 0 R + /BaseFont/YHQIEI+CMBX12 + /FirstChar 33 + /LastChar 196 + /Widths[342.6 581 937.5 562.5 937.5 875 312.5 437.5 437.5 562.5 875 312.5 375 312.5 + 562.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 312.5 312.5 342.6 + 875 531.3 531.3 875 849.5 799.8 812.5 862.3 738.4 707.2 884.3 879.6 419 581 880.8 + 675.9 1067.1 879.6 844.9 768.5 844.9 839.1 625 782.4 864.6 849.5 1162 849.5 849.5 + 687.5 312.5 581 312.5 562.5 312.5 312.5 546.9 625 500 625 513.3 343.8 562.5 625 312.5 + 343.8 593.8 312.5 937.5 625 562.5 625 593.8 459.5 443.8 437.5 625 593.8 812.5 593.8 + 593.8 500 562.5 1125 562.5 562.5 562.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 675.9 937.5 875 787 750 879.6 812.5 875 812.5 875 0 0 812.5 + 656.3 625 625 937.5 937.5 312.5 343.8 562.5 562.5 562.5 562.5 562.5 849.5 500 574.1 + 812.5 875 562.5 1018.5 1143.5 875 312.5 562.5] + >> + endobj + 12 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F2 + /FontDescriptor 11 0 R + /BaseFont/QNXUEG+CMR10 + /FirstChar 33 + /LastChar 196 + /Widths[277.8 500 833.3 500 833.3 777.8 277.8 388.9 388.9 500 777.8 277.8 333.3 277.8 + 500 500 500 500 500 500 500 500 500 500 500 277.8 277.8 277.8 777.8 472.2 472.2 777.8 + 750 708.3 722.2 763.9 680.6 652.8 784.7 750 361.1 513.9 777.8 625 916.7 750 777.8 + 680.6 777.8 736.1 555.6 722.2 750 750 1027.8 750 750 611.1 277.8 500 277.8 500 277.8 + 277.8 500 555.6 444.4 555.6 444.4 305.6 500 555.6 277.8 305.6 527.8 277.8 833.3 555.6 + 500 555.6 527.8 391.7 394.4 388.9 555.6 527.8 722.2 527.8 527.8 444.4 500 1000 500 + 500 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 625 833.3 + 777.8 694.4 666.7 750 722.2 777.8 722.2 777.8 0 0 722.2 583.3 555.6 555.6 833.3 833.3 + 277.8 305.6 500 500 500 500 500 750 444.4 500 722.2 777.8 500 902.8 1013.9 777.8 + 277.8 500] + >> + endobj + 15 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F3 + /FontDescriptor 14 0 R + /BaseFont/BYERXD+CMR9 + /FirstChar 33 + /LastChar 196 + /Widths[285.5 513.9 856.5 513.9 856.5 799.4 285.5 399.7 399.7 513.9 799.4 285.5 342.6 + 285.5 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 285.5 285.5 + 285.5 799.4 485.3 485.3 799.4 770.7 727.9 742.3 785 699.4 670.8 806.5 770.7 371 528.1 + 799.2 642.3 942 770.7 799.4 699.4 799.4 756.5 571 742.3 770.7 770.7 1056.2 770.7 + 770.7 628.1 285.5 513.9 285.5 513.9 285.5 285.5 513.9 571 456.8 571 457.2 314 513.9 + 571 285.5 314 542.4 285.5 856.5 571 513.9 571 542.4 402 405.4 399.7 571 542.4 742.3 + 542.4 542.4 456.8 513.9 1027.8 513.9 513.9 513.9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 642.3 856.5 799.4 713.6 685.2 770.7 742.3 799.4 + 742.3 799.4 0 0 742.3 599.5 571 571 856.5 856.5 285.5 314 513.9 513.9 513.9 513.9 + 513.9 770.7 456.8 513.9 742.3 799.4 513.9 927.8 1042 799.4 285.5 513.9] + >> + endobj + 18 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F4 + /FontDescriptor 17 0 R + /BaseFont/KRSBFD+CMSY9 + /FirstChar 33 + /LastChar 196 + /Widths[1027.8 513.9 513.9 1027.8 1027.8 1027.8 799.4 1027.8 1027.8 628.1 628.1 1027.8 + 1027.8 1027.8 799.4 279.3 1027.8 685.2 685.2 913.6 913.6 0 0 571 571 685.2 513.9 + 742.3 742.3 799.4 799.4 628.1 821.1 673.6 542.6 793.8 542.4 736.3 610.9 871 562.7 + 696.6 782.2 707.9 1229.2 842.1 816.3 716.8 839.3 873.9 622.4 563.2 642.3 632.1 1017.5 + 732.4 685 742 685.2 685.2 685.2 685.2 685.2 628.1 628.1 456.8 456.8 456.8 456.8 513.9 + 513.9 399.7 399.7 285.5 513.9 513.9 628.1 513.9 285.5 856.5 770.7 856.5 428.2 685.2 + 685.2 799.4 799.4 456.8 456.8 456.8 628.1 799.4 799.4 799.4 799.4 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 799.4 285.5 799.4 513.9 799.4 513.9 + 799.4 799.4 799.4 799.4 0 0 799.4 799.4 799.4 1027.8 513.9 513.9 799.4 799.4 799.4 + 799.4 799.4 799.4 799.4 799.4 799.4 799.4 799.4 799.4 1027.8 1027.8 799.4 799.4 1027.8 + 799.4] + >> + endobj + 21 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F5 + /FontDescriptor 20 0 R + /BaseFont/NHVVDD+CMTT9 + /FirstChar 33 + /LastChar 196 + /Widths[525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 525 525 525 525 525 525 525 525 525 525 0 0 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525] + >> + endobj + 24 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F6 + /FontDescriptor 23 0 R + /BaseFont/GGIEHE+CMBX9 + /FirstChar 33 + /LastChar 196 + /Widths[360.2 617.6 986.1 591.7 986.1 920.4 328.7 460.2 460.2 591.7 920.4 328.7 394.4 + 328.7 591.7 591.7 591.7 591.7 591.7 591.7 591.7 591.7 591.7 591.7 591.7 328.7 328.7 + 360.2 920.4 558.8 558.8 920.4 892.9 840.9 854.6 906.6 776.5 743.7 929.9 924.4 446.3 + 610.8 925.8 710.8 1121.6 924.4 888.9 808 888.9 886.7 657.4 823.1 908.6 892.9 1221.6 + 892.9 892.9 723.1 328.7 617.6 328.7 591.7 328.7 328.7 575.2 657.4 525.9 657.4 543 + 361.6 591.7 657.4 328.7 361.6 624.5 328.7 986.1 657.4 591.7 657.4 624.5 488.1 466.8 + 460.2 657.4 624.5 854.6 624.5 624.5 525.9 591.7 1183.3 591.7 591.7 591.7 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 710.8 986.1 920.4 827.2 + 788.9 924.4 854.6 920.4 854.6 920.4 0 0 854.6 690.3 657.4 657.4 986.1 986.1 328.7 + 361.6 591.7 591.7 591.7 591.7 591.7 892.9 525.9 616.8 854.6 920.4 591.7 1071 1202.5 + 920.4 328.7 591.7] + >> + endobj + 26 0 obj + << + /Filter[/FlateDecode] + /Length 2450 + >> + stream + x?????????P?DUI?H?/_??8?8?J?0?T??? ?5!??N?>?E?tI*???h+ ???im??,bZ?????9?k?????w??\????u??8+W???+E??:????3?;???lx???[?+ ?t??.c?u?????U???>???????'???+ B???$)??????Csi??OZ-??c????"??Z+?2'??????wR??^Ei???????(??5???o?G_?D?h5?KqD???f??P^??u ???V?5???v?)?l??,????[F??)???l?D?3??????+ ??)???da?????CzHu?K?E!J?:U?L?f=3_m:&??????M??H+ ??Q]??8???/]????+ ??:?'?kP?* + D???l?(d-??4??r?(????/v8?_????n?????????)?? + g??!R%??L?(+ ?SS?n????m^C???b?Af?0/???o??? ??#??~%?Y?%'??\2`??m2?eF?a?e$??`gu9??rn??A??T9PX???W7?fpMIDe???A???r??(???D??f=?FDP???????~<1?3???B??}?AGEF'?rK?d?q;???h + ??Zb + ?Z??? yw? ah?:???v_??o?0?@????dE+????n?p?,UG?%??&@??E??t??pf?xp)??F'gZF?9?????w?b$ U?#"g_r?)z??=?????*?W-??? > + endobj + 6 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 28 0 R + >> + endobj + 33 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F7 + /FontDescriptor 32 0 R + /BaseFont/DWGIET+CMTI10 + /FirstChar 33 + /LastChar 196 + /Widths[306.7 514.4 817.8 769.1 817.8 766.7 306.7 408.9 408.9 511.1 766.7 306.7 357.8 + 306.7 511.1 511.1 511.1 511.1 511.1 511.1 511.1 511.1 511.1 511.1 511.1 306.7 306.7 + 306.7 766.7 511.1 511.1 766.7 743.3 703.9 715.6 755 678.3 652.8 773.6 743.3 385.6 + 525 768.9 627.2 896.7 743.3 766.7 678.3 766.7 729.4 562.2 715.6 743.3 743.3 998.9 + 743.3 743.3 613.3 306.7 514.4 306.7 511.1 306.7 306.7 511.1 460 460 511.1 460 306.7 + 460 511.1 306.7 306.7 460 255.6 817.8 562.2 511.1 511.1 460 421.7 408.9 332.2 536.7 + 460 664.4 463.9 485.6 408.9 511.1 1022.2 511.1 511.1 511.1 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 627.2 817.8 766.7 692.2 664.4 743.3 715.6 + 766.7 715.6 766.7 0 0 715.6 613.3 562.2 587.8 881.7 894.4 306.7 332.2 511.1 511.1 + 511.1 511.1 511.1 831.3 460 536.7 715.6 715.6 511.1 882.8 985 766.7 255.6 511.1] + >> + endobj + 34 0 obj + << + /Filter[/FlateDecode] + /Length 2903 + >> + stream + x??YK?????W??FZ?)?????v????%?H?M????????I???]]???????p?O?'????'??/??zzZO???O?????????b???Y?+?O/? ~i7?x???v?J???r#??3?6qX?]{?l???`+ uVO??X?????lK???+??s????????w?+ ??0?3??I?H??rw????6OWwOb?????Fz?W5?"??cO{?Y0??a???)??????r??EE!???!)M??+??.?9p?8?????fE?Z?!????]3??[?{?8?3????G @?-????5U????0%gg!? ?d?&y??~??g???;?H?gm8?? mrE?~p??c?"??`5?gXM?0???0P??|'??+E??: s???Lp??????EIC??????? :?????N/?? ??&Q ??6?-;???X??32'4??????v???b????)???}A???{?4?f?v?gkle[?y3f???XR?P?ccz???w??U?=??Z? + ?=? + ?8/'?X6?N???@7??y+ ???N????'?????%GA ;?R|? + ?x?F?????8?Ok?zH&??k*z???Q????G\@?S#???B?R?|6?$??"`???t?O-?nT0???S7?d???V0 ((e" + <;=RS?M?g?W(??=???D8????R??C?fZ'??????$?)j56"??S??7??&?F?j?{???x??N?Z?@????$o4z?N???@??Fuy?????nsP??yqr/?s??h?k?,,??#j~???(??Q?{?{?QK?(F??B)? ???S+_O?? ? '@?k!E??D?????W???F???"~Z?O??p?\!?k?? ??y????????d????( + ??~C??+ ??*}?Z'?o??5a4q??y?`RI?d????U?at_}??E?/??.m?> + endobj + 30 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 35 0 R + >> + endobj + 40 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F8 + /FontDescriptor 39 0 R + /BaseFont/JFHAFM+CMBX10 + /FirstChar 33 + /LastChar 196 + /Widths[350 602.8 958.3 575 958.3 894.4 319.4 447.2 447.2 575 894.4 319.4 383.3 319.4 + 575 575 575 575 575 575 575 575 575 575 575 319.4 319.4 350 894.4 543.1 543.1 894.4 + 869.4 818.1 830.6 881.9 755.6 723.6 904.2 900 436.1 594.4 901.4 691.7 1091.7 900 + 863.9 786.1 863.9 862.5 638.9 800 884.7 869.4 1188.9 869.4 869.4 702.8 319.4 602.8 + 319.4 575 319.4 319.4 559 638.9 511.1 638.9 527.1 351.4 575 638.9 319.4 351.4 606.9 + 319.4 958.3 638.9 575 638.9 606.9 473.6 453.6 447.2 638.9 606.9 830.6 606.9 606.9 + 511.1 575 1150 575 575 575 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 691.7 958.3 894.4 805.6 766.7 900 830.6 894.4 830.6 894.4 0 0 830.6 670.8 + 638.9 638.9 958.3 958.3 319.4 351.4 575 575 575 575 575 869.4 511.1 597.2 830.6 894.4 + 575 1041.7 1169.4 894.4 319.4 575] + >> + endobj + 43 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F9 + /FontDescriptor 42 0 R + /BaseFont/MMACQA+CMSY10 + /FirstChar 33 + /LastChar 196 + /Widths[1000 500 500 1000 1000 1000 777.8 1000 1000 611.1 611.1 1000 1000 1000 777.8 + 275 1000 666.7 666.7 888.9 888.9 0 0 555.6 555.6 666.7 500 722.2 722.2 777.8 777.8 + 611.1 798.5 656.8 526.5 771.4 527.8 718.7 594.9 844.5 544.5 677.8 762 689.7 1200.9 + 820.5 796.1 695.6 816.7 847.5 605.6 544.6 625.8 612.8 987.8 713.3 668.3 724.7 666.7 + 666.7 666.7 666.7 666.7 611.1 611.1 444.4 444.4 444.4 444.4 500 500 388.9 388.9 277.8 + 500 500 611.1 500 277.8 833.3 750 833.3 416.7 666.7 666.7 777.8 777.8 444.4 444.4 + 444.4 611.1 777.8 777.8 777.8 777.8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 777.8 277.8 777.8 500 777.8 500 777.8 777.8 777.8 777.8 0 0 777.8 + 777.8 777.8 1000 500 500 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 + 777.8 777.8 1000 1000 777.8 777.8 1000 777.8] + >> + endobj + 46 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F10 + /FontDescriptor 45 0 R + /BaseFont/BUKXWA+CMMI10 + /FirstChar 33 + /LastChar 196 + /Widths[622.5 466.3 591.4 828.1 517 362.8 654.2 1000 1000 1000 1000 277.8 277.8 500 + 500 500 500 500 500 500 500 500 500 500 500 277.8 277.8 777.8 500 777.8 500 530.9 + 750 758.5 714.7 827.9 738.2 643.1 786.2 831.3 439.6 554.5 849.3 680.6 970.1 803.5 + 762.8 642 790.6 759.3 613.2 584.4 682.8 583.3 944.4 828.5 580.6 682.6 388.9 388.9 + 388.9 1000 1000 416.7 528.6 429.2 432.8 520.5 465.6 489.6 477 576.2 344.5 411.8 520.6 + 298.4 878 600.2 484.7 503.1 446.4 451.2 468.8 361.1 572.5 484.7 715.9 571.5 490.3 + 465 322.5 384 636.5 500 277.8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 615.3 833.3 762.8 694.4 742.4 831.3 779.9 583.3 666.7 612.2 0 0 772.4 + 639.7 565.6 517.7 444.4 405.9 437.5 496.5 469.4 353.9 576.2 583.3 602.5 494 437.5 + 570 517 571.4 437.2 540.3 595.8 625.7 651.4 277.8] + >> + endobj + 49 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F11 + /FontDescriptor 48 0 R + /BaseFont/PSIOKW+CMR7 + /FirstChar 33 + /LastChar 196 + /Widths[323.4 569.4 938.5 569.4 938.5 877 323.4 446.4 446.4 569.4 877 323.4 384.9 + 323.4 569.4 569.4 569.4 569.4 569.4 569.4 569.4 569.4 569.4 569.4 569.4 323.4 323.4 + 323.4 877 538.7 538.7 877 843.3 798.6 815.5 860.1 767.9 737.1 883.9 843.3 412.7 583.3 + 874 706.4 1027.8 843.3 877 767.9 877 829.4 631 815.5 843.3 843.3 1150.8 843.3 843.3 + 692.5 323.4 569.4 323.4 569.4 323.4 323.4 569.4 631 507.9 631 507.9 354.2 569.4 631 + 323.4 354.2 600.2 323.4 938.5 631 569.4 631 600.2 446.4 452.6 446.4 631 600.2 815.5 + 600.2 600.2 507.9 569.4 1138.9 569.4 569.4 569.4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 706.4 938.5 877 781.8 754 843.3 815.5 877 815.5 + 877 0 0 815.5 677.6 646.8 646.8 970.2 970.2 323.4 354.2 569.4 569.4 569.4 569.4 569.4 + 843.3 507.9 569.4 815.5 877 569.4 1013.9 1136.9 877 323.4 569.4] + >> + endobj + 52 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F12 + /FontDescriptor 51 0 R + /BaseFont/OLNRCR+CMMI7 + /FirstChar 33 + /LastChar 196 + /Widths[719.7 539.7 689.9 950 592.7 439.2 751.4 1138.9 1138.9 1138.9 1138.9 339.3 + 339.3 585.3 585.3 585.3 585.3 585.3 585.3 585.3 585.3 585.3 585.3 585.3 585.3 339.3 + 339.3 892.9 585.3 892.9 585.3 610.1 859.1 863.2 819.4 934.1 838.7 724.5 889.4 935.6 + 506.3 632 959.9 783.7 1089.4 904.9 868.9 727.3 899.7 860.6 701.5 674.8 778.2 674.6 + 1074.4 936.9 671.5 778.4 462.3 462.3 462.3 1138.9 1138.9 478.2 619.7 502.4 510.5 + 594.7 542 557.1 557.3 668.8 404.2 472.7 607.3 361.3 1013.7 706.2 563.9 588.9 523.6 + 530.4 539.2 431.6 675.4 571.4 826.4 647.8 579.4 545.8 398.6 442 730.1 585.3 339.3 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 693.8 954.4 868.9 + 797.6 844.5 935.6 886.3 677.6 769.8 716.9 0 0 880 742.7 647.8 600.1 519.2 476.1 519.8 + 588.6 544.1 422.8 668.8 677.6 694.6 572.8 519.8 668 592.7 662 526.8 632.9 686.9 713.8 + 756 339.3] + >> + endobj + 53 0 obj + << + /Filter[/FlateDecode] + /Length 3678 + >> + stream + x??Z?????_??t?? &+ ??v(??mQ??$???????7??&??m ???3?C??? + ?.>9?(?????=?T??????`Le?w?AZ?(/?>?+ ?!??K ??sg??t?_??tJ?i?????@0????????t4?\?8?^1?>??gV?e?/+ ??m X??*?U??Vi??"P?80Pp?3? + ?Zk5\[? /F$A??m?}k?t?v???NU???\%?+ d?lr??T?F??V???Sg????qc?^,??}??e????6???9???`????+ ??3?w????0qN ???? V?????? ?????|o!?PB??G?#(`6?p???Tr?? \P??T9c?5???U???f????/l??q?s?n?'S&&E?????X?}19????v4?????T?7? ????????/1?????*??_?o?'~?ou?????????Ezj?0M???????\ ???x? ??????B?e????????BK??????O??|?tTgL???!?? ??????,?? ?j5? 9j*F$nC??d\J?U??+???t5?S???B`?( + ?|t???????Y2??? ??+ %>?x0yckb?? ?h? ???,1???^??0??\xf???????6R???\???? ???dva??L"6??9????{3????I v??d????1N??????? ?k????"#? EFt]??P_???J?N?^e??h7?????+?:???na/?? ??Wz??;|?;?)0 n??????? + ??K~?? + **??#????d8Q=??r6J" ??Be?????G???,?X??????C{???W???-lJ?)7!i?*??l%_??996wF?^Nq9>???p??<8-Uo??|?tH???$?h?":V + 6[?`W??A)u?*U"b:Y??=???k??+ ?????, ?^???R{??=?z???=[.H????????8?.???Z??l????J?08??????q~'?tV?3 >??+ ?40? + ??????4?????z???V?N?E{P?^e~?3l???6?"pv??~??,~q + endstream + endobj + 54 0 obj + << + /F2 12 0 R + /F1 9 0 R + /F8 40 0 R + /F9 43 0 R + /F10 46 0 R + /F11 49 0 R + /F12 52 0 R + /F7 33 0 R + >> + endobj + 37 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 54 0 R + >> + endobj + 59 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F13 + /FontDescriptor 58 0 R + /BaseFont/PZJINS+CMR5 + /FirstChar 33 + /LastChar 196 + /Widths[402.8 680.6 1097.2 680.6 1097.2 1027.8 402.8 541.7 541.7 680.6 1027.8 402.8 + 472.2 402.8 680.6 680.6 680.6 680.6 680.6 680.6 680.6 680.6 680.6 680.6 680.6 402.8 + 402.8 1027.8 1027.8 1027.8 645.8 1027.8 980.6 934.7 958.3 1004.2 900 865.3 1033.4 + 980.6 494.5 691.7 1015.3 830.6 1188.9 980.6 1027.8 900 1027.8 969.5 750 958.3 980.6 + 980.6 1327.8 980.6 980.6 819.5 402.8 680.6 402.8 680.6 402.8 402.8 680.6 750 611.1 + 750 611.1 437.5 680.6 750 402.8 437.5 715.3 402.8 1097.2 750 680.6 750 715.3 541.7 + 548.6 541.7 750 715.3 958.3 715.3 715.3 611.1 680.6 1361.1 680.6 680.6 680.6 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 830.6 1097.2 1027.8 + 911.1 888.9 980.6 958.3 1027.8 958.3 1027.8 0 0 958.3 680.6 680.6 402.8 402.8 645.8 + 402.8 437.5 680.6 680.6 680.6 680.6 680.6 980.6 611.1 680.6 958.3 1027.8 680.6 1177.8 + 1316.7 1027.8 402.8 680.6] + >> + endobj + 60 0 obj + << + /Filter[/FlateDecode] + /Length 3519 + >> + stream + x??ZK?????W(7?jD? ??????u???S???W??0?H??????J??7?E?Fw???n??,?W?+??5???~\???j??~q????????????b??(3U??????-?l???????/V???T:?U??i???w??<4wtz?G?Yj??Xzv8????????N????J 4e?e9??i? 'M????&??????y??Yx?+ ?2[?2?????,/c??????mK;+ ????_???????D + ??7?5uR?&.?6FT&???/??h?J???f?4f?b?_?R??=$??A?1?O?1]??YV??]??h5?Xt???*E?Yr????hP?flS?k??h_?4d"ri????m_Ov????Z???b?2???ggKg?,P?e,?? + ??#?OM?d???X???.[??!? ???N???H^?? @?`0??VV????s?????hdd?T???~?????+?t&PY??.?7???z??fo??+ ?? ??fH??R??n????S? ?p?(9,?q!9lQrX??-8?4?hv?|?k?&4??w!??U?'?O!???MtV?ya???9+ ?S??VuP_Q???a????Z?T????vvO#????&;s?r???}kM????~?!??????s"????Wx?P??2E?D???-? ?zx4?W\?H0>?Z?j?????a?]??G?X?=O?u?3????T??&???H????E+ ???????3?e??f?2?m+ ?pc?i?o?,w?D?v!?` ??A??Ab, + ?y?+??h?;?0~x????zH?Q?>???8??Q??????<8? ??????w?a?7 ?????g???o!9l@ c?c?Gf?????????]????8a #a???=?7EF??m{6s??4? >DxR?G ?7%?6?Ht??Et?L? XJ??$=b??????M?? + endstream + endobj + 61 0 obj + << + /F9 43 0 R + /F2 12 0 R + /F10 46 0 R + /F12 52 0 R + /F8 40 0 R + /F7 33 0 R + /F13 59 0 R + /F11 49 0 R + >> + endobj + 56 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 61 0 R + >> + endobj + 66 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F14 + /FontDescriptor 65 0 R + /BaseFont/QSYXAN+CMMI5 + /FirstChar 33 + /LastChar 196 + /Widths[886.4 674.7 855.3 1144.8 726 578.1 918.1 1361.1 1361.1 1361.1 1361.1 458.3 + 458.3 736.1 736.1 736.1 736.1 736.1 736.1 736.1 736.1 736.1 736.1 736.1 736.1 458.3 + 458.3 1083.3 736.1 1083.3 736.1 749 1036.1 1037 996 1109.9 1007 867.4 1064 1110.4 + 626.7 772.9 1138.9 955.6 1284 1075.7 1047.5 875.4 1082.2 1030 856.3 832.3 943.9 827.8 + 1279.2 1112.9 824.3 943.1 597.2 597.2 597.2 1361.1 1361.1 597.2 774.4 633.3 649.4 + 739.7 677 684 700.6 827.6 533.6 588.2 758.1 480.3 1228 880.8 702.8 739.7 658.9 671.3 + 670.1 563.7 846.1 722.2 1009 791.7 730.6 688.7 533.6 553.5 889.2 736.1 458.3 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 832.6 1152.8 1047.5 + 966.7 1017.7 1110.4 1065.3 840.3 944.5 893.5 0 0 1060.6 913.3 790.6 746.9 654.2 613.5 + 666.7 743.8 677.1 549.8 827.6 840.3 849.8 712 666.7 831.1 726 815.2 681.6 791.7 841.7 + 864.6 930.6 458.3] + >> + endobj + 69 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F15 + /FontDescriptor 68 0 R + /BaseFont/TZQOQC+CMSY7 + /FirstChar 33 + /LastChar 196 + /Widths[1138.9 585.3 585.3 1138.9 1138.9 1138.9 892.9 1138.9 1138.9 708.3 708.3 1138.9 + 1138.9 1138.9 892.9 329.4 1138.9 769.8 769.8 1015.9 1015.9 0 0 646.8 646.8 769.8 + 585.3 831.4 831.4 892.9 892.9 708.3 917.6 753.4 620.2 889.5 616.1 818.4 688.5 978.6 + 646.5 782.1 871.7 791.7 1342.7 935.6 905.8 809.2 935.9 981 702.2 647.8 717.8 719.9 + 1135.1 818.9 764.4 823.1 769.8 769.8 769.8 769.8 769.8 708.3 708.3 523.8 523.8 523.8 + 523.8 585.3 585.3 462.3 462.3 339.3 585.3 585.3 708.3 585.3 339.3 938.5 859.1 954.4 + 493.6 769.8 769.8 892.9 892.9 523.8 523.8 523.8 708.3 892.9 892.9 892.9 892.9 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 892.9 339.3 892.9 585.3 + 892.9 585.3 892.9 892.9 892.9 892.9 0 0 892.9 892.9 892.9 1138.9 585.3 585.3 892.9 + 892.9 892.9 892.9 892.9 892.9 892.9 892.9 892.9 892.9 892.9 892.9 1138.9 1138.9 892.9 + 892.9 1138.9 892.9] + >> + endobj + 72 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F16 + /FontDescriptor 71 0 R + /BaseFont/XWIFMP+CMBSY10 + /FirstChar 33 + /LastChar 196 + /Widths[1150 575 575 1150 1150 1150 894.4 1150 1150 702.8 702.8 1150 1150 1150 894.4 + 344.4 1150 766.7 766.7 1022.2 1022.2 0 0 638.9 638.9 766.7 575 830.6 830.6 894.4 + 894.4 702.8 920.7 747.8 613 892.1 606.9 814.1 681.6 987.4 642.4 779.4 871.2 788.2 + 1377.8 937.3 905.6 809.9 939.2 989.6 696.4 644.1 714.7 737.4 1168.6 816.7 758.6 818.5 + 766.7 766.7 766.7 766.7 766.7 702.8 702.8 511.1 511.1 511.1 511.1 575 575 447.2 447.2 + 319.4 575 575 702.8 575 319.4 958.3 900 958.3 568.8 766.7 766.7 894.4 894.4 526.4 + 511.1 511.1 702.8 894.4 894.4 894.4 894.4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 894.4 319.4 894.4 575 894.4 575 894.4 894.4 894.4 894.4 + 0 0 894.4 894.4 894.4 1150 575 575 894.4 894.4 894.4 894.4 894.4 894.4 894.4 894.4 + 894.4 894.4 894.4 894.4 1150 1150 894.4 894.4 1150 894.4] + >> + endobj + 75 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F17 + /FontDescriptor 74 0 R + /BaseFont/ZPTNFD+MSAM10 + /FirstChar 33 + /LastChar 196 + /Widths[1388.9 1000 1000 777.8 777.8 777.8 777.8 1111.1 666.7 666.7 777.8 777.8 777.8 + 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 275 500 777.8 777.8 777.8 + 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 944.4 500 722.2 777.8 777.8 + 500 500 722.2 722.2 722.2 777.8 777.8 777.8 777.8 777.8 750 1000 1000 833.3 611.1 + 611.1 611.1 722.2 722.2 722.2 777.8 777.8 777.8 777.8 777.8 666.7 666.7 760.4 760.4 + 777.8 777.8 777.8 777.8 777.8 777.8 1333.3 1333.3 500 500 946.7 902.2 666.7 777.8 + 777.8 777.8 500 500 833.3 500 555.6 777.8 777.8 777.8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 777.8 777.8 777.8 777.8 777.8 277.8 666.7 666.7 + 777.8 777.8 0 0 1000 1000 777.8 722.2 888.9 611.1 1000 1000 1000 1000 833.3 833.3 + 416.7 416.7 416.7 416.7 1111.1 1111.1 1000 1000 500 500 1000 777.8] + >> + endobj + 76 0 obj + << + /Filter[/FlateDecode] + /Length 4098 + >> + stream + x??]o?????B})(?b?????C$??_.@?????/\???I??? M??e?? ??grD???????Z_???S???f Pvf_p?W????p????vt?? 0?!Ke?T??%X??!}a?n?A?@?4????/?%??b?!?D`?b??Ff?@?#th??g(??w??c?[??V?h+Y?\?l?W! ? b???h??*???3?o(\ wx>g??.:q?????Q{d?\?;?L????D?????B%9N????0?U:N.??_??h?(E\6s!gx?.&????@??2#?,3m )?o??P???????@/??LN%/j????m?xZ?.L?',U???G??X?G/L?????c????k?f ?rW? ???a???G7?z5??}K????3?tfc????>?aU?]??S??%?????'X???&??D?9????K?$????E4?.??7S???? ??O?8??)?_|n?\?L?K????h??=?m???R??J?3??:?!K%?+]??G?????G?DD]????;Z ??P??746?? + ???W???ff????? 3?f${C>U??rpL o????#??8I~=???7????+ ???n?\???=?K??e+ c????h!??;? h!`)??|B + (??H??z???N?? ?o.?PB?,????R/3????L|6[x??r?kx??>2t??7???Yk? ??????'?o???va?B??Y?P??#"????EZS@??? Tj?L?6QA3?Q?h + ???8 ?P????????4s_"????-zfq???9e???M????????C?z??29????a 6i?B???0?*???4p{\D?R,?????,zwW??`T???w?s0???y??(??/i?U[mU? ]???6L?L|bE2XI*/?w????W?b????JlQ"?'W ??n4\\?C??0?&{?\?e?E??????{.L? + ??Z???????????? >?u????q[??E1???X}?6??Y???c???cj?f??U?c?%f??VaS?A?+ ??z*=@]?o?S???T}3t??r??????Qy??????\???Sw?N??"?s?fg B?g?????N??]?????pb?{?:?{???4q[??b? ?4?????N?*??T/ ??Pko????\s[?ih7?LL ???`?Z?Z?????n????-?.+??? ??H9~??Lb|8?8?)?%2????^?'C5x???K 4?j"z???????? ?R????U'???xh65=)> + endobj + 63 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 77 0 R + >> + endobj + 80 0 obj + << + /Filter[/FlateDecode] + /Length 4052 + >> + stream + x??Ms????_??D?? ???d:i?d????x??8??%?f"? + I???C~{w?+ d+ "??o?b????}u??c2Li?/???????@?+ ??X??????u??q?0z.?:Aq?*????????.-?D?'4??42????????????"q??D??3?D?4?F??0?M1nc?????S???^N?6?????'???<? + Q????Oxbn?Pu??my?Y?~??Y?zb??%?t??????N??=?J?1y%X[4X??? ???????$?+ O???-???C?z????A-?l?4 + #w?????5,L?-?? >?????t????nin?????oy?? >?s??0?( ??a[?????jj?????)?A????H????uy????,????o?.|?O at o? ?????_??c?u??UI???mC)tiA????????????????&??????} 4?0-G!M?8?????????$????p6????+ ?S???/??{|??b??$? ?,'7_?OUOo? US????? ???g??0????+ ?M???Y?????????"???????z????????i?? ??)???????SgK??aR??fXa?i???????i]?'?.??v?????O?H???P?^??/H?y??'???*???NRgyl?*??????:?q<~+ iR????c???/ ??irJdL/D?t??q??d?e M*Q?ES??Y???h?7m?8????I}\???%?9????-?????????>??}????????? ?[???:???? + ?p)0YH??????l???r%RiR?,B??????e?8 ????????t9Z? ??T0=)?z" nL}??r??4???l?8?D{ue?zo?$t??c??????6????????HQ?tH????t?pe????k?? + ?e`?e?re/??L??"Kfj[t???`:??? ??Y*??^?P&??i)???/x?8?Xp?p?p|????C??????Yj1%u??$AYc??&OS????)??k6f[}G?XZ5(-?b}T?[?:+ ?T)S?Py??Y???*#???u????Dw????qv???%??? cq????????|??B?*????_?)????h?????_?MlU????zL?1FX??y?(b??#)???b?75?G??@%?z?rk?"?I???E#?i?w???O?????b69?JF1kZOe?Ok?lu??#????r5J??qa?~????R??+ ?L!1|???{_f?? x???,?b?|??` ???+ ?MP}\??`????6???0L????L?9Hb%?+ y? + endstream + endobj + 81 0 obj + << + /F2 12 0 R + /F8 40 0 R + /F9 43 0 R + /F10 46 0 R + /F12 52 0 R + /F7 33 0 R + /F17 75 0 R + /F14 66 0 R + /F11 49 0 R + /F15 69 0 R + >> + endobj + 79 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 81 0 R + >> + endobj + 84 0 obj + << + /Length 790 + /Filter/FlateDecode + /Name/Im1 + /Type/XObject + /Subtype/Form + /BBox[0 0 2384 3370] + /FormType 1 + /Matrix[1 0 0 1 0 0] + /Resources<< + /ProcSet[/PDF/Text] + /Font 85 0 R + >> + >> + stream + x??V?o?1 ?????C???8??H?[??"@???????q???ib?a?[?l??$}??/??u?3??<g? + ?C?? + ? r`????kN??I1Cvl???d?"??BJ?*A|??H?-8*8?Q??????0S????8{??B?????2By??7????dD(???q[?r????sk a??X? x,?O??2{YE??+yFA???s?PJ??v(?E?\'?i;?w?f?qWH???"??r??5??P?rp?PH?c?b???P?'5d??"??F?=?r?z????4nE?Q?@A\?B?????5O?? ??? &)Q??? ?-n????n0????[#?????'b????SD??(??uI???, a?C&??'a?2N???{? ?uD?n??????x?U?i, ??? + ?t )??kk??z??5y]??/??Mq????=? ??o?TM??S;?#?x8?!????????? ?a???;?g/????Q???O?k??;Ez????%??w?~?y???????q?o??]? ?=|1????????????{sX???????Y*??@??'!??o>????????hO7???6?????????????~~K?J? + endstream + endobj + 85 0 obj + << + /R7 86 0 R + >> + endobj + 86 0 obj + << + /BaseFont/Times-Roman + /Type/Font + /Subtype/Type1 + >> + endobj + 89 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F18 + /FontDescriptor 88 0 R + /BaseFont/OYBFMT+CMMI9 + /FirstChar 33 + /LastChar 196 + /Widths[639.4 477.1 609.5 852.5 529.4 374.4 671.1 1027.8 1027.8 1027.8 1027.8 285.5 + 285.5 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 513.9 285.5 + 285.5 799.4 513.9 799.4 513.9 543.7 770.7 777.7 733.6 847.5 756.3 656.2 804.8 850.2 + 449.3 566.3 870.4 699.4 992.9 821.6 782.1 656.2 810.6 777.6 627.9 599.6 699.1 599.4 + 970.5 849 596.5 699.2 399.7 399.7 399.7 1027.8 1027.8 424.4 544.5 440.4 444.9 532.5 + 477.8 498.8 490.1 592.2 351.7 420.1 535.1 306.7 905.5 620 497.5 515.9 459.2 463.7 + 478.8 371.1 591.4 499.2 736.6 582.6 506.2 478 334.5 391.6 653.3 513.9 285.5 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 627.7 856.5 782.1 713.6 + 760.6 850.2 799.2 599.5 685.2 631.1 0 0 792.1 658.7 579.2 530.8 455.9 416.4 450.6 + 513.2 481.1 363.8 592.2 599.5 619.2 506.9 450.6 588.2 529.4 587.7 452.4 556.3 611.7 + 640.8 670.5 285.5] + >> + endobj + 92 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F19 + /FontDescriptor 91 0 R + /BaseFont/KESPKK+CMMI6 + /FirstChar 33 + /LastChar 196 + /Widths[779.9 586.7 750.7 1021.9 639 487.8 811.6 1222.2 1222.2 1222.2 1222.2 379.6 + 379.6 638.9 638.9 638.9 638.9 638.9 638.9 638.9 638.9 638.9 638.9 638.9 638.9 379.6 + 379.6 963 638.9 963 638.9 658.7 924.1 926.6 883.7 998.3 899.8 775 952.9 999.5 547.7 + 681.6 1025.7 846.3 1161.6 967.1 934.1 780 966.5 922.1 756.7 731.1 838.1 729.6 1150.9 + 1001.4 726.4 837.7 509.3 509.3 509.3 1222.2 1222.2 518.5 674.9 547.7 559.1 642.5 + 589 600.7 607.7 725.7 445.6 511.6 660.9 401.6 1093.7 769.7 612.5 642.5 570.7 579.9 + 584.5 476.8 737.3 625 893.2 697.9 633.1 596.1 445.6 479.2 787.2 638.9 379.6 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 742.6 1027.8 934.1 859.3 + 907.4 999.5 951.6 736.1 833.3 781.2 0 0 946 804.5 698 652 566.2 523.3 571.8 644 590.3 + 466.4 725.7 736.1 750 621.5 571.8 726.7 639 716.5 582.1 689.8 742.1 767.4 819.4 379.6] + >> + endobj + 93 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F20 + /FontDescriptor 74 0 R + /BaseFont/ZPTNFD+MSAM10 + /FirstChar 33 + /LastChar 196 + /Widths[1427.5 1027.8 1027.8 799.4 799.4 799.4 799.4 1142 685.2 685.2 799.4 799.4 + 799.4 799.4 799.4 799.4 799.4 799.4 799.4 799.4 799.4 799.4 799.4 279.3 513.9 799.4 + 799.4 799.4 799.4 799.4 799.4 799.4 799.4 799.4 799.4 799.4 799.4 946 513.9 726.9 + 799.4 799.4 513.9 513.9 726.9 726.9 726.9 799.4 799.4 799.4 799.4 799.4 770.7 1027.8 + 1027.8 856.5 628.1 628.1 628.1 742.3 742.3 742.3 799.4 799.4 799.4 799.4 799.4 685.2 + 685.2 788.1 788.1 799.4 799.4 799.4 799.4 799.4 799.4 1370.4 1370.4 513.9 513.9 961.4 + 916.7 685.2 799.4 799.4 799.4 513.9 513.9 856.5 513.9 571 799.4 799.4 799.4 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 799.4 799.4 799.4 799.4 + 799.4 285.5 685.2 685.2 799.4 799.4 0 0 1027.8 1027.8 799.4 742.3 913.6 628.1 1027.8 + 1027.8 1027.8 1027.8 856.5 856.5 428.2 428.2 428.2 428.2 1142 1142 1027.8 1027.8 + 513.9 513.9 1027.8 799.4] + >> + endobj + 96 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F21 + /FontDescriptor 95 0 R + /BaseFont/SPFWBN+CMTT10 + /FirstChar 33 + /LastChar 196 + /Widths[525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 525 525 525 525 525 525 525 525 525 525 0 0 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525] + >> + endobj + 97 0 obj + << + /Filter[/FlateDecode] + /Length 3862 + >> + stream + x??[???? ?_?????kE$E}\&???^'?Lf??????Ag???????l?? ?%Q???\/}Y?"? ?+ [r7?=?????6????R?J???l)????+C3?? + @?t??mC?0?i???L??????N J??????j??q??Um8?+ < ??W????????p?w?}E?,???K??=x???2?GR??=e??E???B?t?s0?1@|s ?-?!eN?/$?3??????^1??Q???L?I?ABq?+PE1?9?^PZ? a?l?C??&@??????`?{??@-+' + "+????:4@?D???????r?3????9#?Oz??g????M???? + g?Y????????#?4z?pF?ml? _?|A?xa??2 + ?^???U? + W??M8F??z?????VX??Q??+?+ Q%:????T?u1I?3?OaN?bb?{?.+ ??U??????H?l|2?????V?:1X??#k???v~?.??G?[????)??\??7%d?p?n?K3zC?????+,~?9?%o??1???'_??????s?????7?????"2- ?/fU> + endobj + 99 0 obj + << + /Im1 84 0 R + >> + endobj + 83 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 98 0 R + /XObject 99 0 R + >> + endobj + 104 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F22 + /FontDescriptor 103 0 R + /BaseFont/EMJFTD+CMITT10 + /FirstChar 33 + /LastChar 196 + /Widths[525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 525 525 525 525 525 525 525 525 525 525 0 0 525 + 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 525 + 525 525] + >> + endobj + 105 0 obj + << + /Filter[/FlateDecode] + /Length 3204 + >> + stream + x??]???????}ie?????}?n???E???M + p-?"K>Q??????3R?-9???????3?7?? X???#}???gG??X?.???wo?"??dq?]$?O??:?4[\???S?r???_????????c?@???lZy??????Jl???4??? I?n/:??fQ+jU??l ?R??m+7??????.???1M3??????Tr?\?a???Hkr?????g^?v4I(?0"?z?E??!d?6?lz?k?????hdm>?6?S?Xg??#M?{???}/?I??I?.|??B8P??m????bgZ?=???7,7?|??}?O?j?fI?j??r?????????f??dA#??????@??????^???3|?%?0y??????0??d??C??5??L?????QN?O+ ??}N?>?X????D????m:eW?O?g??????v?????'??Y???)iY??8????????Y?v;gZ??z"??(M??:6?p???Tv???f???w??4??hK??t??????0?k?q?????%?v?@?C?p?t??t??[?????N?'b?l?h~Eg???b?y????s7???+???z$??9??O??????????*?>????r{ CQ????JB?)f?$?????Y?????/?-|?m?s}??^>x?=7N?yo?c??'?w*#???C?9Y>??.;?<}????g`??,:B??$?}??R?1? 1?m?=@????%???? ?V?+ &? tL1$e???j??(0?#????: sx??l?m?1$??|hk???_?????! ???6?$??`??XY??L?Vd'[E???K + ?n}?8_a> ?PJ?I??d 1?T??d-[+M ??]??????^p???? ??S?t + Q?4??(!??R???5??R=?0??Y~?? ???A[JI[?R?!?r>???????;r?? + ?????G. 3?FC%???Y????????0Z(?? ?lM??I"]&?R?(Z/ Fs'4dK5??????x+G[i?'9eS1??5IX + DIe?9?????C?????u?Q+ ??????A7?J??`?y???P??2 KG??A?Tp?T?a??F( ????yA??; ?_/?*[?c???}v???E?????M B?"\ ?~?????7}UP????IpHlC? V?&???????VTs?????&rAv??j??w|T??????j??5 ????a(? + t???z???`6?? hT?T?:?? o??DG0?%U? {???}?k?9e???????-qCr?h???{???????+?:??????n????? hy??<?@Jh???0?R?M???????W?i?yl?+ ?g??L?>?:j??R??E0?*?!??>X?M[??A? >?????Y??\qb0???^??m?8,?+ endstream + endobj + 106 0 obj + << + /F2 12 0 R + /F9 43 0 R + /F10 46 0 R + /F12 52 0 R + /F17 75 0 R + /F8 40 0 R + /F7 33 0 R + /F22 104 0 R + /F1 9 0 R + >> + endobj + 101 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 106 0 R + >> + endobj + 109 0 obj + << + /Filter[/FlateDecode] + /Length 3887 + >> + stream + x??[K?????W(7N??&?5[>8???G?????!Wq$? ?TH???!?=???i????? ?ht7??WQE???}??'??.??y?????/??U???q??0KV?D?Y????o????]????*??i?????C?I?????BD????????~??7???? ;??T??UDc??n?????X%4??T??-C?JJ????C|??+ C{0_?zC?????4?9???F??E??MHc_U\?`r?+ }?v}?Bk?12P?yF???;?S?K??~$?6?|????????{???-b?'?r??Q '_G???p??? ????8X?"cH???M???SZ???aSE?!????C?AviI??????_C?p?+ q?????uU????g]?AT?$??|??@??~??????v??n???|???z]???f?d$SI?3?Sm?;&{??9??&x??8?G[??Xk+ ???f?jI*?F?~?p??r????SW????X???P????["??K&?+????}???,2?W??}?? ?????????????*?W???X???H?/ + ?jX~v?7_??J?W??1??????}N?j????+? ?/x??????hc.)K}r???C_?Z???w??:g "O??]N????GB?{??iH?w???n?tO!?{ + ????p??????????f'??9r?s?????u????0?s???#."~m??#??a?/9O H?k@?R??e??3?^??-?????\^????? ???J ???'??4???w??K??7?R????Ocz??s+\?M?-?^??{?F4?']8s?-r_??VfuR8?`??t?(?[tpfJ???? ??=t????v??K??+ + 1~Je?;?>L?????M?Q??C ??????:C?Uw?_}?W?Mf?G>8"?> + endobj + 108 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 110 0 R + >> + endobj + 115 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F23 + /FontDescriptor 114 0 R + /BaseFont/GQIZOO+CMR6 + /FirstChar 33 + /LastChar 196 + /Widths[351.8 611.1 1000 611.1 1000 935.2 351.8 481.5 481.5 611.1 935.2 351.8 416.7 + 351.8 611.1 611.1 611.1 611.1 611.1 611.1 611.1 611.1 611.1 611.1 611.1 351.8 351.8 + 351.8 935.2 578.7 578.7 935.2 896.3 850.9 870.4 915.7 818.5 786.1 941.7 896.3 442.6 + 624.1 928.7 753.7 1090.7 896.3 935.2 818.5 935.2 883.3 675.9 870.4 896.3 896.3 1220.4 + 896.3 896.3 740.7 351.8 611.1 351.8 611.1 351.8 351.8 611.1 675.9 546.3 675.9 546.3 + 384.3 611.1 675.9 351.8 384.3 643.5 351.8 1000 675.9 611.1 675.9 643.5 481.5 488 + 481.5 675.9 643.5 870.4 643.5 643.5 546.3 611.1 1222.2 611.1 611.1 611.1 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 753.7 1000 935.2 831.5 + 805.5 896.3 870.4 935.2 870.4 935.2 0 0 870.4 736.1 703.7 703.7 1055.5 1055.5 351.8 + 384.3 611.1 611.1 611.1 611.1 611.1 896.3 546.3 611.1 870.4 935.2 611.1 1077.8 1207.4 + 935.2 351.8 611.1] + >> + endobj + 118 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F24 + /FontDescriptor 117 0 R + /BaseFont/IRJVNO+CMSY6 + /FirstChar 33 + /LastChar 196 + /Widths[1222.2 638.9 638.9 1222.2 1222.2 1222.2 963 1222.2 1222.2 768.5 768.5 1222.2 + 1222.2 1222.2 963 365.7 1222.2 833.3 833.3 1092.6 1092.6 0 0 703.7 703.7 833.3 638.9 + 898.1 898.1 963 963 768.5 989.9 813.3 678.4 961.2 671.3 879.9 746.7 1059.3 709.3 + 846.3 938.8 854.5 1427.2 1005.7 973 878.4 1008.3 1061.4 762 711.3 774.4 785.2 1222.7 + 883.7 823.9 884 833.3 833.3 833.3 833.3 833.3 768.5 768.5 574.1 574.1 574.1 574.1 + 638.9 638.9 509.3 509.3 379.6 638.9 638.9 768.5 638.9 379.6 1000 924.1 1027.8 541.7 + 833.3 833.3 963 963 574.1 574.1 574.1 768.5 963 963 963 963 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 963 379.6 963 638.9 963 638.9 963 963 + 963 963 0 0 963 963 963 1222.2 638.9 638.9 963 963 963 963 963 963 963 963 963 963 + 963 963 1222.2 1222.2 963 963 1222.2 963] + >> + endobj + 119 0 obj + << + /Filter[/FlateDecode] + /Length 3076 + >> + stream + x?????????Pn??&+ ???? ??a??i?????x?(?A?v??H???OI\???`??X;????28~3O???2?R??R??.???9oq???1B? D??????a})?R\???P????@?A+ q&????) ??? !}?E?9??,?DX?}@J?cs??????TV`#???3'_D??;??Ow?w7+?dEW?????g&???m????}2??H?a??]?#??"?|? + ?h?1??n???x|??}??????J-"?k??}???z???)?F:? ?1?L??*?L0???V???f??U? ~-??p?kx*w"?*??%??r7]^?B?*?1l?h???;^,?2t??????6p??-???+8q?????S??R%N?jR???W?)M?TE?'xtSTT?b9*??" i??x?}o#8:#??????a?X?5??#9 at AG?8?????h*??!???/???IZTgo?H + m? e?K??d????sA?t: ???|? Y????-?'?????????g??@??,??oU???/<??????????S~??0??(?gx?c???0???pR??v+????K.xD??i?n?Q???@??RT/P3_%??????%?em??????.?.7U?w???T???#G????`9f(f???wA/??1x4&T`}9?? I?-!?V?I???9??? u???p???3C?2?r?r????/]??f2X?f????|???C??x?ziP[9??( "Q?/k?LE?=?k?8? 2(???E???E???t"/?C??(c??? ????,6?cp??|?|L???????Z?A?u??vW????#{?U???????T?h?L_<??~?[?l?????#I?C???,LM-G????L??D??a4?A? ??h?^??a??s??O8??.~?k?7AQ"????K#?p??f?C????_DL8X9?>@h?kX????|zba?D?????$'P?kP?]??`??S??5?W0q(????/P??Ce`O????6? ?>???????+??$ '^???????/???(Vo.Kb??????? + ???rg?l??W?:? SA[????g?;?1c???M?.{@?~?Q?[??-????6?g???0??,?l]C#?H?)?? &??????????=r |?y`S?&?J?y? + ??H?Q:Fo????N? /F????Y?m + endstream + endobj + 120 0 obj + << + /F2 12 0 R + /F21 96 0 R + /F10 46 0 R + /F12 52 0 R + /F5 21 0 R + /F22 104 0 R + /F23 115 0 R + /F19 92 0 R + /F4 18 0 R + /F24 118 0 R + /F6 24 0 R + /F3 15 0 R + /F18 89 0 R + /F20 93 0 R + /F8 40 0 R + /F9 43 0 R + >> + endobj + 112 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 120 0 R + >> + endobj + 123 0 obj + << + /Length 1547 + /Filter/FlateDecode + /Name/Im2 + /Type/XObject + /Subtype/Form + /BBox[0 0 2384 3370] + /FormType 1 + /Matrix[1 0 0 1 0 0] + /Resources<< + /ProcSet[/PDF/Text] + /Font 124 0 R + >> + >> + stream + x??XMoe5 ??_q?? ???EB??V?bU#?.????s??N?}?T????Oo??'????????V????lv?TM?q?6/??????~?o.??-W2?{?J5z?q0?jj??(D??\jC?q??h????5?o>o???????);??n.????z?z?"u?!C?e??????"??o&??;? ???N?`B%?]p?????J???'???W5?????8??Z????????@5???'8_?? $? M-?M>??????????6?? ???(?? <6????4???\2??C?l (O????)6?R+?R???fJ??!??)=?w<?9?? }?hr????St??g??71FEYcz#dmXd?-?????P?(G ?J??KA?:P)8E????nr?r?:EVY?@?c???J?L?? ??b??L???&?????????+ R$?j????6D?b2_??T?|???}?A?8?(??V???/?????GR??{%M?*???#??e"?q?)q?U?{????v? ??d+ endstream + endobj + 124 0 obj + << + /R7 125 0 R + >> + endobj + 125 0 obj + << + /BaseFont/Times-Roman + /Type/Font + /Subtype/Type1 + >> + endobj + 126 0 obj + << + /Filter[/FlateDecode] + /Length 3954 + >> + stream + x??[[s??~???>??ji?B?t&???{???I3q:C?RZ?????e?!??????+?????88??@?(?????~??????-??u??~???g/?* ?d??z?????u?B???|?C???/~|??g/E4?$L??UD?oe"??qF???&???+????X?Dm??:?vy????n??_???I?s? ???}Qp????k???8?g]???6?;??oC??G?H?j-E?$??D1?????mYm???u???? ?-[??????J?M}??X?4??b??we??????????y0o???:??C?aoi??????????J???b*????V&?w*SDM??m]????mMt-?Vu? ????g???9$EJ}?Vl?7???P???Pz????w?v~????<`1J????[??? + ??V??? + rHUp?=4?????=?tp?+*?bI?xp????X???????????d6q_??4??h????Pd???r?????8???B??????CcV?a?r6? Ez??o?'Q?d??W?????JE???|7fN?vd? f??05?)?+ ???vu??r7??????br??k|??U?????Lc?s???????0???+??}Y?H??AqTl????5?vu?'k??D`w[?g???.???~?8?t??-??=? ?"?? ??/??M?t??h?|????F?????AGC??? ?? g?8?Y????a/6????(?V?????????>GsbI~?hB?? B???+ ????qKn?7M~?#????a\p?!*????K???k????Ll??e?J??.6a????aah?p?????wVV7i??????p???5V?M?8`?t????K?dvKG??d??h?Z}?i???????X????{_??#@???]?O???K?Kr3?????+ ?J?]???wr?.CY??,?4k??I??{ ??Q'?+ ?A?F6Od?2???o? J?2X?t?pV?8`?C???N?7?7fT??"?X??"?????f?/??+ n/?(???A?????7?N????k?Y??/.0?,??????.?1???Er?R?`?+ 66??`????|??x?"??p??m?t?@c????P?[???F???????oN?U?H????zJ2?f+???Z?;??c?LQ????O??!?d F?J?????c?^??? ??_od?N'k*?d?0???Ue/#?r?E?q?Dy ??\!_Es? ,9jN??????N?M?i?????ZJ??????E)?C? ?Xh?? ??j??W??q5?LQ&?]???H???0????%(c??G4??????J????%/(r? + ???$ ?o??????-?? + (N> + endobj + 128 0 obj + << + /Im2 123 0 R + >> + endobj + 122 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 127 0 R + /XObject 128 0 R + >> + endobj + 131 0 obj + << + /Filter[/FlateDecode] + /Length 3518 + >> + stream + x??ZY??4~?_Qo?"??%?C??2 ?n?t,4n[]??]X63??7?G?} ?/e?))????????w?}????#???f?????????o?]&?xw????H??! + D??n?????>???!HO??????????@2?2~2??S???Ry?2tU;????G????????????????\??S??? 7U??O?)???8??>??m(?D?|????????&?W?N??E?`g(?F?????&G"????do???Otn?? ?????y???Dd??de?aKZ?I)"? c>T?i?W?#}&??j????PQ?{?????????-E"T;%B^?fPQ?U=~c/?M?-???RW?p???2X:ynsr?\??????&???Iq??H(??W?;?????.Q,?????m?M?o????vp???)?5As???-????? ??"??"???}?ROw@?N?Sn??##?????????Q?ln?*???>?@R?y????f?#????%???Q?/?'$;??????????? ???;,??{#??3???A ?pg?D???xh0X ????pj?? ???<? ???V?????C?N?D?}~b??uU ?C????j??`?+??~J??????*?????Iwz????????!?={???Er??????W?? ???0??A??O?????OAt??Q?2l~F??@??y?b?N ???}?????A"y?(??i???`U$E??\??s?+ E&???h???Kj3???'t??'?????Y?TB'?W?d?r??0+ ?j + ?FM????l + ]???D??y?J??u9?? + K?CfX ?+?f6e??A1Nlx+ @r?O?}UC?K>?(???Nw??@7 ?\?.?2??q?$a`?j??4Uo;L???G??3+ ?uUH????[?????? ?????t?`?6 ???mfk?)?????L6*)Z?c?J6?)r????a??n8B%?6y%wv?`?br"4?tE? ?o??h?'3??.l?D??=???n@?06??P6?7?q?????J ?vMK???K}&????[????I?????9?'sh????????5L???U???B5??????j9???(=g??V??????p?? \? ????c?(?a??UW???+ ??=?\??O?:K?uCwEn?? V?.Gw?? ?????Iy*????*?B?(?_`??????????S"s+:T?pf???+=?E?f;??v????{????/Fp?vL??1E%????`??PnOf?mA??w?p???z????h}|??p??qF9?jy?;^???,??;???! [?Sz#???8?$f?^u~?y?o?`?0{?XM?}??19?Y$d?3??T?[&R??J.??T??{1???}B??RH???edS? ??7??K??????b&???Q63 xb^??L9??(|?E???`?dl??([8bLpoS???:*3=)??%??q??X?????%g??u?r|??'Q?za??.o?l????UShnc+???`?E?????C?.?'????G.??1?w??Y??????q?????^;?N/?v????????????+ ? ???O?v????t/"h???????~??5 ?K?L?g?%??%s?5??O?"?K??&??Vo9~?>? ?F|53??Ym"?+ endstream + endobj + 132 0 obj + << + /F8 40 0 R + /F7 33 0 R + /F2 12 0 R + /F10 46 0 R + /F12 52 0 R + /F21 96 0 R + /F9 43 0 R + /F17 75 0 R + /F1 9 0 R + /F11 49 0 R + /F15 69 0 R + >> + endobj + 130 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 132 0 R + >> + endobj + 135 0 obj + << + /Filter[/FlateDecode] + /Length 3480 + >> + stream + x??[?????_?>??+ I???????DJ????????o.??],?f????~????O??O??0?N????????O???f??G?E$?8?]????j???_?3??1??D???C?W?/??Jf????{UmwY?7U9_?Pz?j?s???\??G?c>?E????~.?? ????,???Q??(?????????B#??????via;??~???h??e|43???sg??0@??????/??J??+o??'????x????)?`?r?'??ap5??._?/O??????????E?F????l?6o?Dg???q?l!t?+1[?\\f^nP~???|!??k7? ??]?|m?r?-??n???|s?W???????4\??o?/? + ?0~o?]????x?h^b??yy ?Y???>z?]mOn)??D?S?7t??jG?N??j_?.????7Uy??J????$N?Xo???891:V?????A?????y????8W??l?"??????1O ???Xn???~?c??#??NL?u??>/?????? + O??????d?h?4<<;??,??/ ;C???Y??????(:-6U??R?L-?m???H?+ (?Iv??????+ ??????R2?????W?????^??EF??58??q????-bu???????? ??????p|??\Xlf%???FL??(a? ??? ?a????8?j???5???}3 G1L???*J?7?= r???e???-+??E???f???$?????????[{"?~U??'????u??u(?$J????????L?????cW??t?????2?4e?e??6?????'u)?)JM?o?_??B+ + endstream + endobj + 136 0 obj + << + /F9 43 0 R + /F11 49 0 R + /F2 12 0 R + /F10 46 0 R + /F15 69 0 R + /F12 52 0 R + /F21 96 0 R + /F7 33 0 R + /F1 9 0 R + >> + endobj + 134 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 136 0 R + >> + endobj + 139 0 obj + << + /Filter[/FlateDecode] + /Length 2792 + >> + stream + x??Y??????+x3AB?B+ tO????/ ? ?/D.?????*\?f??|~??????????????>??)?m?M6{???b?$IJ*?Y?2??)(??2???R[ ?[iOb??a?K??&??zk)??????I?h???cY??'???.?l??-O?~ ?9U??9?0ftI??????d?l???? ????8K2????F0?Q*?T???,!)?4?????\????YC?????7?y??]9?J$M?????^?~'O??Y?@ ??Z??f?#?G??'e?????L>E?V??1?Af????1=????gQY??N?o;+ ??.????M?Je?|N;?i?o[????I?l??*???Rl??c??W?g?????p???:??? ????Q???"??#?Z%K}???c1A2;??\}?#7???????n=?3??k$?M?/I^2?f?B`?a??E??)????"????6???&?Q1????C???FP??=??f?ID4?J?????i9B??6Z?????1??n??J?-YQ-?tPI???3='????H??q? + ?d??????7???????/~?m + endstream + endobj + 140 0 obj + << + /F2 12 0 R + /F10 46 0 R + /F1 9 0 R + >> + endobj + 138 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 140 0 R + >> + endobj + 145 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F25 + /FontDescriptor 144 0 R + /BaseFont/JVDGRL+CMTI9 + /FirstChar 33 + /LastChar 196 + /Widths[314.8 527.8 839.5 786.1 839.5 787 314.8 419.8 419.8 524.7 787 314.8 367.3 + 314.8 524.7 524.7 524.7 524.7 524.7 524.7 524.7 524.7 524.7 524.7 524.7 314.8 314.8 + 314.8 787 524.7 524.7 787 763 722.5 734.6 775 696.3 670.1 794.1 763 395.7 538.9 789.2 + 643.8 920.4 763 787 696.3 787 748.8 577.2 734.6 763 763 1025.3 763 763 629.6 314.8 + 527.8 314.8 524.7 314.8 314.8 524.7 472.2 472.2 524.7 472.2 314.8 472.2 524.7 314.8 + 314.8 472.2 262.3 839.5 577.2 524.7 524.7 472.2 432.9 419.8 341.1 550.9 472.2 682.1 + 473.8 498.5 419.8 524.7 1049.4 524.7 524.7 524.7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 643.8 839.5 787 710.5 682.1 763 734.6 787 734.6 + 787 0 0 734.6 629.6 577.2 603.4 905.1 918.2 314.8 341.1 524.7 524.7 524.7 524.7 524.7 + 850.9 472.2 550.9 734.6 734.6 524.7 906.2 1011.1 787 262.3 524.7] + >> + endobj + 146 0 obj + << + /Filter[/FlateDecode] + /Length 2976 + >> + stream + x??ZIw????W0?|[?n4?d??????????r?@??,?????? .'?/zew-_}U???;? ?q????????}0?\?frz%R?? &?_?? FF? L.??|I?*-???k?a?v???n???|?=v|?G????N5"?1??n?B?B? G?(?????)?q?%????)-?t?c?U9T??2T??V??XV??s?? ]fu?-??H?]>???B?,?+ q??'U???A\?C??f?/?? + ? 4?b?A?9 + ~??;?>?$?=@???? ??t|{?????P?????i?#??fi?hK ??y???p=???R`??4???P????S?O!??p?Q^>??q ? F???M?v?????zA6???r5???uhFlxV?,??"?? ? 6??" + ?e?`?????BF;*??VAdD??OL,{????6?M?44Xj?w??????c??E??=?u:???!???<W??L??!?v??5 ?U?=v?a7???3??@??=X?Y??!l??m?E??L;?l"*??.??%?z??|?x???_??`??\???5??1?)?+?p?u??GES???J?!??O?(?p??N??H ????az??Ph?? + ?d????=?#??0y??p/9???B+ endstream + endobj + 147 0 obj + << + /F1 9 0 R + /F3 15 0 R + /F25 145 0 R + /F19 92 0 R + /F2 12 0 R + >> + endobj + 142 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 147 0 R + >> + endobj + 150 0 obj + << + /Length 4513 + /Filter/FlateDecode + /Name/Im3 + /Type/XObject + /Subtype/Form + /BBox[0 0 2384 3370] + /FormType 1 + /Matrix[1 0 0 1 0 0] + /Resources<< + /ProcSet[/PDF/Text] + /Font 151 0 R + >> + >> + stream + x??Z??I????K@?"???EBH?fl?h^B? FB?>??#?????0??VtUddd?U???????/o?>???~?\?o + _y?q???????????????????=???????????o>>~??<3???S??M?+?????5?,??o?_|???~|??/?????????VR????c?|-?g?1?M??^??X?]y?-?K?)??M_??v?/i???I?u????H?5Z????~?N4????iJ?X:r???P?a6??+Y??%??`???$@/t??c*??O??$??]??C???G?????;s=?w?T?Czz?=??g?{??dUT+ ??&?Y?!??Q????-??d?C??Q"???? :qNA?i?|?\{"4?!??~?????$4[Y?G%p ?h??a^X?h??5?? ??K??S?>?d?8???Z*t?ijpLC )?F/HX?%?Q?ta^RI?{+?m??si???/?+ v??.?8??T? ??J8???#J??? D?P?3?????a??????IkX?Dx???{?e<w?#pp?ZF& ??1??A?,,\p??{????JH?B?????u)?b?,?V+??c???F> 7M?z ]VC2?T?k?D?q<#z????y? Fz???????bY&w,??U?+_???????&???+ ????????L5m??j ?K.?<] z?????D#%?uVlXm?Wp?:?"???("h????3??bo????7,j???c?@?p'?}~??? ??S?=;3?u??.??F;|2>?8h????}???:i?F????7?8??9?+  T?+??e{ ?ct'??/~xOg???????gb?3?-Yt!?*@}??}??;??GH2 *{Dv*9????q R?????mi?G??f???????& ?^?$ 7?{_?d\?0??????- + endstream + endobj + 151 0 obj + << + /R7 152 0 R + /R9 153 0 R + >> + endobj + 152 0 obj + << + /BaseFont/YQICZA+Bookman-Demi + /FontDescriptor 154 0 R + /Type/Font + /FirstChar 83 + /LastChar 117 + /Widths[660 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 580 0 580 0 0 0 0 0 0 0 0 0 620 0 0 460 + 0 0 660] + /Encoding/WinAnsiEncoding + /Subtype/Type1 + >> + endobj + 154 0 obj + << + /Type/FontDescriptor + /FontName/YQICZA+Bookman-Demi + /FontBBox[0 -13 653 694] + /Flags 4 + /Ascent 694 + /CapHeight 694 + /Descent -13 + /ItalicAngle 0 + /StemV 97 + /MissingWidth 340 + /CharSet(/S/c/e/o/r/u) + /FontFile3 155 0 R + >> + endobj + 153 0 obj + << + /BaseFont/Times-Roman + /Type/Font + /Subtype/Type1 + >> + endobj + 155 0 obj + << + /Filter/LZWDecode + /Subtype/Type1C + /Length 1209 + >> + stream + ?+ ?#?L? X??c)??m2????L?e ?1??x!???I8?^#???=??r0????i1? ?????)??!\??????!??i??????? 9? ?3ND at e?#? ?+ ??LV^?ODh?Q?n?Y?J?> G?l ?gA?BP*&???p+ ?S?q?A??*??i??T1f????,[ ??,?@ ??{?D+?u.?q>?D?j?y+ endstream + endobj + 158 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F26 + /FontDescriptor 157 0 R + /BaseFont/QIGTJS+CMR8 + /FirstChar 33 + /LastChar 196 + /Widths[295.1 531.3 885.4 531.3 885.4 826.4 295.1 413.2 413.2 531.3 826.4 295.1 354.2 + 295.1 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 295.1 295.1 + 295.1 826.4 501.7 501.7 826.4 795.8 752.1 767.4 811.1 722.6 693.1 833.5 795.8 382.6 + 545.5 825.4 663.6 972.9 795.8 826.4 722.6 826.4 781.6 590.3 767.4 795.8 795.8 1091 + 795.8 795.8 649.3 295.1 531.3 295.1 531.3 295.1 295.1 531.3 590.3 472.2 590.3 472.2 + 324.7 531.3 590.3 295.1 324.7 560.8 295.1 885.4 590.3 531.3 590.3 560.8 414.1 419.1 + 413.2 590.3 560.8 767.4 560.8 560.8 472.2 531.3 1062.5 531.3 531.3 531.3 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 663.6 885.4 826.4 736.8 + 708.3 795.8 767.4 826.4 767.4 826.4 0 0 767.4 619.8 590.3 590.3 885.4 885.4 295.1 + 324.7 531.3 531.3 531.3 531.3 531.3 795.8 472.2 531.3 767.4 826.4 531.3 958.7 1076.8 + 826.4 295.1 531.3] + >> + endobj + 161 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F27 + /FontDescriptor 160 0 R + /BaseFont/ILKWGJ+CMMI8 + /FirstChar 33 + /LastChar 196 + /Widths[660.7 490.6 632.1 882.1 544.1 388.9 692.4 1062.5 1062.5 1062.5 1062.5 295.1 + 295.1 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 531.3 295.1 + 295.1 826.4 531.3 826.4 531.3 559.7 795.8 801.4 757.3 871.7 778.7 672.4 827.9 872.8 + 460.7 580.4 896 722.6 1020.4 843.3 806.2 673.6 835.7 800.2 646.2 618.6 718.8 618.8 + 1002.4 873.9 615.8 720 413.2 413.2 413.2 1062.5 1062.5 434 564.4 454.5 460.2 546.7 + 492.9 510.4 505.6 612.3 361.7 429.7 553.2 317.1 939.8 644.7 513.5 534.8 474.4 479.5 + 491.3 383.7 615.2 517.4 762.5 598.1 525.2 494.2 349.5 400.2 673.4 531.3 295.1 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 642.9 885.4 806.2 736.8 + 783.4 872.8 823.4 619.8 708.3 654.8 0 0 816.7 682.4 596.2 547.3 470.1 429.5 467 533.2 + 495.7 376.2 612.3 619.8 639.2 522.3 467 610.1 544.1 607.2 471.5 576.4 631.6 659.7 + 694.5 295.1] + >> + endobj + 164 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F28 + /FontDescriptor 163 0 R + /BaseFont/UYQSSP+CMSY8 + /FirstChar 33 + /LastChar 196 + /Widths[1062.5 531.3 531.3 1062.5 1062.5 1062.5 826.4 1062.5 1062.5 649.3 649.3 1062.5 + 1062.5 1062.5 826.4 288.2 1062.5 708.3 708.3 944.5 944.5 0 0 590.3 590.3 708.3 531.3 + 767.4 767.4 826.4 826.4 649.3 849.5 694.7 562.6 821.7 560.8 758.3 631 904.2 585.5 + 720.1 807.4 730.7 1264.5 869.1 841.6 743.3 867.7 906.9 643.4 586.3 662.8 656.2 1054.6 + 756.4 705.8 763.6 708.3 708.3 708.3 708.3 708.3 649.3 649.3 472.2 472.2 472.2 472.2 + 531.3 531.3 413.2 413.2 295.1 531.3 531.3 649.3 531.3 295.1 885.4 795.8 885.4 443.6 + 708.3 708.3 826.4 826.4 472.2 472.2 472.2 649.3 826.4 826.4 826.4 826.4 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 826.4 295.1 826.4 531.3 826.4 + 531.3 826.4 826.4 826.4 826.4 0 0 826.4 826.4 826.4 1062.5 531.3 531.3 826.4 826.4 + 826.4 826.4 826.4 826.4 826.4 826.4 826.4 826.4 826.4 826.4 1062.5 1062.5 826.4 826.4 + 1062.5 826.4] + >> + endobj + 165 0 obj + << + /Length 2909 + /Filter/FlateDecode + /Name/Im4 + /Type/XObject + /Subtype/Form + /BBox[0 0 2384 3370] + /FormType 1 + /Matrix[1 0 0 1 0 0] + /Resources<< + /ProcSet[/PDF/Text] + /Font 166 0 R + >> + >> + stream + x??Y??f? ?Oq?v?7???m ????E?" ???:`????TU?6?8 3?u?^???????]?NiH?W??s?????#\????t?>>???x????|???????d??????? ?????8??z?????o?jw?????>^)??_%?e??????/??_? 5?????__?~???? $K?Y?C?o??? ??#?9?{??`o???-?c???O??-??V?o???"_?=??d?9:@??u???-?7?sC + 0d??<+ ]?hzPDR??#+ Ab?????????x?a6k?;4x??Z?^U51?5??p?8?}?As?R???????{?^?g????Jh???j???????n?D ??????r?? ?X??Y?????q?QoR?-???K?o?????~??e?G???#??)?%{?Z???,8????3S?g}? + [I?x???,*???????~??e???4???'X?%w+ ??????0w?t???F?`?CJ??????iPtR?if???????Rk%?t?gXx????H??Y??F??2GbK?.Y){?8???B???t%?8 ?`?Y?m?}u??-??xms2C??/jJ?M?`???> + endobj + 168 0 obj + << + /BaseFont/Times-Roman + /Type/Font + /Subtype/Type1 + >> + endobj + 167 0 obj + << + /BaseFont/ZMMIPJ+Bookman-Demi + /FontDescriptor 169 0 R + /Type/Font + /FirstChar 84 + /LastChar 116 + /Widths[700 0 0 0 0 0 0 0 0 0 0 0 0 580 0 0 0 580 0 580 0 0 0 0 0 0 0 0 0 0 460 0 + 460] + /Encoding/WinAnsiEncoding + /Subtype/Type1 + >> + endobj + 169 0 obj + << + /Type/FontDescriptor + /FontName/ZMMIPJ+Bookman-Demi + /FontBBox[-4 -248 703 681] + /Flags 4 + /Ascent 681 + /CapHeight 681 + /Descent -248 + /ItalicAngle 0 + /StemV 105 + /MissingWidth 340 + /CharSet(/T/a/e/g/r/t) + /FontFile3 170 0 R + >> + endobj + 170 0 obj + << + /Filter/LZWDecode + /Subtype/Type1C + /Length 1451 + >> + stream + ?+ ?PU)?"?X??o8NF?9?? ?kB?AG???b???n ??S???P6?M?Ap??e2??????l?????$?G????Q?e9M????l4??????e? ????0c?^Lf?q??t4?wR ?@a?S?$ 2?5 ??X ????;6?@i??73)??o???f????{?h??s????0?{;|???t9??|A?(D#h???A?????3?? ?3?2 ????k????c?+ ?:;??7C`??;R????6 ?r?+?R?-b??K#x?2J? ???`?28?* 3P?+ `+ ?+ ???`7&@9:D??1,=?bp2}??9)??A ? 0?A?????J??b'???$?*G?dY.E??N???OUE?ZU???0_????1D+ X.?K?c?D?Q?!??a????H8 ??V ?.'+ ??)C@? }h*?* ??; "?5 QF)??.$K??l(?X??HH?.%?? + ?[ ????X+ ???Cz? ??O??j,?0?`|q>?????y+ endstream + endobj + 171 0 obj + << + /Length 2564 + /Filter/FlateDecode + /Name/Im5 + /Type/XObject + /Subtype/Form + /BBox[0 0 2384 3370] + /FormType 1 + /Matrix[1 0 0 1 0 0] + /Resources<< + /ProcSet[/PDF/Text] + /Font 172 0 R + >> + >> + stream + x??XK?&? ???????D??tM`???r&???>????"???lb`c?a?k?)?,I???$2??=??????~???rNm???|l??Te|????c?????{3???Y??OXj?j-????????????}?d???l?~???????)Wi??s?L?(??|?}?S?????:SV?~???Y?"??_?l?????????JN*u?e$????E[????+ ???}?4f?(\?4r???IK}??hBS]??????L??[???6????.;p??n??|H ?Xf? 8U??,a?4??g?c!p???}+?CU?H"%UXn?????e?G?V???%??j? + ??????(?:[??'?A???6??T,?e?z???4???*?{??V????a?(D????fz*?}??,D ,+ ??x?>k?6=?q9F??3?A?T???J?19[ZuGi>??*%f@?3WR4?)?sq???z?Z1OyA?b??(?\??(?s????-9Vj(<????RSL??? + endstream + endobj + 172 0 obj + << + /R8 173 0 R + /R7 174 0 R + >> + endobj + 174 0 obj + << + /BaseFont/Times-Roman + /Type/Font + /Subtype/Type1 + >> + endobj + 173 0 obj + << + /BaseFont/UWKZBX+Bookman-Demi + /FontDescriptor 175 0 R + /Type/Font + /FirstChar 32 + /LastChar 115 + /Widths[340 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 660 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 740 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 580 0 0 0 0 0 0 0 360 + 0 0 0 1000 680 620 640 0 460 520] + /Encoding/WinAnsiEncoding + /Subtype/Type1 + >> + endobj + 175 0 obj + << + /Type/FontDescriptor + /FontName/UWKZBX+Bookman-Demi + /FontBBox[0 -213 980 730] + /Flags 4 + /Ascent 730 + /CapHeight 730 + /Descent -213 + /ItalicAngle 0 + /StemV 147 + /MissingWidth 340 + /CharSet(/C/a/i/m/n/o/p/r/s/space/three) + /FontFile3 176 0 R + >> + endobj + 176 0 obj + << + /Filter/LZWDecode + /Subtype/Type1C + /Length 1982 + >> + stream + ?+ ?PU)?"?X??o8NF?9?? ?kB?AG???b???n ??S???P6?M?Ap??e2??????l?????$?G????Q?e9M????l4??????e? ????0c?^Lf?q??t4?wR ?@a?S?$ 2?5 ??X ????;6?@i??73)??o???f????{?h??s????0?{;|???t9??|A?(D#h???A?????3?? ?3?2 ????k????c?+ ?:;??7C`??;R????6 ?r?+?R?-b??K#x?2J? ???`???x????H@?Bx+ ??1?%?N?%? KdX? ?a E?D)2?Cq Te???$??K??b'???eaLY???R ?$??0????i???+ ?a????V}??H{???x{?'????nx?b+ ??J5 + ?p?5'?^U?FX?S??|&?W??|??? + + ????7L??)b?1?c 65???r8??Y?????+ X2?b?) ??-)c?aA?2??Y? ???(]??0(??@y?{????vV5?j{??tw??`?v-?d?vm?}?7??l[X?o??>s]xK???)0?u?? ?+ ?2??C`??????,??`??Y+ at l??C?W?a,ED??R?Y?Ai-G??V??~`?????V+ ?V-?P??Y????+ ??lG? + ????? B?Q?A*'??\G??(?X??HH?.%???[ ????X+ 1p??,X ?p+?+ ??|' ??O??j,?0?m?}???p+ ????? `?+?Z ??+???$c?R a????c(E?5R?(.Ppv H-??J?}?1?>???` ?0????"?Z?q&W(?TD??$' ??? Y????h ????!4'+ endstream + endobj + 179 0 obj + << + /Type/Font + /Subtype/Type1 + /Name/F29 + /FontDescriptor 178 0 R + /BaseFont/FJVDGQ+CMMI12 + /FirstChar 33 + /LastChar 196 + /Widths[609.7 458.2 577.1 808.9 505 354.2 641.4 979.2 979.2 979.2 979.2 272 272 489.6 + 489.6 489.6 489.6 489.6 489.6 489.6 489.6 489.6 489.6 489.6 489.6 272 272 761.6 489.6 + 761.6 489.6 516.9 734 743.9 700.5 813 724.8 633.9 772.4 811.3 431.9 541.2 833 666.2 + 947.3 784.1 748.3 631.1 775.5 745.3 602.2 573.9 665 570.8 924.4 812.6 568.1 670.2 + 380.8 380.8 380.8 979.2 979.2 410.9 514 416.3 421.4 508.8 453.8 482.6 468.9 563.7 + 334 405.1 509.3 291.7 856.5 584.5 470.7 491.4 434.1 441.3 461.2 353.6 557.3 473.4 + 699.9 556.4 477.4 454.9 312.5 377.9 623.4 489.6 272 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 606.7 816 748.3 679.6 728.7 811.3 765.8 571.2 + 652.8 598 0 0 757.6 622.8 552.8 507.9 433.7 395.4 427.7 483.1 456.3 346.1 563.7 571.2 + 589.1 483.8 427.7 555.4 505 556.5 425.2 527.8 579.5 613.4 636.6 272] + >> + endobj + 180 0 obj + << + /Length 5880 + /Filter/FlateDecode + /Name/Im6 + /Type/XObject + /Subtype/Form + /BBox[0 0 2384 3370] + /FormType 1 + /Matrix[1 0 0 1 0 0] + /Resources<< + /ProcSet[/PDF/Text] + /Font 181 0 R + >> + >> + stream + x???K?%?q???+??6?T?Mnm???????$K^???||d? FFk?YL???L2q??!?_??h1?n?{~???????UG?B.??7??????U????3?????__??'????W??|???5???mK?DRg?e??JM?Yc?x???~????-??T???i?]-???????????[5????};?9?=?\?~???U??????????UF?M?u?M??}??^???h + ????mC;???????Ju\A|>????/KRL?acLK??"??c???/??_?z?y??P????6_?????B ?,sR???q?j?q~v??p????-???]?P?!k-?q????#s[vdn???5? ??????????????Y?=F=C??;0?e?????1???[???fx|3 k>[,} #.???l?9??4??????{,K??r~?1c ?u|????????m!}?u?? ??F?c??????X??????s?m?u}v/?????u-Ri?4f+]?k?]wU?h_G??b?????5X??I?.? + *??y?kG?=???????w?I????w???E?9?L?qc?3~z#?eW cz??????s????t?lM?G??h???Q?-?????3zF???G?B at -Q?????????=]?vK?b?????)????C?w?j??w???8?{?UG?????`?;?,?m?f)W??(gyt?B?$=???q;???m?X?A?[8mcM????qk????????K????????? ??^Y??0?.??2,??E5??????9???????'Zq??\w???u??|??QI??(K?m?????y%?}????#???,??l8????*X?^s_qS?T?h3??)`v?Jy???Y?O?Q?e?V???XyU?qi????#_??c`??r8??r?Fn???iG???~Y?#?- ??T?3Aas??h,??RX?w??="?vQf:? P*??dF?J?0D=)?d????????????l?????'??80?,xWVx+ 6v???.t3???????=??K???K???Q?L???cQm+ ?:???TE?:9? $/a??%U???1?O?K??UU???+?????J/?????fj??m???? ??????? ????U h0T?y"a???8????????tj??=????Dk{?i*? X?F?@??]=7Q?zZ?????#d??{U??8?P]??}?F???nY?'????v?AQ+D??i???@?P???????g???????j?txS?J?????x#B??????Y~?:??(????,4?d??j(?+ t:??? SO??2?xvv-{?~??????Clo:??ER?-??4?H????F]q4? ???hj?24?G???3????DP?????-?K + ??????d8{?I???d??_???L?&?[?L???CH'j??;D?,?v??a?`O>??EN|'?\ + ???E??}o??o?O?. [k*?5?????\O????????G???C??Q?:???@????.???????4?z??pM?-?]??:h_???"??^?|?@3U??zY ?0??Q????^h??G`)?b?d?3??5G#H??+ J??B??{?E ??V?D?)|??1????`x.A??>??Z@??*K??`?F{h.?NA9o???'?[?0???H?*Z?-?my?+ 2????;?pw????U\?r?n2?NM????????r??n?????r;?/E?????,E0???Tdd)??-E?????<,???/ME??????Ei???"s?0?????W,E??kI2??K?9n_????)???[????%??(X????%??hZ????????\????%???^?? ??????#gv??6?L?U$JO6?NB]N?V?????????t?Uq}?????z?????Y?A??D?Z?vP?ufO3>+ ??"*??=??}P?"/?? x>??M? ??R????m????f?EQ??6E?`D78?E????hb?^????hL&??I!?/_2W?o?????a?t?4????B9??^??C?v'%tD????K at H???GiOE?w??q? ??R)&k?>??n???e? + ??O ?H?g\?V)????If??-?????{??i??3?V{LP?? f[??z??????YyN~Ht??a???8kS???O???2{r????QY5?By6??? K? + ?[?8?y^????go7?|????"7H? p?f=J??9{?Q+ A?? ?p????D ?.?<???"Fs?+ ??L???l ???\??r???v(??8{M~^??+ ???????Zv?F?pK4dJiil??ifo + ??Wli2?u?d?d??K??4_????????K???8?C??(??gb?A???f?+?X???G???2o} + ~a????"Vf?Y9??t?n??^?b?^??pJ,?h????@?v~?)? ??^r????j????+ endstream + endobj + 181 0 obj + << + /R8 182 0 R + /R7 183 0 R + >> + endobj + 183 0 obj + << + /BaseFont/Times-Roman + /Type/Font + /Subtype/Type1 + >> + endobj + 182 0 obj + << + /BaseFont/ODTSLI+Bookman-Demi + /FontDescriptor 184 0 R + /Type/Font + /FirstChar 32 + /LastChar 115 + /Widths[340 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 660 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 740 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 580 0 0 0 0 0 0 0 360 + 0 0 0 1000 680 620 640 0 460 520] + /Encoding/WinAnsiEncoding + /Subtype/Type1 + >> + endobj + 184 0 obj + << + /Type/FontDescriptor + /FontName/ODTSLI+Bookman-Demi + /FontBBox[0 -213 980 730] + /Flags 4 + /Ascent 730 + /CapHeight 730 + /Descent -213 + /ItalicAngle 0 + /StemV 147 + /MissingWidth 340 + /CharSet(/C/a/four/i/m/n/o/p/r/s/space) + /FontFile3 185 0 R + >> + endobj + 185 0 obj + << + /Filter/LZWDecode + /Subtype/Type1C + /Length 1885 + >> + stream + ?+ ?PU)?"?X??o8NF?9?? ?kB?AG???b???n ??S???P6?M?Ap??e2??????l?????$?G????Q?e9M????l4??????e? ????0c?^Lf?q??t4?wR ?@a?S?$ 2?5 ??X ????;6?@i??73)??o???f????{?h??s????0?{;|???t9??|A?(D#h???A?????3?? ?3?2 ????k????c?+ ?:;??7C`??;R????6 ?r?+?R?-b??K#x?2J? ???`???x????H@MBx+ ??1?%?N?%? KdX? ?a E?D)2?Cq G?zn+ D???{?G?P{???V{???? + `?L + $uPx????(??gZ??f?]??{_?6?c?6]?g?g??k[?d\v?\?I???9v ???{?????.?M? F=?? x ???"?x? ??0?'8"?V??T"?@?@??@???lt;?A??R??|@+%h ???|J?`,%?V2?YK1g-????[ku?+ @>0v?+ ?`???V??` p.? B?*?a? d at + ??(??w l\?`&????C?Np*C?z ??7??>*E????M?A?'??U?+ ???? + endstream + endobj + 186 0 obj + << + /Length 6186 + /Filter/FlateDecode + /Name/Im7 + /Type/XObject + /Subtype/Form + /BBox[0 0 2384 3370] + /FormType 1 + /Matrix[1 0 0 1 0 0] + /Resources<< + /ProcSet[/PDF/Text] + /Font 187 0 R + >> + >> + stream + x?????&?q????R6?R?=sk?0??H^4|?%K^??}????4?0"?????k??'?????G??u??????oz?_u?+??z???-?p_%}???????z??????K????????????x???W??????Oo?]1??--^?????Uc9?{?b????????N??????Ym?x?1?v????oA?Jel??????y'??????={U?2G??X??w?sn????G-??s????Z?????????????????W????????+?b?j?j??W?????o?o?????o????????l?F???_)k????EsL?V,?p???????V?F?gf;?,?eo ???????Y?????iyYb?xoK???4??_????F_?????l?y[4?D>??0?????{??I???c?c_m???^?o_??L?????g~X????,?0>?0?g????i?@????7?Se?0??7_??Y?8??? .5?N6(??g?zA???????R=?.s????$z???v???&?????[???&-7?? ?g_N-b??W??G??\???uG??p????s??X?G?%?-?,??<??Z??/??g3?0n??????6! (9Z???E??&?B_?q?e?\?;[7?/|.???n?P?M?f????REp?p\T??v?????K??Q?K?$????T????3??? ?f>???5A??????Uc??9??3.?Ad0M?N ??=?{?r?!?Hib??c 1+-?,??J?QI ????k?4???m?W?rCO?,9????i!d)t???Q?w??&????r?f?N?*??N_????t?[?^??q??9*h?E.?HX???-w?-?XP~??.!?MWc?#???wr??(!O?vg?Y?:?A??PT?P????(??<$d?(??s?K??o.??5dy??\4?HY?I?z9]??k?J?P/?->sM?????~?xS?K + ???^O?p?8 ???"???????L?&?[?L????K'r??;D,?v??agO????S|'?\ + ??E??}o??o?N?. ?s*?5?-??e#??+ + + jw??Lq???xF=?X??T\?s?@P??o/.?T????55? t?????} K???hjzE??++ ???-y???Y?2?}?H-?f ?e?/???D?c?T???z} ???3 ??,zt?`)?bIe????A? + ?-??+S_?C???O??rN0&?5?A?Sc??bK??4?2Y??1 ?l?Q??Q??7?3?f?af???-??_?KT[????<#????? ?,,? ?????<|?+ ???*?R?B;(?:??+ mdH h,?[????haK^??.q???z* + ??Wpba?c^?#a???H?? + ?,?x? + ?L?!zR???b??CL?&E?G?RE?=???g?3?#??O?c??????#8p?mg1?\@??09?UGr5? P?A ???Z5("@ F??b?? ??A ??@????A????d]? ?????"??V?D????? + @?????`d#M"k??@??*2???iFo + ??Wla2?u?d?d??K??4^????????K?aq???a^???? + 2 ??-?W,??e ????|? + #???)A?,???z??z3??["?be?x-?? + 8%g??] g?#q?? ???P??l/?sk?{sX?T+ endstream + endobj + 187 0 obj + << + /R7 188 0 R + /R8 189 0 R + >> + endobj + 188 0 obj + << + /BaseFont/Times-Roman + /Type/Font + /Subtype/Type1 + >> + endobj + 189 0 obj + << + /BaseFont/SWZETY+Bookman-Demi + /FontDescriptor 190 0 R + /Type/Font + /FirstChar 32 + /LastChar 115 + /Widths[340 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 660 0 0 0 0 0 0 0 0 0 0 0 0 + 740 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 580 0 0 0 0 0 0 0 360 + 0 0 0 1000 680 620 640 0 460 520] + /Encoding/WinAnsiEncoding + /Subtype/Type1 + >> + endobj + 190 0 obj + << + /Type/FontDescriptor + /FontName/SWZETY+Bookman-Demi + /FontBBox[0 -213 980 730] + /Flags 4 + /Ascent 730 + /CapHeight 730 + /Descent -213 + /ItalicAngle 0 + /StemV 147 + /MissingWidth 340 + /CharSet(/C/a/i/m/n/o/p/r/s/six/space) + /FontFile3 191 0 R + >> + endobj + 191 0 obj + << + /Filter/LZWDecode + /Subtype/Type1C + /Length 1928 + >> + stream + ?+ ?PU)?"?X??o8NF?9?? ?kB?AG???b???n ??S???P6?M?Ap??e2??????l?????$?G????Q?e9M????l4??????e? ????0c?^Lf?q??t4?wR ?@a?S?$ 2?5 ??X ????;6?@i??73)??o???f????{?h??s????0?{;|???t9??|A?(D#h???A?????3?? ?3?2 ????k????c?+ ?:;??7C`??;R????6 ?r?+?R?-b??K#x?2J? ???`???x????H@MBx+ ??1?%?N?%? KdX? ?a E?D)2?Cq G?zn+ D???{?G?P{???V{???? + `?L + $uPx????(??gZ??f?]??{_?6?c?6]?g?g??k[?d\v?\?I???9v ???{?????.?M? F=?? x ???"?x? ??0?'8"?V??T"?@?@??@???lt;?A??R??|@+%h ???|J?`,%?V2?YK1g-????[ku?+ @>0v?+ ?`???V??` p.? B?*?a? d at + ??(??w l\?`&????C?Np*C?z ??7??>*E????M?A?'??U?+ ??oD????c 1?"?@?J??"!`???G?!Z?8?"?[ a?+ endstream + endobj + 192 0 obj + << + /Filter[/FlateDecode] + /Length 2040 + >> + stream + x??\?r?6}?W0o??Bp??i:in?f?q[?????(?&??Jr???? @+ ?????W?+ ?&1@?*?e?????'+ ??27f(??um??|+?rC"?A?`??????&^ L]?-vn + ??Rg??[???bO?7y|??????(?d?+ )z???U???????.?s?(y?CQ?(?Y?Wh???lM?0?I{O8?????]p?Is?X `9????2)G??G??????{??0???V???????T??$????:?J???)?S??????=??J:bqA?SzL?)LY]V?R?Kz7? ??V?B????????????'?pp????x?? ?= + ????T(??????.rF?9??Z(??3????Y_??l(l????8????[`&b??.???SO?9?Fb,????0Y!y????%j????????g?}?????????????-???????E{???]?c5?KQ>??-???????f?1B????)???%Cn6,tf?V??d~???????PZ????V ?(G????7?|?????19?^.??b6:?O??s??t6?~??Zz`:???????L??????o?C[c?n+ ?????????}??\?MG?????~v3?C?[?&?c?-v??$sd?p?ew3W???/F???????????AC5\?t>_?.O?DQ????JU??0?(?vk?ka???*> + endobj + 194 0 obj + << + /Im3 150 0 R + /Im4 165 0 R + /Im5 171 0 R + /Im6 180 0 R + /Im7 186 0 R + >> + endobj + 149 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 193 0 R + /XObject 194 0 R + >> + endobj + 8 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-53 -251 1139 750] + /FontName/YHQIEI+CMBX12 + /ItalicAngle 0 + /StemV 109 + /FontFile 7 0 R + /Flags 4 + >> + endobj + 7 0 obj + << + /Filter[/FlateDecode] + /Length1 1447 + /Length2 7820 + /Length3 533 + /Length 8690 + >> + stream + x???UX\???? ??%?Kp? + (??!?!???!hp????!??????>?_???????????_c?????????$?ubbcf??+?i????YQ???@@'0?V??????D?-+ + ? l?0Y?mQX????5?+ ???????????R???J@???????qh?v?? ??????19??g??_rb??????l*jka ??+v??????N??+ .n+ ??lP?t+ ?ny?o:#?*??at]?`;&n????^???m??K?B?I?w?N??n,??UG?>?????a???u?v?gU??Z????`_??68?9???E?QIy<%????]?WX???4?Y??@? J???H???? R??????????Cq)?a/????#?+D???f&?O)????&??~??n?`??gW???b9?Yg???fuj?@?[n?q(??{??g?+l?F?T?OXs?q?%??6[#?lQw??9R=??W??R????h ?>????qND\?TFP?B?[?t88??????s?NI?8%3???3?5y#?z?X + ?+ ?NE???S?''? fo?S????????o?]??m, ?)???Pcc??=???+??%?$?????+ ???M??~$9?!?."}?'???=3? ??ga/???,=+?{???T???" ????3>??1??,j?|?B???? ????:u??????|??9`?z?/z?T????&1??9??E????eSK?-R??#R.??[??mkE??G?.??????????a???J????6??N??"???????????9??+[9KG?_??????? + ?????????"H?`???.|fp?`C??xx?"?????`+?H? D(???AQ?2?ST???xG??????tH???}??7WU?|??%???E?? ?????vk????h`?>5,%??IMj?/I??"B\?c?V1????;?X?+??++ ???g.???+ L?:?9????*j???q?0????]?E??5??vi?de@%^??_?1?#??|?~??\J?1?WD??'6f?6?+ J??3}qn0??2o??s??????t??{? + [???]??? + ??.3??9???M??&???c?#H??P?h? + ?~?D????????}?0L?,????roC?3 + ??m???+??M?6?@??????:/z ??>??4qUc,f?V??H3?zD????!??jJh??I?7???.????aFN?A???:??Xq???4?.?g???u?(? g2???y? D>?????2??-??\?2????Iy??n?~????g??5?y??q??rQ?????&\?!?k=??B?K???=??????5?????7#{|3??K?p???@?*A?|?{I??????*?&e? + ????)J?^?????B?L?*??A???????O??????????-??se??VE???? ??(????@?????$?U???Q?zTvQ?dR?t?F*;{?????z?U?Y:Hl??1u+ ?K??Q???\??6",??4?z(Vy????*?V??Zcsy??[?FQ^ ?-^??????`??????7?Ou?0?W?U+: 0 ???E,_? M?]????r??T???f???g p?9l??+??[???I??_V????G?AX??W?????.]^?Oxk??E???Z?`&???!??[#??{???[.=o?J???D??I??????rf?????h??KC??o??*??r???O? ??H8*?????,q???0kb????n?#?????6?^n?%?1 + =????????^?MPN??[P4????!{k3???x??Z????????????? ????~Fr??b}Rado?MW??K7L8?g:X???u?Mc>p???k/q?#??Y?cOwc?V?b???h?zq?%?????3+??A?,?c?[4?m??I???E???????H0OA??????L?&???MF?!b0:?~?$?#a6?k;???T???]J*t* 7?;?7['?I???|?t??q?p?SRa???Q?V??&?n?D?t???[??????*????s????Gm?R??????S?? i???p?@??*??~?k???N??+?mZ???????l?)Qf????????}{?I?P?K?P?????X???O???=?f????????\???;?wo? ?J?8???Dhi????wL-p???2I??? + l0???? ??????u???c\?  ? g??>?????&?Uk???A?;?]??$??//??or?U????Ts??)??$?Mg??~ I.??0u?j#?J?zt???7????l???Ub?I|???S??&????YoEi2?p??v??????????????????u?????P?E???? [?????? ??iR????hy?*????HO??l?T????uj{@6^???*>??????,??????;?|?????????K??e #?>]?ky?4?p/i?D!E7V,?g?'t5??????|?<-????E????l?nY[??????? ??9?ZKK?.??VR??%?????Z??{I?X d??.t8??/?"-???h???i=??f????kq?y???^=e?b??+?W?%?I[i?}?D?{A?0??:??@t??????q0??f?7\^???????G??+ ) >??=????h??^?^/??6????{??????s?jdO?'.?2u????7 + ?tk?\x????QR?h???LT\?R?+??? ?*??$q?r????[???c?;??A??????w??? ??i??'c*??=??/-t??4 + ??0Q?? 3??h????A???m?p??N?A???9?L'??????6???&?d??R??n ??QN???c???7?.???F?~pz?/???X?md?I????n?TG???????W??z?? ??????C Qw?Rqx?!6[???? ??2Y?[+'?u??{?)g??!?+m?? j=???'?;??^?RE???p???? 9E??U?D/??/K????G?^??a?? ?q|g0?,????~???????T????9MvR_Q?83??3?{;:??v 's?~BiL??t?????nM??|????j.????}?RV??V??w:??-%#O? 2???????2?c??2?^??KM??M39?????!?????N+ {nO'?(?/?^?????,?? ?????TP?=?m4ljP'???#??*|???E?F<?%r?I????+?J?????O?9/&c????c@??E7?m?\UV??y?`0rZ??@?d??+EnM??n???;=???NV??????>?? E?q^o?????CB?Vw? '0?d6&q??*/?K|d?????s?Y??o??????Qk????k+ ??wM??M*5U?l]??@?????s???-EO+ ???P????2*J????\l ?"` 0\?YE?Ur}?W?0??_??$?EA???U?*K????hhgl?~?? M?Y????) + ????5??71~al?'r?? ?LE?c??5??FVV?`?P??R? o2h?U?8n?g?]?DY?+ /]27\? Qw?W??|Q??&+ x????T?o?,?_U????'? 6?U?q6??W??5?na??7 + ???????y?@8C?>p?z?6 at 5?x?M??:]O???vzXWE$?????????????b????uU??????PzT?GaA?^2c?:??E?????6?x???R?`??L??????????Iz_,???????????=l??7yW6'??/???S{YY?5???(.?rC6rBX+ ?? ???`??h?]Tk3N??Z?m?V%?cz?7??w?4???&7/??.?:??h??4?#?O?>?'?`??U???????] ????OD?9?x?B??H`?a?y???^*|A5?K=r?l??Z&K ?- ? ??z??.?f.??5m)i???hs2??o G:???dH93???W?-??"Or???k?j???b?|\?^+L ??V?k?b??[x??K(??S?z??1x??^hiT??????O??g?|[???????Y???]?>t?tK]xh?Z?u?v?E/r???$b?C??G??????C??\?&Y?M(???????????4v????t? ?dj???/??))o?CQ??+?w /?@????????bwm?? ?po???@%??tR?(o????A??Z> + endobj + 10 0 obj + << + /Filter[/FlateDecode] + /Length1 2018 + /Length2 14981 + /Length3 533 + /Length 16106 + >> + stream + x???eT??????C??????????? wwwwww?????????9;9???=?_?c]??S?]sV????*?B&vF+ pt?"???Sj"?O;[k"?)??P+ |????`bd??n?g???????W ?%?O?????g2???#??`?W?????+??vq?+ ?9gL@%????.??????(h?Wg?????f???/z?? ???:?L at W6x?1???@Wv!???_??>? ????6?_t??]???@W?!???d?r? ??0m2f???Tj?k<>??Z^P????n-??- ^???m?U?_ )?O???I??P?94?E^???*?E????? A[??]I??R?0I?x_????????????`ywY?G?T?51xbKP'(1o_??y?;?.6?=??7^=??(????m?g??~(TI`m????X?R???x#?nG??`??!??e??O??.????l??f%IC?????P?8?D??S0}?L??O1???cOY?AwF???WX? ??{???%}?????^???< ??Y??h1?????KzZpA4???`???R??)?N)?+yP??e???=??&!f'???X?B????? ?????H?Y RE'd??}?+ W?Y?\?yaX=2????{?W????????1?iT??????"3xU?d??P??>??6;[???r?$P??O?????!?????y\O?U??)?[P'???H?i????Z? + I? ??.&???N????$?????%???????&.!?6???q??????M?d?g??q????@???y? ?F???_?d??????\H?=???1h8?N)??@ + ?R??7?? ????W????s?????#)?f???r???E$?? ????8O??M??B????q13??X?????U???????Ns????1Yx?@?)??5F?g?D?w??+???K?Zm*??N??}?=???{????D?????Y2?????r?K?f?l??????w??b???Y&?9jG?T??*'|qU?FV??"u??e? #^?????[i???4??5{???Z + +?)????*??,?%?B??5<?????D????Wr2?o?B????c??g5*???L/+ ??+D??v?Npw#??UB????NW?}4O+`?: '???v??"7??????t{?k??????#?Tx??Pc??MI?f????/????????r????????Q??w???E?]K4?:??P??m-???3)g7?"???U?sK?9l??1@?2??8???fU?%??2_?b6uF??1]@f??85/y???v?0]+$| /}??m???h[ls\????????z??f??,???/k`???m???????y????d????nPq??$?:????????^?{????D?P|\?@?#?+ ? 'sw????????%???Z???fx[?v????;\?O??????E?81p0?m$\??$?{?6?^<?????rR??y?g? ?????s??:??7?^t??F??????I???g rE???'???:s??????(v??????di? %*?q+^??????<$o?????q[F???.????)?R6j?cv?????9??Qq ?K????up?+>G??3(b?oFC/e??=i?9???G???ey?~ + ????? ?Qu?q3^?2IN5vk + ????Ar?>Wn'?' ???[?HE???J???G??????Ie?DW>/}?k???$uZ????LP????5?bF????7G?B?? ?T??k?????????k'???Gg???Ohx??z_???HD??=Iq]???!??2R:?????fu_F??S???4??I??&q??????h??s|??E?4?Z9?K[?6!??q?0??H?{z?6|??????x0??i???? ??$&3?X'?`????:q????>:?oE??'????`3K?]?v?Q?i?r&??6?#????:?hG??????{?zb27P}?U?A????-?v0??S????o??k?* ?????1? ?o?3 ???G??b??????Y-K??>??U?%x!??i~"??6'b?^e?>??]?m?m?x,???A??????=??Oa.=?g?mM??$?\S??*kV?.jg?!???v???^??s1.??C?F?`??o???`%4?[?rS????c??Y???\?s?"?w;?{Cq 2??t?? + ~?A?.J_I??M???????I>????~??&???Dr?ln + ??Y?!????cY!r?2,}m?????N??@???on??m???PF??F{? Z?(f?2e??%?|??b????q1-AbL?OU]D?Z/????????q??e?,?`??+ #q??3?3?q1??J??????V?3v???????U[??l5??c0??????i???9_SK??5?T??$6??P??*?[??????a2?????"???????hrW?????h????a???Ib????C?=K??)=?W?? ?c?J:q?n???J ???u?`'???Z??????????k,??????}????i???w1??????o??????p?es?????p?k?Y?r@????Bp?[??~|?I(D?B???L?{?g??[?d???L;??-????r???????f?Q?pF ?r?_?????i?X?? ?8?G?'?^*???f6??sg??'u??rY??8?" ?c??f,U?]???#M?d????H?_R>?8???[?????"? + ?????@?S??1?(????????1hSpP?/??Pq??Q?`?H?[????s???2????PJN??a?0???b?i1G???`F?{???X?+?}Y?~C??_b??~Z$R???'??????8?]J??Z ?????42V?^([_!??"t??b?<xr?p 9<4:?6?KjR~.SQZk?I?'?gD??=Z?+}??]g?????Q?C0???0P8?~k???hH|XLu?T??[w#u1??2Y+??o???n???TS_$#fPs`~?Q??n??ow + _K?????w i??Mg??X????q??@!U?I???j?_j?????h???/?z??A?1??"?K????Y??=1(?z&?O?ty??y???^F?j?&oI?wJx???Z?#??.!?-??j?M???F?hH?4\??W?4u*%????Mz???Vf??K?;QPU??%??????e?U?6????e????CK?KE????n?w? ]5e?|????d??co?M??k????S?x????%?~?/QTM?????b?0?0, + ??? 4:??Gl??~??q?0l??x????+? ==(??e K?? 1Qq?????f??^???V+??]?????m?? & CO?ag?????q??018?R?_??????X?}?F??+0?????? ?~?1?@??\]??8?R??^7?V???j??6;??&??????? + _??(????!?P5D8??i?z???'F&?=+ vnC??O\????m?q/;?F??/|0'?^?yc?+?[*p???1?k??$???^?$?6 b~??~??a??Y*1?4??"??Z???'?U9? ???>?{:??/?????x+ Z/???i??Ze^???e?E??syS?(J IQ?x?&?????+????2ZJ#s???a???\}o??bGp???????t6??%,L_????C???/?;?? + OJ{?????Ja???*u??D?n?}? + (7?b????5 ?C ???????^cl?????????x????U????*?\?? ??x???"m????&????|?#o??!+?'c?????Hx?????? ??EEZn?v?????S&E ?W?s/?yf??Ua.SjM?LN?XUB!?[?}l?Ht%}c???{`i0A????ZQ"?{>%?dCI5?o?k _?H z????5? ce!%/ ?E??yKW?9?p?R??O??k?7????] Z?)?;????m????????cjbc??,b?a???N?yF??????s????F??????.G?K?`]n??>??????@?y/2?????????lrw?tzE?|u?????????P|?+8??L?lB??????A????w j?????1&i??V 4*V??2'?}.?.!???]s;???=?H'?O?+ ?? ?1kid??e???tObQ\F?????@?*?!?}??f?>Ot + ?H]z?/.? L??l}?A + sM??+%!Q???=P?????d^??,r??1`???5o??%:???J??|?My??s?? ???|?v&.? aO?zOLA???5~?l?????q?7)g~????!b??C???I???(????qa???X?$?K?2?5???nINR????[+ ??I????N?????$mh ???z=c??}?Ii?A??W)=??^?F? ?B??I?8??Zh??Z?,????,?????? + ?!k^Y&?r?*??E?I(6P^?s? ?hT"?? ??N??"??33?? ?4??z???r?????I???"?L???/?yj?#B?0??k??!Z????"N???P?7?j?P???}?P+ vv????yJ???????&{????? EC7?H??1{? + GI??1??|t???a????:?m?)ph??>6?|?(O???.?,??@???Q??QK???y4gx?k[@?4|??'?Y?P~8"]?Y?kL?L???KOb???n???Z(?%??2?@+ ??????q0?t 5??w?????!N???>-?????,`???It??XBfZ???????o6D*U?r??] wT??????H????J?BIL???1????M?A???????q?=@W? ?t?{?j1J?????????\g? + ?\?Ef?T?f &^`?0???B?? cm?????????r??m????{??^??6????8Y??q???p??S?}???a???YL??????|L'Y?xlDeWFN?E'??E??!??jqBS?^?t?9?A)?J?B1???b??',????Uo}??;???[,QL???r?B?tXgo?8C?&???D7?;???NR\??J?Ur,U??*1??@?`??*vu#??+ ?:??<=L!?c?)9,?j Ho,p'??e??jA???d???WjH?)Z?????LK?'W??;?? ?W??f?w???L???.R?`G!i??'?L??/???k?M???K?CL*?b_?l? + X?05?}????????,????2??]%\??????6A?xd?o\?*??2??3???p??" e????????_???%h:?E?f? FzYuc?5?G?????#<????u?[S?j>p??hEA??????-?L~?P?vC.E??W?a?^?6?????+?L??? ????~ eA?3q??????V=GF??V??ZEF??e|]?gY????o????`???qA?f?:?O???.?????????.??#S??C?]?????\??b??H?h?2?]3E??????????\?f???-?????3U???w?????sR?]?i?z`?O;?r??I?2Q?q~^B?;x???o?^?S?e??@??h?v???????wp _C???^?e?|f?A????I?:Q?D'?%.?> + endobj + 13 0 obj + << + /Filter[/FlateDecode] + /Length1 1952 + /Length2 13048 + /Length3 533 + /Length 14139 + >> + stream + x???UX???p?[pK?????w?"??Kpw'?ww ?N???w}???????????i?a?%s????EN??L/dbk??q?gf`???)q????E??N??6??N@+ ?;???M????+ ???????k??m??4F???2??#??5???'Qo_P@?(?0#??e=???,|???##ye?z??=?"??k??_?J???vfOlB?Z??b???o??"?+?;X?#?!S7??Y?????L?`R?? ????Z]q???es? ?L????MI?h??]'qu?\?9?V????N?,xDl??@C?>????(??? ??uC?,p????w?%N????=?,@?&?X???8?Z???"?????????????,?e?~? + ;????&/=\H3??[???^???8?GL???j????)+ ?r?("Lt@????>?s???g???0Imr?D}? ??????eg??S??l?P%?\?AY?j?1?r??)??? + o?F??.?7???????W??H?F?k?A?3?c????e?)"???0??P?6g?u"?"? ??[cC?*TlO??2u??[??Oh?Q???61? .??,??????&5??jG??2?.??v????>?c???????@w?????a??1 ?$???v????????,?????H??7g]}?prQ?E?P?[?rb???& )t:QL + ?wt????_;-V?+??/0??k"\???????M???W4??G(l?W???N??+{r???>: n?*2??4^0????O??+A??f???F?h84?g&?s?F??RG?K?+??m??P?????1??;???&*???SS?S? ?>?v????????????6Pyc?;???????d -??t[?%Hr??xF?j ?v?Bl???=i9*t1H??A??zo??g???+X???? 7?????,???=???!? ???s??7??5f?]M???B#???X?T???r???(?k????A??o8@????x??B??tG??D???C#??+D ?s?#?L?v????6)??6]?V??y?Fu??@ S?W???@?Mq??.???.??n;n?????????=????79q???T7:??:???F??{???? ?o1A?;???? ?MK???????@????YOn??g\??C ????????B?&TZ???Em_*???9+ aN??m?h?????? N??M???????a?lZR?bw?????b???ZTV??8lk?]?j??>??E1zh?^U|??K?+ VQ?? + ???BUd?k/y@?o + ???j?T?#i??0<_ + %?~?? 7????%?c???!oL???P???8"??@ %?,G???f?KDm??OV?x@?$+???eT??????1???xn.;??H?t???Zc?Dr???ia????? ?(TU?u-??~?/??w?vf?KS?^??-4???????9j9?]?L/????t????)??L=?? + ]7?!??D ??/???? ?????-rVr>?}???????????~xr,???n?7U~w??jB?uo?-????H??????Xrf? 7c?(?????? >??j?ql??"?h|S??y/?n??`?UY/3??|?\s?c?V7$????? ).?????6#;?Y 9???????_???-l???0???J&N_b?>P?t????z&??B?cx? I????!??v?NZ?????V#??IC:?F?q? ?H?? ??-??O?-n,*?*?2?? ?u4t?1??"b?????H??e?[??K???6?? q?L????????u?2??DZ?!?v????S(%h?K???:U6I???0f/? ?s= ,??%??a?????0=???Oe?? + $H0?e????+L?mMs???.??{mf?}??@T??G|????????????2??HL?m?m)?e?{???{?7W=i??(?n????W?%???] ??F|??k?f@? B???A"?q? + ?&7??+ h?Pw??~V????O?sh??@b????????p?x??V??????a&?sv}??&???\A1f?H?=????]???f????'9????.)??Q[lM?$?????4?8?}, ?zL???_??S?? 59???:??[?S???<?> + endobj + 16 0 obj + << + /Filter[/FlateDecode] + /Length1 941 + /Length2 2155 + /Length3 533 + /Length 2826 + >> + stream + x??Sy???{????)??.?)??PB+???????VF????h ?Q)???ZZh??? @?( VE?????+ ? ?@W8??????????????M}?d+????FN? ???W?????+ ?f7??o_'fB!RI? PQ?+ w??%?=?w?:???? p?H?'$??fN?v?BSwQ?/???LE\?a???J?a???w???\K/????q?????8|{[??xq?=&v????A??ZxlE??%joE??.?,?? ?3?Q-?]?gMmw-?O?]?X?? ??TEhpj?sa????D?zh???z??@_??Q?0??c???z??}?? ????I? '?g??????l?g|*??,p?????X??T? ??T?j????????W?)?d?}??MKo????x?w?????wD?t???=????g?N??q?a?O????IG?)???????D?]?y1????N???{wd??x ??.??5?_?`??=V??3?CHm????????c??kE;????j?%? ?C.?WF?E?4???Eq?Y?????W`?,????M??????i?ih?pDk|?=w' ']h??K??W t????w`???$??f#?? + r???????\?ri,?vh%????._???fj?o?7??f?ut???1p??????/p??u??e#????????l???G??? GFtVp#fow??U? ??:.???????w?#*.?v ?????y?6k?#2f?CR?????f9jO??'?. z9D=??F8H??????m6t?`?#?GM[?I?? ????-??_F????E?$?r?????>?`=?(?F???I;??"????T?R??q q?#rP?yL???"???????+ ?[??%??)?`b?Tp????QR_?c-|?5?*??y+ ????0??o?????3?;?x?$j?????????9[?D?~7??I /??H??d??? ?>??} + >????=?K?A?5?i???}?N.l?u-?I?8??U????(?a? + ?k??n?+??-??D??kvr0i??Jm.????]??Kb'?2?i> + endobj + 19 0 obj + << + /Filter[/FlateDecode] + /Length1 1446 + /Length2 7338 + /Length3 533 + /Length 8217 + >> + stream + x???g4l?????0??^??N?`ft3?!F?(?K??D?D???N?=?????}??}???????3??o_{??]{_??1?)?a65?'?/$ P?56?? ??)?! ?# ?B@?BRRB+ ?! ??&? ????@?+ u?B_g$F?%t-+??d?~?? R????x at F?@?dGo???^?Y????!R??oO??;FR?Tv^??????Z???W???]??eT?/&???}+?9O??~@K??K?"J?$5???? t!??.?????9??????????A? ???Z ',???teipi??cB?K?5???DM?'7.$?b9? ?Zd??}li>?f?=??a?m??????@?\ + ?h?i????O??? ?<h????"n??0l?/mFxE?W??%?????2??????-~?q??????]k? ??\?OW?H?? ??N??%d%???K4 + Q?=???S??M???T?7??'???$GU??Ibrsn??8S????fW????_???????y?}?b?c }?|???M8vFJi?'?4=[?? ?R?.?fX???a?1?*??/??cU?l?'O??F??f??? + ?H??~LQ??d??~???jR K?????o D???d??Q?&???+?s????? ?f?|>?Db7??7^?y?6??n@?MJ???kb??_??pv?B??\?bK??^q??G???M???R?;??i ?????"?0/??n?W?T??>X?V?lt?9=?p??e???i?(?y??????VJ?l"????????D)? ??(?d??????l???;????Z????n']??s?????6??P_?!????x??F?0?/????o??*0{?"??kO?A?7w?????_?a=??*???+ ?t??_???h???m?????eJ??b?????W???????$??m)\??? ??p?|????j?3w?????k????9??????}h?????????4?p_1??1?E?1qb?A???a?ZJ/????Rz?tH?s?$???2?n???.??????q???)?FdE??g6?1?F??c??M???=uo?y??s?cus?????w??M.?P???4V?hb??T??????5Z$???????H???p~?f?=Q?N1?\?}?????`3c?y????? f? ???5?G?e?C??b'K5X??b?k?8??%????L?W[?)B?T?p?U??E?u?|?Q??????????B Q??0???d?`?????nv???u0n?.[?^O???0??`??U?E? On????.Psq??r??6?m?^?i????a??mc????sV??@#? ?0^????U?`?'??????q??p???pa???C?r???%??BRk0?xw???+ '???8?>?&?5?_yX?4?Ua ?'?YN??? + ?L????X?4Y?????E?LBB6}?[?)?6y;???????iEL){?T??J?Pr??+??i??L?jr\gL#zI7>eG?`?k?|?Sg?????]"??N??k2?????4X?Xj???a?????S??YV???3}??B????>?Pk$|4n!G??.i??x`/?}??Y+?{???????~?h?O??U N?SF5??w/w??=???d/????,?)?X??sho~t;k?;?????K???cq??>???D?,)P/t?Ku?i?m?6?uni???K ?E???IS????x??Ju#?e?s{?X^??[??,?U??????q???h)rps???*?J+C???????} ~t/.?Z?[?w?!6_????1w?^?0.?0_k:ke???[????`+?$??? ??Q4?D???3ft +?????or?(4? c?????????? + r?"?f??~?n?cw????R?zZ????J%L?k?La,??nej??????'?????F?N???=?go???R{ #(J?j?{???q?%?????y??Xb?`??? ?>?z?N??????!c??$???????????? + 2o???R?r{???#???,??h1?b1??4\?D??Ep-?P???X?H??bf?x"?^??sG?s???????????[???r????Fv/??c3?u??2?W?????? |? {6W???[hP?-?+BB??:???K?y???~??? ^????????_????>??????R???2 U??t??????E?/?u? L????V???N1?h>???'??;????%x????T?v??I?f ?[?@?????+ ???{y??+]?0??[?8*NkJ????H\????$?tW?[.??O\7}?Z???????m?8?x?$W)???l,?=?????`? k???8??M??!O?4{0G?? ? ?c ?Q???d?r????b%L??,???=?v????a7???^J??d????a9???????,y????j?^?????P??!K]Nhe?M?(.??M?R5??C?)o??1? @???????+ ??V???n?y??j?? ?J??'?????z???;???vGm5?W???0)????4JP???#h + ????A?`%sE?1c~?zU5.cH????????????}??*^h?????+?'?u)?V?0i?kv?%?3?wU|?(?;?@GHbi%\ + b?pL???X;???\?G?k???"???|?,??\??Tv???-?????T??p????M??;0?7+iT?x + 7???P??V9?3?????l[????????I~&i? ??D?????K?oM?/??V%??F4?}?+ ??1???5?????N???????0?????p?q?-^???DG.??{9???]}v??B)???Z??^5?\??%42??!? ?Y??? + z?A?? + WS????Z?z? ????\?????kJ!???FAlL9r??k8~Y??;$?x^??L??H?DL?-?Z?B?7+ endstream + endobj + 23 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-58 -250 1195 750] + /FontName/GGIEHE+CMBX9 + /ItalicAngle 0 + /StemV 117 + /FontFile 22 0 R + /Flags 4 + >> + endobj + 22 0 obj + << + /Filter[/FlateDecode] + /Length1 960 + /Length2 3127 + /Length3 533 + /Length 3797 + >> + stream + x???iZ0?d?[???CF?2??d?????a?032h?dI?QY?$K?5?D?w%Y??$D????}??:??????????;p14???|???? ;3? #???C?ZQ?:?.?WqY?/uF?????2??Y-m??t???p8??b???FVY??Q?? ?????k?/}??q??0?0(8??????0??#?wQ?M??e85?\?/?????bFvuV?i??Xg???|?0E??&?%?C???????Rt?_??D????=n???~??huC?e?#v>u???????m???`LV?o9d??k? vs????W$???;2??>?g????????? ?p^s???kZ?+??V -k + 4+ x??m???=????i}P??a?wFgj`??n-??WU??]m?[xm??????9j???X?zc%.%?\4l=?S?d[dpb??C?2?h????'??Q&F????Q????u + ~??6???? ?????V??????2t??????P????4????%???{9?sq-MF??Q/u??vn???? s*{?l????,?_??/? ??????;e?^| Q,4????Q7U02 ??X?j {???$????{y??w??b???qa?l?`\??M?u?}I??t}???*?'???M?????????!W??7!???? ????X?????z?7s]cr????&?rQ??j???a?0:?4[???2??o?v}??n?M?e1????`3?????8x???2F???]??9???Nl??_?oiQ8_??li41??]0??tMK?=^%?d?????j???E{?vd???t?p?r??fx???m??s???>???&o(??"qiu2???h?8?4)?^(\?T?#i?&?1?h???tr4#??3????r??H:??????J?|J?%?^?tUs?h??G\?Z7??E?rg + ? + ?d?>?\?8?=?????????g?vZl??^?(???^[oR*?S?;?????-ai%??^?In??6??7.?=?>?o??B?n?? ??O?K:?bK??????dx.\}+?@???M?E + ??HpI???'Z???Y?d??\,???m????7x??y'?c??b???YS?? ?[??j#????????????+a???d???e??u????K?????fY?i??xX??2????An??????? ?$G?S?pTO??+ endstream + endobj + 32 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-163 -250 1146 969] + /FontName/DWGIET+CMTI10 + /ItalicAngle -14.04 + /StemV 68 + /FontFile 31 0 R + /Flags 68 + >> + endobj + 31 0 obj + << + /Filter[/FlateDecode] + /Length1 1524 + /Length2 11308 + /Length3 533 + /Length 12224 + >> + stream + x???UT\Q???`??K?????? (???Cpw?+ ??@V+ 3?????:[?MEm-?A+ ??kw?????? _?>???R?????|=?,?????_?je??Z9???V?????_?j???Z????V?????d{?r? _??X??Jlo )/o????f5 ?D?8C1?*?t?t?T?0~yb???R*"l????6V??;???L?V?K!=G|y?h6? lN??????"H??r??w??N#????~???C??*t~f???uZ{????????gU[?K??(?t?E?L+w6 + :???P??w?~S??? ??"Kn? ?S9?*?]????)KO ?????f?vK?????8?????rco??r?__R:8tO}.?x??PvJ]6?J?`??a5??d v??q?**??L?=;??????K?x??E?NH?~[H??(? ??8???)????Z?J???kpn?2??%`k????^y0O?????R??L??5Q???B?R[?y?Ka?;@?r???/3?????b??h?8???R??[?(??F_8?o?M??i6}Nv??c?%akrQ?E???n?,D + ??fO????kl?q-???KlU??G?E???:??4g7?????J,?X3???9??3?w??'?o;J????H????????*?;))??EN ?:l.4eb? ?|??>?au{??:m60F??]p5??? ???U + ??jq?Z9?/\?{?ox*U???wvW?????????:?_????ad3j?044gsl?z!7`?M????`??????*#4??????het??pw??'?O?r}?. ???`??M?Yvm?o{?????i_[lO?D???cz???Y"??N??it??8N9?Hx???\??f??."?w??A?D??h?b?u?P?o?l!???~??1?+ ??\??'c???8?OMi????Ll?????7??yr?????3??H"???5?S?????=_???=???z][??? ??(o??\N??J?iW?=iJ????!"O,$?;??eB? ????f????z?{???>mL#????|?,w??u?[???c?E5`?~???????V?euI?????,?wre??is?b`[?T???W62???n????Q?A??A??I?? ??xW?*??V??R?H?0??pK?O??q>????v<???R?"??????R?U?#????xU??f ??#??.??=?? ?[??l?6 8?2???Pr?9PJ\?e??&>m? + "'R???? ????DOf~?@??n:?+q??(d?fIu?4????c~??s?&??~^Y????'5??s?G7?s???Y???kl ?{???????n[}?[?y??b????w??????UG|???V??/?+?E^}?#w???/?????!??`??-??dD???= + ?g`?L>P?[??"?F?.??5 ?]48??3??????3??????o???x??h? ??0]??w?I???Lgr????? + j(???r??I + ??W+'??Ze?t?+?C?????a?i??? + ??x?aR_?? {x???k?? 1?H{??P???I? ??S????????C????NT;?:?W?????$??!\ -Y????V?i??2p??'8??w??E!S?;.[}s??D??!8???)?N?Hj???T???>?3U  ??2?y?Z????f?r?~?6QJ???i? ???.?F?T? ?????4? ???`?w???????????0gA7??gT????IF?/H??????????:??.???z?g[W??????:0"??` ?M-~Q?????$Ux?n?$??1?oz{?O6??^?>uv~?#c-??>l???>M;q?????.?~V??b0?(}P&??c^r???~?SH~>r?????Im???a;+lmC??@'}??+????Xp ?-jg???'D???I?3QQ?1@~?c?1'??????~ ??????(3?????&???W.?RU/ZL?I?=?_{s>,?`?:.meuGr??????XDPo{t?uX?Z?R?&?k??XDib?NZ? ?????y?A????n%???l?K?}>km at _?+S???|M?E?-????????E\?Z?1}"v????Q?????;?jU%H??ZZ*4?VxQ??I??%??oC+ "?"???mz?;???nY???? ??5S?e!??;i?FU???c?@?3]o?????9???????p?;ET???c?=???'?#K"???????pC?z?gJ?L0B#G????$?M(4e{??g\?e???'??Vz??Y?<j??w?WxJ\i?&m ??????4???u??XT! E?a?EV>?Z?)?i?nF}M?N?a?Z?,? ?(??t???W????+ I???.??????????c?)?? ???k?w??z? Y????0??g?b???AW?q?V~>????q?????zO??Cj???G???????X?;ay2l???J???<3GT???`?????W!?nQa?7????B]??a?9?E???O6???G?!?*my;??O?@???K???? ?(??>??l?????/?:A[??BMsa^h??+ ?z??O????>??H?7???!???>?41? ???z?Y?5?r????????#eN?*?v=?.?+?Z?V6"$jST? @??I???? ?H;?81A?!a????h^vA?+ ?z?+?_?NO?)???@????w;?T?W??d=?je\??=????8-VS???>??2j????F?3???,_t???$O?-?W+???d&?i??"al??aKpA?????#?6??S?\KG?rHB????~a??8??*3WV?Y#L?_|Hb??B2N1?+ ?-??;E?|)(E?X?S5U??D???? + Kl? ?d??M? ?\I?]?.E??7?:??U????~q?fs??'?`) ?_?????_w]????R1;?2Z? ??f]Q>pzS??.?n?????3????C??? ?)?WV+ ^x??Z~????Q?????wG?o???hw@>5?h:???t??Yl.^?_??!??u???]v??$??^???$?m??E6????py:???????tQ??f?U??5????9f?co??+??I?4??Z?^?a%Js3??`?_b?N?\??L????9o%-gJ?yw???9l`???{(?2?????????RE???l{????7?o>?8????,?n?L?j D?2)wC\?:]?????? ?5?+?D???6!V????s?;sW?#*q?>?b~ u??? ?W&? ??? ?hp?q?7?Z?K + ?t?V??TPR?M\?? ?2?????3????D?`*0nK???????b????f?i?4?w ??4?#/?b?%* {????fcc??k<_???B???lm-??@?N_?? ???e??? ? ??e@?3?????????S:f?Pq,??1?@u:5W?M}????l??X&&?\???(?e????9 + 6??????/R?J&?3?t?/t????+ r?]?7%?R??$|?????{?)?^????O%??p???2?5R?q~???aX??X??a ?I ?2?(pLfaK?????????|?YuFY?i????+?)??8???N?????ZU????+U?????Mr??-5???8]??????q?"??L??4??[???]???V???|?_m??(*?"~??*??9?O3^!W????? ?F? ???]?[D???? ?R???Z??!j?j-g?xo)?+???z?n?SV?i|??+ F??ES??I?x???`v??7?????b&??'??$gN?C|??\$ex nF_???C?hW"??9? %??h??U??oI??s?&?????oT??]'q8?????!e?t'9 + OJ?Bn???????[?H?b=?? czXU?E?WB?$??????Oa@? + bW7?^d??x N?R??X?V????@+l?????R_??k&??@??{??9? g????Sl?*?d??0?p?H??????D?x1C? ??JR,m?$?>??w????{?:?5-p?w??&l?f??{??h??+ j????9/? kcJy2 FH?x??^????e??/!??B??????X??7d????2ws???_??o?4???????o[m?E-o6?????f???eu????????$?B???0;7;?l??p??.(z???g??y?r?r[?k=*I???xR???T+#?5???C+ ?z??'y ![Z??v?%?P?Q\?r????[}???u???M????DYQ????:?1#@ ??Q?;YI???????[g??c??V"?,w?????S??S?????_?&$ Iq ?X???/?,&g??iZs??CO?s ??#?C?H????$?Qi^?P??+ ?Cs3egb?TQ ?9??28???????a5????`xB?*??2??4lY???m~??S?BRj?????c%?b????jqx??o????oO}???j??B+$A ??????'qL??? %s?4??{??o?N?y?txD??%????zF?])yce]??????0> + endobj + 38 0 obj + << + /Filter[/FlateDecode] + /Length1 1404 + /Length2 8858 + /Length3 533 + /Length 9723 + >> + stream + x???UT\????$?C?"?????k?K??\?CNp ? ??? zj???J?>????v???????G???G????P?d??X+ 5?? ?? q?2w + + t?+ ????)=+ ??X?QXU P= ?????????,.???;?U??f???? ???3 N?n@?2? + ????????????????9d)?h???????Vj 7K[??9??w?h??????+ O??YS??Eq??z???????Q)???9?????`/%??T?9i?W?v???2L:??????? B?? + ???@}Y ?=??;7??? ?{??d?1x?O???L????????gXs7??r???_?????g?~?????I?:? ?????????? + ?D??H??S??/???n"H??M?Cn??o?Y?H%IzQs??lO??y?^?n??eo?2??q??twk??e??$??/?E?`?hd??b>??|M??i*?_)x?C_v?A?u???sBl~?????#Y?l?} ?b???S????3?"^??]?`???????C????????c.?J??K????dH????$J^,???[?}Ay??)?u?? ??^?c??t|?q~o#????T???m???&rE?E?8{???jV[EJ?)?Ll???7??????srw5e???|?,?w@??9(??????I?k???t?;???!?f3??2?s?4?_z?2Ft/?S???Wr??17Z??+ pQ?U???7???K4??b?G??z?r1?????k????H???? ??S??$????v?D?0??3???LY<!W??????Un?k????j??0?ZF??4??e???t7H??$^v???oqi?w??(?P??bf?P??????????4\??(?^S?????!??[????????_??b??Po?(????/????&+ ???s?&?e?:+ L????a3??3?7~h?? 3^???]`V??gP???t&??:?rt?AOuA?]??`]??I???>?5????HDM?C?/p?X> + endobj + 41 0 obj + << + /Filter[/FlateDecode] + /Length1 1449 + /Length2 5376 + /Length3 533 + /Length 6300 + >> + stream + x??tg<j?-!?? a!???=z????? c?(!??D???E?(?{?^????&????s??????r?????/??????^?????g?/o???T?(,?X+ ?%J????I?{??'? ???t?q:?p*??(???@ + ?A???pZ??e?oT??r$R???????q? ??W??? ?+ ????? !??w?7?^??s8@????x???Rp??!??-??/???h???A(???+ + ?c??????<?@\?????(+ 8p?????????d??F?Z????????t~#\L?o$?k]?7?U3??p??$p????Y????='???? t???@B??m????W???????}?1??????)(??? J+ ??SW? ?s??<0????????????> ? ?#M}E??????{`???????wh?????&??+[x9(l??6q???~N?q?h?4?f + ?4??_?w)?I??{s?c?B????+?3?|? ?????XF?0???a?vo???K2 ??`{-b???C??+??_~^?/Q?td?????????6?`?k+ ?W?M+! 0?)??o????J? ??V&vc?3??ly?m`"@u????? cBa.?Y??6?AW]?c??V.???@?.I?)"N???????}[?5???????????s??f? z?????9A?l????-??b??)7???a'F???n_F3?c????U?4?3M??uA?u???~??['???"0?}?f,G??>d0~^???\??X???,??+?????V?? ?-??O?&+???????! ?dq.?? E?????????????|9?o"???(+.??N??? + ?%??H?e??j??y????0?????????r???V??????[?O1?d ??Rh?8?-a??G?[?V? + M^?`.F,????????w??m??TB????*i???U2z?????????eL?] ~[??f?uAfs???r?????(,???U2????7?E???R[I??/??????'.?C? ,??q&%?_ ??< + endstream + endobj + 45 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-32 -250 1048 750] + /FontName/BUKXWA+CMMI10 + /ItalicAngle -14.04 + /StemV 72 + /FontFile 44 0 R + /Flags 68 + >> + endobj + 44 0 obj + << + /Filter[/FlateDecode] + /Length1 1571 + /Length2 11403 + /Length3 533 + /Length 12352 + >> + stream + x???UT\a??qw?(?????'?` + w???www'????A????;????5w????_??J + V?K???2$ + M??/[.?O?q??:e?c;??oX??????????c??1???;S?? ?f3]??`????L?????*?;n??X4?????VI#?j????k??????_N?IjY?d]~???(?~?CX?l??????K`???5??%[??&??!m?G?a]?$?Q?????k1????9?j_??h?D?h?_&SZ??Q F????0?l#?R?l?7??O?????i?7??f+ fX?U?CK????G??`?M????~??3??T??r2,??_? ??7T???????9?_d???#T5?????5???r?CH??????? + ???0??$(???????'?m?gb$ ]!Bob,??F ?????????????wc??v?5C??m?6O??????.} ???Sb7??G??a?N?$#??A??s4?3T??? ???????Tj??o??????~?\?5t??u? l?b????8?Hj??2?W?6b?>S??/a&??? ?[?$????h2DN???y?|b?yz?R????G?9?!09e?ua????z?\????Kq??ma?Z?M?????}?????????l>?{?z??e1??+ ?]??E??}?. + ???Z?K??1?KQ??? %E?FUz/???=?K??JI Q????F???K%?R=???????C??MI??,??RN??g2???M??L???w????h?D,??.???????? x?]?;G?P<??zJAt????b?[v?B????e?)'??j?gV?????????]??5v(???$?I???????`F??tg????gJ?S?0??7??C"?n??#?w??$??D[.????p????$jg??E?????-???M? ?\?????8??G5?~Z??r`??q?g ?M@?e??/??????O.}?????tP??hX?r??????lJ'-?H?? ?A????t??w0[??'G?a??? ??C;A6?:sD???E??wqB?q??c+??9?C????/???Z>oT?;???????^?Wf?.J?P?J?e??c}??h???\??0?!?*\t?ESzJ??????m* 5 0?wZ?5??lQ?.>z?????|g??$?9O(?????L6???K?4?D?/??????V]F??4? ????2?g?0??Lz?m??]6R?????`?.?-?x???N??K?i+ 4???e0'???[?G?&?R ?&#????x?9?e?Hp?6:?c0????+ <?+ U???B???????,???????[???|?WU?,mu?g?m???9Ul?.?????W??t?o^???LO?P??wl? ??1o??{qC??0?F9?????=??6?????J?LW???FLY???0*??7rD??????s^???,=cK?????????&???Z?B.???????G?W\$? ?????H???72l? + ??v???X?B?????????x???#???4K?*?h?:^u?o?^?K? + ?k?}??X7?h$ P???tG]^do??7?w1??0???8)}!W??'Zu??~g?6?o??i?N7X?Iy?x?+ %?9????!+c@??W?)??????E????%A6Qt??U??ek'?9p??6?cf????}%???!d3??g?]+ ?B?B?h( + ????R`W??!??)??&6HM??P??h?? ???U#?????*?)P?????`?=7 x?O?S(1??*?*??j>o ,:U??m?(???????r?p[?U?*?L2"?"As??!M?r?P???o??????????????8????7b?+ odg???|Z(?I?GE6?7???|l*FSj???|3?6x(? ){\?????A? ?*X?t?l?????E??????-E??tx= ?A??/????[G??3?7R,??W[????T?=???# ?????#?P???O1mF????? )?( '?dn,z?P??a?+X4?y??+P9?| ?l???4???W?h???O???!?;?8?n???u??L~H??u.f?(?.???^?????????-+'u??????????A?`r???>?T?(??:o???@??_cn??KHXGWma? ????[??3?zeD?F??>s????????K?????n?/??q?3?+?W?B?+ ;V}C??+ G\??V??R?7?Z???a???0?????[$??e?!1???8??G??Q@J??BF??t5?????UL????????\E?^5B?????G?p???*???"?? ???2??P kimS)?>?)?k+?????????nX?m???{\?CeWI??$8h?~d??M???|??bA??R.???X?????+ ?y?.?2#?f?h?# ?FI??r????~[S?? ?_'t??l???W??OWW?????/M?(t?????G`???N]?a/I??[??????????f?p??Oa??Lu?W(S`???1y?K??}?"?|]?"?a??????T??C~?f?]???zh?s?4,$Fv?! ?ZC?L??B|??m??f?????6??C???z8w???[MG??? ?/? ?T??/?????gr?1D??? N???????????`????????5 + ??+ endstream + endobj + 48 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-27 -250 1122 750] + /FontName/PSIOKW+CMR7 + /ItalicAngle 0 + /StemV 79 + /FontFile 47 0 R + /Flags 4 + >> + endobj + 47 0 obj + << + /Filter[/FlateDecode] + /Length1 1052 + /Length2 3204 + /Length3 533 + /Length 3927 + >> + stream + x??Ui?3??/??L`t?%*?No???6a?1?G,??????F??????'j? ?o:$???_i?3??!D#N???p???.???z? ???????a?84?97????^?????/1??Wv?+ b> + ???H??E?t?2Xs$?s???*^6??w%?:??f?kaA??Y!#K??I ???????N???Q???????+ H?:5?uu???9?*Vi?Z???"R,3R6*??VK?L?Jde??8??(5M?:Y?]??l???T,!?p??)E???????L??55L??5x?tB???.?p??d????E? ????m????u^w????E???O??!??-???o?4??!????????g-???g?????2E??=J|O}b?????s?????* + >1????%_M??*#?J[??\sL??e?????? + 0????'??g???ED????I????(>????????;?M???d????WT????yG_ ????[???????s?I??k\??U??a7~w?&???)"??????*?????2Z?q?%v?Sl??2A?????X-p??I??Y?0???P?,???sd??~???????)?#?^Q?yum$?5m?N?? ??-?{5?:6m^a:???Omd???9??x??p?GKR????MJ????D~?(?[??????|?N|??[|??I?y"c?????????????? /?!????.2? + ?? ??(?lky???r??&Y???L`s ?MD!e?{? ??v???p-KQ;???_?"?c?U?> + endobj + 50 0 obj + << + /Filter[/FlateDecode] + /Length1 1254 + /Length2 8009 + /Length3 533 + /Length 8811 + >> + stream + x???eX?]????E + '8??kqw?"Ip?P\K??R?????E[(V??? ??????~?g??7?$?q?k???k???0?hh?I? ?`9?????K ???(+ ????+? u}?`???+??O???+ P???P??,????*d????YE???-P??? `??e???W??U?? ???m+ ??? `?????+??qp???e?N?.n`E+ v?????? + ?[?>?5`????T&$??s??G????=???v???????x}Zg?s??`FV~???e~}ma?6?+N????&a0J0?????@?w???I$?7'D??m??D?1?#)G[6Ycu2N????fG????]\$>?K?Nb?TG?z?"????????l???(G?MhW??17O????Q!??B????Q???? %O?d???X'|??1#m???????O??A??k??f?^???????b???Q?*??z?+ ?? ??_??%?^?d?D?????_^?X.w`???5e??B??n??NO?r at o??H????????c????e??_????4`??n4E?w??t?a?3??????\"??`Z???B?h*?o?+ ? ?2/??f??mg?n4?H???????2??s?????wd??b??%???c???p?C?M??:$?? + ??A???.??a2???2w1??uB?c?????)\*\D??.?wLf??R=??d?gky?????? ??@?}??1J?]-?Pi??NUO? >?O?UZC?f[>?Yv???_J)+?Q???g ??n8?,~????p???zX"?I??(?"I. =?+ ?J8:?3Mh\W???"y??Y???q??1x?n?Q?-?^?,N?W?????/????6s????}????|Um?5?m7?l-?l.?????Fz??6c??+ R???? V?5???a1???????????r???????d???1??Gm???????f?q6?vfW????^/?`c?WU?~??3???`-?=????-???????@?@gXah? ??*n???????4??!03?'??[*v??T)???+?&?? ?????]$?B????oq???eWA!Z?])??? ?fb4?wc??uEZ???C?5??!?b??>f ??q--???????Y.e??w?{;X??C?x ????#:?|n?? 1????????f??6J? 3?n?F??*a?_??j???]?]"?O1 ?L'?q??L?7?????????!S ??s6R;vY??7? ?f????~?CIJ??V??T???N?5j??\$?T???????L????x~?????J?0??nM&??L??%????Y? ??Y$2???? ??#6x??t~?wd?w??????;?J'??4|??w?.????>;w+??>??'p???mK??K???N??Z3??G??AC????/?i??|?t?V7OI!?&??)?????Qv?5`??z?????F!?:+ ?g?27??**?b?????2?,?@sv??Ebf?:????rT?q?d???2??Tk??[g?uS??/{?? + ?????y??tudU??$? 1?bM???????OA?????????=<??s?2"??f S???????4l????F;?H~??HT????l???7tJ?z5????1???j?~??|:??h?wN?IwhY]9??D?=\k?e?L?Fg?D?w?t.???!?LF[????O?&$ar?af???q???6??]?????]nY^a$^gF ?JR?p?S? + ?UR>C?"!C2????1??/?(s???S??????t_b?8^????,n? ?? 0??DoC?!D???`v^???w???]????K?nX??d + ??9?????j7?4??h??p???:?m]??V5D+ s 6{???mO?2?g?Ub?(?M?w????SI?la_f? ?Z?}?6+??~B5S_6???????\@s??e$/??a??1X?>??Bo?\???k-?k\?7??E? ?&???$?4?\B?8??o;????#\?p?;?(f???>???????dPC?RKm??J????l"dD#????9_u?G??=r???5A???+ ??%??S???p&z????U??{?8?l??o??Y"Be?????gB?a5+yKc???kUZQ?????o?l+ 6?W?H> + endobj + 57 0 obj + << + /Filter[/FlateDecode] + /Length1 782 + /Length2 1396 + /Length3 533 + /Length 1979 + >> + stream + x???{8T????vS?d?DKQ??? Sr?Q4L??\??5????53???% + $?NI??P$*?IH(?BrI9????N??99?v?????????????????}?w-#????A?("???iL??????T?????@ ?",P1??-p????0 &?N ?+ .??!?? + =A??=???????0??+ a?#,?+ C???tO/?e???M?z?.?e?C#yE?7?ry?????e??+ endstream + endobj + 65 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[37 -250 1349 750] + /FontName/QSYXAN+CMMI5 + /ItalicAngle -14.04 + /StemV 90 + /FontFile 64 0 R + /Flags 68 + >> + endobj + 64 0 obj + << + /Filter[/FlateDecode] + /Length1 799 + /Length2 1812 + /Length3 533 + /Length 2403 + >> + stream + x??Ry8???(?? + ??aF?bf0??:?X?;c???l?fd-[>? %????R?T??)Q?T??W?rD??????w?9???\?}?y???~????? ?ru7?dp?A;.?o?EaI?5??@+ `?+ `?!0?3W4?????_??? X,g{Y~9???il&+?.?'??@?2@??+? + ?x?? ???k??Oc1???Pb?( ~?? ?cF? W&??????u?????(?>?n??^???V?v??Jcr?Q<??????`QF3???0??(Z?w?? ???? &'0"4?E?0")#??L??H?c4?????+ C??H?p~F\mGn?{?????? + ?????5k???+???2?Z;z?? 8???0???/?P??:'?k?I??J?@k%(vB??=Z)M????v?+???? ?/7?*6???%3??XJ?????? ?` ?2*??"Y???%{y???Nd???7aO???????????W???&??o]/? i??????T???? + D??)4S??kb?EkO&> + endobj + 67 0 obj + << + /Filter[/FlateDecode] + /Length1 1018 + /Length2 2328 + /Length3 533 + /Length 3042 + >> + stream + x???y?y?y???????\?}oVvv?6'??@+:?????????>+ ?F??Af8+ ???P?+ ?+ ??t?p???C.??????A&$2??????????YX??"??M??P:h??P??w?9????H$?e?-?g1 ??????GL$ N??xhv?4y?LA???4?[??j??? Y???????Hs?????u??m-?T~????J}??3??????5rR?????t:?\W???????]G??A + i?????G?????E??mb?_??#'??"??6X{?6\?m????cK#?MY07~???i6??d?K(???AV?W??? T]%?%?D?j?\rA?? f????b??]?????}?G?6????!????4?az?s?iaQu????G?v{?%? ???B?R?????R??k????0"???s?OB$G?(????Z?M??k 6j?-?$?GS?hD?}P???}??pY!r?????G-?&vTs????f? + 3%????.?0}?B??]?g?:???V????? ??q???}wb????????u-???K?AtI??l;#??wM??????|2?0?Eu????W?=SQy?z ?x?Q(????3???Ny?63{??3?}|u???s?5S{???????V?x??a???9??i{???mA?o???[sQ???}???wz ????J??????#9;N?BJ&?N/??8~b?& .%?U)?R???gf?????c5??fq?C?c?i?L?Z.5}*i~ ?R????G8b.c?Fz:?l?;?d?{C?ML}>i??????`l??Jv??7d?VG??&??`?9?n?+M?t??p'? + ??3)?????B??Z??U??_?D?6???/??w2???tC??-? ?e?O??*;?t???~?.b??;#d??#?fT/??m`r?ijc???CdETSm?Yn?j????:XS??@?]?????????o,V??(???K-??^#[Zti8??7??H????fFg??? ?????%T????}????G][?????l??}HV2F?|8?- + ?????%?????? =k???/???=????P??u???z???\h?%?CB*k?_???0????b???X\?lf?~?>?????? + EI????HZ?"l??(F?N]Fj?@3(?J?0?f. ???C????~|?XB??w??V????Q? 1s[kF????F?*G??????x?z??07N}p??e?e?????A?m?Y???JF????vlW? ????o????\qdWh ?_?8R????H??m??sa???7?!3{???#????=???"??cM???~e?Vs`?uo!?>?_????jP??x????S%?8L?{??r@?????}?BJ?Ts??????I?d????M???\ z????l???!?????D3?r?n???Ux??T??,?v^??IT??>????????^Qc?Ly??X'?? + 9?-y??6 + ???>B???=??v??d??ZW??8??G!??`??gK??q??6??.,???Q?8kbR ??ai?Y????a9??(???o???x + ,W?D%????+?(?]??,?g???v???gS???*9 ?,k?('??R?D|??h?=E?;&??????2??????li?}??M|????\?L?B?????9??> + endobj + 70 0 obj + << + /Filter[/FlateDecode] + /Length1 787 + /Length2 1386 + /Length3 533 + /Length 1966 + >> + stream + x??RiTYeQ?+ $Q?B? ???ET??FEZTlEAp?6????BcO???3??LU?x????????&0?????L&%@D??Y^??!2??d2???)"??q?0@????? + P ????p8?a?De ???t+ t?x? ?@?IC?q0 ??????X???-dU????z??"?????(.??#s?8?5R!? ??2+ ?+- g@ + ?G?????H?L??+ se???y?hkVFO?????H?w???X_0D%???????6?2??s???7 ??R?;?:hP~k??wr?[16?{??????eC?+ (?]D??4Hp??*???Ps}W??$?g*????n??L??2M*?.??????rb\?"??S&????3?q???c?????C?&?3????j?C0[ ?`??l??????&m???????E?^HK??';?:4o???2)^4[`Z??Rk????U6??]M????0?%;M??????k?7??K[?RV?b-??z???\?:U?1????6???q0?H???+ eq??u????#???????a?_2^?7?????ic???'???W???l???}??co?L??T\?]w[?b??!??lsT???)?q5?lM?~:?????$??z?-???????_?B????T$??8?V?? + endstream + endobj + 74 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[8 -463 1331 1003] + /FontName/ZPTNFD+MSAM10 + /ItalicAngle 0 + /StemV 40 + /FontFile 73 0 R + /Flags 4 + >> + endobj + 73 0 obj + << + /Filter[/FlateDecode] + /Length1 840 + /Length2 1492 + /Length3 533 + /Length 2099 + >> + stream + x??RiP ???Q? ??8??? !$(??Pn?RaB?!=??+ a??n,1L *???+ ?y0@?????~??11??lKm0WA?T?D???????i??+ V$??T?9??ou?2?!?cmf??:?8?'u???8;???r??$?????&????*N????q=J*??wYe?@??????q?q????H???OjA???;~??o?G???1? ?m?&????O???^???5}C?fiK?bQ?m??u????f????x?&??????4?]?????XY?????y??<|>?s???;??# j??JY??H'???[???????*??DZD`kSu?z??w5u3???????????bA K???H?R; + endstream + endobj + 88 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-29 -250 1075 750] + /FontName/OYBFMT+CMMI9 + /ItalicAngle -14.04 + /StemV 74 + /FontFile 87 0 R + /Flags 68 + >> + endobj + 87 0 obj + << + /Filter[/FlateDecode] + /Length1 1002 + /Length2 4316 + /Length3 533 + /Length 5014 + >> + stream + x???i??o_?%%a?j?Wlx?h??B ?GZ??s?8}9??0???:I??H5}oW d??#8?????}}????8hj??4*?Z????o'???Q ? ?a??B???Q???????!r??.{<[06?Gu?}.-Q??W+z???"??>?GB??{??f?n??4s + 0-??K?B?G??6?????? ??%???%?:???h*??W??lX????tH?Ot?(?K??f[WO;??4???m?Hg,?????r???A}8v?w??k??? ??? ~?N3??\?h?????u{?c????=??d:c ?? + ?`!???P?me??=F?; :+ x?????,???{%???>??????>?+'P??YtS ?IZ???o?cN,.?:??vx?f???u7??N?/F?tl?)Rha????Z???w????Y?q???? ??K???c?7we???#?>??K ? z???[ ??BK????b? ???????M?K??S?%?j?c ??Ou? + ?n?"zj??g???????????O?`t???'c?4???k????Z????zE;~?????v?W??S?????i?r??}?}????????xS?W&?I??x??????d?d???T????n?o?T???PI>???I???|?1? ?DgR??]?'??2)?l?*4???\1?Q????8????????8?;>-|?X$????1??-7x?O??????H?1/I???8.??4q??G1??4Q??o?g?,??????ly?S?qn???????8?a\Q???????/=f?w?r ?~|0???!RN??I:??????M??????tT?e?U??_ ???#L?s?????P ?f*???? ??4??6??M??2???CuQ?z?? Q??=B??R?iug?b?@????)???T?g?6???????A!?I?'n-v????M? ??`i?~??A%?-??8U?????-???K???OZ|^???\???#? R??0/?oR;?M?V?C??#1????g?????7?-?&O?,K??>?'???-?/??n|??d`?p???S?? yw???V???wL? ??????!?Xs???Li}????l??uRuY???L#??DSS ??e??K??5??J????s???? ?C?r"??T0??x??*?d????\m=???<?? %$(???o??yM?X/ FB??!?\ #b?y??gE+ml????||d???? ??P^?\! ??g??yTf + [6???????Ki??j?5?2??d??a4N?????Sg*I??????KE??????>H??t?L?!????\??L}S????*=!?*y\?????Z???H?w?? + ? ????I???Q.*???????' + 1(??'???BA??? ~ + endstream + endobj + 91 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[11 -250 1241 750] + /FontName/KESPKK+CMMI6 + /ItalicAngle -14.04 + /StemV 85 + /FontFile 90 0 R + /Flags 68 + >> + endobj + 90 0 obj + << + /Filter[/FlateDecode] + /Length1 859 + /Length2 2562 + /Length3 533 + /Length 3187 + >> + stream + x??R{8???F???S?aR???0??8? -???&?a2??2?%?X9t"r?!??A?+?AH??($~S???????????k????????1&i#Q????v?3???v??\7S????)U ???? ??????}U?h??E?m???1+?K?=?V???OJ={????M}C?????????3????O?p?+??/l.=?v??CeO??[H??R ??R}$X?w??? ?!?5{?5Vp(KD|E?????7?-?S?A??^?}I??=???-N??Nw???z????l"?I???x8???8?????=r?-=Ss???g%et?)????#j?J?????????'G?>{y?vQFK???????0?????3iL?~a}}???pDe?4??=o?+;????????:?????co|???|???1????????#??????+?????s56K??As?L{????|g? + ?b?????????O??????? Z + ?k=je?H ??b< + ??????~???6????y[i?/2.:Qt??: 5??:???k ?phN[^D?yR???p?x?{????"?8?4??w?S_???(E'ft?l?6??r?????;?????j_m????????~X??b7?\/?,??f(????????o????"??????HL? o????~brT?\???O?*??;'H!?q???2?S???????*+;Hu?2Q?????+ ?#??c?%L??6K??(????]??f1},????r?+??#?B??fd?&??5?????I2?,?=???d???V?k?{???jSB?3?s??a4?~?V7 ?V????c?8??c???w??,??+?nP? ??G?l??uM????|J?N?? ??f?LK??00????x??hsE?V??=??????$]f??:????O?6??=7??X??G?=_?)???? ?@??;??u????g?+?????S?D?n??EP?{?9vc?L???*?#?Y??)????????g>9??????O??A?A??A??+ endstream + endobj + 95 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-4 -235 731 800] + /FontName/SPFWBN+CMTT10 + /ItalicAngle 0 + /StemV 69 + /FontFile 94 0 R + /Flags 4 + >> + endobj + 94 0 obj + << + /Filter[/FlateDecode] + /Length1 1107 + /Length2 5598 + /Length3 533 + /Length 6338 + >> + stream + x???gXk??)?BQ?H'?H1???t"D@?R?B?EzW? H/??MG?RD??*??N???????|y???{?3?a~?^???Y??k?9t?m???*?(?????4PY??@?@?+ ????l?????7?9B??8Y?????7?v?? q???!N???0?!N??7??;????PRr?? + ??%D?????O{?B?????@1")"?+j????Q?_?"n?????????pk@??Cm?-?Iz?E???????A2?$.??????S|+x???j??b45k%?W}O5$?^????l?O6?$?x??+?S?VL??? ??R7|?7l?O??1?P???a?_ ??~?:M?N??J?????r??}??b?!?L??1O$F??u????0????u???!?6?????'?P?NiV???kl9 P???u??????????*&??T?/F?4??~~0 + ??&(??,\^?? ?{FZG????`?M|w??????P?R???h?V?I?~??Sl??????w??????? ??1????C[PJ?.O?6?c.?&??l??r?&S$-?? o?w??8?i??????FimI?otA????????????!C??&?B"??/z????<#1AH8U?M?M> ^n?\CD???@S?????j?0?????????5 ?0uV?????"??????5sw?Sx?C?X\5???????????i)???c????0??8??+???w+?v???'?h?w???????2&????,??aL .???{???t?)??sS??6???q=???G???o?v ?1\ + ???????>???*?????# 3??V ???E.???^??:??M??@?.?L55:??+a?8??j??(?T??N$?1?j?o???>IL? + ?E~?9?x??W?O?@??W. U???>]??????? + ?wf?-?{)?o???Q"??J??7???:z:jV??s?&%????5e??EW????|p?v??kd|[v=?Bp?????????t??T!?g????m??(j4;gjyu??x?s?nk"*D??J_?????~???@??????V?t?MvV)??????????%?????? ????5?????(R?????%????H???;?F'?n}???O?N?T;????????2> + ????.???$??n??????E?h/?&?P??????T?????V?:?K?30/R[????!?+????qxE ???Ob? ?j?t0?je v?6??tL??!???v?&?????~??MO??JY? {??H?kTm&W:?'?J?s??/h|?? ?/?o?g?m???~?_?`b?_???| Ct?????^O??\????'?f?? V??VH?f?*???????+ ?.??d??3l??@?WN^h????^??$!~????? ???? ????h?.Rub?3?????}b?\H????K?IN? ???I??i??y%??/?>??? Zfy???K?c?7?#?A?]?3????;??????C?????S?^???1?n?I???c ??Ox?*??,????v?Y??|?????" #S?`??%?????6}g + ???Cd9IxLy??"'+ L??i;c??z?????uSN?]+ SM???R>,X?~JZ??k?5??q}?@??i S6I@???L ??To#?2?`H????? ?!2:?0mu?D??????i?ti?9??O??|??7?Aq?^????S???|}????$0??E??40?R?5]??z??/>????????2?X5?^????P?6??1??[?75?????fNv????#2t'F A??A?Q?fL?kQ??f??F>5`???7????G?<3z?x:)1"??~?B?/Wbm8?w&??^??{? O???A7?6 + ?L?/h????y_??sg????*:?????]??'M%??T???^?P???&??z??=??????ny???S?P6?(??????M?5?c{?;Y??B,K<??9f??q?tc??l??f{??!SeP??A>?R?x???uV?=}?jA?{m?=%??#/??{WdE????????????W????F>??Hq?jRhN?%^?H??@?z??s????Z=)?n?j\e???W???:?Q7dr?,#???q?G???1??Lw9??O??? Y"??~Or?U??)?IcY???????f?? ???1???+ endstream + endobj + 103 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[11 -233 669 696] + /FontName/EMJFTD+CMITT10 + /ItalicAngle -14.04 + /StemV 69 + /FontFile 102 0 R + /Flags 68 + >> + endobj + 102 0 obj + << + /Filter[/FlateDecode] + /Length1 1023 + /Length2 3807 + /Length3 533 + /Length 4506 + >> + stream + x???i8???????E?p??ef,c e_?^??43???1v?$KEHvRd)K!??["?-?W(?-??????????o??y???????????=???w^"?f???e?.?@????U+ 0D?"z??@W2 ?%??J??cI E+ B?j?M?r+ ?: "B?f??H?0U?#MU????-VZ???w?1???1?\a??Y?8sDK?S?b?\?N2C1?*??C?S??b|}'???gc?z\?>???|??D*?????"???8??D??????,M?$z?`z??a?A??F?L?x?&?????V&??}??????g?UUl?i??;lo + ??t??a??? ??? _????@?h??Wep?????s??????E? ?@?O????az*?J??u??n??I?3??7????R?v?G??MSz<"?G??p???T??g??^?m?????B\?????????? + D}?ok?????? ???H?hps+ ??????F??????exF?E????W ?'=?k??H??????o}??,M>{?Z???Y>>g??>??~?'?p!6FP8?[?i+? ???????B??$#???? v4*qz\?7h?\??E?n?5?????H\?F?a??P`?8?4?R?!zrs?B?XZp??? QmF?.??S??'P b?*;??b?O>*=Y?{D??E?X?K?p?O?0?ie???????_e}9?T??m? O??r</?]?r????????2Z4????)%??V1??N?J/????tY???N?RU???#7????+ ??????M??7???zb+O?%fan???V\P?}o???U??Xf???p6>J?Om ??F?Z????e?????f{?oRw???5o????n_?x\?$v?%?K!8??,j?Pe??ui??+??bdo??]x?|???AR?9???+ endstream + endobj + 114 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-20 -250 1193 750] + /FontName/GQIZOO+CMR6 + /ItalicAngle 0 + /StemV 83 + /FontFile 113 0 R + /Flags 4 + >> + endobj + 113 0 obj + << + /Filter[/FlateDecode] + /Length1 762 + /Length2 1192 + /Length3 533 + /Length 1763 + >> + stream + x?????????M_?U???ll$??-?.@??^RL vo0I??T??1?? ??-????KI??B?w?IA=??m+ix?2vb]n??DW=?'O?*%mU?%xK?????Ek)??7rl ??G?V?s???3;??n?S?????Em?>Awh???%?e-?7N?i??=??x??o?????????o?6?yd,S??L?d??2?&6?W?d???Q??P?????H:???????C??j????=0??4> + endobj + 116 0 obj + << + /Filter[/FlateDecode] + /Length1 779 + /Length2 751 + /Length3 533 + /Length 1322 + >> + stream + x??RkPWA??v?U?J?E?c7??*?B "AiP?us?,lva??????B??Uy?A??????*G?k?V|?P??n??S??N?u???~?9??s?w?]"UB??YC?b"?+Uj?D(???B?#:??????0?0?+ dI???????8T AB?"@AQ ??%D????F? 4$??ePG????)??2@>???^C&??????s:?]j??+ Bf?5???:S??1]?????K????6???:S{^??QQ?Y!???????Gq???????oK)+JH}???3 + ??X}-a??#?,v??[???'#*+??TEq??-??L????????????w*?p?1V???q?KU^a&??.wuoCN\?bA??u?{?NV.u?F????h???`?R??G^%???n]_?????s1??(?]v\t??q?????#?K??O ????F>b;???? 1???a?k????? j???'cL?????k??s?te*?)=??> + endobj + 143 0 obj + << + /Filter[/FlateDecode] + /Length1 1577 + /Length2 11646 + /Length3 533 + /Length 12585 + >> + stream + x???Ut\A?????B??33Y????????d133?B????,L?????I^???????v?={?Su??"!?S??7??7??v?a?e?J+?s+ X?@??hc`f??F + 0r&????q^+ j??t?D?*?jb ?|po?-M??QZtXL?iV2????????,?=*r????+???f??)??y.?????w?O??*??_??????? ?s]c7Z?\+??vD??T??F?97??g?g?a ?? 6?:A??????r_?a??????,?d????|?n?*?=Zs`?3n?9iU-os?k8?5?7I}"?m????e??h?hi??N??]?? r?X??3oW?????!?.???"X-E ???D????????}? + oy??V,I?p??OV?Z??P;?,D?tU4 W?????[}???????!f$pGD?/*G?Ing??}f,?????????@??????WJ??V>?)????;????hJ??[T???d?,?oWS????A%?????c~???i?%?f??>;E[H?N8?q?m?Z???P\?d????=???q???????)?????| 6?i?7?????????z5??9??Y?O??$>?+0?????Sy??;~f????|Z3{?????v??%???KP{??+ I? a???b?E?3H??u??? + ???\???!?????????B?4?3??8??'?$S?v??????? ?LZ3+ $?V??Ci.?S?? + ????=?i + Qwk?D??"-+ ?y "? ????nY?^PQ?0??~Lf#???|:.j?Wf?L??fQ????.???J??L#?70?' ??l??X}b _j"?S?? ??Y ?\?+?Jy?lf?]r?nK????f?I????qE@??1b?'5?'_?x??k?[g???l% ??1a?B????@???a?Ez7$??\????%?????]?x?*???!sk O? ???''+ F;?? ]q??>?&?<?a???????{A??WK???x?????%o???3T?XP??<.?n{?3tc????? ?/J???AN?F?x?%????[??z?v????j{?%;8????????P???=?`pW???Y"?&T??d(?? ? ty?~???????!?B????l?>gE?KZ?C?'?B?|?YD???G??=kq'?/+r??i2U?g??ul9{/?,?mM??????"{??)?????0??L????B????[??f??qH?n8/C??KI??~??&L??QL??,BOWq?I?L???v????? ?r??R>?????!??da?k?b???Z????? ????H6????K?1????>?????{@u??=N?q? D???"?f(?????Xi|?????jsox???f? ??u????)??S?s|?.??O??1?ph???T?x ??y!?N??! ????zM?;??]????C??????u?o0bii?,??~j?6R??????w?\@??%v?F+H???h??l~??(?b?@??????fD_?J?????T?]?????;??bk??????iI?Zj?wb?|???&5Rj?.???? ??[N* ;??Q????aT?l.1C??????@)?z?F??A|?????T??[D??*> ok?~S?(Q? l??gDO??G??&I3!f2???????+ d?/?)?)w??E??!?d?T1?-??"{j?}?? ?G??} + ????du???_I???/F ? + ?D?%2?/?W????W?C????X3??tF4 + ???>?Y???/6???????????J???J4Q?+???(m??Qk + ?SR5o??( + ?Mw?%?9?6?`m??W???+B ?F???ipe??5????????6????w?jD?????n??x?;d?e%J~???z??\????IOG8???L?X?]???W?^zK???U???9(X?pF)?Ln?\p!y?w?????O+ ? + K??~??y??J??/???{>?*H (????Q??'????????,???#E?????c???vy?Y~p?????????X???7!?e`??3???Y#????&?'?q?2e????????? ??4??? + ?!?F????Gz?8C???qi|i??c0?KJ????Zz}x?????D???I????2????l?*`???i1?dc??96?+?????xX?*?<??Ys`??????fD??^?m????jF0N?4/FQ??????????W??z??[m??V&f????3?????|Zn????????{?Y?? ?X??abw5_t?G?/?C?D??wx?P? ??~"E}p.>&Hx?P??n??@?;?*&v}U?tm???"z?g!???lB?;?????[????Gp?_?U??u?vfDS*?? 7M?4?T?_&????????:UZ??/8?/1V?????5?T?$?p[k???|?"4?Z?u?{?y?E??????2?G5=?Le ?????m?GT???d>??7 ~!H??kM????f?????i??(??)*?'?????.3?Km??i + ?,??5/?44??}O??0??jcl>}?????V6S???~?(??b?9Y?zK?]?pp??????????5??? ??;?n??d?Q??;?????l??[r4???8??|????`???N-??)m???7*?q(??XA????? ?*5???? R??U??c??}(X?R??`{??Osm??:'Qy+ j$??????|s???_R??U?_%?X????"?f?'??`+??i??aT?P^sV??z?? @qA]@Ae??-???A\f???oC?? ?4$?[?D?&??6???^Gt4?y1j???????X?J[O?$?????4?n?i at 3????+ fU????/?t(.??5?_?v?"?????? M,?Y?W??*????+ ?P??\}??e&?k?8???? _+;"?4?z??9?\ ?K??1?????zED?U????MU??cc]:?x??;U4???Nj???2????l????$??k?btx2\??? ?_??J?5OE?mN???Hv2]???????{?{?L????????]?HK* + e?W?????F????? ?}??????&B??4i???=d?????g??J??}?%6$c?Y??6^??39D????Oinwi???21<;???[?>-???*K?T?????K{??JX????? + ??*?????)?BC[;=????/Sm?-9B???J?^?I?+A^)?;h??????b+,???)f???????4[??+??O??0B?$L?O"????]??R"??.??Kh?N?n?:??K??K@?*m1?????`6??I?O??~]??_??N???? ?L?T?$v?;?R???a9O????|???q(?E???]f???z??M0s???B??`XGnZ2?qT?J???????~j + ??(???????MO|???I?k?q?TBP??H?#???Bjyk?,?`V???o?B?c(???F?????))!Li>? .?)??C!p??3%???&?-??E?PF?K]a6U?I:??KLR"??? ?\ud?7}??(m?????????`??Q?????51?h???/?Y`?>{Z??[P????]&??dy1?b(,?iM?W??=^??M??a???? + ????^???7????N?e?v????~??p???f"???+ ?d?2X?? ????z?>04?Um? ??????a????.?A??,H??fc?6*@#I?%?K?v?????????p?!"96I??+Y??6??[?%^?? 2|=\???=??%N~d?=????Ce?`?I???+ ???HD?R?O;?q???T?p?x?/?p???=??dn?xM?q??u??^???2?t~Y??zi?yW?Z???? ?Y?,^G?????p??????be??k??&?FK????_M?*?W?S?jR???????????i+ ?=?n?? ??>f??2???qr`z?i???IN??~?????|?oV?j??#L?"~M)??o_1W???c??$r?S?)???!&=????$T? ?j???&y???e9r{?T}??,??Y??,M=??'??`,???[??W??y????t???M???\&???@??i?R?{A??,????.J???????c?A( Z?B? `s5??#???;-?bE?4???g?L??????P`??G???J??gB y2|?? ?l?%?k/??4?{?????D@????p??(F/??i???3??V7?e?1)?Y????s? ?&n??????NS/??"?"??H]?Elr ?.?:d?}K????pLK????E[?????9?;i?h?s-+ ?7??rHT?+ ??M?l????G??T??\?????H>??(iM??"???x??'???X{?hS?WO??)1;?fU???j???|R~Lt4??;?_??g??n?????y????P ?????#?M?|????k?2z?J/?x??t?????I???????(``i?g?hc?go ??+ endstream + endobj + 157 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-36 -250 1070 750] + /FontName/QIGTJS+CMR8 + /ItalicAngle 0 + /StemV 76 + /FontFile 156 0 R + /Flags 4 + >> + endobj + 156 0 obj + << + /Filter[/FlateDecode] + /Length1 963 + /Length2 2448 + /Length3 533 + /Length 3116 + >> + stream + x???yAT?? ??(|?Rt?A*?%?X??????+ ???`+ ?5??????oT?8???D2?z?^???Xo")???????????0??=B??wV'?;?/'?\??K?>???~8?P at Ct?????}?r??=>?K;???0??#?? Zp????f u?????^??Sd?+?????EYw??x~}kR???a???.?o-3??%????l??e~??pv?m???:??]T??E?????q??? |?y ????X+?Y?`?????/???????'?H ?J?xc?^??'[Z& + endstream + endobj + 160 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-24 -250 1110 750] + /FontName/ILKWGJ+CMMI8 + /ItalicAngle -14.04 + /StemV 78 + /FontFile 159 0 R + /Flags 68 + >> + endobj + 159 0 obj + << + /Filter[/FlateDecode] + /Length1 1074 + /Length2 5442 + /Length3 533 + /Length 6175 + >> + stream + x???UX\Y??q .?) h??? ?kp??*$PUP?HC?@?@4?@??B??.?5?3t??????f???g??9??k}?;k?sq8? (BP5% ,( (??jJn???89??P0?W?? ????@?? " + ????????8???? + ????{?$@E?:??+ ?q????P?? + q???sUvwuT?;?C?b?Bb?]??\?????(G??? ?G + ????m??????6S????????? + G?{@B???`?_|?#???JHPHH?6???????6S?;" ?pg???+ ????mg?N$???*. + ????????????oxk? ?o???o(+ A5?Osw???G}?????i!????@??U??)??g?R??6>?? + ?x???3I???NU?????a????L5?4N?n??Q???????TPe??+ y?W??c?7L?_,??M???3?????n?w?4$8?n??g8c0 ?}+ ?kQg?!?x?n???^Di????n?????p?t?0w?w???? ?e?\??z?????s?????;?K??????t???^?????,?dbH????v?8??????|n????!?u????y?n??4???P??e??1????si!jCme??NQ???r?????a???^?????????S?W?????m$???U???Z?_????>Z 6?M>?"e?>V??%4  + ?c%?E?a?gRE???V4?7???!?$8???_?E?????#[E?mY?i??"??$+ ????m?;?{??%???y?L?I??p?? ??&????i??oF3a+??D^?? n?3???d??:8?????P???????? ?L???)????q??E???VD???dq?>????7?d+ "?n?Ks?RhZ??_H?V?'Y????TN?-?4GQ?[v?z? ???j'j??*[8?w e G??V?aP??g?|?? ????~?????+ 2]0?&? ??????R?}6???Z????J~~9?),??WY?k{?????nq%s???m????*?8?"b?qx?>??l??f-D?9!gCTX????????????????Wv9???????? ?????r??????)??? &???????????gTj?m?Sw(=S|V?<^???-2 ?????K????CN]D? + ? ???v3?Eb2? ??BW08??#?A?_Ceq%? U???{?v?3:rl?? ?L??(?,f?>?+4?I???E???o??@?8??H??*???u??????9-??S?N? C?k?deG?x??? ?zP\?????0??s?)????w?xHB???s^.??????9]????????????V?????????eQ???_???b?B??[?z2???O????????>???????Y ???&?%!i????????????$?=y|?~~O???m?~?????r?e'?)E(K?o;|??i?V??I1E?Di?w;|??BnG?B????> D?????z/-????{????O???]?qb?:/? ???????H?_-?I?z?c?5?=??'X?Y???J???+??E??e?o+hNbwN???i??rvS???6???s_?????S??#??;{w??AX?Fm????T?i???E???T?]????I??`?)?? ? ?cL?????\i??zr???????P??? A??v????E)?U~???Y.????????[? 4??$????6?-????]????????n?8q?????7?8?i]QO??H56?G6?t??E?c??;??S? ??p?????"??????s\?z?t?.?????b???P?S!?z?*??D?3??f?$??w2Z~???>???,???Z??+ E_;??4n????M+?$a"}9*???KH' A?CC?13??? ??' j??q?8Z??i??????????p???V!?D???4???????It?"???s?x?5g?? + ?fNtq$S??Z:??QQ????b]?Km9??+?@J'???k?Ky???K???$Y? ???4??+??#?4?e?%?????$$6 ?$^,???4k??Ik?4???F????U?Qg{*????<T@??'p???Pd? + w[???'2M`#z?1?ox?:wT????*???i??G/???^m??m?'??s?'Kz>???^????~?G?u??Wj?????H?[j??e??S???FI????????#?z^g?)%?]?L??t?`Hjt?|g-??c,?FL??Jp?HQg????(m??N;??W??? ?*????l?|?=?w??ZHC??)?????E???'??`$ + #????, X? + endstream + endobj + 163 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-30 -955 1185 779] + /FontName/UYQSSP+CMSY8 + /ItalicAngle -14.035 + /StemV 89 + /FontFile 162 0 R + /Flags 68 + >> + endobj + 162 0 obj + << + /Filter[/FlateDecode] + /Length1 875 + /Length2 1311 + /Length3 533 + /Length 1949 + >> + stream + x??RiTS???,??p? $7@C??D"3!? Wnn ?&h?RTD?2*OD??b?(? *?>????>?jo??\???[?_W??????9?^{f?~ 76????"?? x?0????y ????L? ???H??? ??+ `n????R?(??,& + ?0E1[?b"+ ?I?Gb + ??!?'@A?????? *??L?(>???$ w,OV??6?+?f?{M?j???ir????????(??{$???o??DJ??!?????.K?????????F????lY?j?;?{'/?T9????|? + ????J?\?f???????;? ?IH??????b 5Hk?m?l?6?"????f??`57??,xT??9]?~)]/?[[???O??}???????vW??m`????a\?~??sC????1? ??s? b????????????6F/?H???:2??????? ?eE?????????=??????YE?#??CC?u?F??k?4~mV'?n?AzG?p,????hwe6?3 ????|o#?M???9????u?G?Z?Nw?f;??????X?3"*?3#Rl'?&c-?ekG6'?i???\??????????C#~?1?d?h zQE*?EI??+#?2???-/4??~????i?B?4?w??z??o??-?Z??k??J6????W????????1?S?gn??8?L????}?$q4??`a??d0?o?\N?????u??y?a??W?B?%???L?OS???vt?0??cEs????4 =????%?I[;???l?? K??????k?7hr??????g?????????"Ww??????(?????????_]~!????????C??]???>?|c??????G?? ?? =2??=?tBu?7Oj????"?;??????t?A;Y:]?'?=?M?$?vV??j??yF?9,??T?l?????|?_N??jc????i???n??? P?s?????????/???@L???c + bq??\8 + ? + endstream + endobj + 178 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-30 -250 1026 750] + /FontName/FJVDGQ+CMMI12 + /ItalicAngle -14.04 + /StemV 65 + /FontFile 177 0 R + /Flags 68 + >> + endobj + 177 0 obj + << + /Filter[/FlateDecode] + /Length1 782 + /Length2 2150 + /Length3 533 + /Length 2740 + >> + stream + x???y8?k???d"t???Q??Y33?N??o#?b?<fk?0??$?v2?D????6??U???????H?p?w?s?s?????z?{??y?????????{?z:??pk*+$??\8?&+ r??J???pn ??c|;u???4?53?p?)e??O? ?? ??????dz??2???H????$:??9x?q?_??d??K??_?/5??Z?????(Z"???|s?=?????!+ ?J?mP??.**:??8??7G. 682s?r?w? ?????g??????Mp + ?C?8?o?_??y?????(/??z?u??u?K????ZweC?5?????9???M??v??K? z;?t????2????t)??H.?&??s???S??T?Nt;?Yb?F???]?#?s+?Yk4??*8?[/W ??????{qf?n}?d8'^&??????Z??k?x?%??}???U?"????????1+???i?Gk?0Qu6)?5???YU??b?aS???p???*???iHT??u"????6???&?J?? ???b???Y???b?_? ?|??j|?XFQ5ly?0?? ??????E??%??R?XkU?Po??Y???{?? ???_f???9N?R?]?:??B?????["??N?????S??.??5r??+???9s?????| ???h?L?????j?? .,#&??]????-8T?r?2{?Vm?1???????1??m?}/e"????w???n?Y???/????i????Fl?o?k??d)???+????\?4??J5?? ?????WT?M?????L?$??~"+??"U???u??????;????{+ ??yrtd??i^??Pf??t?\F??4??UG?25?v6kx?9??e??????H?i??s? ??l?[?p??'?B?C! ?E?? O*g _MkV?h?H?yR?????\R???9~ ????N/??O??6-C???v??7???????_????^]k?c at O?B?iI?|?H????;??ODC?? ?u??????_???KT?*??h#?????=V-?3??:[v?S !????$S??)?(?? #g\)]]+ 1??t^ + /??6??6?v?=??4 ????#\q???????n? + ?ox?>? ?u#?? ??=}?2too??S????6%??s??Wg????s??["_??a?%!???A??B|e???w?y9?[jZQ??/?[y??Y?l)z??yi?s?W?FV?`?e]k????????PR??????k????K?gS??bje??q???[?s????yA????#{cJ?:B???1?k??Q????]??T?A0i?U??hS?u?4???????yKu???fq?Y?R??1}??????zo????k{?GWmr+?[&f????l?yke?41d?1e??:$?;??(/d?? + ?>Y???e??I?C?g*?B?P?_?7?kl?????/??? ?D2??/???????\?F}?^ g1???#??&]T???/?? ?' (t????dN8 ?O??r^ + endstream + endobj + 1 0 obj + << + /Creator( TeX output 2007.11.10:1354) + /Producer(dvipdfm 0.13.2c, Copyright \251 1998, by Mark A. Wicks) + /CreationDate(D:20071110135414-08'00') + >> + endobj + 5 0 obj + << + /Type/Page + /Resources 6 0 R + /Contents[25 0 R 4 0 R 26 0 R 27 0 R] + /Parent 195 0 R + >> + endobj + 29 0 obj + << + /Type/Page + /Resources 30 0 R + /Contents[25 0 R 4 0 R 34 0 R 27 0 R] + /Parent 195 0 R + >> + endobj + 36 0 obj + << + /Type/Page + /Resources 37 0 R + /Contents[25 0 R 4 0 R 53 0 R 27 0 R] + /Parent 195 0 R + >> + endobj + 55 0 obj + << + /Type/Page + /Resources 56 0 R + /Contents[25 0 R 4 0 R 60 0 R 27 0 R] + /Parent 195 0 R + >> + endobj + 195 0 obj + << + /Type/Pages + /Count 4 + /Kids[5 0 R 29 0 R 36 0 R 55 0 R] + /Parent 3 0 R + >> + endobj + 62 0 obj + << + /Type/Page + /Resources 63 0 R + /Contents[25 0 R 4 0 R 76 0 R 27 0 R] + /Parent 196 0 R + >> + endobj + 78 0 obj + << + /Type/Page + /Resources 79 0 R + /Contents[25 0 R 4 0 R 80 0 R 27 0 R] + /Parent 196 0 R + >> + endobj + 82 0 obj + << + /Type/Page + /Resources 83 0 R + /Contents[25 0 R 4 0 R 97 0 R 27 0 R] + /Parent 196 0 R + >> + endobj + 100 0 obj + << + /Type/Page + /Resources 101 0 R + /Contents[25 0 R 4 0 R 105 0 R 27 0 R] + /Parent 196 0 R + >> + endobj + 196 0 obj + << + /Type/Pages + /Count 4 + /Kids[62 0 R 78 0 R 82 0 R 100 0 R] + /Parent 3 0 R + >> + endobj + 107 0 obj + << + /Type/Page + /Resources 108 0 R + /Contents[25 0 R 4 0 R 109 0 R 27 0 R] + /Parent 197 0 R + >> + endobj + 111 0 obj + << + /Type/Page + /Resources 112 0 R + /Contents[25 0 R 4 0 R 119 0 R 27 0 R] + /Parent 197 0 R + >> + endobj + 121 0 obj + << + /Type/Page + /Resources 122 0 R + /Contents[25 0 R 4 0 R 126 0 R 27 0 R] + /Parent 197 0 R + >> + endobj + 129 0 obj + << + /Type/Page + /Resources 130 0 R + /Contents[25 0 R 4 0 R 131 0 R 27 0 R] + /Parent 197 0 R + >> + endobj + 197 0 obj + << + /Type/Pages + /Count 4 + /Kids[107 0 R 111 0 R 121 0 R 129 0 R] + /Parent 3 0 R + >> + endobj + 133 0 obj + << + /Type/Page + /Resources 134 0 R + /Contents[25 0 R 4 0 R 135 0 R 27 0 R] + /Parent 198 0 R + >> + endobj + 137 0 obj + << + /Type/Page + /Resources 138 0 R + /Contents[25 0 R 4 0 R 139 0 R 27 0 R] + /Parent 198 0 R + >> + endobj + 141 0 obj + << + /Type/Page + /Resources 142 0 R + /Contents[25 0 R 4 0 R 146 0 R 27 0 R] + /Parent 198 0 R + >> + endobj + 148 0 obj + << + /Type/Page + /Resources 149 0 R + /Contents[25 0 R 4 0 R 192 0 R 27 0 R] + /Parent 198 0 R + >> + endobj + 198 0 obj + << + /Type/Pages + /Count 4 + /Kids[133 0 R 137 0 R 141 0 R 148 0 R] + /Parent 3 0 R + >> + endobj + 3 0 obj + << + /Type/Pages + /Count 16 + /Kids[195 0 R 196 0 R 197 0 R 198 0 R] + /MediaBox[0 0 612 792] + >> + endobj + 25 0 obj + << + /Length 1 + >> + stream + + endstream + endobj + 27 0 obj + << + /Length 1 + >> + stream + + endstream + endobj + 4 0 obj + << + /Length 30 + >> + stream + 1.00028 0 0 1.00028 72 720 cm + endstream + endobj + 199 0 obj + << + >> + endobj + 200 0 obj + null + endobj + 201 0 obj + << + >> + endobj + 2 0 obj + << + /Type/Catalog + /Pages 3 0 R + /Outlines 199 0 R + /Threads 200 0 R + /Names 201 0 R + >> + endobj + xref + 0 202 + 0000000000 65535 f + 0000299405 00000 n + 0000302006 00000 n + 0000301654 00000 n + 0000301859 00000 n + 0000299569 00000 n + 0000008092 00000 n + 0000123718 00000 n + 0000123531 00000 n + 0000000009 00000 n + 0000132710 00000 n + 0000132522 00000 n + 0000000937 00000 n + 0000149119 00000 n + 0000148933 00000 n + 0000001838 00000 n + 0000163569 00000 n + 0000163375 00000 n + 0000002790 00000 n + 0000166694 00000 n + 0000166509 00000 n + 0000003772 00000 n + 0000175214 00000 n + 0000175026 00000 n + 0000004498 00000 n + 0000301759 00000 n + 0000005481 00000 n + 0000301809 00000 n + 0000008005 00000 n + 0000299672 00000 n + 0000012138 00000 n + 0000179320 00000 n + 0000179125 00000 n + 0000008153 00000 n + 0000009117 00000 n + 0000012094 00000 n + 0000299777 00000 n + 0000020775 00000 n + 0000191851 00000 n + 0000191661 00000 n + 0000012200 00000 n + 0000201884 00000 n + 0000201689 00000 n + 0000013120 00000 n + 0000208493 00000 n + 0000208299 00000 n + 0000014054 00000 n + 0000221148 00000 n + 0000220962 00000 n + 0000014984 00000 n + 0000225381 00000 n + 0000225190 00000 n + 0000015933 00000 n + 0000016911 00000 n + 0000020663 00000 n + 0000299882 00000 n + 0000025535 00000 n + 0000234494 00000 n + 0000234307 00000 n + 0000020837 00000 n + 0000021828 00000 n + 0000025421 00000 n + 0000300079 00000 n + 0000033816 00000 n + 0000236779 00000 n + 0000236587 00000 n + 0000025597 00000 n + 0000239490 00000 n + 0000239296 00000 n + 0000026585 00000 n + 0000242843 00000 n + 0000242647 00000 n + 0000027578 00000 n + 0000245110 00000 n + 0000244923 00000 n + 0000028519 00000 n + 0000029472 00000 n + 0000033644 00000 n + 0000300184 00000 n + 0000038142 00000 n + 0000033878 00000 n + 0000038004 00000 n + 0000300289 00000 n + 0000047154 00000 n + 0000038204 00000 n + 0000039206 00000 n + 0000039239 00000 n + 0000247516 00000 n + 0000247323 00000 n + 0000039309 00000 n + 0000252837 00000 n + 0000252645 00000 n + 0000040294 00000 n + 0000041266 00000 n + 0000256324 00000 n + 0000256138 00000 n + 0000042261 00000 n + 0000042989 00000 n + 0000046925 00000 n + 0000047120 00000 n + 0000300394 00000 n + 0000051368 00000 n + 0000262972 00000 n + 0000262777 00000 n + 0000047232 00000 n + 0000047963 00000 n + 0000051242 00000 n + 0000300596 00000 n + 0000055521 00000 n + 0000051432 00000 n + 0000055394 00000 n + 0000300704 00000 n + 0000060859 00000 n + 0000267782 00000 n + 0000267594 00000 n + 0000055585 00000 n + 0000269855 00000 n + 0000269660 00000 n + 0000056572 00000 n + 0000057497 00000 n + 0000060648 00000 n + 0000300812 00000 n + 0000067017 00000 n + 0000060923 00000 n + 0000062685 00000 n + 0000062720 00000 n + 0000062791 00000 n + 0000066820 00000 n + 0000066981 00000 n + 0000300920 00000 n + 0000070840 00000 n + 0000067098 00000 n + 0000070691 00000 n + 0000301125 00000 n + 0000074585 00000 n + 0000070904 00000 n + 0000074459 00000 n + 0000301233 00000 n + 0000077572 00000 n + 0000074649 00000 n + 0000077516 00000 n + 0000301341 00000 n + 0000081719 00000 n + 0000271486 00000 n + 0000271291 00000 n + 0000077636 00000 n + 0000078588 00000 n + 0000081639 00000 n + 0000301449 00000 n + 0000123450 00000 n + 0000081783 00000 n + 0000086511 00000 n + 0000086558 00000 n + 0000087039 00000 n + 0000086806 00000 n + 0000087110 00000 n + 0000284377 00000 n + 0000284189 00000 n + 0000088406 00000 n + 0000287803 00000 n + 0000287608 00000 n + 0000089393 00000 n + 0000294290 00000 n + 0000294094 00000 n + 0000090378 00000 n + 0000091371 00000 n + 0000094495 00000 n + 0000094613 00000 n + 0000094542 00000 n + 0000094857 00000 n + 0000095094 00000 n + 0000096632 00000 n + 0000099411 00000 n + 0000099529 00000 n + 0000099458 00000 n + 0000099886 00000 n + 0000100140 00000 n + 0000296550 00000 n + 0000296354 00000 n + 0000102209 00000 n + 0000103165 00000 n + 0000109260 00000 n + 0000109378 00000 n + 0000109307 00000 n + 0000109735 00000 n + 0000109988 00000 n + 0000111960 00000 n + 0000118361 00000 n + 0000118408 00000 n + 0000118479 00000 n + 0000118836 00000 n + 0000119088 00000 n + 0000121103 00000 n + 0000123218 00000 n + 0000123362 00000 n + 0000299987 00000 n + 0000300502 00000 n + 0000301028 00000 n + 0000301557 00000 n + 0000301938 00000 n + 0000301961 00000 n + 0000301983 00000 n + trailer + << + /Size 202 + /Root 2 0 R + /Info 1 0 R + >> + startxref + 302104 + %%EOF From sabre at nondot.org Sun Jul 20 16:10:16 2008 From: sabre at nondot.org (Chris Lattner) Date: Sun, 20 Jul 2008 16:10:16 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2008-08-SPIN-Pancam.html 2008-08-SPIN-Pancam.pdf Message-ID: <200807202110.m6KLAGE9003236@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2008-08-SPIN-Pancam.html added (r1.1) 2008-08-SPIN-Pancam.pdf added (r1.1) --- Log message: add another paper. --- Diffs of the changes: (+59 -0) 2008-08-SPIN-Pancam.html | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 2008-08-SPIN-Pancam.pdf | 0 2 files changed, 59 insertions(+) Index: llvm-www/pubs/2008-08-SPIN-Pancam.html diff -c /dev/null llvm-www/pubs/2008-08-SPIN-Pancam.html:1.1 *** /dev/null Sun Jul 20 16:10:07 2008 --- llvm-www/pubs/2008-08-SPIN-Pancam.html Sun Jul 20 16:09:57 2008 *************** *** 0 **** --- 1,59 ---- + + + + + + Verifying Multi-threaded C Programs with SPIN + + + +
+ Verifying Multi-threaded C Programs with SPIN +
+
+ Anna Zaks and Amir Pnueli +
+ +

Abstract:

+
+ A key challenge in model checking software is the difficulty + of verifying properties of implementation code, as opposed to checking an + abstract algorithmic description. We describe a tool for verifying + multithreaded C programs that uses the SPIN model checker. Our tool works + by compiling a multi-threaded C program into a typed bytecode format, + and then using a virtual machine that interprets the bytecode and + computes new program states under the direction of SPIN. Our virtual + machine is compatible with most of SPIN's search options and optimization + flags, such as bitstate hashing and multi-core checking. It provides + support for dynamic memory allocation (the malloc and free family of + functions), and for the pthread library, which provides primitives often + used by multi-threaded C programs. A feature of our approach is that it + can check code after compiler optimizations, which can sometimes introduce + race conditions. We describe how our tool addresses the state space + explosion problem by allowing users to de???ne data abstraction functions + and to constrain the number of allowed context switches. We also describe + a reduction method that reduces context switches using dynamic + knowledge computed on-the-fly, while being sound for both safety and + liveness properties. Finally, we present initial experimental results with + our tool on some small examples. +
+ +

Bibtex:

+
+ @inproceedings{ZJ2008,
+       Author = {Anna Zaks and Rajeev Joshi},
+       Title = {Verifying Multi-threaded {C} Programs with {SPIN}},
+       Booktitle = {15th International SPIN Workshop on Model Checking of Software (SPIN 2008)},
+       Address = {Los Angeles, USA},
+       Month = {August},
+       Year = 2008
+ }
+ 
+ +

Download:

+ + + + Index: llvm-www/pubs/2008-08-SPIN-Pancam.pdf From sabre at nondot.org Sun Jul 20 16:12:51 2008 From: sabre at nondot.org (Chris Lattner) Date: Sun, 20 Jul 2008 16:12:51 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/index.html Message-ID: <200807202112.m6KLCpZM003343@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: index.html updated: 1.77 -> 1.78 --- Log message: add two papers to the index. --- Diffs of the changes: (+10 -0) index.html | 10 ++++++++++ 1 files changed, 10 insertions(+) Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.77 llvm-www/pubs/index.html:1.78 --- llvm-www/pubs/index.html:1.77 Fri Jun 27 15:57:27 2008 +++ llvm-www/pubs/index.html Sun Jul 20 16:12:32 2008 @@ -9,6 +9,12 @@ Proc. International Conference on Principles and Practice of Programming In Java (PPPJ 2008), September 2008 +
  • "Verifying Multi-threaded C Programs +with SPIN"
    +Anna Zaks and Amir Pnueli
    +Proc. International SPIN Workshop on Model Checking of Software (SPIN +2008), August 2008
  • +
  • "Automatic Data Partitioning in Software Transactional Memories"
    Torvald Riegel, Christof Fetzer, and Pascal Felber
    @@ -18,6 +24,10 @@ Fernando Magno Quintao Pereira and Jens Palsberg
    Proc. ACM SIGPLAN 2008 Conference on Programming Language Design and Implementation (PLDI'08), June, 2008
  • +
  • "CoVaC: Compiler Validation by Program Analysis +of the Cross-Product"
    +Anna Zaks and Amir Pnueli
    +Proc. International Symposium on Formal Methods (FM 2008), May 2008
  • "LLVM and Clang: Next Generation Compiler Technology"
    Chris Lattner
    From sabre at nondot.org Sun Jul 20 16:16:35 2008 From: sabre at nondot.org (Chris Lattner) Date: Sun, 20 Jul 2008 16:16:35 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2008-05-CoVaC.html 2008-08-SPIN-Pancam.html Message-ID: <200807202116.m6KLGZN4003513@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2008-05-CoVaC.html updated: 1.1 -> 1.2 2008-08-SPIN-Pancam.html updated: 1.1 -> 1.2 --- Log message: remove ligatures. --- Diffs of the changes: (+2 -2) 2008-05-CoVaC.html | 2 +- 2008-08-SPIN-Pancam.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/pubs/2008-05-CoVaC.html diff -u llvm-www/pubs/2008-05-CoVaC.html:1.1 llvm-www/pubs/2008-05-CoVaC.html:1.2 --- llvm-www/pubs/2008-05-CoVaC.html:1.1 Sun Jul 20 16:05:38 2008 +++ llvm-www/pubs/2008-05-CoVaC.html Sun Jul 20 16:16:16 2008 @@ -18,7 +18,7 @@

    Abstract:

    The paper presents a deductive framework for proving program equivalence -and its application to automatic veri???cation of transformations performed +and its application to automatic verification of transformations performed by optimizing compilers. To leverage existing program analysis techniques, we reduce the equivalence checking problem to analysis of one system - a cross-product of the two input programs. We Index: llvm-www/pubs/2008-08-SPIN-Pancam.html diff -u llvm-www/pubs/2008-08-SPIN-Pancam.html:1.1 llvm-www/pubs/2008-08-SPIN-Pancam.html:1.2 --- llvm-www/pubs/2008-08-SPIN-Pancam.html:1.1 Sun Jul 20 16:09:57 2008 +++ llvm-www/pubs/2008-08-SPIN-Pancam.html Sun Jul 20 16:16:17 2008 @@ -30,7 +30,7 @@ used by multi-threaded C programs. A feature of our approach is that it can check code after compiler optimizations, which can sometimes introduce race conditions. We describe how our tool addresses the state space -explosion problem by allowing users to de???ne data abstraction functions +explosion problem by allowing users to define data abstraction functions and to constrain the number of allowed context switches. We also describe a reduction method that reduces context switches using dynamic knowledge computed on-the-fly, while being sound for both safety and From nicholas at mxc.ca Sun Jul 20 21:51:32 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 21 Jul 2008 02:51:32 -0000 Subject: [llvm-commits] [llvm] r53812 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <200807210251.m6L2pWF5013586@zion.cs.uiuc.edu> Author: nicholas Date: Sun Jul 20 21:51:31 2008 New Revision: 53812 URL: http://llvm.org/viewvc/llvm-project?rev=53812&view=rev Log: Switch on the use of arbitrary precision integers in scalar evolution. This will bail after 256-bits to avoid producing code that the backends can't handle. Previously, we capped it at 64-bits, preferring to miscompile in those cases. This change also reverts much of r52248 because the invariants the code was expecting are now being met. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=53812&r1=53811&r2=53812&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sun Jul 20 21:51:31 2008 @@ -538,20 +538,12 @@ assert(K < 9 && "We cannot handle such long AddRecs yet."); - // FIXME: A temporary hack to remove in future. Arbitrary precision integers - // aren't supported by the code generator yet. For the dividend, the bitwidth - // we use is the smallest power of 2 greater or equal to K*W and less or equal - // to 64. Note that setting the upper bound for bitwidth may still lead to - // miscompilation in some cases. - unsigned DividendBits = 1U << Log2_32_Ceil(K * It->getBitWidth()); - if (DividendBits > 64) - DividendBits = 64; -#if 0 // Waiting for the APInt support in the code generator... unsigned DividendBits = K * It->getBitWidth(); -#endif + if (DividendBits > 256) + return new SCEVCouldNotCompute(); const IntegerType *DividendTy = IntegerType::get(DividendBits); - const SCEVHandle ExIt = SE.getTruncateOrZeroExtend(It, DividendTy); + const SCEVHandle ExIt = SE.getZeroExtendExpr(It, DividendTy); // The final number of bits we need to perform the division is the maximum of // dividend and divisor bitwidths. @@ -573,12 +565,7 @@ Dividend *= N-(K-1); if (DividendTy != DivisionTy) Dividend = Dividend.zext(DivisionTy->getBitWidth()); - - APInt Result = Dividend.udiv(Divisor); - if (Result.getBitWidth() != It->getBitWidth()) - Result = Result.trunc(It->getBitWidth()); - - return SE.getConstant(Result); + return SE.getConstant(Dividend.udiv(Divisor).trunc(It->getBitWidth())); } SCEVHandle Dividend = ExIt; @@ -587,11 +574,10 @@ SE.getMulExpr(Dividend, SE.getMinusSCEV(ExIt, SE.getIntegerSCEV(i, DividendTy))); - return SE.getTruncateOrZeroExtend( - SE.getUDivExpr( - SE.getTruncateOrZeroExtend(Dividend, DivisionTy), - SE.getConstant(Divisor) - ), It->getType()); + if (DividendTy != DivisionTy) + Dividend = SE.getZeroExtendExpr(Dividend, DivisionTy); + return SE.getTruncateExpr(SE.getUDivExpr(Dividend, SE.getConstant(Divisor)), + It->getType()); } /// evaluateAtIteration - Return the value of this chain of recurrences at From nicholas at mxc.ca Sun Jul 20 21:52:34 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 21 Jul 2008 02:52:34 -0000 Subject: [llvm-commits] [test-suite] r53813 - in /test-suite/trunk/SingleSource/Benchmarks/Shootout-C++: ary.cpp ary2.cpp ary3.cpp lists.cpp lists1.cpp strcat.cpp Message-ID: <200807210252.m6L2qYKE013632@zion.cs.uiuc.edu> Author: nicholas Date: Sun Jul 20 21:52:34 2008 New Revision: 53813 URL: http://llvm.org/viewvc/llvm-project?rev=53813&view=rev Log: Unbreak these tests on linux, where you need cstdlib to define atoi. Modified: test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/ary.cpp test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/ary2.cpp test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/ary3.cpp test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/lists.cpp test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/lists1.cpp test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/strcat.cpp Modified: test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/ary.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Shootout-C%2B%2B/ary.cpp?rev=53813&r1=53812&r2=53813&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/ary.cpp (original) +++ test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/ary.cpp Sun Jul 20 21:52:34 2008 @@ -2,6 +2,7 @@ // $Id$ // http://www.bagley.org/~doug/shootout/ +#include #include #include Modified: test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/ary2.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Shootout-C%2B%2B/ary2.cpp?rev=53813&r1=53812&r2=53813&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/ary2.cpp (original) +++ test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/ary2.cpp Sun Jul 20 21:52:34 2008 @@ -2,6 +2,7 @@ // $Id$ // http://www.bagley.org/~doug/shootout/ +#include #include #include Modified: test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/ary3.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Shootout-C%2B%2B/ary3.cpp?rev=53813&r1=53812&r2=53813&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/ary3.cpp (original) +++ test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/ary3.cpp Sun Jul 20 21:52:34 2008 @@ -2,6 +2,7 @@ // $Id$ // http://www.bagley.org/~doug/shootout/ +#include #include #include Modified: test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/lists.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Shootout-C%2B%2B/lists.cpp?rev=53813&r1=53812&r2=53813&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/lists.cpp (original) +++ test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/lists.cpp Sun Jul 20 21:52:34 2008 @@ -3,6 +3,7 @@ // http://www.bagley.org/~doug/shootout/ // from Bill Lear +#include #include #include #include Modified: test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/lists1.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Shootout-C%2B%2B/lists1.cpp?rev=53813&r1=53812&r2=53813&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/lists1.cpp (original) +++ test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/lists1.cpp Sun Jul 20 21:52:34 2008 @@ -2,6 +2,7 @@ // $Id$ // http://www.bagley.org/~doug/shootout/ +#include #include #include #include Modified: test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/strcat.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Shootout-C%2B%2B/strcat.cpp?rev=53813&r1=53812&r2=53813&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/strcat.cpp (original) +++ test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/strcat.cpp Sun Jul 20 21:52:34 2008 @@ -3,6 +3,7 @@ // http://www.bagley.org/~doug/shootout/ // with help from PeterB +#include #include #include using namespace std; From nicholas at mxc.ca Sun Jul 20 21:56:46 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 21 Jul 2008 02:56:46 -0000 Subject: [llvm-commits] [test-suite] r53814 - in /test-suite/trunk/SingleSource/Benchmarks/Misc-C++: ray.cpp sphereflake.cpp Message-ID: <200807210256.m6L2ukoB013770@zion.cs.uiuc.edu> Author: nicholas Date: Sun Jul 20 21:56:46 2008 New Revision: 53814 URL: http://llvm.org/viewvc/llvm-project?rev=53814&view=rev Log: More atoi requiring cstdlib Modified: test-suite/trunk/SingleSource/Benchmarks/Misc-C++/ray.cpp test-suite/trunk/SingleSource/Benchmarks/Misc-C++/sphereflake.cpp Modified: test-suite/trunk/SingleSource/Benchmarks/Misc-C++/ray.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Misc-C%2B%2B/ray.cpp?rev=53814&r1=53813&r2=53814&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Misc-C++/ray.cpp (original) +++ test-suite/trunk/SingleSource/Benchmarks/Misc-C++/ray.cpp Sun Jul 20 21:56:46 2008 @@ -1,3 +1,4 @@ +#include #include #include #include Modified: test-suite/trunk/SingleSource/Benchmarks/Misc-C++/sphereflake.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Misc-C%2B%2B/sphereflake.cpp?rev=53814&r1=53813&r2=53814&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Misc-C++/sphereflake.cpp (original) +++ test-suite/trunk/SingleSource/Benchmarks/Misc-C++/sphereflake.cpp Sun Jul 20 21:56:46 2008 @@ -1,6 +1,7 @@ // sphere flake bvh raytracer (c) 2005, thierry berger-perrin // this code is released under the GNU Public License. #include // see http://ompf.org/ray/sphereflake/ +#include #include // compile with ie g++ -O2 -ffast-math sphereflake.cc #define GIMME_SHADOWS // usage: ./sphereflake [lvl=6] >pix.ppm From nicholas at mxc.ca Sun Jul 20 22:01:35 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 21 Jul 2008 03:01:35 -0000 Subject: [llvm-commits] [test-suite] r53815 - /test-suite/trunk/SingleSource/Benchmarks/Misc-C++/bigfib.cpp Message-ID: <200807210301.m6L31Z5S013983@zion.cs.uiuc.edu> Author: nicholas Date: Sun Jul 20 22:01:35 2008 New Revision: 53815 URL: http://llvm.org/viewvc/llvm-project?rev=53815&view=rev Log: ULONG_MAX is defined in header "climits". Fixes build with gcc 4.3. Modified: test-suite/trunk/SingleSource/Benchmarks/Misc-C++/bigfib.cpp Modified: test-suite/trunk/SingleSource/Benchmarks/Misc-C++/bigfib.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Misc-C%2B%2B/bigfib.cpp?rev=53815&r1=53814&r2=53815&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Misc-C++/bigfib.cpp (original) +++ test-suite/trunk/SingleSource/Benchmarks/Misc-C++/bigfib.cpp Sun Jul 20 22:01:35 2008 @@ -8,6 +8,7 @@ // http://groups.google.com/groups?selm=bo4nls%2417vfq6%241%40ID-79865.news.uni-berlin.de +#include #include #include #include From clattner at apple.com Sun Jul 20 22:25:17 2008 From: clattner at apple.com (Chris Lattner) Date: Sun, 20 Jul 2008 20:25:17 -0700 Subject: [llvm-commits] [llvm] r53812 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp In-Reply-To: <200807210251.m6L2pWF5013586@zion.cs.uiuc.edu> References: <200807210251.m6L2pWF5013586@zion.cs.uiuc.edu> Message-ID: <455A7039-96B0-4A8A-96AA-980FB5EE6663@apple.com> On Jul 20, 2008, at 7:51 PM, Nick Lewycky wrote: > Author: nicholas > Date: Sun Jul 20 21:51:31 2008 > New Revision: 53812 > > URL: http://llvm.org/viewvc/llvm-project?rev=53812&view=rev > Log: > Switch on the use of arbitrary precision integers in scalar > evolution. This will > bail after 256-bits to avoid producing code that the backends can't > handle. > Previously, we capped it at 64-bits, preferring to miscompile in > those cases. > > This change also reverts much of r52248 because the invariants the > code was > expecting are now being met. Uh, legalizetypes is not enabled by default. Please revert this. Did this pass make check? If so, we need better tests. -Chris > > > Modified: > llvm/trunk/lib/Analysis/ScalarEvolution.cpp > > Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=53812&r1=53811&r2=53812&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) > +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sun Jul 20 21:51:31 > 2008 > @@ -538,20 +538,12 @@ > > assert(K < 9 && "We cannot handle such long AddRecs yet."); > > - // FIXME: A temporary hack to remove in future. Arbitrary > precision integers > - // aren't supported by the code generator yet. For the dividend, > the bitwidth > - // we use is the smallest power of 2 greater or equal to K*W and > less or equal > - // to 64. Note that setting the upper bound for bitwidth may > still lead to > - // miscompilation in some cases. > - unsigned DividendBits = 1U << Log2_32_Ceil(K * It->getBitWidth()); > - if (DividendBits > 64) > - DividendBits = 64; > -#if 0 // Waiting for the APInt support in the code generator... > unsigned DividendBits = K * It->getBitWidth(); > -#endif > + if (DividendBits > 256) > + return new SCEVCouldNotCompute(); > > const IntegerType *DividendTy = IntegerType::get(DividendBits); > - const SCEVHandle ExIt = SE.getTruncateOrZeroExtend(It, DividendTy); > + const SCEVHandle ExIt = SE.getZeroExtendExpr(It, DividendTy); > > // The final number of bits we need to perform the division is the > maximum of > // dividend and divisor bitwidths. > @@ -573,12 +565,7 @@ > Dividend *= N-(K-1); > if (DividendTy != DivisionTy) > Dividend = Dividend.zext(DivisionTy->getBitWidth()); > - > - APInt Result = Dividend.udiv(Divisor); > - if (Result.getBitWidth() != It->getBitWidth()) > - Result = Result.trunc(It->getBitWidth()); > - > - return SE.getConstant(Result); > + return SE.getConstant(Dividend.udiv(Divisor).trunc(It- > >getBitWidth())); > } > > SCEVHandle Dividend = ExIt; > @@ -587,11 +574,10 @@ > SE.getMulExpr(Dividend, > SE.getMinusSCEV(ExIt, SE.getIntegerSCEV(i, > DividendTy))); > > - return SE.getTruncateOrZeroExtend( > - SE.getUDivExpr( > - SE.getTruncateOrZeroExtend(Dividend, DivisionTy), > - SE.getConstant(Divisor) > - ), It->getType()); > + if (DividendTy != DivisionTy) > + Dividend = SE.getZeroExtendExpr(Dividend, DivisionTy); > + return SE.getTruncateExpr(SE.getUDivExpr(Dividend, > SE.getConstant(Divisor)), > + It->getType()); > } > > /// evaluateAtIteration - Return the value of this chain of > recurrences at > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From nicholas at mxc.ca Sun Jul 20 23:03:01 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 21 Jul 2008 04:03:01 -0000 Subject: [llvm-commits] [llvm] r53816 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <200807210403.m6L4318d015924@zion.cs.uiuc.edu> Author: nicholas Date: Sun Jul 20 23:03:00 2008 New Revision: 53816 URL: http://llvm.org/viewvc/llvm-project?rev=53816&view=rev Log: Revert r53812 -- premature. LegalizeTypes isn't actually on yet! Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=53816&r1=53815&r2=53816&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sun Jul 20 23:03:00 2008 @@ -538,12 +538,20 @@ assert(K < 9 && "We cannot handle such long AddRecs yet."); + // FIXME: A temporary hack to remove in future. Arbitrary precision integers + // aren't supported by the code generator yet. For the dividend, the bitwidth + // we use is the smallest power of 2 greater or equal to K*W and less or equal + // to 64. Note that setting the upper bound for bitwidth may still lead to + // miscompilation in some cases. + unsigned DividendBits = 1U << Log2_32_Ceil(K * It->getBitWidth()); + if (DividendBits > 64) + DividendBits = 64; +#if 0 // Waiting for the APInt support in the code generator... unsigned DividendBits = K * It->getBitWidth(); - if (DividendBits > 256) - return new SCEVCouldNotCompute(); +#endif const IntegerType *DividendTy = IntegerType::get(DividendBits); - const SCEVHandle ExIt = SE.getZeroExtendExpr(It, DividendTy); + const SCEVHandle ExIt = SE.getTruncateOrZeroExtend(It, DividendTy); // The final number of bits we need to perform the division is the maximum of // dividend and divisor bitwidths. @@ -565,7 +573,12 @@ Dividend *= N-(K-1); if (DividendTy != DivisionTy) Dividend = Dividend.zext(DivisionTy->getBitWidth()); - return SE.getConstant(Dividend.udiv(Divisor).trunc(It->getBitWidth())); + + APInt Result = Dividend.udiv(Divisor); + if (Result.getBitWidth() != It->getBitWidth()) + Result = Result.trunc(It->getBitWidth()); + + return SE.getConstant(Result); } SCEVHandle Dividend = ExIt; @@ -574,10 +587,11 @@ SE.getMulExpr(Dividend, SE.getMinusSCEV(ExIt, SE.getIntegerSCEV(i, DividendTy))); - if (DividendTy != DivisionTy) - Dividend = SE.getZeroExtendExpr(Dividend, DivisionTy); - return SE.getTruncateExpr(SE.getUDivExpr(Dividend, SE.getConstant(Divisor)), - It->getType()); + return SE.getTruncateOrZeroExtend( + SE.getUDivExpr( + SE.getTruncateOrZeroExtend(Dividend, DivisionTy), + SE.getConstant(Divisor) + ), It->getType()); } /// evaluateAtIteration - Return the value of this chain of recurrences at From nicholas at mxc.ca Sun Jul 20 23:59:11 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 21 Jul 2008 04:59:11 -0000 Subject: [llvm-commits] [test-suite] r53828 - /test-suite/trunk/MultiSource/Applications/kimwitu++/k.h Message-ID: <200807210459.m6L4xBUO017623@zion.cs.uiuc.edu> Author: nicholas Date: Sun Jul 20 23:59:10 2008 New Revision: 53828 URL: http://llvm.org/viewvc/llvm-project?rev=53828&view=rev Log: Add for strlen() and for free(). Fixed build on GCC 4.3. PR2572 Modified: test-suite/trunk/MultiSource/Applications/kimwitu++/k.h Modified: test-suite/trunk/MultiSource/Applications/kimwitu++/k.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/kimwitu%2B%2B/k.h?rev=53828&r1=53827&r2=53828&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Applications/kimwitu++/k.h (original) +++ test-suite/trunk/MultiSource/Applications/kimwitu++/k.h Sun Jul 20 23:59:10 2008 @@ -20,6 +20,8 @@ #define KIMWITUVERSIONMINOR 3 #define KIMWITUVERSIONMICRO 6 +#include +#include #include #include #include
  • Adobe Image Foundation and Adobe PixelBender: Our Usage of LLVMChuck Rose III, Adobe
    Cell BackendScott Michel, Aerospace
    ClangCodeGen Overview and Focus on SelectionDAGsDan Gohman, Apple
    ClangSteve Naroff
    CodeGen Overview and Focus on SelectionDAGsDan Gohman, Apple
    Finding Bugs with Source Code AnalysisTed Kremenek, Apple
    Building an Efficient JIT with LLVMNate Begeman, Apple
    llvm2c - New LLVM Compiler DriverAnton Korobeynikov, Saint Petersburg State University.