From baldrick at free.fr Mon Sep 7 00:10:00 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 07 Sep 2009 07:10:00 +0200 Subject: [llvm-commits] [llvm] r81126 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp In-Reply-To: <6EC1E224-E0DC-445D-BBDB-4A85D2A55106@apple.com> References: <200909061927.n86JRrb0015006@zion.cs.uiuc.edu> <6EC1E224-E0DC-445D-BBDB-4A85D2A55106@apple.com> Message-ID: <4AA495A8.1000503@free.fr> Hi Evan, > This seems wrong. Perhaps the switch statement should be something like > this? > > case X86II::MO_NO_FLAG: // No flag. > break; > case X86II::MO_PIC_BASE_OFFSET: > case X86II::MO_DARWIN_NONLAZY_PIC_BASE: > case X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE: > // Subtract the pic base. > NegatedSymbol = GetPICBaseSymbol(); > break; the value of NegatedSymbol was not being used. Ciao, Duncan. From baldrick at free.fr Mon Sep 7 00:58:26 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 07 Sep 2009 05:58:26 -0000 Subject: [llvm-commits] [llvm] r81144 - /llvm/trunk/lib/System/Unix/Program.inc Message-ID: <200909070558.n875wQkW031467@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 7 00:58:25 2009 New Revision: 81144 URL: http://llvm.org/viewvc/llvm-project?rev=81144&view=rev Log: Using a signal handler that does nothing should be equivalent to SIG_IGN. Modified: llvm/trunk/lib/System/Unix/Program.inc Modified: llvm/trunk/lib/System/Unix/Program.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Program.inc?rev=81144&r1=81143&r2=81144&view=diff ============================================================================== --- llvm/trunk/lib/System/Unix/Program.inc (original) +++ llvm/trunk/lib/System/Unix/Program.inc Mon Sep 7 00:58:25 2009 @@ -116,9 +116,6 @@ return false; } -static void TimeOutHandler(int Sig) { -} - static void SetMemoryLimits (unsigned size) { #if HAVE_SYS_RESOURCE_H @@ -231,10 +228,9 @@ // Install a timeout handler. if (secondsToWait) { - Act.sa_sigaction = 0; - Act.sa_handler = TimeOutHandler; + memset(&Act, 0, sizeof(Act)); + Act.sa_handler = SIG_IGN; sigemptyset(&Act.sa_mask); - Act.sa_flags = 0; sigaction(SIGALRM, &Act, &Old); alarm(secondsToWait); } From baldrick at free.fr Mon Sep 7 00:58:29 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 07 Sep 2009 07:58:29 +0200 Subject: [llvm-commits] [llvm] r81115 - in /llvm/trunk/lib: CodeGen/RegAllocPBQP.cpp CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp CodeGen/SelectionDAG/SelectionDAGBuild.cpp CodeGen/StackSlotColoring.cpp Support/regengine.inc System/Unix/Program.inc Target/ARM/Thumb2SizeReduction.cpp Target/PowerPC/PPCISelLowering.cpp Target/X86/AsmPrinter/X86MCInstLower.cpp Target/X86/X86ISelLowering.cpp Target/XCore/XCoreRegisterInfo.cpp Transforms/Scalar/CondPropagate.cpp In-Reply-To: <04783965-406C-46C4-8CBC-D86443F9FFA3@gmail.com> References: <200909061241.n86CfKds028484@zion.cs.uiuc.edu> <04783965-406C-46C4-8CBC-D86443F9FFA3@gmail.com> Message-ID: <4AA4A105.7000903@free.fr> Hi Benjamin, >> MachineFunction::iterator BBI = CR.CaseBB; >> >> - if (++BBI != FuncInfo.MF->end()) >> - NextBlock = BBI; >> + if (++BBI != FuncInfo.MF->end()) {} > > This looks weird. I think it can be reduced to > MachineFunction::iterator BBI = CR.CaseBB + 1; that turns out to not be equivalent. I changed it to MachineFunction::iterator BBI = CR.CaseBB + 1; ++BBI; instead. >> if (slow(m, sp, rest, ssub, esub) != NULL) { >> - dp = dissect(m, sp, rest, ssub, esub); >> + char *dp = dissect(m, sp, rest, ssub, esub); >> assert(dp == rest); > > this change will probably cause "unused variable" warnings in -Asserts > build They were unused before too :) However you are right that gcc understands this now. I have fixed it. >> --- llvm/trunk/lib/System/Unix/Program.inc (original) >> +++ llvm/trunk/lib/System/Unix/Program.inc Sun Sep 6 07:41:19 2009 >> @@ -116,9 +116,7 @@ >> return false; >> } >> >> -static bool Timeout = false; >> static void TimeOutHandler(int Sig) { >> - Timeout = true; >> } > > It looks like this function can be removed entirely Now done. Thanks for thinking about this! Best wishes, Duncan. From baldrick at free.fr Mon Sep 7 03:07:02 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 07 Sep 2009 08:07:02 -0000 Subject: [llvm-commits] [gcc-plugin] r81146 - in /gcc-plugin/trunk: llvm-backend.cpp llvm-convert.cpp llvm-internal.h Message-ID: <200909070807.n878724Z028458@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 7 03:07:02 2009 New Revision: 81146 URL: http://llvm.org/viewvc/llvm-project?rev=81146&view=rev Log: Add support for ssa names. I'm not sure I understood SSA_NAME_IS_DEFAULT_DEF correctly, but this does seem to work on simple examples. The plugin can now compile int f(int x) { return x; } You can't stop progress! Modified: gcc-plugin/trunk/llvm-backend.cpp gcc-plugin/trunk/llvm-convert.cpp gcc-plugin/trunk/llvm-internal.h Modified: gcc-plugin/trunk/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=81146&r1=81145&r2=81146&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-backend.cpp (original) +++ gcc-plugin/trunk/llvm-backend.cpp Mon Sep 7 03:07:02 2009 @@ -1784,10 +1784,16 @@ // know we want to output it. DECL_DEFER_OUTPUT(current_function_decl) = 0; + // Provide the function convertor with dominators. + calculate_dominance_info(CDI_DOMINATORS); + // Convert the AST to raw/ugly LLVM code. TreeToLLVM Emitter(current_function_decl); Function *Fn = Emitter.EmitFunction(); + // Free dominator and other ssa data structures. + execute_free_datastructures(); + //TODO performLateBackendInitialization(); createPerFunctionOptimizationPasses(); @@ -1800,8 +1806,6 @@ // Finally, we have written out this function! TREE_ASM_WRITTEN(current_function_decl) = 1; - execute_free_datastructures(); - // When debugging, append the LLVM IR to the dump file. if (dump_file) { raw_fd_ostream dump_stream(fileno(dump_file), false); Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81146&r1=81145&r2=81146&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Mon Sep 7 03:07:02 2009 @@ -72,6 +72,7 @@ #include "tree-flow.h" #include "tree-pass.h" #include "rtl.h" +#include "domwalk.h" extern int get_pointer_alignment (tree exp, unsigned int max_align); extern enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER]; @@ -92,17 +93,6 @@ TREE_CODE(DECL_INITIAL(exp)) == CONSTRUCTOR && \ !TREE_TYPE(DECL_INITIAL(exp))) -/// isGimpleTemporary - Return true if this is a gimple temporary that we can -/// directly compile into an LLVM temporary. This saves us from creating an -/// alloca and creating loads/stores of that alloca (a compile-time win). We -/// can only do this if the value is a first class llvm value and if it's a -/// "gimple_formal_tmp_reg". -static bool isGimpleTemporary(tree decl) { - return false; -//FIXME return is_gimple_formal_tmp_reg(decl) && -//FIXME !isAggregateTreeType(TREE_TYPE(decl)); -} - /// getINTEGER_CSTVal - Return the specified INTEGER_CST value as a uint64_t. /// uint64_t getINTEGER_CSTVal(tree exp) { @@ -735,80 +725,83 @@ //TODO // may be deleted when the optimizers run, so would be dangerous to keep. //TODO eraseLocalLLVMValues(); - // Simplify any values that were uniqued using a no-op bitcast. - for (std::vector::iterator I = UniquedValues.begin(), - E = UniquedValues.end(); I != E; ++I) { - BitCastInst *BI = *I; - assert(BI->getSrcTy() == BI->getDestTy() && "Not a no-op bitcast!"); - BI->replaceAllUsesWith(BI->getOperand(0)); - // Safe to erase because after the call to eraseLocalLLVMValues. - BI->eraseFromParent(); - } - UniquedValues.clear(); - return Fn; } extern "C" tree gimple_to_tree(gimple); extern "C" void release_stmt_tree (gimple, tree); -Function *TreeToLLVM::EmitFunction() { - // Set up parameters and prepare for return, for the function. - StartFunctionBody(); - - // Emit the body of the function iterating over all BBs - basic_block bb; - edge e; - edge_iterator ei; - FOR_EACH_BB (bb) { - for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi); - gsi_next (&gsi)) { - gimple gimple_stmt = gsi_stmt (gsi); - - switch (gimple_code(gimple_stmt)) { - case GIMPLE_ASSIGN: - case GIMPLE_COND: - case GIMPLE_GOTO: - case GIMPLE_LABEL: - case GIMPLE_RETURN: - case GIMPLE_ASM: - case GIMPLE_CALL: - case GIMPLE_SWITCH: - case GIMPLE_NOP: - case GIMPLE_PREDICT: - case GIMPLE_RESX: { - // TODO Handle gimple directly, rather than converting to a tree. - tree stmt = gimple_to_tree(gimple_stmt); - - // If this stmt returns an aggregate value (e.g. a call whose result is - // ignored), create a temporary to receive the value. Note that we don't - // do this for MODIFY_EXPRs as an efficiency hack. - MemRef DestLoc; - if (isAggregateTreeType(TREE_TYPE(stmt)) && - TREE_CODE(stmt)!= MODIFY_EXPR && TREE_CODE(stmt)!=INIT_EXPR) - DestLoc = CreateTempLoc(ConvertType(TREE_TYPE(stmt))); +void TreeToLLVM::EmitBasicBlock(basic_block bb) { + for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi); + gsi_next (&gsi)) { + gimple gimple_stmt = gsi_stmt (gsi); + + switch (gimple_code(gimple_stmt)) { + case GIMPLE_ASSIGN: + case GIMPLE_COND: + case GIMPLE_GOTO: + case GIMPLE_LABEL: + case GIMPLE_RETURN: + case GIMPLE_ASM: + case GIMPLE_CALL: + case GIMPLE_SWITCH: + case GIMPLE_NOP: + case GIMPLE_PREDICT: + case GIMPLE_RESX: { + // TODO Handle gimple directly, rather than converting to a tree. + tree stmt = gimple_to_tree(gimple_stmt); + + // If this stmt returns an aggregate value (e.g. a call whose result is + // ignored), create a temporary to receive the value. Note that we don't + // do this for MODIFY_EXPRs as an efficiency hack. + MemRef DestLoc; + if (isAggregateTreeType(TREE_TYPE(stmt)) && + TREE_CODE(stmt)!= MODIFY_EXPR && TREE_CODE(stmt)!=INIT_EXPR) + DestLoc = CreateTempLoc(ConvertType(TREE_TYPE(stmt))); - Emit(stmt, DestLoc.Ptr ? &DestLoc : NULL); - - release_stmt_tree(gimple_stmt, stmt); - break; - } + Emit(stmt, DestLoc.Ptr ? &DestLoc : NULL); - default: - print_gimple_stmt(stderr, gimple_stmt, 0, TDF_RAW); - llvm_report_error("Unhandled GIMPLE statement during LLVM emission!"); - } + release_stmt_tree(gimple_stmt, stmt); + break; } - FOR_EACH_EDGE (e, ei, bb->succs) - if (e->flags & EDGE_FALLTHRU) - break; - if (e && e->dest != bb->next_bb) { - Builder.CreateBr(getLabelDeclBlock(gimple_block_label (e->dest))); - EmitBlock(BasicBlock::Create(Context, "")); + default: + print_gimple_stmt(stderr, gimple_stmt, 0, TDF_RAW); + llvm_unreachable("Unhandled GIMPLE statement during LLVM emission!"); } } + edge e; + edge_iterator ei; + FOR_EACH_EDGE (e, ei, bb->succs) + if (e->flags & EDGE_FALLTHRU) + break; + if (e && e->dest != bb->next_bb) { + Builder.CreateBr(getLabelDeclBlock(gimple_block_label (e->dest))); + EmitBlock(BasicBlock::Create(Context, "")); + } +} + +static void emit_basic_block(struct dom_walk_data *walk_data, basic_block bb) { + ((TreeToLLVM *)walk_data->global_data)->EmitBasicBlock(bb); +} + +Function *TreeToLLVM::EmitFunction() { + // Set up parameters and prepare for return, for the function. + StartFunctionBody(); + + // Emit the body of the function by iterating over all BBs. To ensure that + // definitions of ssa names are seen before any uses, the iteration is done + // in dominator order. + struct dom_walk_data walk_data; + memset(&walk_data, 0, sizeof(struct dom_walk_data)); + walk_data.dom_direction = CDI_DOMINATORS; + walk_data.before_dom_children = emit_basic_block; + walk_data.global_data = this; + init_walk_dominator_tree(&walk_data); + walk_dominator_tree(&walk_data, ENTRY_BLOCK_PTR); + fini_walk_dominator_tree(&walk_data); + // Wrap things up. return FinishFunctionBody(); } @@ -832,12 +825,8 @@ switch (TREE_CODE(exp)) { default: - DEBUG({ - llvm::errs() << "Unhandled expression!\n" - << "TREE_CODE: " << TREE_CODE(exp) << "\n"; - debug_tree(exp); - }); - abort(); + debug_tree(exp); + llvm_unreachable("Unhandled expression!"); // Control flow case LABEL_EXPR: Result = EmitLABEL_EXPR(exp); break; @@ -852,6 +841,8 @@ case RESX_EXPR: Result = EmitRESX_EXPR(exp); break; // Expressions + case SSA_NAME: + Result = EmitSSA_NAME(exp); break; case VAR_DECL: case PARM_DECL: case RESULT_DECL: @@ -1030,11 +1021,8 @@ switch (TREE_CODE(exp)) { default: - DEBUG({ - errs() << "Unhandled lvalue expression!\n"; - debug_tree(exp); - }); - abort(); + debug_tree(exp); + llvm_unreachable("Unhandled lvalue expression!"); case PARM_DECL: case VAR_DECL: @@ -1115,9 +1103,8 @@ //===----------------------------------------------------------------------===// void TreeToLLVM::TODO(tree exp) { - DEBUG(errs() << "Unhandled tree node\n"); if (exp) debug_tree(exp); - abort(); + llvm_unreachable("Unhandled tree node"); } /// CastToType - Cast the specified value to the specified type if it is @@ -1582,11 +1569,6 @@ TREE_STATIC(decl) || DECL_EXTERNAL(decl) || type == error_mark_node) return; - // Gimple temporaries are handled specially: their DECL_LLVM is set when the - // definition is encountered. - if (isGimpleTemporary(decl)) - return; - // If this is just the rotten husk of a variable that the gimplifier // eliminated all uses of, but is preserving for debug info, ignore it. if (TREE_CODE(decl) == VAR_DECL && DECL_VALUE_EXPR(decl)) @@ -2248,30 +2230,22 @@ return false; } +/// EmitSSA_NAME - Return the defining value of the given SSA_NAME. +Value *TreeToLLVM::EmitSSA_NAME(tree exp) { + if (SSA_NAME_IS_DEFAULT_DEF(exp)) + return Emit(SSA_NAME_VAR(exp), 0); + return SSANames[exp]; +} /// EmitLoadOfLValue - When an l-value expression is used in a context that /// requires an r-value, this method emits the lvalue computation, then loads /// the result. Value *TreeToLLVM::EmitLoadOfLValue(tree exp, const MemRef *DestLoc) { - // If this is a gimple temporary, don't emit a load, just use the result. - if (isGimpleTemporary(exp)) { - if (DECL_LLVM_SET_P(exp)) - return DECL_LLVM(exp); - // Since basic blocks are output in no particular order, it is perfectly - // possible to encounter a use of a gimple temporary before encountering - // its definition, which is what has happened here. This happens rarely - // in practice, so there's no point in trying to do anything clever: just - // demote to an ordinary variable and create an alloca to hold its value. -abort(); //FIXME -//FIXME DECL_GIMPLE_FORMAL_TEMP_P(exp) = 0; - EmitAutomaticVariableDecl(exp); - // Fall through. - } else if (canEmitRegisterVariable(exp)) { + if (canEmitRegisterVariable(exp)) // If this is a register variable, EmitLV can't handle it (there is no // l-value of a register variable). Emit an inline asm node that copies the // value out of the specified register. return EmitReadOfRegisterVariable(exp, DestLoc); - } LValue LV = EmitLV(exp); bool isVolatile = TREE_THIS_VOLATILE(exp); @@ -2868,70 +2842,6 @@ return 0; } -/// HandleMultiplyDefinedGimpleTemporary - Gimple temporaries *mostly* have a -/// single definition, in which case all uses are dominated by the definition. -/// This routine exists to handle the rare case of a gimple temporary with -/// multiple definitions. It turns the temporary into an ordinary automatic -/// variable by creating an alloca for it, initializing the alloca with the -/// first definition that was seen, and fixing up any existing uses to load -/// the alloca instead. -/// -void TreeToLLVM::HandleMultiplyDefinedGimpleTemporary(tree Var) { - Value *UniqVal = DECL_LLVM(Var); - assert(isa(UniqVal) && "Invalid value for gimple temporary!"); - Value *FirstVal = cast(UniqVal)->getOperand(0); - - // Create a new temporary and set the VAR_DECL to use it as the llvm location. - Value *NewTmp = CreateTemporary(FirstVal->getType()); - SET_DECL_LLVM(Var, NewTmp); - - // Store the already existing initial value into the alloca. If the value - // being stored is an instruction, emit the store right after the instruction, - // otherwise, emit it into the entry block. - StoreInst *SI = new StoreInst(FirstVal, NewTmp); - - BasicBlock::iterator InsertPt; - if (Instruction *I = dyn_cast(FirstVal)) { - InsertPt = I; // Insert after the init instruction. - - // If the instruction is an alloca in the entry block, the insert point - // will be before the alloca. Advance to the AllocaInsertionPoint if we are - // before it. - if (I->getParent() == &Fn->front()) { - for (BasicBlock::iterator CI = InsertPt, E = Fn->begin()->end(); - CI != E; ++CI) { - if (&*CI == AllocaInsertionPoint) { - InsertPt = AllocaInsertionPoint; - ++InsertPt; - break; - } - } - } - - // If the instruction is an invoke, the init is inserted on the normal edge. - if (InvokeInst *II = dyn_cast(I)) { - InsertPt = II->getNormalDest()->begin(); - while (isa(InsertPt)) - ++InsertPt; - } else - ++InsertPt; // Insert after the init instruction. - } else { - InsertPt = AllocaInsertionPoint; // Insert after the allocas. - ++InsertPt; - } - BasicBlock *BB = InsertPt->getParent(); - BB->getInstList().insert(InsertPt, SI); - - // Replace any uses of the original value with a load of the alloca. - for (Value::use_iterator U = UniqVal->use_begin(), E = UniqVal->use_end(); - U != E; ++U) - U.getUse().set(new LoadInst(NewTmp, "mtmp", cast(*U))); - - // Finally, This is no longer a GCC temporary. -abort(); //FIXME -//FIXME DECL_GIMPLE_FORMAL_TEMP_P(Var) = 0; -} - /// EmitMODIFY_EXPR - Note that MODIFY_EXPRs are rvalues only! /// We also handle INIT_EXPRs here; these are built by the C++ FE on rare /// occasions, and have slightly different semantics that don't affect us here. @@ -2940,29 +2850,15 @@ tree lhs = TREE_OPERAND (exp, 0); tree rhs = TREE_OPERAND (exp, 1); - // If this is the definition of a gimple temporary, set its DECL_LLVM to the - // RHS. bool LHSSigned = !TYPE_UNSIGNED(TREE_TYPE(lhs)); bool RHSSigned = !TYPE_UNSIGNED(TREE_TYPE(rhs)); - if (isGimpleTemporary(lhs)) { - // If DECL_LLVM is already set, this is a multiply defined gimple temporary. - if (DECL_LLVM_SET_P(lhs)) { - HandleMultiplyDefinedGimpleTemporary(lhs); - return EmitMODIFY_EXPR(exp, DestLoc); - } + + // If this is the definition of an ssa name, record it in the SSANames map. + if (TREE_CODE(lhs) == SSA_NAME) { + assert(SSANames.find(lhs) == SSANames.end() && "Multiply defined ssa name!"); Value *RHS = Emit(rhs, 0); - const Type *LHSTy = ConvertType(TREE_TYPE(lhs)); - // The value may need to be replaced later if this temporary is multiply - // defined - ensure it can be uniquely identified by not folding the cast. - Instruction::CastOps opc = CastInst::getCastOpcode(RHS, RHSSigned, - LHSTy, LHSSigned); - CastInst *Cast = CastInst::Create(opc, RHS, LHSTy, RHS->getName()); - if (opc == Instruction::BitCast && RHS->getType() == LHSTy) - // Simplify this no-op bitcast once the function is emitted. - UniquedValues.push_back(cast(Cast)); - Builder.Insert(Cast); - SET_DECL_LLVM(lhs, Cast); - return Cast; + SSANames[lhs] = RHS; + return RHS; } else if (canEmitRegisterVariable(lhs)) { // If this is a store to a register variable, EmitLV can't handle the dest // (there is no l-value of a register variable). Emit an inline asm node @@ -6801,9 +6697,6 @@ } } - assert(!isGimpleTemporary(exp) && - "Cannot use a gimple temporary as an l-value"); - Value *Decl = DECL_LLVM(exp); if (Decl == 0) { if (errorcount || sorrycount) { Modified: gcc-plugin/trunk/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-internal.h?rev=81146&r1=81145&r2=81146&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-internal.h (original) +++ gcc-plugin/trunk/llvm-internal.h Mon Sep 7 03:07:02 2009 @@ -30,6 +30,7 @@ // LLVM headers #include "llvm/CallingConv.h" #include "llvm/Intrinsics.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/IndexedMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SetVector.h" @@ -322,10 +323,9 @@ // AllocaInsertionPoint - Place to insert alloca instructions. Lazily created // and managed by CreateTemporary. Instruction *AllocaInsertionPoint; - - /// UniquedValues - Values defined using a no-op bitcast in order to make them - /// unique. These can be simplified once the function has been emitted. - std::vector UniquedValues; + + // SSANames - Map from GCC ssa names to the defining LLVM value. + DenseMap SSANames; //===---------------------- Exception Handling --------------------------===// @@ -377,7 +377,10 @@ /// EmitFunction - Convert 'fndecl' to LLVM code. Function *EmitFunction(); - + + /// EmitBasicBlock - Convert the given basic block. + void EmitBasicBlock(basic_block bb); + /// EmitLV - Convert the specified l-value tree node to LLVM code, returning /// the address of the result. LValue EmitLV(tree_node *exp); @@ -511,6 +514,7 @@ Value *EmitSWITCH_EXPR(tree_node *exp); // Expressions. + Value *EmitSSA_NAME(tree_node *exp); Value *EmitLoadOfLValue(tree_node *exp, const MemRef *DestLoc); Value *EmitOBJ_TYPE_REF(tree_node *exp, const MemRef *DestLoc); Value *EmitADDR_EXPR(tree_node *exp); From baldrick at free.fr Mon Sep 7 06:59:55 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 07 Sep 2009 11:59:55 -0000 Subject: [llvm-commits] [gcc-plugin] r81148 - in /gcc-plugin/trunk: llvm-convert.cpp llvm-internal.h Message-ID: <200909071159.n87Bxtc5026449@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 7 06:59:54 2009 New Revision: 81148 URL: http://llvm.org/viewvc/llvm-project?rev=81148&view=rev Log: Handle SSA default definitions in a more sophisticated way. These represent the initial value of a variable at the start of the function. The only non-trivial case occurs for function parameters. In this case, associate the ssa name with an explicit load of the parameter value at an appropriate place in the entry block. Modified: gcc-plugin/trunk/llvm-convert.cpp gcc-plugin/trunk/llvm-internal.h Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81148&r1=81147&r2=81148&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Mon Sep 7 06:59:54 2009 @@ -618,6 +618,13 @@ Args = Args == static_chain ? DECL_ARGUMENTS(FnDecl) : TREE_CHAIN(Args); } + // Loading the value of a PARM_DECL at this point yields its initial value. + // Remember this for use when materializing the reads implied by SSA default + // definitions. + SSAInsertionPoint = Builder.Insert(CastInst::Create(Instruction::BitCast, + Constant::getNullValue(Type::getInt32Ty(Context)), + Type::getInt32Ty(Context)), "ssa point"); + // If this is not a void-returning function, initialize the RESULT_DECL. if (DECL_RESULT(FnDecl) && !VOID_TYPE_P(TREE_TYPE(DECL_RESULT(FnDecl))) && !DECL_LLVM_SET_P(DECL_RESULT(FnDecl))) @@ -2232,9 +2239,42 @@ /// EmitSSA_NAME - Return the defining value of the given SSA_NAME. Value *TreeToLLVM::EmitSSA_NAME(tree exp) { - if (SSA_NAME_IS_DEFAULT_DEF(exp)) - return Emit(SSA_NAME_VAR(exp), 0); - return SSANames[exp]; + DenseMap::iterator I = SSANames.find(exp); + if (I != SSANames.end()) + return I->second; + + // This SSA name is the default definition for the underlying symbol. + assert(SSA_NAME_IS_DEFAULT_DEF(exp) && "SSA name used before being defined!"); + + // The underlying symbol is an SSA variable. + tree var = SSA_NAME_VAR(exp); + assert(SSA_VAR_P(var) && "Not an SSA variable!"); + + // If the variable is itself an ssa name, use its LLVM value. + if (TREE_CODE (var) == SSA_NAME) + return SSANames[exp] = EmitSSA_NAME(var); + + // Otherwise the symbol is a VAR_DECL, PARM_DECL or RESULT_DECL. Since a + // default definition is only created if the very first reference to the + // variable in the function is a read operation, and refers to the value + // read, it has an undefined value except for PARM_DECLs. + if (TREE_CODE(var) != PARM_DECL) + return UndefValue::get(ConvertType(TREE_TYPE(exp))); + + // Read the initial value of the parameter and associate it with the ssa name. + assert(DECL_LLVM_IF_SET(var) && "Parameter not laid out?"); + + unsigned Alignment = DECL_ALIGN(var); + assert(Alignment != 0 && "Parameter with unknown alignment!"); + + const Type *Ty = ConvertType(TREE_TYPE(exp)); + Value *Ptr = BitCastToType(DECL_LLVM_IF_SET(var), PointerType::getUnqual(Ty)); + + // Perform the load in the entry block, after all parameters have been set up + // with their initial values, and before any modifications to their values. + LoadInst *LI = new LoadInst(Ptr, "defaultdef", SSAInsertionPoint); + LI->setAlignment(Alignment); + return SSANames[exp] = LI; } /// EmitLoadOfLValue - When an l-value expression is used in a context that @@ -2855,10 +2895,8 @@ // If this is the definition of an ssa name, record it in the SSANames map. if (TREE_CODE(lhs) == SSA_NAME) { - assert(SSANames.find(lhs) == SSANames.end() && "Multiply defined ssa name!"); - Value *RHS = Emit(rhs, 0); - SSANames[lhs] = RHS; - return RHS; + assert(SSANames.find(lhs) == SSANames.end() && "Multiply defined SSA name!"); + return SSANames[lhs] = Emit(rhs, 0); } else if (canEmitRegisterVariable(lhs)) { // If this is a store to a register variable, EmitLV can't handle the dest // (there is no l-value of a register variable). Emit an inline asm node Modified: gcc-plugin/trunk/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-internal.h?rev=81148&r1=81147&r2=81148&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-internal.h (original) +++ gcc-plugin/trunk/llvm-internal.h Mon Sep 7 06:59:54 2009 @@ -324,6 +324,10 @@ // and managed by CreateTemporary. Instruction *AllocaInsertionPoint; + // SSAInsertionPoint - Place to insert reads corresponding to SSA default + // definitions. + Instruction *SSAInsertionPoint; + // SSANames - Map from GCC ssa names to the defining LLVM value. DenseMap SSANames; From baldrick at free.fr Mon Sep 7 07:23:50 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 07 Sep 2009 12:23:50 -0000 Subject: [llvm-commits] [gcc-plugin] r81149 - /gcc-plugin/trunk/llvm-convert.cpp Message-ID: <200909071223.n87CNpI4029623@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 7 07:23:50 2009 New Revision: 81149 URL: http://llvm.org/viewvc/llvm-project?rev=81149&view=rev Log: Name the ssa variable after the parameter name. This makes the IR a lot more readable. Modified: gcc-plugin/trunk/llvm-convert.cpp Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81149&r1=81148&r2=81149&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Mon Sep 7 07:23:50 2009 @@ -2267,12 +2267,15 @@ unsigned Alignment = DECL_ALIGN(var); assert(Alignment != 0 && "Parameter with unknown alignment!"); + const char *ParameterName = + DECL_NAME(var) ? IDENTIFIER_POINTER(DECL_NAME(var)) : "anon"; + const Type *Ty = ConvertType(TREE_TYPE(exp)); Value *Ptr = BitCastToType(DECL_LLVM_IF_SET(var), PointerType::getUnqual(Ty)); // Perform the load in the entry block, after all parameters have been set up // with their initial values, and before any modifications to their values. - LoadInst *LI = new LoadInst(Ptr, "defaultdef", SSAInsertionPoint); + LoadInst *LI = new LoadInst(Ptr, ParameterName, SSAInsertionPoint); LI->setAlignment(Alignment); return SSANames[exp] = LI; } From ssen at apple.com Mon Sep 7 13:46:46 2009 From: ssen at apple.com (Shantonu Sen) Date: Mon, 7 Sep 2009 11:46:46 -0700 Subject: [llvm-commits] [PATCH] Remove obsolete autoconf stuff, and upgrade autoconf, cuts down configure size to 361K (from 1.1M!) In-Reply-To: <6a8523d60909061449u5ce9b254t9a6398e5e313f4ee@mail.gmail.com> References: <4AA26CD9.10007@gmail.com> <6a8523d60909061449u5ce9b254t9a6398e5e313f4ee@mail.gmail.com> Message-ID: <70A73AA7-DF18-44A6-B773-AC05DDDEEB6D@apple.com> This patch looks scary to me. Do we really want to invest in moving to a new autoconf/libtool/automake version that I'm told has known incompatibilities (which means it's unlikely to be used by anyone else)? Some specific issues: 1) > dnl Indicate that we require autoconf 2.59 or later. Ths is needed > because we > dnl use some autoconf macros only available in 2.59. > -AC_PREREQ(2.59) > +AC_PREREQ(2.64) Please update the comments 2) > -want_libtool_version='1\.5\.22' What version of libtool is being used? I can't figure it out. Where is it documented? 3) > 3. Copy /ltdl.m4 to llvm/autoconf/m4 > + 3. Copy /ltsugar.m4 to llvm/autoconf/m4 > 4. Copy /share/aclocal/libtool.m4 to llvm/autoconf/m4/ > libtool.m4 You didn't update any of the step numbering, leading to many duplicate numbered steps and gaps of steps. 4) I thought the policy was not to upgrade config.guess? Even if not, you've lost several local LLVM changes: > *:Darwin:*:*) > UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown > case $UNAME_PROCESSOR in > - *86) UNAME_PROCESSOR=i686 ;; > unknown) UNAME_PROCESSOR=powerpc ;; > esac I don't know what else was overwritten, but it can't be good. 6) These changes use libtool internal macros, like "_LT_PROG_ECHO_BACKSLASH". These are not stable, and should not be used by configure scripts. I think this requirements more refinement. Shantonu Sent from my MacBook On Sep 6, 2009, at 2:49 PM, Daniel Dunbar wrote: > 2009/9/5 T?r?k Edwin : >> Hi, >> >> The attached patches update the autoconf stuff to work with latest >> autoconf, and remove some obsolete m4 macros >> that were no longer used. >> >> This cuts down the size of configure from 1.1M to 361K! > > Very nice! > >> Can someone test if this works on darwin too? > > Seems to work fine, I tested targeting i386/x86_64 and ppc from a > x86_64-apple-darwin10 machine. > >> How should I commit the patch (broken up in 5 pieces or a single >> commit?) > > No opinion. > > - Daniel > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From ssen at apple.com Mon Sep 7 13:50:48 2009 From: ssen at apple.com (Shantonu Sen) Date: Mon, 7 Sep 2009 11:50:48 -0700 Subject: [llvm-commits] [PATCH] x86_64 detection and building on 10.6 In-Reply-To: <9C42BEC1-E380-4E85-BCC5-BA86B7B0E958@apple.com> References: <638514FD-A5C8-407C-B5F7-778283024822@fallingsnow.net> <44B13E8C-5C13-47AB-9F45-B07E1ECAAD30@apple.com> <6a8523d60909020936w23b9606eiba293613499cf4a4@mail.gmail.com> <72AC7ED1-5507-4076-873D-EC7D9A1B0458@apple.com> <9C42BEC1-E380-4E85-BCC5-BA86B7B0E958@apple.com> Message-ID: <7DB11730-EEF6-45CD-86F2-CF2DDD40FF9A@apple.com> Case in point. Had this change been already committed, it would have been overwritten by: I don't think LLVM should be going out on a limb until there's a reasonable safeguard that local changes won't regress. So far the evidence is that this type of change would regress within days Shantonu Sent from my MacBook On Sep 2, 2009, at 1:04 PM, Mike Stump wrote: > On Sep 2, 2009, at 9:41 AM, Shantonu Sen wrote: >> Isn't config.guess upstream from FSF? Do we really want to fork >> this file? > > No. The upstream is presently getting this support as well through > other channels. This isn't a fork, but a preview of what is to > come. When their tree gets it, and it is refreshened through the > usual updates, eventually we'll get it for free. We should not be > shy about `fixing' it now. From daniel at zuster.org Mon Sep 7 14:25:54 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 07 Sep 2009 19:25:54 -0000 Subject: [llvm-commits] [llvm] r81152 - in /llvm/trunk/test: FrontendC/2009-03-09-WeakDeclarations-1.c lib/llvm.exp Message-ID: <200909071925.n87JPsHD019177@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Sep 7 14:25:54 2009 New Revision: 81152 URL: http://llvm.org/viewvc/llvm-project?rev=81152&view=rev Log: Avoid Tcl substitution, introduced %llvmgcc_only for this one little test (%llvmgcc includes a '-w' argument, and this test looks for warnings). Modified: llvm/trunk/test/FrontendC/2009-03-09-WeakDeclarations-1.c llvm/trunk/test/lib/llvm.exp Modified: llvm/trunk/test/FrontendC/2009-03-09-WeakDeclarations-1.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2009-03-09-WeakDeclarations-1.c?rev=81152&r1=81151&r2=81152&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2009-03-09-WeakDeclarations-1.c (original) +++ llvm/trunk/test/FrontendC/2009-03-09-WeakDeclarations-1.c Mon Sep 7 14:25:54 2009 @@ -1,4 +1,4 @@ -// RUN: $llvmgcc $test -c -o /dev/null |& \ +// RUN: %llvmgcc_only %s -c -o /dev/null |& \ // RUN: egrep {(14|15|22): warning:} | \ // RUN: wc -l | grep --quiet 3 // XTARGET: darwin,linux Modified: llvm/trunk/test/lib/llvm.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lib/llvm.exp?rev=81152&r1=81151&r2=81152&view=diff ============================================================================== --- llvm/trunk/test/lib/llvm.exp (original) +++ llvm/trunk/test/lib/llvm.exp Mon Sep 7 14:25:54 2009 @@ -59,6 +59,8 @@ regsub -all {%%} $new_line {_#MARKER#_} new_line #replace %prcontext with prcontext.tcl (Must replace before %p) regsub -all {%prcontext} $new_line $prcontext new_line + #replace %llvmgcc_only with actual path to llvmgcc + regsub -all {%llvmgcc_only} $new_line "$llvmgcc" new_line #replace %llvmgcc with actual path to llvmgcc regsub -all {%llvmgcc} $new_line "$llvmgcc -emit-llvm -w" new_line #replace %llvmgxx with actual path to llvmg++ From daniel at zuster.org Mon Sep 7 14:26:03 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 07 Sep 2009 19:26:03 -0000 Subject: [llvm-commits] [llvm] r81153 - in /llvm/trunk/test/Transforms/InstCombine: 2008-01-06-BitCastAttributes.ll call.ll Message-ID: <200909071926.n87JQ3Mq019205@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Sep 7 14:26:02 2009 New Revision: 81153 URL: http://llvm.org/viewvc/llvm-project?rev=81153&view=rev Log: Don't depend on Tcl behavior of redirecting stderr for all commands in a pipeline. Modified: llvm/trunk/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll llvm/trunk/test/Transforms/InstCombine/call.ll Modified: llvm/trunk/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll?rev=81153&r1=81152&r2=81153&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll Mon Sep 7 14:26:02 2009 @@ -1,5 +1,5 @@ ; Ignore stderr, we expect warnings there -; RUN: llvm-as < %s 2> /dev/null | opt -instcombine | llvm-dis | not grep bitcast +; RUN: llvm-as < %s | opt -instcombine 2> /dev/null | llvm-dis | not grep bitcast define void @a() { ret void Modified: llvm/trunk/test/Transforms/InstCombine/call.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/call.ll?rev=81153&r1=81152&r2=81153&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/call.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/call.ll Mon Sep 7 14:26:02 2009 @@ -1,5 +1,5 @@ ; Ignore stderr, we expect warnings there -; RUN: llvm-as < %s 2> /dev/null | opt -instcombine | llvm-dis | \ +; RUN: llvm-as < %s | opt -instcombine 2> /dev/null | llvm-dis | \ ; RUN: grep call | notcast ; END. From daniel at zuster.org Mon Sep 7 14:26:11 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 07 Sep 2009 19:26:11 -0000 Subject: [llvm-commits] [llvm] r81154 - in /llvm/trunk/tools/bugpoint: ExecutionDriver.cpp ExtractFunction.cpp Miscompilation.cpp OptimizerDriver.cpp Message-ID: <200909071926.n87JQBmH019236@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Sep 7 14:26:11 2009 New Revision: 81154 URL: http://llvm.org/viewvc/llvm-project?rev=81154&view=rev Log: Add -output-prefix option to bugpoint (to change the default output name). Modified: llvm/trunk/tools/bugpoint/ExecutionDriver.cpp llvm/trunk/tools/bugpoint/ExtractFunction.cpp llvm/trunk/tools/bugpoint/Miscompilation.cpp llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Modified: llvm/trunk/tools/bugpoint/ExecutionDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExecutionDriver.cpp?rev=81154&r1=81153&r2=81154&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ExecutionDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/ExecutionDriver.cpp Mon Sep 7 14:26:11 2009 @@ -100,6 +100,10 @@ cl::list InputArgv("args", cl::Positional, cl::desc("..."), cl::ZeroOrMore, cl::PositionalEatsArgs); + + cl::opt + OutputPrefix("output-prefix", cl::init("bugpoint"), + cl::desc("Prefix to use for outputs (default: 'bugpoint')")); } namespace { @@ -274,7 +278,7 @@ /// void BugDriver::compileProgram(Module *M) { // Emit the program to a bitcode file... - sys::Path BitcodeFile ("bugpoint-test-program.bc"); + sys::Path BitcodeFile (OutputPrefix + "-test-program.bc"); std::string ErrMsg; if (BitcodeFile.makeUnique(true,&ErrMsg)) { errs() << ToolName << ": Error making unique filename: " << ErrMsg @@ -310,7 +314,7 @@ std::string ErrMsg; if (BitcodeFile.empty()) { // Emit the program to a bitcode file... - sys::Path uniqueFilename("bugpoint-test-program.bc"); + sys::Path uniqueFilename(OutputPrefix + "-test-program.bc"); if (uniqueFilename.makeUnique(true, &ErrMsg)) { errs() << ToolName << ": Error making unique filename: " << ErrMsg << "!\n"; @@ -330,7 +334,7 @@ sys::Path BitcodePath (BitcodeFile); FileRemover BitcodeFileRemover(BitcodePath, CreatedBitcode && !SaveTemps); - if (OutputFile.empty()) OutputFile = "bugpoint-execution-output"; + if (OutputFile.empty()) OutputFile = OutputPrefix + "-execution-output"; // Check to see if this is a valid output filename... sys::Path uniqueFile(OutputFile); Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=81154&r1=81153&r2=81154&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original) +++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Mon Sep 7 14:26:11 2009 @@ -37,6 +37,7 @@ namespace llvm { bool DisableSimplifyCFG = false; + extern cl::opt OutputPrefix; } // End llvm namespace namespace { @@ -324,7 +325,7 @@ Module *M) { char *ExtraArg = NULL; - sys::Path uniqueFilename("bugpoint-extractblocks"); + sys::Path uniqueFilename(OutputPrefix + "-extractblocks"); std::string ErrMsg; if (uniqueFilename.createTemporaryFileOnDisk(true, &ErrMsg)) { outs() << "*** Basic Block extraction failed!\n"; Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=81154&r1=81153&r2=81154&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original) +++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Mon Sep 7 14:26:11 2009 @@ -30,6 +30,7 @@ using namespace llvm; namespace llvm { + extern cl::opt OutputPrefix; extern cl::list InputArgv; } @@ -301,12 +302,15 @@ << " Please report a bug!\n"; errs() << " Continuing on with un-loop-extracted version.\n"; - BD.writeProgramToFile("bugpoint-loop-extract-fail-tno.bc", ToNotOptimize); - BD.writeProgramToFile("bugpoint-loop-extract-fail-to.bc", ToOptimize); - BD.writeProgramToFile("bugpoint-loop-extract-fail-to-le.bc", + BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-tno.bc", + ToNotOptimize); + BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-to.bc", + ToOptimize); + BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-to-le.bc", ToOptimizeLoopExtracted); - errs() << "Please submit the bugpoint-loop-extract-fail-*.bc files.\n"; + errs() << "Please submit the " + << OutputPrefix << "-loop-extract-fail-*.bc files.\n"; delete ToOptimize; delete ToNotOptimize; delete ToOptimizeLoopExtracted; Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=81154&r1=81153&r2=81154&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Mon Sep 7 14:26:11 2009 @@ -37,6 +37,9 @@ #include using namespace llvm; +namespace llvm { + extern cl::opt OutputPrefix; +} namespace { // ChildOutput - This option captures the name of the child output file that @@ -68,7 +71,7 @@ // Output the input to the current pass to a bitcode file, emit a message // telling the user how to reproduce it: opt -foo blah.bc // - std::string Filename = "bugpoint-" + ID + ".bc"; + std::string Filename = OutputPrefix + "-" + ID + ".bc"; if (writeProgramToFile(Filename)) { errs() << "Error opening file '" << Filename << "' for writing!\n"; return; @@ -129,7 +132,7 @@ const char * const *ExtraArgs) const { // setup the output file name outs().flush(); - sys::Path uniqueFilename("bugpoint-output.bc"); + sys::Path uniqueFilename(OutputPrefix + "-output.bc"); std::string ErrMsg; if (uniqueFilename.makeUnique(true, &ErrMsg)) { errs() << getToolName() << ": Error making unique filename: " @@ -139,7 +142,7 @@ OutputFilename = uniqueFilename.str(); // set up the input file name - sys::Path inputFilename("bugpoint-input.bc"); + sys::Path inputFilename(OutputPrefix + "-input.bc"); if (inputFilename.makeUnique(true, &ErrMsg)) { errs() << getToolName() << ": Error making unique filename: " << ErrMsg << "\n"; From daniel at zuster.org Mon Sep 7 14:26:18 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 07 Sep 2009 19:26:18 -0000 Subject: [llvm-commits] [llvm] r81155 - in /llvm/trunk/test/BugPoint: crash-narrowfunctiontest.ll remove_arguments_test.ll Message-ID: <200909071926.n87JQJ6A019264@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Sep 7 14:26:18 2009 New Revision: 81155 URL: http://llvm.org/viewvc/llvm-project?rev=81155&view=rev Log: Use -output-prefix in bugpoint tests so that outputs go in temp directory (and we don't race on them). Modified: llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll llvm/trunk/test/BugPoint/remove_arguments_test.ll Modified: llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll?rev=81155&r1=81154&r2=81155&view=diff ============================================================================== --- llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll (original) +++ llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll Mon Sep 7 14:26:18 2009 @@ -1,6 +1,6 @@ ; Test that bugpoint can narrow down the testcase to the important function ; -; RUN: bugpoint %s -bugpoint-crashcalls -silence-passes > /dev/null +; RUN: bugpoint %s -output-prefix %t -bugpoint-crashcalls -silence-passes > /dev/null define i32 @foo() { ret i32 1 } Modified: llvm/trunk/test/BugPoint/remove_arguments_test.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/BugPoint/remove_arguments_test.ll?rev=81155&r1=81154&r2=81155&view=diff ============================================================================== --- llvm/trunk/test/BugPoint/remove_arguments_test.ll (original) +++ llvm/trunk/test/BugPoint/remove_arguments_test.ll Mon Sep 7 14:26:18 2009 @@ -1,4 +1,4 @@ -; RUN: bugpoint %s -bugpoint-crashcalls -silence-passes +; RUN: bugpoint %s -output-prefix %t -bugpoint-crashcalls -silence-passes ; Test to make sure that arguments are removed from the function if they are ; unnecessary. From edwintorok at gmail.com Mon Sep 7 14:59:19 2009 From: edwintorok at gmail.com (=?ISO-8859-1?Q?T=F6r=F6k_Edwin?=) Date: Mon, 07 Sep 2009 22:59:19 +0300 Subject: [llvm-commits] [PATCH] Remove obsolete autoconf stuff, and upgrade autoconf, cuts down configure size to 361K (from 1.1M!) In-Reply-To: <70A73AA7-DF18-44A6-B773-AC05DDDEEB6D@apple.com> References: <4AA26CD9.10007@gmail.com> <6a8523d60909061449u5ce9b254t9a6398e5e313f4ee@mail.gmail.com> <70A73AA7-DF18-44A6-B773-AC05DDDEEB6D@apple.com> Message-ID: <4AA56617.7000108@gmail.com> On 2009-09-07 21:46, Shantonu Sen wrote: > This patch looks scary to me. Do we really want to invest in moving to > a new autoconf/libtool/automake version that I'm told has known > incompatibilities (which means it's unlikely to be used by anyone else)? I can't regenerate llvm's configure with autoconf 2.61 or autoconf 2.64 which are the only ones available on Debian. The regeneration succeeds, but there is a syntax error in configure when run (a libtool macro is not expanded). I'd like to support both autoconf 2.60 and 2.64. Thanks for the review, comments below and new patch attached. > > Some specific issues: > 1) >> dnl Indicate that we require autoconf 2.59 or later. Ths is needed >> because we >> dnl use some autoconf macros only available in 2.59. >> -AC_PREREQ(2.59) >> +AC_PREREQ(2.64) > > Please update the comments Sorry that should be AC_PREREQ(2.60), it should still work with autoconf 2.60. I changed AutoRegen.sh to accept both. If you have autoconf 2.60 can you try whether ./AutoRegen.sh works for you with my patch applied? > > 2) >> -want_libtool_version='1\.5\.22' > > What version of libtool is being used? I can't figure it out. Where is > it documented? In the newly attached I kept libtool at what LLVM currently has, only one macro is used from it though, see below: AC_PROG_NM. As such I don't think libtool needs to be upgraded. > > 3) >> 3. Copy /ltdl.m4 to llvm/autoconf/m4 >> + 3. Copy /ltsugar.m4 to llvm/autoconf/m4 >> 4. Copy /share/aclocal/libtool.m4 to llvm/autoconf/m4/libtool.m4 > > You didn't update any of the step numbering, leading to many duplicate > numbered steps and gaps of steps. Dropped this section from README now, libtool doesn't need to be updated since we don't use libtool per se. > > 4) I thought the policy was not to upgrade config.guess? Even if not, > you've lost several local LLVM changes: >> *:Darwin:*:*) >> UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown >> case $UNAME_PROCESSOR in >> - *86) UNAME_PROCESSOR=i686 ;; >> unknown) UNAME_PROCESSOR=powerpc ;; >> esac > > I don't know what else was overwritten, but it can't be good. Didn't know it had LLVM local changes, I'll remove the config.* updates from my patch, and keep them as is. > > 6) These changes use libtool internal macros, like > "_LT_PROG_ECHO_BACKSLASH". These are not stable, and should not be > used by configure scripts. > > I think this requirements more refinement. Yeah that is hackish, I've done it like that to cut down configure size. However libtool is currently only used to detect the extension of shared libraries, and for AC_PROG_NM. Detecting the shared lib extension with libtool needs LT_INIT that adds another 300K bloat to configure, instead my latest patch determines the shared lib extension with a much simpler m4 macro I copied from LLVM's libtool.m4. I think the libtool.m4 in LLVM allows that, it only has this copyright: ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 ## Free Software Foundation, Inc. ## Originally by Gordon Matzigkeit , 1996 ## ## This file is free software; the Free Software Foundation gives ## unlimited permission to copy and/or distribute it, with or without ## modifications, as long as this notice is preserved. full.patch.gz: autoconf/depcomp | 522 autoconf/ltmain.sh | 6863 ------- autoconf/m4/bison.m4 | 15 autoconf/m4/cxx_bidi_iterator.m4 | 22 autoconf/m4/cxx_fwd_iterator.m4 | 22 autoconf/m4/cxx_namespaces.m4 | 19 autoconf/m4/cxx_std_iterator.m4 | 26 autoconf/m4/flex.m4 | 17 autoconf/m4/ltdl.m4 | 418 autoconf/missing | 353 b/autoconf/AutoRegen.sh | 10 b/autoconf/README.TXT | 35 b/autoconf/configure.ac | 40 b/autoconf/install-sh | 530 b/autoconf/m4/path_tclsh.m4 | 4 b/autoconf/m4/shrext.m4 | 38 b/autoconf/mkinstalldirs | 40 b/configure |32893 ++++---------------------------------- b/include/llvm/Config/config.h.in | 168 19 files changed, 4522 insertions(+), 37513 deletions(-) Best regards, --Edwin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Update-configure.ac-to-work-with-autoconf-2.64.patch Type: text/x-diff Size: 8556 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090907/28b6fcf3/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-Update-install-sh-and-mkinstalldirs.patch Type: text/x-diff Size: 21038 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090907/28b6fcf3/attachment-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Remove-obsolete-m4-macros-and-unused-programs.-Also-.patch.gz Type: application/x-gzip Size: 115054 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090907/28b6fcf3/attachment.gz -------------- next part -------------- A non-text attachment was scrubbed... Name: 0004-Regenerate-configure-and-config.h.in.patch.gz Type: application/x-gzip Size: 200136 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090907/28b6fcf3/attachment-0001.gz -------------- next part -------------- A non-text attachment was scrubbed... Name: full.patch.gz Type: application/x-gzip Size: 270217 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090907/28b6fcf3/attachment-0002.gz From nicholas at mxc.ca Mon Sep 7 15:44:51 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 07 Sep 2009 20:44:51 -0000 Subject: [llvm-commits] [llvm] r81156 - /llvm/trunk/lib/VMCore/Verifier.cpp Message-ID: <200909072044.n87KipRI029141@zion.cs.uiuc.edu> Author: nicholas Date: Mon Sep 7 15:44:51 2009 New Revision: 81156 URL: http://llvm.org/viewvc/llvm-project?rev=81156&view=rev Log: Homogenize whitespace. 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=81156&r1=81155&r2=81156&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Mon Sep 7 15:44:51 2009 @@ -114,7 +114,7 @@ // What to do if verification fails. Module *Mod; // Module we are verifying right now DominatorTree *DT; // Dominator Tree, caution can be null! - + std::string Messages; raw_string_ostream MessagesStr; @@ -233,9 +233,9 @@ void visitFunction(Function &F); void visitBasicBlock(BasicBlock &BB); using InstVisitor::visit; - + void visit(Instruction &I); - + void visitTruncInst(TruncInst &I); void visitZExtInst(ZExtInst &I); void visitSExtInst(SExtInst &I); @@ -385,7 +385,7 @@ Assert1(!GV.isConstant(), "'common' global may not be marked constant!", &GV); } - + // Verify that any metadata used in a global initializer points only to // other globals. if (MDNode *FirstNode = dyn_cast(GV.getInitializer())) { @@ -535,16 +535,17 @@ static bool VerifyAttributeCount(const AttrListPtr &Attrs, unsigned Params) { if (Attrs.isEmpty()) return true; - + unsigned LastSlot = Attrs.getNumSlots() - 1; unsigned LastIndex = Attrs.getSlot(LastSlot).Index; if (LastIndex <= Params || (LastIndex == (unsigned)~0 && (LastSlot == 0 || Attrs.getSlot(LastSlot - 1).Index <= Params))) return true; - + return false; } + // visitFunction - Verify that a function is ok. // void Verifier::visitFunction(Function &F) { @@ -586,7 +587,7 @@ "Varargs functions must have C calling conventions!", &F); break; } - + bool isLLVMdotName = F.getName().size() >= 5 && F.getName().substr(0, 5) == "llvm."; if (!isLLVMdotName) @@ -623,7 +624,6 @@ } } - // verifyBasicBlock - Verify that a basic block is well formed... // void Verifier::visitBasicBlock(BasicBlock &BB) { @@ -640,7 +640,6 @@ std::sort(Preds.begin(), Preds.end()); PHINode *PN; for (BasicBlock::iterator I = BB.begin(); (PN = dyn_cast(I));++I) { - // Ensure that PHI nodes have at least one entry! Assert1(PN->getNumIncomingValues() != 0, "PHI nodes must have at least one entry. If the block is dead, " @@ -716,7 +715,7 @@ CheckFailed("Function return type does not match operand " "type of return inst!", &RI, F->getReturnType()); } - + // Check to make sure that the return value has necessary properties for // terminators... visitTerminatorInst(RI); @@ -743,7 +742,6 @@ visitInstruction(SI); } - /// visitUserOp1 - User defined operators shouldn't live beyond the lifetime of /// a pass, if any exist, it's an error. /// @@ -1273,11 +1271,10 @@ Assert1(*UI != (User*)&I || !DT->isReachableFromEntry(BB), "Only PHI nodes may reference their own value!", &I); } - + // Verify that if this is a terminator that it is at the end of the block. if (isa(I)) Assert1(BB->getTerminator() == &I, "Terminator not at end of block!", &I); - // Check that void typed values don't have names Assert1(I.getType() != Type::getVoidTy(I.getContext()) || !I.hasName(), @@ -1301,7 +1298,6 @@ Assert1(PTy->getElementType() != Type::getMetadataTy(I.getContext()), "Instructions may not produce pointer to metadata.", &I); - // Check that all uses of the instruction, if they are instructions // themselves, actually have parent basic blocks. If the use is not an // instruction, it is an error! @@ -1327,7 +1323,7 @@ dyn_cast(I.getOperand(i)->getType())) Assert1(PTy->getElementType() != Type::getMetadataTy(I.getContext()), "Invalid use of metadata pointer.", &I); - + if (Function *F = dyn_cast(I.getOperand(i))) { // Check to make sure that the "address of" an intrinsic function is never // taken. @@ -1430,11 +1426,11 @@ Function *IF = CI.getCalledFunction(); Assert1(IF->isDeclaration(), "Intrinsic functions should never be defined!", IF); - + #define GET_INTRINSIC_VERIFIER #include "llvm/Intrinsics.gen" #undef GET_INTRINSIC_VERIFIER - + switch (ID) { default: break; @@ -1461,7 +1457,7 @@ Assert1(isa(CI.getOperand(2)), "llvm.gcroot parameter #2 must be a constant.", &CI); } - + Assert1(CI.getParent()->getParent()->hasGC(), "Enclosing function does not use GC.", &CI); break; @@ -1660,7 +1656,7 @@ va_list VA; va_start(VA, ParamNum); const FunctionType *FTy = F->getFunctionType(); - + // For overloaded intrinsics, the Suffix of the function name must match the // types of the arguments. This variable keeps track of the expected // suffix, to be checked at the end. @@ -1761,7 +1757,7 @@ Verifier *V = new Verifier(action); PM.add(V); PM.run(const_cast(M)); - + if (ErrorInfo && V->Broken) *ErrorInfo = V->MessagesStr.str(); return V->Broken; From nicholas at mxc.ca Mon Sep 7 16:50:25 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 07 Sep 2009 21:50:25 -0000 Subject: [llvm-commits] [llvm] r81157 - /llvm/trunk/lib/VMCore/Verifier.cpp Message-ID: <200909072150.n87LoPtL005243@zion.cs.uiuc.edu> Author: nicholas Date: Mon Sep 7 16:50:24 2009 New Revision: 81157 URL: http://llvm.org/viewvc/llvm-project?rev=81157&view=rev Log: Express this in the canonical way. 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=81157&r1=81156&r2=81157&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Mon Sep 7 16:50:24 2009 @@ -866,8 +866,8 @@ const Type *SrcTy = I.getOperand(0)->getType(); const Type *DestTy = I.getType(); - bool SrcVec = SrcTy->getTypeID() == Type::VectorTyID; - bool DstVec = DestTy->getTypeID() == Type::VectorTyID; + bool SrcVec = isa(SrcTy); + bool DstVec = isa(DestTy); Assert1(SrcVec == DstVec, "SIToFP source and dest must both be vector or scalar", &I); From clattner at apple.com Mon Sep 7 17:12:08 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 7 Sep 2009 15:12:08 -0700 Subject: [llvm-commits] [PATCH] Add malloc call utility functions In-Reply-To: <4AA25B50.2020208@free.fr> References: <1B994CDD-5E0A-4255-8B22-1781A229B2BB@apple.com> <4AA25B50.2020208@free.fr> Message-ID: <63F4F220-93E8-4D5B-B21F-A889FF72432E@apple.com> On Sep 5, 2009, at 5:36 AM, Duncan Sands wrote: > Hi Victor, when bitcode containing a MallocInst is read, it looks > like you plan to turn this into a malloc call ignoring the alignment > value of the MallocInst. However if the alignment was huge, the > pointer > returned by the malloc call might not be sufficiently aligned. In > this > case you would need to allocate a larger amount of memory and adjust > the > returned pointer to be sufficiently aligned. The extra complexity may > not be worth it: I don't know if anyone ever used huge alignments with > MallocInst, or even if codegen respected these alignments. If you > decide to ignore the alignment I suggest you add a comment about this. The MallocInst alignment field is already ignored by all versions of llvm. Don't worry about this. -Chris From sabre at nondot.org Mon Sep 7 17:14:42 2009 From: sabre at nondot.org (Chris Lattner) Date: Mon, 07 Sep 2009 22:14:42 -0000 Subject: [llvm-commits] [llvm] r81158 - /llvm/trunk/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll Message-ID: <200909072214.n87MEg75008321@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 17:14:41 2009 New Revision: 81158 URL: http://llvm.org/viewvc/llvm-project?rev=81158&view=rev Log: tweak test, add PR# Modified: llvm/trunk/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll Modified: llvm/trunk/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll?rev=81158&r1=81157&r2=81158&view=diff ============================================================================== --- llvm/trunk/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll (original) +++ llvm/trunk/test/Transforms/TailCallElim/move_alloca_for_tail_call.ll Mon Sep 7 17:14:41 2009 @@ -1,10 +1,11 @@ ; RUN: opt -tailcallelim %s | llvm-dis | FileCheck %s +; PR615 declare void @bar(i32*) define i32 @foo() { ; CHECK: i32 @foo() -; CHECK: alloca +; CHECK-NEXT: alloca %A = alloca i32 ; [#uses=2] store i32 17, i32* %A call void @bar( i32* %A ) From sabre at nondot.org Mon Sep 7 17:15:23 2009 From: sabre at nondot.org (Chris Lattner) Date: Mon, 07 Sep 2009 22:15:23 -0000 Subject: [llvm-commits] [llvm] r81159 - /llvm/trunk/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll Message-ID: <200909072215.n87MFNps008421@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 17:15:23 2009 New Revision: 81159 URL: http://llvm.org/viewvc/llvm-project?rev=81159&view=rev Log: tighten test. Modified: llvm/trunk/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll Modified: llvm/trunk/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll?rev=81159&r1=81158&r2=81159&view=diff ============================================================================== --- llvm/trunk/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll (original) +++ llvm/trunk/test/Transforms/LoopStrengthReduce/exit_compare_live_range.ll Mon Sep 7 17:15:23 2009 @@ -12,7 +12,7 @@ volatile store float 0.000000e+00, float* %D %indvar.next = add i32 %indvar, 1 ; [#uses=2] ; CHECK: icmp -; CHECK: br i1 +; CHECK-NEXT: br i1 %exitcond = icmp eq i32 %indvar.next, %E ; [#uses=1] br i1 %exitcond, label %loopexit, label %no_exit loopexit: ; preds = %no_exit From clattner at apple.com Mon Sep 7 17:15:44 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 7 Sep 2009 15:15:44 -0700 Subject: [llvm-commits] [llvm] r81083 - in /llvm/trunk/test: CodeGen/X86/ Transforms/ConstantMerge/ Transforms/GVN/ Transforms/IndVarSimplify/ Transforms/Inline/ Transforms/InstCombine/ Transforms/LoopStrengthReduce/ Transforms/SimplifyLibCalls/ Transforms/TailCallElim/ In-Reply-To: <200909051135.n85BZIaM031538@zion.cs.uiuc.edu> References: <200909051135.n85BZIaM031538@zion.cs.uiuc.edu> Message-ID: On Sep 5, 2009, at 4:35 AM, Daniel Dunbar wrote: > Author: ddunbar > Date: Sat Sep 5 06:35:16 2009 > New Revision: 81083 > > URL: http://llvm.org/viewvc/llvm-project?rev=81083&view=rev > Log: > Eliminate uses of %prcontext. > - I'd appreciate it if someone else eyeballs my changes to make sure > I captured > the intent of the test. Great, thanks Daniel! -Chris From clattner at apple.com Mon Sep 7 17:17:00 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 7 Sep 2009 15:17:00 -0700 Subject: [llvm-commits] [llvm] r81045 - in /llvm/trunk: lib/VMCore/LLVMContext.cpp lib/VMCore/Metadata.cpp test/Transforms/GlobalDCE/2009-09-03-MDNode.ll In-Reply-To: <200909042132.n84LW7eZ007146@zion.cs.uiuc.edu> References: <200909042132.n84LW7eZ007146@zion.cs.uiuc.edu> Message-ID: On Sep 4, 2009, at 2:32 PM, Devang Patel wrote: > Author: dpatel > Date: Fri Sep 4 16:32:05 2009 > New Revision: 81045 > > URL: http://llvm.org/viewvc/llvm-project?rev=81045&view=rev > Log: > While replacing an MDNode elment, properly update MDNode's operand > list. > MDNode's operand list does not include all elements. Devang, please minimize this testcase by hand. You should be able to reproduce this problem with a 10-15 line .ll file. -Chris > > Added: > llvm/trunk/test/Transforms/GlobalDCE/2009-09-03-MDNode.ll > Modified: > llvm/trunk/lib/VMCore/LLVMContext.cpp > llvm/trunk/lib/VMCore/Metadata.cpp > > Modified: llvm/trunk/lib/VMCore/LLVMContext.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContext.cpp?rev=81045&r1=81044&r2=81045&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/LLVMContext.cpp (original) > +++ llvm/trunk/lib/VMCore/LLVMContext.cpp Fri Sep 4 16:32:05 2009 > @@ -62,9 +62,10 @@ > return Changed; > > while (!DeadMDNodes.empty()) { > - const MDNode *N = cast(DeadMDNodes.back()); > DeadMDNodes.pop_back(); > - if (N->use_empty()) > - delete N; > + Value *V = DeadMDNodes.back(); DeadMDNodes.pop_back(); > + if (const MDNode *N = dyn_cast_or_null(V)) > + if (N->use_empty()) > + delete N; > } > } > return Changed; > > Modified: llvm/trunk/lib/VMCore/Metadata.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=81045&r1=81044&r2=81045&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/Metadata.cpp (original) > +++ llvm/trunk/lib/VMCore/Metadata.cpp Fri Sep 4 16:32:05 2009 > @@ -72,6 +72,9 @@ > // Only record metadata uses. > if (MetadataBase *MB = dyn_cast_or_null(Vals[i])) > OperandList[NumOperands++] = MB; > + else if(Vals[i] && > + Vals[i]->getType()->getTypeID() == Type::MetadataTyID) > + OperandList[NumOperands++] = Vals[i]; > Node.push_back(ElementVH(Vals[i], this)); > } > } > @@ -144,6 +147,27 @@ > pImpl->MDNodeSet.RemoveNode(this); > } > > + // MDNode only lists metadata elements in operand list, because > MDNode > + // used by MDNode is considered a valid use. However on the side, > MDNode > + // using a non-metadata value is not considered a "use" of non- > metadata > + // value. > + SmallVector OpIndexes; > + unsigned OpIndex = 0; > + for (User::op_iterator OI = op_begin(), OE = op_end(); > + OI != OE; ++OI, OpIndex++) { > + if (*OI == From) > + OpIndexes.push_back(OpIndex); > + } > + if (MetadataBase *MDTo = dyn_cast_or_null(To)) { > + for (SmallVector::iterator OI = OpIndexes.begin(), > + OE = OpIndexes.end(); OI != OE; ++OI) > + setOperand(*OI, MDTo); > + } else { > + for (SmallVector::iterator OI = OpIndexes.begin(), > + OE = OpIndexes.end(); OI != OE; ++OI) > + setOperand(*OI, 0); > + } > + > // Replace From element(s) in place. > for (SmallVector::iterator I = Indexes.begin(), E = > Indexes.end(); > I != E; ++I) { > > Added: llvm/trunk/test/Transforms/GlobalDCE/2009-09-03-MDNode.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalDCE/2009-09-03-MDNode.ll?rev=81045&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/Transforms/GlobalDCE/2009-09-03-MDNode.ll (added) > +++ llvm/trunk/test/Transforms/GlobalDCE/2009-09-03-MDNode.ll Fri > Sep 4 16:32:05 2009 > @@ -0,0 +1,264 @@ > +; RUN: llvm-as < %s | opt -globaldce | llc -O0 -o /dev/null > + > +%struct..0__pthread_mutex_s = type { i32, i32, i32, i32, i32, i32, > %struct.__pthread_list_t } > +%"struct.__gnu_cxx::_ConvertibleConcept" > = type { i32 } > +%struct.__pthread_list_t = type { %struct.__pthread_list_t*, > %struct.__pthread_list_t* } > +%struct.pthread_attr_t = type { i64, [48 x i8] } > +%struct.pthread_mutex_t = type { %struct..0__pthread_mutex_s } > + > + at _ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*) > * @pthread_once ; [#uses=0] > + at _ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* > @pthread_getspecific ; [#uses=0] > + at _ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* > @pthread_setspecific ; [#uses=0] > + at _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias > weak i32 (i64*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* > @pthread_create ; i8*)*> [#uses=0] > + at _ZL22__gthrw_pthread_cancelm = alias weak i32 (i64)* > @pthread_cancel ; [#uses=0] > + at _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 > (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; (%struct.pthread_mutex_t*)*> [#uses=0] > + at _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak > i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; (%struct.pthread_mutex_t*)*> [#uses=0] > + at _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak > i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; (%struct.pthread_mutex_t*)*> [#uses=0] > + > @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t > = alias weak i32 (%struct.pthread_mutex_t*, > %"struct.__gnu_cxx::_ConvertibleConcept"*) > * @pthread_mutex_init ; %"struct.__gnu_cxx::_ConvertibleConcept"*) > *> [#uses=0] > + at _ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, > void (i8*)*)* @pthread_key_create ; > [#uses=0] > + at _ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* > @pthread_key_delete ; [#uses=0] > + at _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias > weak i32 (%"struct.__gnu_cxx::_ConvertibleConcept int,unsigned int>"*)* @pthread_mutexattr_init ; (%"struct.__gnu_cxx::_ConvertibleConcept int>"*)*> [#uses=0] > + at _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = > alias weak i32 (%"struct.__gnu_cxx::_ConvertibleConcept int,unsigned int>"*, i32)* @pthread_mutexattr_settype ; (%"struct.__gnu_cxx::_ConvertibleConcept int>"*, i32)*> [#uses=0] > + at _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = > alias weak i32 (%"struct.__gnu_cxx::_ConvertibleConcept int,unsigned int>"*)* @pthread_mutexattr_destroy ; (%"struct.__gnu_cxx::_ConvertibleConcept int>"*)*> [#uses=0] > + > +define weak void @_ZN9__gnu_cxx26__aux_require_boolean_exprIbEEvRKT_ > (i8* %__t) { > +entry: > + tail call void @llvm.dbg.func.start(metadata !0) > + tail call void @llvm.dbg.stoppoint(i32 240, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !0) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_19_ConvertibleConceptIjjEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !8) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !8) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPcEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !11) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !11) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPKcEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !12) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !12) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPwEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !13) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !13) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPKwEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !14) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !14) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIPwEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !15) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !15) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIPcEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !16) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !16) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIiEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !17) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !17) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIlEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !18) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !18) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIxEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !19) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !19) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIjEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !20) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !20) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_22_OutputIteratorConceptISt19ostreambuf_iteratorIcSt11char_traitsIcEEcEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !21) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !21) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_22_OutputIteratorConceptISt19ostreambuf_iteratorIwSt11char_traitsIwEEwEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !22) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !22) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPcEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !23) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !23) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPKcEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !24) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !24) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPKcSsEEEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !25) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !25) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPcSsEEEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !26) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !26) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPKwSbIwSt11char_traitsIwESaIwEEEEEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !27) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !27) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPwSbIwSt11char_traitsIwESaIwEEEEEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !28) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !28) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPwEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !29) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !29) > + ret void > +} > + > +define weak void > @_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPKwEEEEvv > () { > +entry: > + tail call void @llvm.dbg.func.start(metadata !30) > + tail call void @llvm.dbg.stoppoint(i32 63, i32 0, metadata !2) > + tail call void @llvm.dbg.region.end(metadata !30) > + ret void > +} > + > +declare void @llvm.dbg.func.start(metadata) nounwind readnone > + > +declare void @llvm.dbg.stoppoint(i32, i32, metadata) nounwind > readnone > + > +declare void @llvm.dbg.region.end(metadata) nounwind readnone > + > +declare extern_weak i32 @pthread_once(i32*, void ()*) > + > +declare extern_weak i8* @pthread_getspecific(i32) > + > +declare extern_weak i32 @pthread_setspecific(i32, i8*) > + > +declare extern_weak i32 @pthread_create(i64*, > %struct.pthread_attr_t*, i8* (i8*)*, i8*) > + > +declare extern_weak i32 @pthread_cancel(i64) > + > +declare extern_weak i32 @pthread_mutex_lock(%struct.pthread_mutex_t*) > + > +declare extern_weak i32 @pthread_mutex_trylock > (%struct.pthread_mutex_t*) > + > +declare extern_weak i32 @pthread_mutex_unlock > (%struct.pthread_mutex_t*) > + > +declare extern_weak i32 @pthread_mutex_init > (%struct.pthread_mutex_t*, > %"struct.__gnu_cxx::_ConvertibleConcept"*) > + > +declare extern_weak i32 @pthread_key_create(i32*, void (i8*)*) > + > +declare extern_weak i32 @pthread_key_delete(i32) > + > +declare extern_weak i32 @pthread_mutexattr_init > (%"struct.__gnu_cxx::_ConvertibleConcept"*) > + > +declare extern_weak i32 @pthread_mutexattr_settype > (%"struct.__gnu_cxx::_ConvertibleConcept int>"*, i32) > + > +declare extern_weak i32 @pthread_mutexattr_destroy > (%"struct.__gnu_cxx::_ConvertibleConcept"*) > + > +!0 = metadata !{i32 458798, i32 0, metadata !1, > metadata !"__aux_require_boolean_expr", > metadata !"__aux_require_boolean_expr", > metadata !"_ZN9__gnu_cxx26__aux_require_boolean_exprIbEEvRKT_", > metadata !2, i32 239, metadata !3, i1 false, i1 true} > +!1 = metadata !{i32 458769, i32 0, i32 4, metadata !"concept- > inst.cc", metadata !"/home/buildbot/buildslave/llvm-x86_64-linux- > selfhost/llvm-gcc.obj/x86_64-unknown-linux-gnu/libstdc++-v3/ > src/../../../../llvm-gcc.src/libstdc++-v3/src", metadata !"4.2.1 > (Based on Apple Inc. build 5649) (LLVM build)", i1 true, i1 true, > metadata !"", i32 0} > +!2 = metadata !{i32 458769, i32 0, i32 4, > metadata !"boost_concept_check.h", metadata !"/home/buildbot/ > buildslave/llvm-x86_64-linux-selfhost/llvm-gcc.obj/x86_64-unknown- > linux-gnu/libstdc++-v3/include/bits", metadata !"4.2.1 (Based on > Apple Inc. build 5649) (LLVM build)", i1 false, i1 true, > metadata !"", i32 0} > +!3 = metadata !{i32 458773, metadata !1, metadata !"", metadata !1, > i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !4, i32 0} > +!4 = metadata !{null, metadata !5} > +!5 = metadata !{i32 458768, metadata !1, metadata !"", metadata !1, > i32 0, i64 64, i64 64, i64 0, i32 0, metadata !6} > +!6 = metadata !{i32 458790, metadata !1, metadata !"", metadata !1, > i32 0, i64 8, i64 8, i64 0, i32 0, metadata !7} > +!7 = metadata !{i32 458788, metadata !1, metadata !"bool", > metadata !1, i32 0, i64 8, i64 8, i64 0, i32 0, i32 2} > +!8 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires<__gnu_cxx::_ConvertibleConcept unsigned int> >", > metadata > !"__function_requires<__gnu_cxx::_ConvertibleConcept unsigned int> >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_19_ConvertibleConceptIjjEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!9 = metadata !{i32 458773, metadata !1, metadata !"", metadata !1, > i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !10, i32 0} > +!10 = metadata !{null} > +!11 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires<__gnu_cxx::_InputIteratorConcept >", > metadata > !"__function_requires<__gnu_cxx::_InputIteratorConcept >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPcEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!12 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires<__gnu_cxx::_InputIteratorConcept > >", > metadata > !"__function_requires<__gnu_cxx::_InputIteratorConcept > >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPKcEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!13 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires<__gnu_cxx::_InputIteratorConcept > >", > metadata > !"__function_requires<__gnu_cxx::_InputIteratorConcept > >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPwEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!14 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires<__gnu_cxx::_InputIteratorConcept wchar_t*> >", > metadata > !"__function_requires<__gnu_cxx::_InputIteratorConcept wchar_t*> >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_21_InputIteratorConceptIPKwEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!15 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires > <__gnu_cxx::_LessThanComparableConcept >", > metadata > !"__function_requires > <__gnu_cxx::_LessThanComparableConcept >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIPwEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!16 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires<__gnu_cxx::_LessThanComparableConcept > >", > metadata > !"__function_requires<__gnu_cxx::_LessThanComparableConcept > >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIPcEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!17 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires<__gnu_cxx::_LessThanComparableConcept > >", > metadata > !"__function_requires<__gnu_cxx::_LessThanComparableConcept > >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIiEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!18 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires<__gnu_cxx::_LessThanComparableConcept int> >", > metadata > !"__function_requires<__gnu_cxx::_LessThanComparableConcept int> >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIlEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!19 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires<__gnu_cxx::_LessThanComparableConcept long int> >", > metadata > !"__function_requires<__gnu_cxx::_LessThanComparableConcept long int> >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIxEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!20 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires > <__gnu_cxx::_LessThanComparableConcept >", > metadata > !"__function_requires > <__gnu_cxx::_LessThanComparableConcept >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_26_LessThanComparableConceptIjEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!21 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires > <__gnu_cxx::_OutputIteratorConcept std::char_traits >, char> >", > metadata > !"__function_requires > <__gnu_cxx::_OutputIteratorConcept std::char_traits >, char> >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_22_OutputIteratorConceptISt19ostreambuf_iteratorIcSt11char_traitsIcEEcEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!22 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires > <__gnu_cxx::_OutputIteratorConcept std::char_traits >, wchar_t> >", > metadata > !"__function_requires > <__gnu_cxx::_OutputIteratorConcept std::char_traits >, wchar_t> >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_22_OutputIteratorConceptISt19ostreambuf_iteratorIwSt11char_traitsIwEEwEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!23 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires > <__gnu_cxx::_RandomAccessIteratorConcept >", > metadata > !"__function_requires > <__gnu_cxx::_RandomAccessIteratorConcept >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPcEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!24 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept char*> >", > metadata > !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept char*> >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPKcEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!25 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires > < > __gnu_cxx > ::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator char*, std::basic_string, > std::allocator > > > >", > metadata > !"__function_requires > < > __gnu_cxx > ::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator char*, std::basic_string, > std::allocator > > > >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPKcSsEEEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!26 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires > < > __gnu_cxx > ::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator std::basic_string, std::allocator > > > > >", > metadata > !"__function_requires > < > __gnu_cxx > ::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator std::basic_string, std::allocator > > > > >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPcSsEEEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!27 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires > < > __gnu_cxx > ::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator wchar_t*, std::basic_string, > std::allocator > > > >", > metadata > !"__function_requires > < > __gnu_cxx > ::_RandomAccessIteratorConcept<__gnu_cxx::__normal_iterator wchar_t*, std::basic_string, > std::allocator > > > >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPKwSbIwSt11char_traitsIwESaIwEEEEEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!28 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires > < > __gnu_cxx > ::_RandomAccessIteratorConcept > <__gnu_cxx::__normal_iterator std::char_traits, std::allocator > > > >", > metadata > !"__function_requires > < > __gnu_cxx > ::_RandomAccessIteratorConcept > <__gnu_cxx::__normal_iterator std::char_traits, std::allocator > > > >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptINS_17__normal_iteratorIPwSbIwSt11char_traitsIwESaIwEEEEEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!29 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires > <__gnu_cxx::_RandomAccessIteratorConcept >", > metadata > !"__function_requires > <__gnu_cxx::_RandomAccessIteratorConcept >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPwEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > +!30 = metadata !{i32 458798, i32 0, metadata !1, > metadata > !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept wchar_t*> >", > metadata > !"__function_requires<__gnu_cxx::_RandomAccessIteratorConcept wchar_t*> >", > metadata > !"_ZN9__gnu_cxx19__function_requiresINS_28_RandomAccessIteratorConceptIPKwEEEEvv > ", metadata !2, i32 61, metadata !9, i1 false, i1 true} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Mon Sep 7 17:23:27 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 7 Sep 2009 15:23:27 -0700 Subject: [llvm-commits] [llvm] r80963 - in /llvm/trunk: include/llvm/CodeGen/FastISel.h lib/CodeGen/SelectionDAG/FastISel.cpp test/CodeGen/X86/fast-isel-fneg.ll In-Reply-To: <200909032253.n83Mrvlj011046@zion.cs.uiuc.edu> References: <200909032253.n83Mrvlj011046@zion.cs.uiuc.edu> Message-ID: On Sep 3, 2009, at 3:53 PM, Dan Gohman wrote: > Author: djg > Date: Thu Sep 3 17:53:57 2009 > New Revision: 80963 > > URL: http://llvm.org/viewvc/llvm-project?rev=80963&view=rev > Log: > LLVM currently represents floating-point negation as -0.0 - x. Fix > FastISel to recognize this pattern and emit a floating-point > negation using xor. ISD::XOR is legal for floating point operands? -Chris > > Added: > llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll > Modified: > llvm/trunk/include/llvm/CodeGen/FastISel.h > llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp > > Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/FastISel.h?rev=80963&r1=80962&r2=80963&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/FastISel.h (original) > +++ llvm/trunk/include/llvm/CodeGen/FastISel.h Thu Sep 3 17:53:57 > 2009 > @@ -300,6 +300,8 @@ > private: > bool SelectBinaryOp(User *I, ISD::NodeType ISDOpcode); > > + bool SelectFNeg(User *I); > + > bool SelectGetElementPtr(User *I); > > bool SelectCall(User *I); > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=80963&r1=80962&r2=80963&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Thu Sep 3 > 17:53:57 2009 > @@ -608,6 +608,26 @@ > MBB->addSuccessor(MSucc); > } > > +/// SelectFNeg - Emit an FNeg operation. > +/// > +bool > +FastISel::SelectFNeg(User *I) { > + unsigned OpReg = getRegForValue(BinaryOperator::getFNegArgument > (I)); > + if (OpReg == 0) return false; > + > + // Twiddle the sign bit with xor. > + EVT VT = TLI.getValueType(I->getType()); > + if (VT.getSizeInBits() > 64) return false; > + unsigned ResultReg = FastEmit_ri_(VT.getSimpleVT(), ISD::XOR, > OpReg, > + UINT64_C(1) << (VT.getSizeInBits > ()-1), > + VT.getSimpleVT()); > + if (ResultReg == 0) > + return false; > + > + UpdateValueMap(I, ResultReg); > + return true; > +} > + > bool > FastISel::SelectOperator(User *I, unsigned Opcode) { > switch (Opcode) { > @@ -618,6 +638,9 @@ > case Instruction::Sub: > return SelectBinaryOp(I, ISD::SUB); > case Instruction::FSub: > + // FNeg is currently represented in LLVM IR as a special case > of FSub. > + if (BinaryOperator::isFNeg(I)) > + return SelectFNeg(I); > return SelectBinaryOp(I, ISD::FSUB); > case Instruction::Mul: > return SelectBinaryOp(I, ISD::MUL); > > Added: llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll?rev=80963&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll (added) > +++ llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll Thu Sep 3 > 17:53:57 2009 > @@ -0,0 +1,15 @@ > +; RUN: llvm-as < %s | llc -fast-isel -march=x86-64 | FileCheck %s > + > +; CHECK: doo: > +; CHECK: xorpd > +define double @doo(double %x) nounwind { > + %y = fsub double -0.0, %x > + ret double %y > +} > + > +; CHECK: foo: > +; CHECK: xorps > +define float @foo(float %x) nounwind { > + %y = fsub float -0.0, %x > + ret float %y > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Mon Sep 7 17:24:24 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 7 Sep 2009 15:24:24 -0700 Subject: [llvm-commits] [llvm] r80962 - /llvm/trunk/lib/CodeGen/ExactHazardRecognizer.cpp In-Reply-To: <200909032248.n83MmqYN010342@zion.cs.uiuc.edu> References: <200909032248.n83MmqYN010342@zion.cs.uiuc.edu> Message-ID: On Sep 3, 2009, at 3:48 PM, David Goodwin wrote: > Author: david_goodwin > Date: Thu Sep 3 17:48:51 2009 > New Revision: 80962 > > URL: http://llvm.org/viewvc/llvm-project?rev=80962&view=rev > Log: > Don't crash when target has no itineraries. Hi David, How about using "if (ItinData.isEmpty()) return;" to reduce nesting? -Chris > > Modified: > llvm/trunk/lib/CodeGen/ExactHazardRecognizer.cpp > > Modified: llvm/trunk/lib/CodeGen/ExactHazardRecognizer.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ExactHazardRecognizer.cpp?rev=80962&r1=80961&r2=80962&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/ExactHazardRecognizer.cpp (original) > +++ llvm/trunk/lib/CodeGen/ExactHazardRecognizer.cpp Thu Sep 3 > 17:48:51 2009 > @@ -83,71 +83,75 @@ > } > > ExactHazardRecognizer::HazardType > ExactHazardRecognizer::getHazardType(SUnit *SU) { > - unsigned cycle = 0; > + if (!ItinData.isEmpty()) { > + unsigned cycle = 0; > > - // Use the itinerary for the underlying instruction to check for > - // free FU's in the scoreboard at the appropriate future cycles. > - unsigned idx = SU->getInstr()->getDesc().getSchedClass(); > - for (const InstrStage *IS = ItinData.beginStage(idx), > - *E = ItinData.endStage(idx); IS != E; ++IS) { > - // We must find one of the stage's units free for every cycle the > - // stage is occupied. FIXME it would be more accurate to find the > - // same unit free in all the cycles. > - for (unsigned int i = 0; i < IS->getCycles(); ++i) { > - assert(((cycle + i) < ScoreboardDepth) && > - "Scoreboard depth exceeded!"); > - > - unsigned index = getFutureIndex(cycle + i); > - unsigned freeUnits = IS->getUnits() & ~Scoreboard[index]; > - if (!freeUnits) { > - DEBUG(errs() << "*** Hazard in cycle " << (cycle + i) << ", > "); > - DEBUG(errs() << "SU(" << SU->NodeNum << "): "); > - DEBUG(SU->getInstr()->dump()); > - return Hazard; > + // Use the itinerary for the underlying instruction to check for > + // free FU's in the scoreboard at the appropriate future cycles. > + unsigned idx = SU->getInstr()->getDesc().getSchedClass(); > + for (const InstrStage *IS = ItinData.beginStage(idx), > + *E = ItinData.endStage(idx); IS != E; ++IS) { > + // We must find one of the stage's units free for every cycle > the > + // stage is occupied. FIXME it would be more accurate to find > the > + // same unit free in all the cycles. > + for (unsigned int i = 0; i < IS->getCycles(); ++i) { > + assert(((cycle + i) < ScoreboardDepth) && > + "Scoreboard depth exceeded!"); > + > + unsigned index = getFutureIndex(cycle + i); > + unsigned freeUnits = IS->getUnits() & ~Scoreboard[index]; > + if (!freeUnits) { > + DEBUG(errs() << "*** Hazard in cycle " << (cycle + i) << > ", "); > + DEBUG(errs() << "SU(" << SU->NodeNum << "): "); > + DEBUG(SU->getInstr()->dump()); > + return Hazard; > + } > } > + > + // Advance the cycle to the next stage. > + cycle += IS->getNextCycles(); > } > - > - // Advance the cycle to the next stage. > - cycle += IS->getNextCycles(); > } > > return NoHazard; > } > > void ExactHazardRecognizer::EmitInstruction(SUnit *SU) { > - unsigned cycle = 0; > - > - // Use the itinerary for the underlying instruction to reserve FU's > - // in the scoreboard at the appropriate future cycles. > - unsigned idx = SU->getInstr()->getDesc().getSchedClass(); > - for (const InstrStage *IS = ItinData.beginStage(idx), > - *E = ItinData.endStage(idx); IS != E; ++IS) { > - // We must reserve one of the stage's units for every cycle the > - // stage is occupied. FIXME it would be more accurate to reserve > - // the same unit free in all the cycles. > - for (unsigned int i = 0; i < IS->getCycles(); ++i) { > - assert(((cycle + i) < ScoreboardDepth) && > - "Scoreboard depth exceeded!"); > + if (!ItinData.isEmpty()) { > + unsigned cycle = 0; > > - unsigned index = getFutureIndex(cycle + i); > - unsigned freeUnits = IS->getUnits() & ~Scoreboard[index]; > - > - // reduce to a single unit > - unsigned freeUnit = 0; > - do { > - freeUnit = freeUnits; > - freeUnits = freeUnit & (freeUnit - 1); > - } while (freeUnits); > + // Use the itinerary for the underlying instruction to reserve > FU's > + // in the scoreboard at the appropriate future cycles. > + unsigned idx = SU->getInstr()->getDesc().getSchedClass(); > + for (const InstrStage *IS = ItinData.beginStage(idx), > + *E = ItinData.endStage(idx); IS != E; ++IS) { > + // We must reserve one of the stage's units for every cycle the > + // stage is occupied. FIXME it would be more accurate to > reserve > + // the same unit free in all the cycles. > + for (unsigned int i = 0; i < IS->getCycles(); ++i) { > + assert(((cycle + i) < ScoreboardDepth) && > + "Scoreboard depth exceeded!"); > + > + unsigned index = getFutureIndex(cycle + i); > + unsigned freeUnits = IS->getUnits() & ~Scoreboard[index]; > + > + // reduce to a single unit > + unsigned freeUnit = 0; > + do { > + freeUnit = freeUnits; > + freeUnits = freeUnit & (freeUnit - 1); > + } while (freeUnits); > + > + assert(freeUnit && "No function unit available!"); > + Scoreboard[index] |= freeUnit; > + } > > - assert(freeUnit && "No function unit available!"); > - Scoreboard[index] |= freeUnit; > + // Advance the cycle to the next stage. > + cycle += IS->getNextCycles(); > } > > - // Advance the cycle to the next stage. > - cycle += IS->getNextCycles(); > + DEBUG(dumpScoreboard()); > } > - > - DEBUG(dumpScoreboard()); > } > > void ExactHazardRecognizer::AdvanceCycle() { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Mon Sep 7 17:31:26 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 07 Sep 2009 22:31:26 -0000 Subject: [llvm-commits] [llvm] r81161 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200909072231.n87MVQYt010463@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 7 17:31:26 2009 New Revision: 81161 URL: http://llvm.org/viewvc/llvm-project?rev=81161&view=rev Log: Simplify this code by using hasDefinitiveInitializer(). 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=81161&r1=81160&r2=81161&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Mon Sep 7 17:31:26 2009 @@ -2024,20 +2024,21 @@ /// we punt. We basically just support direct accesses to globals and GEP's of /// globals. This should be kept up to date with CommitValueTo. static bool isSimpleEnoughPointerToCommit(Constant *C, LLVMContext &Context) { - if (GlobalVariable *GV = dyn_cast(C)) { - if (!GV->hasExternalLinkage() && !GV->hasLocalLinkage()) - return false; // do not allow weak/linkonce/dllimport/dllexport linkage. - return !GV->isDeclaration(); // reject external globals. - } + if (GlobalVariable *GV = dyn_cast(C)) + // Do not allow weak/linkonce/dllimport/dllexport linkage or + // external globals. + return GV->hasDefinitiveInitializer(); + if (ConstantExpr *CE = dyn_cast(C)) // Handle a constantexpr gep. if (CE->getOpcode() == Instruction::GetElementPtr && isa(CE->getOperand(0))) { GlobalVariable *GV = cast(CE->getOperand(0)); - if (!GV->hasExternalLinkage() && !GV->hasLocalLinkage()) - return false; // do not allow weak/linkonce/dllimport/dllexport linkage. - return GV->hasInitializer() && - ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE, + // Do not allow weak/linkonce/dllimport/dllexport linkage or + // external globals. + if (!GV->hasDefinitiveInitializer()) + return false; + return ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE, Context); } return false; From gohman at apple.com Mon Sep 7 17:34:44 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 07 Sep 2009 22:34:44 -0000 Subject: [llvm-commits] [llvm] r81162 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200909072234.n87MYixH010880@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 7 17:34:43 2009 New Revision: 81162 URL: http://llvm.org/viewvc/llvm-project?rev=81162&view=rev Log: Preserve the InBounds flag when evaluating a getelementptr instruction into a getelementptr ConstantExpr. 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=81162&r1=81161&r2=81162&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Mon Sep 7 17:34:43 2009 @@ -2227,8 +2227,9 @@ for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e; ++i) GEPOps.push_back(getVal(Values, *i)); - InstResult = - ConstantExpr::getGetElementPtr(P, &GEPOps[0], GEPOps.size()); + InstResult = cast(GEP)->isInBounds() ? + ConstantExpr::getInBoundsGetElementPtr(P, &GEPOps[0], GEPOps.size()) : + ConstantExpr::getGetElementPtr(P, &GEPOps[0], GEPOps.size()); } else if (LoadInst *LI = dyn_cast(CurInst)) { if (LI->isVolatile()) return false; // no volatile accesses. InstResult = ComputeLoadResult(getVal(Values, LI->getOperand(0)), From gohman at apple.com Mon Sep 7 17:40:13 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 07 Sep 2009 22:40:13 -0000 Subject: [llvm-commits] [llvm] r81163 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200909072240.n87MeDLm011640@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 7 17:40:13 2009 New Revision: 81163 URL: http://llvm.org/viewvc/llvm-project?rev=81163&view=rev Log: Fix GlobalOpt to avoid committing a store if the address getelementptr is missing the inbounds flag. This is slightly conservative, but it avoids problems with two constants pointing to the same address but getting distinct entries in the Memory DenseMap. 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=81163&r1=81162&r2=81163&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Mon Sep 7 17:40:13 2009 @@ -2032,7 +2032,8 @@ if (ConstantExpr *CE = dyn_cast(C)) // Handle a constantexpr gep. if (CE->getOpcode() == Instruction::GetElementPtr && - isa(CE->getOperand(0))) { + isa(CE->getOperand(0)) && + cast(CE)->isInBounds()) { GlobalVariable *GV = cast(CE->getOperand(0)); // Do not allow weak/linkonce/dllimport/dllexport linkage or // external globals. From gohman at apple.com Mon Sep 7 17:42:05 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 07 Sep 2009 22:42:05 -0000 Subject: [llvm-commits] [llvm] r81164 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200909072242.n87Mg56N011876@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 7 17:42:05 2009 New Revision: 81164 URL: http://llvm.org/viewvc/llvm-project?rev=81164&view=rev Log: Don't commit addresses of aggregate values. This avoids problems with an aggregate store overlapping a different aggregate store, despite the stores having distinct addresses. 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=81164&r1=81163&r2=81164&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Mon Sep 7 17:42:05 2009 @@ -2024,6 +2024,11 @@ /// we punt. We basically just support direct accesses to globals and GEP's of /// globals. This should be kept up to date with CommitValueTo. static bool isSimpleEnoughPointerToCommit(Constant *C, LLVMContext &Context) { + // Conservatively, avoid aggregate types. This is because we don't + // want to worry about them partially overlapping other stores. + if (!cast(C->getType())->getElementType()->isSingleValueType()) + return false; + if (GlobalVariable *GV = dyn_cast(C)) // Do not allow weak/linkonce/dllimport/dllexport linkage or // external globals. From gohman at apple.com Mon Sep 7 17:44:55 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 07 Sep 2009 22:44:55 -0000 Subject: [llvm-commits] [llvm] r81165 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200909072244.n87MitX1012225@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 7 17:44:55 2009 New Revision: 81165 URL: http://llvm.org/viewvc/llvm-project?rev=81165&view=rev Log: Don't commit stores with addresses that have indices that are not compile-time constant integers or that are out of bounds for their corresponding static array types. These can cause aliasing that GlobalOpt assumes won't happen. 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=81165&r1=81164&r2=81165&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Mon Sep 7 17:44:55 2009 @@ -2044,6 +2044,27 @@ // external globals. if (!GV->hasDefinitiveInitializer()) return false; + + gep_type_iterator GEPI = gep_type_begin(CE), E = gep_type_end(CE); + User::op_iterator OI = next(CE->op_begin()); + + // The first index must be zero. + ConstantInt *CI = dyn_cast(*OI); + if (!CI || !CI->isZero()) return false; + ++GEPI; + ++OI; + + // The remaining indices must be compile-time known integers within the + // bounds of the corresponding static array types. + for (; GEPI != E; ++GEPI, ++OI) { + CI = dyn_cast(*OI); + if (!CI) return false; + if (const ArrayType *ATy = dyn_cast(*GEPI)) + if (CI->getValue().getActiveBits() > 64 || + CI->getZExtValue() >= ATy->getNumElements()) + return false; + } + return ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE, Context); } From gohman at apple.com Mon Sep 7 17:45:41 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 07 Sep 2009 22:45:41 -0000 Subject: [llvm-commits] [llvm] r81166 - in /llvm/trunk/test/Transforms/GlobalOpt: ctor-list-opt-dbg.ll ctor-list-opt.ll Message-ID: <200909072245.n87MjfOD012329@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 7 17:45:41 2009 New Revision: 81166 URL: http://llvm.org/viewvc/llvm-project?rev=81166&view=rev Log: Add inbounds to these getelementptrs, now that GlobalOpt requires this, to preserve the meaning of these tests. Modified: llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt.ll Modified: llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll?rev=81166&r1=81165&r2=81166&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll (original) +++ llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll Mon Sep 7 17:45:41 2009 @@ -56,9 +56,9 @@ } define internal void @CTOR5() { - %X.2p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; [#uses=2] + %X.2p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; [#uses=2] %X.2 = load i32* %X.2p ; [#uses=1] - %X.1p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 0 ; [#uses=1] + %X.1p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 0 ; [#uses=1] store i32 %X.2, i32* %X.1p store i32 42, i32* %X.2p ret void Modified: llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt.ll?rev=81166&r1=81165&r2=81166&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt.ll (original) +++ llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt.ll Mon Sep 7 17:45:41 2009 @@ -43,9 +43,9 @@ } define internal void @CTOR5() { - %X.2p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; [#uses=2] + %X.2p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; [#uses=2] %X.2 = load i32* %X.2p ; [#uses=1] - %X.1p = getelementptr { i32, [2 x i32] }* @X, i32 0, i32 0 ; [#uses=1] + %X.1p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 0 ; [#uses=1] store i32 %X.2, i32* %X.1p store i32 42, i32* %X.2p ret void From sabre at nondot.org Mon Sep 7 17:52:39 2009 From: sabre at nondot.org (Chris Lattner) Date: Mon, 07 Sep 2009 22:52:39 -0000 Subject: [llvm-commits] [llvm] r81167 - /llvm/trunk/docs/LangRef.html Message-ID: <200909072252.n87MqeUV013174@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 17:52:39 2009 New Revision: 81167 URL: http://llvm.org/viewvc/llvm-project?rev=81167&view=rev Log: describe undef semantics in some more detail. Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=81167&r1=81166&r2=81167&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Mon Sep 7 17:52:39 2009 @@ -2016,13 +2016,109 @@
-

The string 'undef' is recognized as a type-less constant that has no - specific value. Undefined values may be of any type and be used anywhere a - constant is permitted.

+

The string 'undef' can be used anywhere a constant is expected, and + indicates that the user of the value may recieve an unspecified bit-pattern. + Undefined values may be of any type (other than label or void) and be used + anywhere a constant is permitted.

+ +

Undefined values are useful, because it indicates to the compiler that the + program is well defined no matter what value is used. This gives the + compiler more freedom to optimize. Here are some examples of (potentially + surprising) transformations that are valid (in pseudo IR):

-

Undefined values indicate to the compiler that the program is well defined no - matter what value is used, giving the compiler more freedom to optimize.

+
+
+  %A = add %X, undef
+  %B = sub %X, undef
+  %C = xor %X, undef
+Safe:
+  %A = undef
+  %B = undef
+  %C = undef
+
+
+ +

This is safe because all of the output bits are affected by the undef bits. +Any output bit can have a zero or one depending on the input bits.

+ +
+
+  %A = or %X, undef
+  %B = and %X, undef
+Safe:
+  %A = -1
+  %B = 0
+Unsafe:
+  %A = undef
+  %B = undef
+
+
+ +

These logical operations have bits that are not always affected by the input. +For example, if "%X" has a zero bit, then the output of the 'and' operation will +always be a zero, no matter what the corresponding bit from the undef is. As +such, it is unsafe to optimizer or assume that the result of the and is undef. +However, it is safe to assume that all bits of the undef are 0, and optimize the +and to 0. Likewise, it is safe to assume that all the bits of the undef operand +to the or could be set, allowing the or to be folded to -1.

+ +
+
+  %A = select undef, %X, %Y
+  %B = select undef, 42, %Y
+  %C = select %X, %Y, undef
+Safe:
+  %A = %X     (or %Y)
+  %B = 42     (or %Y)
+  %C = %Y
+Unsafe:
+  %A = undef
+  %B = undef
+  %C = undef
+
+
+ +

This set of examples show that undefined select (and conditional branch) +conditions can go "either way" but they have to come from one of the two +operands. In the %A example, if %X and %Y were both known to have a clear low +bit, then %A would have to have a cleared low bit. However, in the %C example, +the optimizer is allowed to assume that the undef operand could be the same as +%Y, allowing the whole select to be eliminated.

+ + +
+
+  %A = xor undef, undef
+  
+  %B = undef
+  %C = xor %B, %B
+
+  %D = undef
+  %E = icmp lt %D, 4
+  %F = icmp gte %D, 4
+
+Safe:
+  %A = undef
+  %B = undef
+  %C = undef
+  %D = undef
+  %E = undef
+  %F = undef
+
+
+ +

This example points out that two undef operands are not necessarily the same. +This can be surprising to people (and also matches C semantics) where they +assume that "X^X" is always zero, even if X is undef. This isn't true for a +number of reasons, but the short answer is that an undef "variable" can +arbitrarily change its value over its "live range". This is true because the +"variable" doesn't actually have a live range. Instead, the value is +logically read from arbitrary registers that happen to be around when needed, +so the value is not neccesarily consistent over time. In fact, %A and %C need +to have the same semantics of the core LLVM "replace all uses with" concept +would not hold.

+
From gohman at apple.com Mon Sep 7 18:04:59 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 07 Sep 2009 23:04:59 -0000 Subject: [llvm-commits] [llvm] r81168 - /llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll Message-ID: <200909072304.n87N4xHi014865@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 7 18:04:59 2009 New Revision: 81168 URL: http://llvm.org/viewvc/llvm-project?rev=81168&view=rev Log: Add a testcase for the GlobalOpt inbounds fix. Added: llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll Added: llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll?rev=81168&view=auto ============================================================================== --- llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll (added) +++ llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll Mon Sep 7 18:04:59 2009 @@ -0,0 +1,23 @@ +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | FileCheck %s + +; Don't get fooled by the inbounds keyword; it doesn't change +; the computed address. + +; CHECK: @H = global i32 2 +; CHECK: @I = global i32 2 + + at llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR } ] + at addr = external global i32 + at G = internal global [6 x [5 x i32]] zeroinitializer + at H = global i32 80 + at I = global i32 90 + +define internal void @CTOR() { + store i32 1, i32* getelementptr ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) + store i32 2, i32* getelementptr inbounds ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) + %t = load i32* getelementptr ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) + store i32 %t, i32* @H + %s = load i32* getelementptr inbounds ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) + store i32 %s, i32* @I + ret void +} From sabre at nondot.org Mon Sep 7 18:33:52 2009 From: sabre at nondot.org (Chris Lattner) Date: Mon, 07 Sep 2009 23:33:52 -0000 Subject: [llvm-commits] [llvm] r81170 - /llvm/trunk/docs/LangRef.html Message-ID: <200909072333.n87NXqwI018462@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 18:33:52 2009 New Revision: 81170 URL: http://llvm.org/viewvc/llvm-project?rev=81170&view=rev Log: add some more notes. Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=81170&r1=81169&r2=81170&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Mon Sep 7 18:33:52 2009 @@ -2118,7 +2118,46 @@ so the value is not neccesarily consistent over time. In fact, %A and %C need to have the same semantics of the core LLVM "replace all uses with" concept would not hold.

- + +
+
+  %A = fdiv undef, %X
+  %B = fdiv %X, undef
+Safe:
+  %A = undef
+b: unreachable
+
+
+ +

These examples show the crucial difference between an undefined +value and undefined behavior. An undefined value (like undef) is +allowed to have an arbitrary bit-pattern. This means that the %A operation +can be constant folded to undef because the undef could be an SNaN, and fdiv is +not (currently) defined on SNaN's. However, in the second example, we can make +a more aggressive assumption: because the undef is allowed to be an arbitrary +value, we are allowed to assume that it could be zero. Since a divide by zero +is has undefined behavior, we are allowed to assume that the operation +does not execute at all. This allows us to delete the divide and all code after +it: since the undefined operation "can't happen", the optimizer can assume that +it occurs in dead code. +

+ +
+
+a:  store undef -> %X
+b:  store %X -> undef
+Safe:
+a: <deleted>
+b: unreachable
+
+
+ +

These examples reiterate the fdiv example: a store "of" an undefined value +can be assumed to not have any effect: we can assume that the value is +overwritten with bits that happen to match what was already there. However, a +store "to" an undefined location could clobber arbitrary memory, therefore, it +has undefined behavior.

+ From gohman at apple.com Mon Sep 7 18:47:14 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 07 Sep 2009 23:47:14 -0000 Subject: [llvm-commits] [llvm] r81171 - in /llvm/trunk: lib/CodeGen/SelectionDAG/FastISel.cpp test/CodeGen/X86/fast-isel-fneg.ll Message-ID: <200909072347.n87NlEv9020080@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 7 18:47:14 2009 New Revision: 81171 URL: http://llvm.org/viewvc/llvm-project?rev=81171&view=rev Log: Fix a thinko: When lowering fneg with xor, bitcast the operands from floating-point to integer first, and bitcast the result back to floating-point. Previously, this test was passing by falling back to SelectionDAG lowering. The resulting code isn't as nice, but it's correct and CodeGen now stays on the fast path. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=81171&r1=81170&r2=81171&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Sep 7 18:47:14 2009 @@ -615,12 +615,25 @@ unsigned OpReg = getRegForValue(BinaryOperator::getFNegArgument(I)); if (OpReg == 0) return false; - // Twiddle the sign bit with xor. + // Bitcast the value to integer, twiddle the sign bit with xor, + // and then bitcast it back to floating-point. EVT VT = TLI.getValueType(I->getType()); if (VT.getSizeInBits() > 64) return false; - unsigned ResultReg = FastEmit_ri_(VT.getSimpleVT(), ISD::XOR, OpReg, - UINT64_C(1) << (VT.getSizeInBits()-1), - VT.getSimpleVT()); + EVT IntVT = EVT::getIntegerVT(I->getContext(), VT.getSizeInBits()); + + unsigned IntReg = FastEmit_r(VT.getSimpleVT(), IntVT.getSimpleVT(), + ISD::BIT_CONVERT, OpReg); + if (IntReg == 0) + return false; + + unsigned IntResultReg = FastEmit_ri_(IntVT.getSimpleVT(), ISD::XOR, IntReg, + UINT64_C(1) << (VT.getSizeInBits()-1), + IntVT.getSimpleVT()); + if (IntResultReg == 0) + return false; + + unsigned ResultReg = FastEmit_r(IntVT.getSimpleVT(), VT.getSimpleVT(), + ISD::BIT_CONVERT, IntResultReg); if (ResultReg == 0) return false; Modified: llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll?rev=81171&r1=81170&r2=81171&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel-fneg.ll Mon Sep 7 18:47:14 2009 @@ -1,14 +1,14 @@ -; RUN: llvm-as < %s | llc -fast-isel -march=x86-64 | FileCheck %s +; RUN: llvm-as < %s | llc -fast-isel -fast-isel-abort -march=x86-64 | FileCheck %s ; CHECK: doo: -; CHECK: xorpd +; CHECK: xor define double @doo(double %x) nounwind { %y = fsub double -0.0, %x ret double %y } ; CHECK: foo: -; CHECK: xorps +; CHECK: xor define float @foo(float %x) nounwind { %y = fsub float -0.0, %x ret float %y From gohman at apple.com Mon Sep 7 18:54:19 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 07 Sep 2009 23:54:19 -0000 Subject: [llvm-commits] [llvm] r81172 - in /llvm/trunk: include/llvm/Constants.h include/llvm/InstrTypes.h include/llvm/Instructions.h include/llvm/Operator.h include/llvm/Value.h lib/AsmParser/LLParser.cpp lib/Bitcode/Reader/BitcodeReader.cpp lib/Transforms/Scalar/InstructionCombining.cpp lib/VMCore/Constants.cpp lib/VMCore/ConstantsContext.h lib/VMCore/Instructions.cpp test/Assembler/flags-plain.ll test/Assembler/flags-reversed.ll test/Assembler/flags-signed.ll test/Assembler/flags-unsigned.ll test/Assembler/flags.ll Message-ID: <200909072354.n87NsKJ8020974@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 7 18:54:19 2009 New Revision: 81172 URL: http://llvm.org/viewvc/llvm-project?rev=81172&view=rev Log: Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed. Removed: llvm/trunk/test/Assembler/flags-plain.ll llvm/trunk/test/Assembler/flags-reversed.ll llvm/trunk/test/Assembler/flags-signed.ll llvm/trunk/test/Assembler/flags-unsigned.ll Modified: llvm/trunk/include/llvm/Constants.h llvm/trunk/include/llvm/InstrTypes.h llvm/trunk/include/llvm/Instructions.h llvm/trunk/include/llvm/Operator.h llvm/trunk/include/llvm/Value.h llvm/trunk/lib/AsmParser/LLParser.cpp llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/lib/VMCore/Constants.cpp llvm/trunk/lib/VMCore/ConstantsContext.h llvm/trunk/lib/VMCore/Instructions.cpp llvm/trunk/test/Assembler/flags.ll Modified: llvm/trunk/include/llvm/Constants.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Constants.h?rev=81172&r1=81171&r2=81172&view=diff ============================================================================== --- llvm/trunk/include/llvm/Constants.h (original) +++ llvm/trunk/include/llvm/Constants.h Mon Sep 7 18:54:19 2009 @@ -571,13 +571,17 @@ // These private methods are used by the type resolution code to create // ConstantExprs in intermediate forms. static Constant *getTy(const Type *Ty, unsigned Opcode, - Constant *C1, Constant *C2); + Constant *C1, Constant *C2, + unsigned Flags = 0); static Constant *getCompareTy(unsigned short pred, Constant *C1, Constant *C2); static Constant *getSelectTy(const Type *Ty, Constant *C1, Constant *C2, Constant *C3); static Constant *getGetElementPtrTy(const Type *Ty, Constant *C, Value* const *Idxs, unsigned NumIdxs); + static Constant *getInBoundsGetElementPtrTy(const Type *Ty, Constant *C, + Value* const *Idxs, + unsigned NumIdxs); static Constant *getExtractElementTy(const Type *Ty, Constant *Val, Constant *Idx); static Constant *getInsertElementTy(const Type *Ty, Constant *Val, @@ -718,7 +722,8 @@ /// get - Return a binary or shift operator constant expression, /// folding if possible. /// - static Constant *get(unsigned Opcode, Constant *C1, Constant *C2); + static Constant *get(unsigned Opcode, Constant *C1, Constant *C2, + unsigned Flags = 0); /// @brief Return an ICmp or FCmp comparison operator constant expression. static Constant *getCompare(unsigned short pred, Constant *C1, Constant *C2); Modified: llvm/trunk/include/llvm/InstrTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InstrTypes.h?rev=81172&r1=81171&r2=81172&view=diff ============================================================================== --- llvm/trunk/include/llvm/InstrTypes.h (original) +++ llvm/trunk/include/llvm/InstrTypes.h Mon Sep 7 18:54:19 2009 @@ -200,19 +200,19 @@ static BinaryOperator *CreateNSWAdd(Value *V1, Value *V2, const Twine &Name = "") { BinaryOperator *BO = CreateAdd(V1, V2, Name); - cast(BO)->setHasNoSignedWrap(true); + BO->setHasNoSignedWrap(true); return BO; } static BinaryOperator *CreateNSWAdd(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { BinaryOperator *BO = CreateAdd(V1, V2, Name, BB); - cast(BO)->setHasNoSignedWrap(true); + BO->setHasNoSignedWrap(true); return BO; } static BinaryOperator *CreateNSWAdd(Value *V1, Value *V2, const Twine &Name, Instruction *I) { BinaryOperator *BO = CreateAdd(V1, V2, Name, I); - cast(BO)->setHasNoSignedWrap(true); + BO->setHasNoSignedWrap(true); return BO; } @@ -221,19 +221,19 @@ static BinaryOperator *CreateExactSDiv(Value *V1, Value *V2, const Twine &Name = "") { BinaryOperator *BO = CreateSDiv(V1, V2, Name); - cast(BO)->setIsExact(true); + BO->setIsExact(true); return BO; } static BinaryOperator *CreateExactSDiv(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { BinaryOperator *BO = CreateSDiv(V1, V2, Name, BB); - cast(BO)->setIsExact(true); + BO->setIsExact(true); return BO; } static BinaryOperator *CreateExactSDiv(Value *V1, Value *V2, const Twine &Name, Instruction *I) { BinaryOperator *BO = CreateSDiv(V1, V2, Name, I); - cast(BO)->setIsExact(true); + BO->setIsExact(true); return BO; } @@ -287,6 +287,21 @@ /// bool swapOperands(); + /// setHasNoUnsignedWrap - Set or clear the nsw flag on this instruction, + /// which must be an operator which supports this flag. See LangRef.html + /// for the meaning of this flag. + void setHasNoUnsignedWrap(bool); + + /// setHasNoSignedWrap - Set or clear the nsw flag on this instruction, + /// which must be an operator which supports this flag. See LangRef.html + /// for the meaning of this flag. + void setHasNoSignedWrap(bool); + + /// setIsExact - Set or clear the exact flag on this instruction, + /// which must be an operator which supports this flag. See LangRef.html + /// for the meaning of this flag. + void setIsExact(bool); + // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const BinaryOperator *) { return true; } static inline bool classof(const Instruction *I) { Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=81172&r1=81171&r2=81172&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Mon Sep 7 18:54:19 2009 @@ -496,7 +496,7 @@ Instruction *InsertBefore = 0) { GetElementPtrInst *GEP = Create(Ptr, IdxBegin, IdxEnd, NameStr, InsertBefore); - cast(GEP)->setIsInBounds(true); + GEP->setIsInBounds(true); return GEP; } template @@ -507,21 +507,21 @@ BasicBlock *InsertAtEnd) { GetElementPtrInst *GEP = Create(Ptr, IdxBegin, IdxEnd, NameStr, InsertAtEnd); - cast(GEP)->setIsInBounds(true); + GEP->setIsInBounds(true); return GEP; } static GetElementPtrInst *CreateInBounds(Value *Ptr, Value *Idx, const Twine &NameStr = "", Instruction *InsertBefore = 0) { GetElementPtrInst *GEP = Create(Ptr, Idx, NameStr, InsertBefore); - cast(GEP)->setIsInBounds(true); + GEP->setIsInBounds(true); return GEP; } static GetElementPtrInst *CreateInBounds(Value *Ptr, Value *Idx, const Twine &NameStr, BasicBlock *InsertAtEnd) { GetElementPtrInst *GEP = Create(Ptr, Idx, NameStr, InsertAtEnd); - cast(GEP)->setIsInBounds(true); + GEP->setIsInBounds(true); return GEP; } @@ -602,6 +602,10 @@ /// a constant offset between them. bool hasAllConstantIndices() const; + /// setIsInBounds - Set or clear the inbounds flag on this GEP instruction. + /// See LangRef.html for the meaning of inbounds on a getelementptr. + void setIsInBounds(bool); + // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const GetElementPtrInst *) { return true; } static inline bool classof(const Instruction *I) { Modified: llvm/trunk/include/llvm/Operator.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Operator.h?rev=81172&r1=81171&r2=81172&view=diff ============================================================================== --- llvm/trunk/include/llvm/Operator.h (original) +++ llvm/trunk/include/llvm/Operator.h Mon Sep 7 18:54:19 2009 @@ -21,6 +21,8 @@ namespace llvm { class GetElementPtrInst; +class BinaryOperator; +class ConstantExpr; /// Operator - This is a utility class that provides an abstraction for the /// common functionality between Instructions and ConstantExprs. @@ -67,24 +69,37 @@ /// despite that operator having the potential for overflow. /// class OverflowingBinaryOperator : public Operator { +public: + enum { + NoUnsignedWrap = (1 << 0), + NoSignedWrap = (1 << 1) + }; + +private: ~OverflowingBinaryOperator(); // do not implement + + friend class BinaryOperator; + friend class ConstantExpr; + void setHasNoUnsignedWrap(bool B) { + SubclassOptionalData = + (SubclassOptionalData & ~NoUnsignedWrap) | (B * NoUnsignedWrap); + } + void setHasNoSignedWrap(bool B) { + SubclassOptionalData = + (SubclassOptionalData & ~NoSignedWrap) | (B * NoSignedWrap); + } + public: /// hasNoUnsignedWrap - Test whether this operation is known to never /// undergo unsigned overflow, aka the nuw property. bool hasNoUnsignedWrap() const { - return SubclassOptionalData & (1 << 0); - } - void setHasNoUnsignedWrap(bool B) { - SubclassOptionalData = (SubclassOptionalData & ~(1 << 0)) | (B << 0); + return SubclassOptionalData & NoUnsignedWrap; } /// hasNoSignedWrap - Test whether this operation is known to never /// undergo signed overflow, aka the nsw property. bool hasNoSignedWrap() const { - return SubclassOptionalData & (1 << 1); - } - void setHasNoSignedWrap(bool B) { - SubclassOptionalData = (SubclassOptionalData & ~(1 << 1)) | (B << 1); + return SubclassOptionalData & NoSignedWrap; } static inline bool classof(const OverflowingBinaryOperator *) { return true; } @@ -161,15 +176,25 @@ /// SDivOperator - An Operator with opcode Instruction::SDiv. /// class SDivOperator : public Operator { +public: + enum { + IsExact = (1 << 0) + }; + +private: ~SDivOperator(); // do not implement + + friend class BinaryOperator; + friend class ConstantExpr; + void setIsExact(bool B) { + SubclassOptionalData = (SubclassOptionalData & ~IsExact) | (B * IsExact); + } + public: /// isExact - Test whether this division is known to be exact, with /// zero remainder. bool isExact() const { - return SubclassOptionalData & (1 << 0); - } - void setIsExact(bool B) { - SubclassOptionalData = (SubclassOptionalData & ~(1 << 0)) | (B << 0); + return SubclassOptionalData & IsExact; } // Methods for support type inquiry through isa, cast, and dyn_cast: @@ -187,15 +212,24 @@ }; class GEPOperator : public Operator { + enum { + IsInBounds = (1 << 0) + }; + ~GEPOperator(); // do not implement + + friend class GetElementPtrInst; + friend class ConstantExpr; + void setIsInBounds(bool B) { + SubclassOptionalData = + (SubclassOptionalData & ~IsInBounds) | (B * IsInBounds); + } + public: /// isInBounds - Test whether this is an inbounds GEP, as defined /// by LangRef.html. bool isInBounds() const { - return SubclassOptionalData & (1 << 0); - } - void setIsInBounds(bool B) { - SubclassOptionalData = (SubclassOptionalData & ~(1 << 0)) | (B << 0); + return SubclassOptionalData & IsInBounds; } inline op_iterator idx_begin() { return op_begin()+1; } Modified: llvm/trunk/include/llvm/Value.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=81172&r1=81171&r2=81172&view=diff ============================================================================== --- llvm/trunk/include/llvm/Value.h (original) +++ llvm/trunk/include/llvm/Value.h Mon Sep 7 18:54:19 2009 @@ -146,12 +146,6 @@ // Only use when in type resolution situations! void uncheckedReplaceAllUsesWith(Value *V); - /// clearOptionalData - Clear any optional optimization data from this Value. - /// Transformation passes must call this method whenever changing the IR - /// in a way that would affect the values produced by this Value, unless - /// it takes special care to ensure correctness in some other way. - void clearOptionalData() { SubclassOptionalData = 0; } - //---------------------------------------------------------------------- // Methods for handling the chain of uses of this Value. // @@ -240,6 +234,13 @@ return SubclassID; } + /// getRawSubclassOptionalData - Return the raw optional flags value + /// contained in this value. This should only be used when testing two + /// Values for equivalence. + unsigned getRawSubclassOptionalData() const { + return SubclassOptionalData; + } + /// hasSameSubclassOptionalData - Test whether the optional flags contained /// in this value are equal to the optional flags in the given value. bool hasSameSubclassOptionalData(const Value *V) const { Modified: llvm/trunk/lib/AsmParser/LLParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=81172&r1=81171&r2=81172&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) +++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Sep 7 18:54:19 2009 @@ -2095,13 +2095,11 @@ if (!Val0->getType()->isIntOrIntVector() && !Val0->getType()->isFPOrFPVector()) return Error(ID.Loc,"constexpr requires integer, fp, or vector operands"); - Constant *C = ConstantExpr::get(Opc, Val0, Val1); - if (NUW) - cast(C)->setHasNoUnsignedWrap(true); - if (NSW) - cast(C)->setHasNoSignedWrap(true); - if (Exact) - cast(C)->setIsExact(true); + unsigned Flags = 0; + if (NUW) Flags |= OverflowingBinaryOperator::NoUnsignedWrap; + if (NSW) Flags |= OverflowingBinaryOperator::NoSignedWrap; + if (Exact) Flags |= SDivOperator::IsExact; + Constant *C = ConstantExpr::get(Opc, Val0, Val1, Flags); ID.ConstantVal = C; ID.Kind = ValID::t_Constant; return false; @@ -2157,10 +2155,12 @@ (Value**)(Elts.data() + 1), Elts.size() - 1)) return Error(ID.Loc, "invalid indices for getelementptr"); - ID.ConstantVal = ConstantExpr::getGetElementPtr(Elts[0], - Elts.data() + 1, Elts.size() - 1); - if (InBounds) - cast(ID.ConstantVal)->setIsInBounds(true); + ID.ConstantVal = InBounds ? + ConstantExpr::getInBoundsGetElementPtr(Elts[0], + Elts.data() + 1, + Elts.size() - 1) : + ConstantExpr::getGetElementPtr(Elts[0], + Elts.data() + 1, Elts.size() - 1); } else if (Opc == Instruction::Select) { if (Elts.size() != 3) return Error(ID.Loc, "expected three operands to select"); @@ -2681,9 +2681,9 @@ return Error(ModifierLoc, "nsw only applies to integer operations"); } if (NUW) - cast(Inst)->setHasNoUnsignedWrap(true); + cast(Inst)->setHasNoUnsignedWrap(true); if (NSW) - cast(Inst)->setHasNoSignedWrap(true); + cast(Inst)->setHasNoSignedWrap(true); } return Result; } @@ -2698,7 +2698,7 @@ bool Result = ParseArithmetic(Inst, PFS, KeywordVal, 1); if (!Result) if (Exact) - cast(Inst)->setIsExact(true); + cast(Inst)->setIsExact(true); return Result; } @@ -3501,7 +3501,7 @@ return Error(Loc, "invalid getelementptr indices"); Inst = GetElementPtrInst::Create(Ptr, Indices.begin(), Indices.end()); if (InBounds) - cast(Inst)->setIsInBounds(true); + cast(Inst)->setIsInBounds(true); return false; } Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=81172&r1=81171&r2=81172&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon Sep 7 18:54:19 2009 @@ -883,19 +883,6 @@ return false; } -static void SetOptimizationFlags(Value *V, uint64_t Flags) { - if (OverflowingBinaryOperator *OBO = - dyn_cast(V)) { - if (Flags & (1 << bitc::OBO_NO_SIGNED_WRAP)) - OBO->setHasNoSignedWrap(true); - if (Flags & (1 << bitc::OBO_NO_UNSIGNED_WRAP)) - OBO->setHasNoUnsignedWrap(true); - } else if (SDivOperator *Div = dyn_cast(V)) { - if (Flags & (1 << bitc::SDIV_EXACT)) - Div->setIsExact(true); - } -} - bool BitcodeReader::ParseConstants() { if (Stream.EnterSubBlock(bitc::CONSTANTS_BLOCK_ID)) return Error("Malformed block record"); @@ -1047,10 +1034,22 @@ } else { Constant *LHS = ValueList.getConstantFwdRef(Record[1], CurTy); Constant *RHS = ValueList.getConstantFwdRef(Record[2], CurTy); - V = ConstantExpr::get(Opc, LHS, RHS); + unsigned Flags = 0; + if (Record.size() >= 4) { + if (Opc == Instruction::Add || + Opc == Instruction::Sub || + Opc == Instruction::Mul) { + if (Record[3] & (1 << bitc::OBO_NO_SIGNED_WRAP)) + Flags |= OverflowingBinaryOperator::NoSignedWrap; + if (Record[3] & (1 << bitc::OBO_NO_UNSIGNED_WRAP)) + Flags |= OverflowingBinaryOperator::NoUnsignedWrap; + } else if (Opc == Instruction::SDiv) { + if (Record[3] & (1 << bitc::SDIV_EXACT)) + Flags |= SDivOperator::IsExact; + } + } + V = ConstantExpr::get(Opc, LHS, RHS, Flags); } - if (Record.size() >= 4) - SetOptimizationFlags(V, Record[3]); break; } case bitc::CST_CODE_CE_CAST: { // CE_CAST: [opcode, opty, opval] @@ -1075,10 +1074,12 @@ if (!ElTy) return Error("Invalid CE_GEP record"); Elts.push_back(ValueList.getConstantFwdRef(Record[i+1], ElTy)); } - V = ConstantExpr::getGetElementPtr(Elts[0], &Elts[1], - Elts.size()-1); if (BitCode == bitc::CST_CODE_CE_INBOUNDS_GEP) - cast(V)->setIsInBounds(true); + V = ConstantExpr::getInBoundsGetElementPtr(Elts[0], &Elts[1], + Elts.size()-1); + else + V = ConstantExpr::getGetElementPtr(Elts[0], &Elts[1], + Elts.size()-1); break; } case bitc::CST_CODE_CE_SELECT: // CE_SELECT: [opval#, opval#, opval#] @@ -1610,8 +1611,19 @@ int Opc = GetDecodedBinaryOpcode(Record[OpNum++], LHS->getType()); if (Opc == -1) return Error("Invalid BINOP record"); I = BinaryOperator::Create((Instruction::BinaryOps)Opc, LHS, RHS); - if (OpNum < Record.size()) - SetOptimizationFlags(I, Record[3]); + if (OpNum < Record.size()) { + if (Opc == Instruction::Add || + Opc == Instruction::Sub || + Opc == Instruction::Mul) { + if (Record[3] & (1 << bitc::OBO_NO_SIGNED_WRAP)) + cast(I)->setHasNoSignedWrap(true); + if (Record[3] & (1 << bitc::OBO_NO_UNSIGNED_WRAP)) + cast(I)->setHasNoUnsignedWrap(true); + } else if (Opc == Instruction::SDiv) { + if (Record[3] & (1 << bitc::SDIV_EXACT)) + cast(I)->setIsExact(true); + } + } break; } case bitc::FUNC_CODE_INST_CAST: { // CAST: [opval, opty, destty, castopc] @@ -1645,7 +1657,7 @@ I = GetElementPtrInst::Create(BasePtr, GEPIdx.begin(), GEPIdx.end()); if (BitCode == bitc::FUNC_CODE_INST_INBOUNDS_GEP) - cast(I)->setIsInBounds(true); + cast(I)->setIsInBounds(true); break; } Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=81172&r1=81171&r2=81172&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Sep 7 18:54:19 2009 @@ -8086,11 +8086,11 @@ // If we were able to index down into an element, create the GEP // and bitcast the result. This eliminates one bitcast, potentially // two. - Value *NGEP = Builder->CreateGEP(OrigBase, NewIndices.begin(), - NewIndices.end()); + Value *NGEP = cast(GEP)->isInBounds() ? + Builder->CreateInBoundsGEP(OrigBase, + NewIndices.begin(), NewIndices.end()) : + Builder->CreateGEP(OrigBase, NewIndices.begin(), NewIndices.end()); NGEP->takeName(GEP); - if (isa(NGEP) && cast(GEP)->isInBounds()) - cast(NGEP)->setIsInBounds(true); if (isa(CI)) return new BitCastInst(NGEP, CI.getType()); @@ -8805,11 +8805,8 @@ // If we found a path from the src to dest, create the getelementptr now. if (SrcElTy == DstElTy) { SmallVector Idxs(NumZeros+1, ZeroUInt); - Instruction *GEP = GetElementPtrInst::Create(Src, - Idxs.begin(), Idxs.end(), "", - ((Instruction*) NULL)); - cast(GEP)->setIsInBounds(true); - return GEP; + return GetElementPtrInst::CreateInBounds(Src, Idxs.begin(), Idxs.end(), "", + ((Instruction*) NULL)); } } @@ -10481,12 +10478,11 @@ } Value *Base = FixedOperands[0]; - GetElementPtrInst *GEP = + return cast(FirstInst)->isInBounds() ? + GetElementPtrInst::CreateInBounds(Base, FixedOperands.begin()+1, + FixedOperands.end()) : GetElementPtrInst::Create(Base, FixedOperands.begin()+1, FixedOperands.end()); - if (cast(FirstInst)->isInBounds()) - cast(GEP)->setIsInBounds(true); - return GEP; } @@ -10889,14 +10885,13 @@ Indices.append(GEP.idx_begin()+1, GEP.idx_end()); } - if (!Indices.empty()) { - GetElementPtrInst *NewGEP = + if (!Indices.empty()) + return (cast(&GEP)->isInBounds() && + Src->isInBounds()) ? + GetElementPtrInst::CreateInBounds(Src->getOperand(0), Indices.begin(), + Indices.end(), GEP.getName()) : GetElementPtrInst::Create(Src->getOperand(0), Indices.begin(), Indices.end(), GEP.getName()); - if (cast(&GEP)->isInBounds() && Src->isInBounds()) - cast(NewGEP)->setIsInBounds(true); - return NewGEP; - } } // Handle gep(bitcast x) and gep(gep x, 0, 0, 0). @@ -10926,12 +10921,11 @@ if (CATy->getElementType() == XTy->getElementType()) { // -> GEP i8* X, ... SmallVector Indices(GEP.idx_begin()+1, GEP.idx_end()); - GetElementPtrInst *NewGEP = + return cast(&GEP)->isInBounds() ? + GetElementPtrInst::CreateInBounds(X, Indices.begin(), Indices.end(), + GEP.getName()) : GetElementPtrInst::Create(X, Indices.begin(), Indices.end(), GEP.getName()); - if (cast(&GEP)->isInBounds()) - cast(NewGEP)->setIsInBounds(true); - return NewGEP; } if (const ArrayType *XATy = dyn_cast(XTy->getElementType())){ @@ -10959,10 +10953,9 @@ Value *Idx[2]; Idx[0] = Constant::getNullValue(Type::getInt32Ty(*Context)); Idx[1] = GEP.getOperand(1); - Value *NewGEP = + Value *NewGEP = cast(&GEP)->isInBounds() ? + Builder->CreateInBoundsGEP(X, Idx, Idx + 2, GEP.getName()) : Builder->CreateGEP(X, Idx, Idx + 2, GEP.getName()); - if (cast(&GEP)->isInBounds()) - cast(NewGEP)->setIsInBounds(true); // V and GEP are both pointer types --> BitCast return new BitCastInst(NewGEP, GEP.getType()); } @@ -11019,9 +11012,9 @@ Value *Idx[2]; Idx[0] = Constant::getNullValue(Type::getInt32Ty(*Context)); Idx[1] = NewIdx; - Value *NewGEP = Builder->CreateGEP(X, Idx, Idx + 2, GEP.getName()); - if (cast(&GEP)->isInBounds()) - cast(NewGEP)->setIsInBounds(true); + Value *NewGEP = cast(&GEP)->isInBounds() ? + Builder->CreateInBoundsGEP(X, Idx, Idx + 2, GEP.getName()) : + Builder->CreateGEP(X, Idx, Idx + 2, GEP.getName()); // The NewGEP must be pointer typed, so must the old one -> BitCast return new BitCastInst(NewGEP, GEP.getType()); } @@ -11069,10 +11062,11 @@ const Type *InTy = cast(BCI->getOperand(0)->getType())->getElementType(); if (FindElementAtOffset(InTy, Offset, NewIndices, TD, Context)) { - Value *NGEP = Builder->CreateGEP(BCI->getOperand(0), NewIndices.begin(), - NewIndices.end()); - if (cast(&GEP)->isInBounds()) - cast(NGEP)->setIsInBounds(true); + Value *NGEP = cast(&GEP)->isInBounds() ? + Builder->CreateInBoundsGEP(BCI->getOperand(0), NewIndices.begin(), + NewIndices.end()) : + Builder->CreateGEP(BCI->getOperand(0), NewIndices.begin(), + NewIndices.end()); if (NGEP->getType() == GEP.getType()) return ReplaceInstUsesWith(GEP, NGEP); @@ -11115,9 +11109,8 @@ Value *Idx[2]; Idx[0] = NullIdx; Idx[1] = NullIdx; - Value *V = GetElementPtrInst::Create(New, Idx, Idx + 2, - New->getName()+".sub", It); - cast(V)->setIsInBounds(true); + Value *V = GetElementPtrInst::CreateInBounds(New, Idx, Idx + 2, + New->getName()+".sub", It); // Now make everything use the getelementptr instead of the original // allocation. @@ -11486,11 +11479,9 @@ // SIOp0 is a pointer to aggregate and this is a store to the first field, // emit a GEP to index into its first field. - if (!NewGEPIndices.empty()) { - CastOp = IC.Builder->CreateGEP(CastOp, NewGEPIndices.begin(), - NewGEPIndices.end()); - cast(CastOp)->setIsInBounds(true); - } + if (!NewGEPIndices.empty()) + CastOp = IC.Builder->CreateInBoundsGEP(CastOp, NewGEPIndices.begin(), + NewGEPIndices.end()); NewCast = IC.Builder->CreateCast(opcode, SIOp0, CastDstTy, SIOp0->getName()+".c"); Modified: llvm/trunk/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=81172&r1=81171&r2=81172&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Constants.cpp (original) +++ llvm/trunk/lib/VMCore/Constants.cpp Mon Sep 7 18:54:19 2009 @@ -632,21 +632,13 @@ } Constant* ConstantExpr::getNSWAdd(Constant* C1, Constant* C2) { - Constant *C = getAdd(C1, C2); - // Set nsw attribute, assuming constant folding didn't eliminate the - // Add. - if (AddOperator *Add = dyn_cast(C)) - Add->setHasNoSignedWrap(true); - return C; + return getTy(C1->getType(), Instruction::Add, C1, C2, + OverflowingBinaryOperator::NoSignedWrap); } Constant* ConstantExpr::getExactSDiv(Constant* C1, Constant* C2) { - Constant *C = getSDiv(C1, C2); - // Set exact attribute, assuming constant folding didn't eliminate the - // SDiv. - if (SDivOperator *SDiv = dyn_cast(C)) - SDiv->setIsExact(true); - return C; + return getTy(C1->getType(), Instruction::SDiv, C1, C2, + SDivOperator::IsExact); } // Utility function for determining if a ConstantExpr is a CastOp or not. This @@ -729,15 +721,19 @@ for (unsigned i = 1, e = getNumOperands(); i != e; ++i) Ops[i-1] = getOperand(i); if (OpNo == 0) - return ConstantExpr::getGetElementPtr(Op, &Ops[0], Ops.size()); + return cast(this)->isInBounds() ? + ConstantExpr::getInBoundsGetElementPtr(Op, &Ops[0], Ops.size()) : + ConstantExpr::getGetElementPtr(Op, &Ops[0], Ops.size()); Ops[OpNo-1] = Op; - return ConstantExpr::getGetElementPtr(getOperand(0), &Ops[0], Ops.size()); + return cast(this)->isInBounds() ? + ConstantExpr::getInBoundsGetElementPtr(getOperand(0), &Ops[0], Ops.size()) : + ConstantExpr::getGetElementPtr(getOperand(0), &Ops[0], Ops.size()); } default: assert(getNumOperands() == 2 && "Must be binary operator?"); Op0 = (OpNo == 0) ? Op : getOperand(0); Op1 = (OpNo == 1) ? Op : getOperand(1); - return ConstantExpr::get(getOpcode(), Op0, Op1); + return ConstantExpr::get(getOpcode(), Op0, Op1, SubclassData); } } @@ -779,13 +775,15 @@ case Instruction::ShuffleVector: return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]); case Instruction::GetElementPtr: - return ConstantExpr::getGetElementPtr(Ops[0], &Ops[1], NumOps-1); + return cast(this)->isInBounds() ? + ConstantExpr::getInBoundsGetElementPtr(Ops[0], &Ops[1], NumOps-1) : + ConstantExpr::getGetElementPtr(Ops[0], &Ops[1], NumOps-1); case Instruction::ICmp: case Instruction::FCmp: return ConstantExpr::getCompare(getPredicate(), Ops[0], Ops[1]); default: assert(getNumOperands() == 2 && "Must be binary operator?"); - return ConstantExpr::get(getOpcode(), Ops[0], Ops[1]); + return ConstantExpr::get(getOpcode(), Ops[0], Ops[1], SubclassData); } } @@ -1031,8 +1029,9 @@ Operands.reserve(CE->getNumOperands()); for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) Operands.push_back(cast(CE->getOperand(i))); - return ExprMapKeyType(CE->getOpcode(), Operands, + return ExprMapKeyType(CE->getOpcode(), Operands, CE->isCompare() ? CE->getPredicate() : 0, + CE->getRawSubclassOptionalData(), CE->hasIndices() ? CE->getIndices() : SmallVector()); } @@ -1280,7 +1279,8 @@ } Constant *ConstantExpr::getTy(const Type *ReqTy, unsigned Opcode, - Constant *C1, Constant *C2) { + Constant *C1, Constant *C2, + unsigned Flags) { // Check the operands for consistency first assert(Opcode >= Instruction::BinaryOpsBegin && Opcode < Instruction::BinaryOpsEnd && @@ -1294,7 +1294,7 @@ return FC; // Fold a few common cases... std::vector argVec(1, C1); argVec.push_back(C2); - ExprMapKeyType Key(Opcode, argVec); + ExprMapKeyType Key(Opcode, argVec, 0, Flags); LLVMContextImpl *pImpl = ReqTy->getContext().pImpl; @@ -1322,7 +1322,8 @@ } } -Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2) { +Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2, + unsigned Flags) { // API compatibility: Adjust integer opcodes to floating-point opcodes. if (C1->getType()->isFPOrFPVector()) { if (Opcode == Instruction::Add) Opcode = Instruction::FAdd; @@ -1387,7 +1388,7 @@ } #endif - return getTy(C1->getType(), Opcode, C1, C2); + return getTy(C1->getType(), Opcode, C1, C2, Flags); } Constant* ConstantExpr::getSizeOf(const Type* Ty) { @@ -1481,6 +1482,36 @@ return pImpl->ExprConstants.getOrCreate(ReqTy, Key); } +Constant *ConstantExpr::getInBoundsGetElementPtrTy(const Type *ReqTy, + Constant *C, + Value* const *Idxs, + unsigned NumIdx) { + assert(GetElementPtrInst::getIndexedType(C->getType(), Idxs, + Idxs+NumIdx) == + cast(ReqTy)->getElementType() && + "GEP indices invalid!"); + + if (Constant *FC = ConstantFoldGetElementPtr( + ReqTy->getContext(), C, (Constant**)Idxs, NumIdx)) + return FC; // Fold a few common cases... + + assert(isa(C->getType()) && + "Non-pointer type for constant GetElementPtr expression"); + // Look up the constant in the table first to ensure uniqueness + std::vector ArgVec; + ArgVec.reserve(NumIdx+1); + ArgVec.push_back(C); + for (unsigned i = 0; i != NumIdx; ++i) + ArgVec.push_back(cast(Idxs[i])); + const ExprMapKeyType Key(Instruction::GetElementPtr, ArgVec, 0, + GEPOperator::IsInBounds); + + LLVMContextImpl *pImpl = ReqTy->getContext().pImpl; + + // Implicitly locked. + return pImpl->ExprConstants.getOrCreate(ReqTy, Key); +} + Constant *ConstantExpr::getGetElementPtr(Constant *C, Value* const *Idxs, unsigned NumIdx) { // Get the result type of the getelementptr! @@ -1494,12 +1525,12 @@ Constant *ConstantExpr::getInBoundsGetElementPtr(Constant *C, Value* const *Idxs, unsigned NumIdx) { - Constant *Result = getGetElementPtr(C, Idxs, NumIdx); - // Set in bounds attribute, assuming constant folding didn't eliminate the - // GEP. - if (GEPOperator *GEP = dyn_cast(Result)) - GEP->setIsInBounds(true); - return Result; + // Get the result type of the getelementptr! + const Type *Ty = + GetElementPtrInst::getIndexedType(C->getType(), Idxs, Idxs+NumIdx); + assert(Ty && "GEP indices invalid!"); + unsigned As = cast(C->getType())->getAddressSpace(); + return getInBoundsGetElementPtrTy(PointerType::get(Ty, As), C, Idxs, NumIdx); } Constant *ConstantExpr::getGetElementPtr(Constant *C, Constant* const *Idxs, @@ -2104,7 +2135,7 @@ Constant *C2 = getOperand(1); if (C1 == From) C1 = To; if (C2 == From) C2 = To; - Replacement = ConstantExpr::get(getOpcode(), C1, C2); + Replacement = ConstantExpr::get(getOpcode(), C1, C2, SubclassData); } else { llvm_unreachable("Unknown ConstantExpr type!"); return; Modified: llvm/trunk/lib/VMCore/ConstantsContext.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantsContext.h?rev=81172&r1=81171&r2=81172&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ConstantsContext.h (original) +++ llvm/trunk/lib/VMCore/ConstantsContext.h Mon Sep 7 18:54:19 2009 @@ -53,10 +53,12 @@ void *operator new(size_t s) { return User::operator new(s, 2); } - BinaryConstantExpr(unsigned Opcode, Constant *C1, Constant *C2) + BinaryConstantExpr(unsigned Opcode, Constant *C1, Constant *C2, + unsigned Flags) : ConstantExpr(C1->getType(), Opcode, &Op<0>(), 2) { Op<0>() = C1; Op<1>() = C2; + SubclassOptionalData = Flags; } /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); @@ -206,9 +208,12 @@ public: static GetElementPtrConstantExpr *Create(Constant *C, const std::vector&IdxList, - const Type *DestTy) { - return + const Type *DestTy, + unsigned Flags) { + GetElementPtrConstantExpr *Result = new(IdxList.size() + 1) GetElementPtrConstantExpr(C, IdxList, DestTy); + Result->SubclassOptionalData = Flags; + return Result; } /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); @@ -291,26 +296,32 @@ ExprMapKeyType(unsigned opc, const std::vector &ops, - unsigned short pred = 0, + unsigned short flags = 0, + unsigned short optionalflags = 0, const IndexList &inds = IndexList()) - : opcode(opc), predicate(pred), operands(ops), indices(inds) {} - uint16_t opcode; - uint16_t predicate; + : opcode(opc), subclassoptionaldata(optionalflags), subclassdata(flags), + operands(ops), indices(inds) {} + uint8_t opcode; + uint8_t subclassoptionaldata; + uint16_t subclassdata; std::vector operands; IndexList indices; bool operator==(const ExprMapKeyType& that) const { return this->opcode == that.opcode && - this->predicate == that.predicate && + this->subclassdata == that.subclassdata && + this->subclassoptionaldata == that.subclassoptionaldata && this->operands == that.operands && this->indices == that.indices; } bool operator<(const ExprMapKeyType & that) const { - return this->opcode < that.opcode || - (this->opcode == that.opcode && this->predicate < that.predicate) || - (this->opcode == that.opcode && this->predicate == that.predicate && - this->operands < that.operands) || - (this->opcode == that.opcode && this->predicate == that.predicate && - this->operands == that.operands && this->indices < that.indices); + if (this->opcode != that.opcode) return this->opcode < that.opcode; + if (this->operands != that.operands) return this->operands < that.operands; + if (this->subclassdata != that.subclassdata) + return this->subclassdata < that.subclassdata; + if (this->subclassoptionaldata != that.subclassoptionaldata) + return this->subclassoptionaldata < that.subclassoptionaldata; + if (this->indices != that.indices) return this->indices < that.indices; + return false; } bool operator!=(const ExprMapKeyType& that) const { @@ -354,7 +365,8 @@ return new UnaryConstantExpr(V.opcode, V.operands[0], Ty); if ((V.opcode >= Instruction::BinaryOpsBegin && V.opcode < Instruction::BinaryOpsEnd)) - return new BinaryConstantExpr(V.opcode, V.operands[0], V.operands[1]); + return new BinaryConstantExpr(V.opcode, V.operands[0], V.operands[1], + V.subclassoptionaldata); if (V.opcode == Instruction::Select) return new SelectConstantExpr(V.operands[0], V.operands[1], V.operands[2]); @@ -373,17 +385,18 @@ return new ExtractValueConstantExpr(V.operands[0], V.indices, Ty); if (V.opcode == Instruction::GetElementPtr) { std::vector IdxList(V.operands.begin()+1, V.operands.end()); - return GetElementPtrConstantExpr::Create(V.operands[0], IdxList, Ty); + return GetElementPtrConstantExpr::Create(V.operands[0], IdxList, Ty, + V.subclassoptionaldata); } // The compare instructions are weird. We have to encode the predicate // value and it is combined with the instruction opcode by multiplying // the opcode by one hundred. We must decode this to get the predicate. if (V.opcode == Instruction::ICmp) - return new CompareConstantExpr(Ty, Instruction::ICmp, V.predicate, + return new CompareConstantExpr(Ty, Instruction::ICmp, V.subclassdata, V.operands[0], V.operands[1]); if (V.opcode == Instruction::FCmp) - return new CompareConstantExpr(Ty, Instruction::FCmp, V.predicate, + return new CompareConstantExpr(Ty, Instruction::FCmp, V.subclassdata, V.operands[0], V.operands[1]); llvm_unreachable("Invalid ConstantExpr!"); return 0; Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=81172&r1=81171&r2=81172&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Mon Sep 7 18:54:19 2009 @@ -1171,6 +1171,9 @@ return true; } +void GetElementPtrInst::setIsInBounds(bool B) { + cast(this)->setIsInBounds(B); +} //===----------------------------------------------------------------------===// // ExtractElementInst Implementation @@ -1716,6 +1719,18 @@ return false; } +void BinaryOperator::setHasNoUnsignedWrap(bool b) { + cast(this)->setHasNoUnsignedWrap(b); +} + +void BinaryOperator::setHasNoSignedWrap(bool b) { + cast(this)->setHasNoSignedWrap(b); +} + +void BinaryOperator::setIsExact(bool b) { + cast(this)->setIsExact(b); +} + //===----------------------------------------------------------------------===// // CastInst Class //===----------------------------------------------------------------------===// Removed: llvm/trunk/test/Assembler/flags-plain.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/flags-plain.ll?rev=81171&view=auto ============================================================================== --- llvm/trunk/test/Assembler/flags-plain.ll (original) +++ llvm/trunk/test/Assembler/flags-plain.ll (removed) @@ -1,28 +0,0 @@ -; RUN: llvm-as < %s | llvm-dis | FileCheck %s - - at addr = external global i64 - -define i64 @add_plain_ce() { -; CHECK: ret i64 add (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 add (i64 ptrtoint (i64* @addr to i64), i64 91) -} - -define i64 @sub_plain_ce() { -; CHECK: ret i64 sub (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 sub (i64 ptrtoint (i64* @addr to i64), i64 91) -} - -define i64 @mul_plain_ce() { -; CHECK: ret i64 mul (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 mul (i64 ptrtoint (i64* @addr to i64), i64 91) -} - -define i64 @sdiv_plain_ce() { -; CHECK: ret i64 sdiv (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 sdiv (i64 ptrtoint (i64* @addr to i64), i64 91) -} - -define i64* @gep_plain_ce() { -; CHECK: ret i64* getelementptr (i64* @addr, i64 171) - ret i64* getelementptr (i64* @addr, i64 171) -} Removed: llvm/trunk/test/Assembler/flags-reversed.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/flags-reversed.ll?rev=81171&view=auto ============================================================================== --- llvm/trunk/test/Assembler/flags-reversed.ll (original) +++ llvm/trunk/test/Assembler/flags-reversed.ll (removed) @@ -1,18 +0,0 @@ -; RUN: llvm-as < %s | llvm-dis | FileCheck %s - - at addr = external global i64 - -define i64 @add_both_reversed_ce() { -; CHECK: ret i64 add nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 add nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91) -} - -define i64 @sub_both_reversed_ce() { -; CHECK: ret i64 sub nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 sub nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91) -} - -define i64 @mul_both_reversed_ce() { -; CHECK: ret i64 mul nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 mul nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91) -} Removed: llvm/trunk/test/Assembler/flags-signed.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/flags-signed.ll?rev=81171&view=auto ============================================================================== --- llvm/trunk/test/Assembler/flags-signed.ll (original) +++ llvm/trunk/test/Assembler/flags-signed.ll (removed) @@ -1,18 +0,0 @@ -; RUN: llvm-as < %s | llvm-dis | FileCheck %s - - at addr = external global i64 - -define i64 @add_signed_ce() { -; CHECK: ret i64 add nsw (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 add nsw (i64 ptrtoint (i64* @addr to i64), i64 91) -} - -define i64 @sub_signed_ce() { -; CHECK: ret i64 sub nsw (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 sub nsw (i64 ptrtoint (i64* @addr to i64), i64 91) -} - -define i64 @mul_signed_ce() { -; CHECK: ret i64 mul nsw (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 mul nsw (i64 ptrtoint (i64* @addr to i64), i64 91) -} Removed: llvm/trunk/test/Assembler/flags-unsigned.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/flags-unsigned.ll?rev=81171&view=auto ============================================================================== --- llvm/trunk/test/Assembler/flags-unsigned.ll (original) +++ llvm/trunk/test/Assembler/flags-unsigned.ll (removed) @@ -1,18 +0,0 @@ -; RUN: llvm-as < %s | llvm-dis | FileCheck %s - - at addr = external global i64 - -define i64 @add_unsigned_ce() { -; CHECK: ret i64 add nuw (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 add nuw (i64 ptrtoint (i64* @addr to i64), i64 91) -} - -define i64 @sub_unsigned_ce() { -; CHECK: ret i64 sub nuw (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 sub nuw (i64 ptrtoint (i64* @addr to i64), i64 91) -} - -define i64 @mul_unsigned_ce() { -; CHECK: ret i64 mul nuw (i64 ptrtoint (i64* @addr to i64), i64 91) - ret i64 mul nuw (i64 ptrtoint (i64* @addr to i64), i64 91) -} Modified: llvm/trunk/test/Assembler/flags.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/flags.ll?rev=81172&r1=81171&r2=81172&view=diff ============================================================================== --- llvm/trunk/test/Assembler/flags.ll (original) +++ llvm/trunk/test/Assembler/flags.ll Mon Sep 7 18:54:19 2009 @@ -141,4 +141,72 @@ ret i64* getelementptr inbounds (i64* @addr, i64 171) } +define i64 @add_plain_ce() { +; CHECK: ret i64 add (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 add (i64 ptrtoint (i64* @addr to i64), i64 91) +} + +define i64 @sub_plain_ce() { +; CHECK: ret i64 sub (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 sub (i64 ptrtoint (i64* @addr to i64), i64 91) +} + +define i64 @mul_plain_ce() { +; CHECK: ret i64 mul (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 mul (i64 ptrtoint (i64* @addr to i64), i64 91) +} + +define i64 @sdiv_plain_ce() { +; CHECK: ret i64 sdiv (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 sdiv (i64 ptrtoint (i64* @addr to i64), i64 91) +} + +define i64* @gep_plain_ce() { +; CHECK: ret i64* getelementptr (i64* @addr, i64 171) + ret i64* getelementptr (i64* @addr, i64 171) +} + +define i64 @add_both_reversed_ce() { +; CHECK: ret i64 add nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 add nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91) +} + +define i64 @sub_both_reversed_ce() { +; CHECK: ret i64 sub nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 sub nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91) +} +define i64 @mul_both_reversed_ce() { +; CHECK: ret i64 mul nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 mul nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91) +} + +define i64 @add_signed_ce() { +; CHECK: ret i64 add nsw (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 add nsw (i64 ptrtoint (i64* @addr to i64), i64 91) +} + +define i64 @sub_signed_ce() { +; CHECK: ret i64 sub nsw (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 sub nsw (i64 ptrtoint (i64* @addr to i64), i64 91) +} + +define i64 @mul_signed_ce() { +; CHECK: ret i64 mul nsw (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 mul nsw (i64 ptrtoint (i64* @addr to i64), i64 91) +} + +define i64 @add_unsigned_ce() { +; CHECK: ret i64 add nuw (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 add nuw (i64 ptrtoint (i64* @addr to i64), i64 91) +} + +define i64 @sub_unsigned_ce() { +; CHECK: ret i64 sub nuw (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 sub nuw (i64 ptrtoint (i64* @addr to i64), i64 91) +} + +define i64 @mul_unsigned_ce() { +; CHECK: ret i64 mul nuw (i64 ptrtoint (i64* @addr to i64), i64 91) + ret i64 mul nuw (i64 ptrtoint (i64* @addr to i64), i64 91) +} From clattner at apple.com Mon Sep 7 18:57:54 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 7 Sep 2009 16:57:54 -0700 Subject: [llvm-commits] [llvm] r81171 - in /llvm/trunk: lib/CodeGen/SelectionDAG/FastISel.cpp test/CodeGen/X86/fast-isel-fneg.ll In-Reply-To: <200909072347.n87NlEv9020080@zion.cs.uiuc.edu> References: <200909072347.n87NlEv9020080@zion.cs.uiuc.edu> Message-ID: <5BEC497E-3D9C-4FCC-9636-1CD9200FBE44@apple.com> On Sep 7, 2009, at 4:47 PM, Dan Gohman wrote: > Author: djg > Date: Mon Sep 7 18:47:14 2009 > New Revision: 81171 > > URL: http://llvm.org/viewvc/llvm-project?rev=81171&view=rev > Log: > Fix a thinko: When lowering fneg with xor, bitcast the operands > from floating-point to integer first, and bitcast the result > back to floating-point. Previously, this test was passing by > falling back to SelectionDAG lowering. The resulting code isn't > as nice, but it's correct and CodeGen now stays on the fast path. Why not lower to ISD::FNEG? -Chris From gohman at apple.com Mon Sep 7 19:00:49 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 07 Sep 2009 17:00:49 -0700 Subject: [llvm-commits] [llvm] r80963 - in /llvm/trunk: include/llvm/CodeGen/FastISel.h lib/CodeGen/SelectionDAG/FastISel.cpp test/CodeGen/X86/fast-isel-fneg.ll In-Reply-To: References: <200909032253.n83Mrvlj011046@zion.cs.uiuc.edu> Message-ID: <163C8649-90F7-4D3B-95AE-0FEB5B404BBC@apple.com> On Sep 7, 2009, at 3:23 PM, Chris Lattner wrote: > > On Sep 3, 2009, at 3:53 PM, Dan Gohman wrote: > >> Author: djg >> Date: Thu Sep 3 17:53:57 2009 >> New Revision: 80963 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=80963&view=rev >> Log: >> LLVM currently represents floating-point negation as -0.0 - x. Fix >> FastISel to recognize this pattern and emit a floating-point >> negation using xor. > > ISD::XOR is legal for floating point operands? Oops, no. This is fixed now. Dan From sabre at nondot.org Mon Sep 7 19:06:16 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 00:06:16 -0000 Subject: [llvm-commits] [llvm] r81173 - in /llvm/trunk: include/llvm/Analysis/ValueTracking.h lib/Analysis/ValueTracking.cpp Message-ID: <200909080006.n8806GSt022590@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 19:06:16 2009 New Revision: 81173 URL: http://llvm.org/viewvc/llvm-project?rev=81173&view=rev Log: add some comments to describe the invariants. Modified: llvm/trunk/include/llvm/Analysis/ValueTracking.h llvm/trunk/lib/Analysis/ValueTracking.cpp Modified: llvm/trunk/include/llvm/Analysis/ValueTracking.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ValueTracking.h?rev=81173&r1=81172&r2=81173&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ValueTracking.h (original) +++ llvm/trunk/include/llvm/Analysis/ValueTracking.h Mon Sep 7 19:06:16 2009 @@ -29,6 +29,12 @@ /// known to be either zero or one and return them in the KnownZero/KnownOne /// bit sets. This code only analyzes bits in Mask, in order to short-circuit /// processing. + /// + /// This function is defined on values with integer type, values with pointer + /// type (but only if TD is non-null), and vectors of integers. In the case + /// where V is a vector, the mask, known zero, and known one values are the + /// same width as the vector element, and the bit is set only if it is true + /// for all of the elements in the vector. void ComputeMaskedBits(Value *V, const APInt &Mask, APInt &KnownZero, APInt &KnownOne, const TargetData *TD = 0, unsigned Depth = 0); @@ -36,6 +42,12 @@ /// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. We use /// this predicate to simplify operations downstream. Mask is known to be /// zero for bits that V cannot have. + /// + /// This function is defined on values with integer type, values with pointer + /// type (but only if TD is non-null), and vectors of integers. In the case + /// where V is a vector, the mask, known zero, and known one values are the + /// same width as the vector element, and the bit is set only if it is true + /// for all of the elements in the vector. bool MaskedValueIsZero(Value *V, const APInt &Mask, const TargetData *TD = 0, unsigned Depth = 0); Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=81173&r1=81172&r2=81173&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ValueTracking.cpp (original) +++ llvm/trunk/lib/Analysis/ValueTracking.cpp Mon Sep 7 19:06:16 2009 @@ -35,6 +35,12 @@ /// optimized based on the contradictory assumption that it is non-zero. /// Because instcombine aggressively folds operations with undef args anyway, /// this won't lose us code quality. +/// +/// This function is defined on values with integer type, values with pointer +/// type (but only if TD is non-null), and vectors of integers. In the case +/// where V is a vector, the mask, known zero, and known one values are the +/// same width as the vector element, and the bit is set only if it is true +/// for all of the elements in the vector. void llvm::ComputeMaskedBits(Value *V, const APInt &Mask, APInt &KnownZero, APInt &KnownOne, const TargetData *TD, unsigned Depth) { @@ -608,6 +614,12 @@ /// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. We use /// this predicate to simplify operations downstream. Mask is known to be zero /// for bits that V cannot have. +/// +/// This function is defined on values with integer type, values with pointer +/// type (but only if TD is non-null), and vectors of integers. In the case +/// where V is a vector, the mask, known zero, and known one values are the +/// same width as the vector element, and the bit is set only if it is true +/// for all of the elements in the vector. bool llvm::MaskedValueIsZero(Value *V, const APInt &Mask, const TargetData *TD, unsigned Depth) { APInt KnownZero(Mask.getBitWidth(), 0), KnownOne(Mask.getBitWidth(), 0); From sabre at nondot.org Mon Sep 7 19:13:52 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 00:13:52 -0000 Subject: [llvm-commits] [llvm] r81174 - in /llvm/trunk: lib/Analysis/ValueTracking.cpp test/Transforms/InstCombine/crash.ll Message-ID: <200909080013.n880Dq4m023571@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 19:13:52 2009 New Revision: 81174 URL: http://llvm.org/viewvc/llvm-project?rev=81174&view=rev Log: fix ComputeMaskedBits handling of zext/sext/trunc to work with vectors. This fixes PR4905 Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp llvm/trunk/test/Transforms/InstCombine/crash.ll Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=81174&r1=81173&r2=81174&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ValueTracking.cpp (original) +++ llvm/trunk/lib/Analysis/ValueTracking.cpp Mon Sep 7 19:13:52 2009 @@ -232,12 +232,16 @@ // FALL THROUGH and handle them the same as zext/trunc. case Instruction::ZExt: case Instruction::Trunc: { + const Type *SrcTy = I->getOperand(0)->getType(); + + unsigned SrcBitWidth; // Note that we handle pointer operands here because of inttoptr/ptrtoint // which fall through here. - const Type *SrcTy = I->getOperand(0)->getType(); - unsigned SrcBitWidth = TD ? - TD->getTypeSizeInBits(SrcTy) : - SrcTy->getScalarSizeInBits(); + if (isa(SrcTy)) + SrcBitWidth = TD->getTypeSizeInBits(SrcTy); + else + SrcBitWidth = SrcTy->getScalarSizeInBits(); + APInt MaskIn(Mask); MaskIn.zextOrTrunc(SrcBitWidth); KnownZero.zextOrTrunc(SrcBitWidth); @@ -265,8 +269,7 @@ } case Instruction::SExt: { // Compute the bits in the result that are not present in the input. - const IntegerType *SrcTy = cast(I->getOperand(0)->getType()); - unsigned SrcBitWidth = SrcTy->getBitWidth(); + unsigned SrcBitWidth = I->getOperand(0)->getType()->getScalarSizeInBits(); APInt MaskIn(Mask); MaskIn.trunc(SrcBitWidth); Modified: llvm/trunk/test/Transforms/InstCombine/crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/crash.ll?rev=81174&r1=81173&r2=81174&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/crash.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/crash.ll Mon Sep 7 19:13:52 2009 @@ -1,8 +1,8 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis +; RUN: opt < %s -instcombine | llvm-dis 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 = "i386-apple-darwin10.0" -define i32 @_Z9model8bitR5Mixeri(i8 %tmp2) ssp { +define i32 @test0(i8 %tmp2) ssp { entry: %tmp3 = zext i8 %tmp2 to i32 %tmp8 = lshr i32 %tmp3, 6 @@ -12,3 +12,22 @@ %tmp12 = xor i32 %tmp11, 0 ret i32 %tmp12 } + +; PR4905 +define <2 x i64> @test1(<2 x i64> %x, <2 x i64> %y) nounwind { +entry: + %conv.i94 = bitcast <2 x i64> %y to <4 x i32> ; <<4 x i32>> [#uses=1] + %sub.i97 = sub <4 x i32> %conv.i94, undef ; <<4 x i32>> [#uses=1] + %conv3.i98 = bitcast <4 x i32> %sub.i97 to <2 x i64> ; <<2 x i64>> [#uses=2] + %conv2.i86 = bitcast <2 x i64> %conv3.i98 to <4 x i32> ; <<4 x i32>> [#uses=1] + %cmp.i87 = icmp sgt <4 x i32> undef, %conv2.i86 ; <<4 x i1>> [#uses=1] + %sext.i88 = sext <4 x i1> %cmp.i87 to <4 x i32> ; <<4 x i32>> [#uses=1] + %conv3.i89 = bitcast <4 x i32> %sext.i88 to <2 x i64> ; <<2 x i64>> [#uses=1] + %and.i = and <2 x i64> %conv3.i89, %conv3.i98 ; <<2 x i64>> [#uses=1] + %or.i = or <2 x i64> zeroinitializer, %and.i ; <<2 x i64>> [#uses=1] + %conv2.i43 = bitcast <2 x i64> %or.i to <4 x i32> ; <<4 x i32>> [#uses=1] + %sub.i = sub <4 x i32> zeroinitializer, %conv2.i43 ; <<4 x i32>> [#uses=1] + %conv3.i44 = bitcast <4 x i32> %sub.i to <2 x i64> ; <<2 x i64>> [#uses=1] + ret <2 x i64> %conv3.i44 +} + From sabre at nondot.org Mon Sep 7 19:27:15 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 00:27:15 -0000 Subject: [llvm-commits] [llvm] r81175 - in /llvm/trunk: lib/Transforms/Scalar/MemCpyOptimizer.cpp test/Transforms/MemCpyOpt/crash.ll Message-ID: <200909080027.n880RFwr025250@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 19:27:14 2009 New Revision: 81175 URL: http://llvm.org/viewvc/llvm-project?rev=81175&view=rev Log: Fix PR4882, by making MemCpyOpt not dereference removed stores to get the context for the newly created operations. Patch by Jakub Staszak! Added: llvm/trunk/test/Transforms/MemCpyOpt/crash.ll Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=81175&r1=81174&r2=81175&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Mon Sep 7 19:27:14 2009 @@ -340,13 +340,15 @@ bool MemCpyOpt::processStore(StoreInst *SI, BasicBlock::iterator &BBI) { if (SI->isVolatile()) return false; + LLVMContext &Context = SI->getContext(); + // There are two cases that are interesting for this code to handle: memcpy // and memset. Right now we only handle memset. // Ensure that the value being stored is something that can be memset'able a // byte at a time like "0" or "-1" or any width, as well as things like // 0xA0A0A0A0 and 0.0. - Value *ByteVal = isBytewiseValue(SI->getOperand(0), SI->getContext()); + Value *ByteVal = isBytewiseValue(SI->getOperand(0), Context); if (!ByteVal) return false; @@ -387,8 +389,7 @@ if (NextStore->isVolatile()) break; // Check to see if this stored value is of the same byte-splattable value. - if (ByteVal != isBytewiseValue(NextStore->getOperand(0), - NextStore->getContext())) + if (ByteVal != isBytewiseValue(NextStore->getOperand(0), Context)) break; // Check to see if this store is to a constant offset from the start ptr. @@ -408,7 +409,6 @@ // store as well. We try to avoid this unless there is at least something // interesting as a small compile-time optimization. Ranges.addStore(0, SI); - Function *MemSetF = 0; @@ -432,16 +432,15 @@ BasicBlock::iterator InsertPt = BI; if (MemSetF == 0) { - const Type *Ty = Type::getInt64Ty(SI->getContext()); + const Type *Ty = Type::getInt64Ty(Context); MemSetF = Intrinsic::getDeclaration(M, Intrinsic::memset, &Ty, 1); - } + } // Get the starting pointer of the block. StartPtr = Range.StartPtr; // Cast the start ptr to be i8* as memset requires. - const Type *i8Ptr = - PointerType::getUnqual(Type::getInt8Ty(SI->getContext())); + const Type *i8Ptr = PointerType::getUnqual(Type::getInt8Ty(Context)); if (StartPtr->getType() != i8Ptr) StartPtr = new BitCastInst(StartPtr, i8Ptr, StartPtr->getName(), InsertPt); @@ -449,10 +448,9 @@ Value *Ops[] = { StartPtr, ByteVal, // Start, value // size - ConstantInt::get(Type::getInt64Ty(SI->getContext()), - Range.End-Range.Start), + ConstantInt::get(Type::getInt64Ty(Context), Range.End-Range.Start), // align - ConstantInt::get(Type::getInt32Ty(SI->getContext()), Range.Alignment) + ConstantInt::get(Type::getInt32Ty(Context), Range.Alignment) }; Value *C = CallInst::Create(MemSetF, Ops, Ops+4, "", InsertPt); DEBUG(errs() << "Replace stores:\n"; @@ -464,7 +462,8 @@ BBI = BI; // Zap all the stores. - for (SmallVector::const_iterator SI = Range.TheStores.begin(), + for (SmallVector::const_iterator + SI = Range.TheStores.begin(), SE = Range.TheStores.end(); SI != SE; ++SI) (*SI)->eraseFromParent(); ++NumMemSetInfer; Added: llvm/trunk/test/Transforms/MemCpyOpt/crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/MemCpyOpt/crash.ll?rev=81175&view=auto ============================================================================== --- llvm/trunk/test/Transforms/MemCpyOpt/crash.ll (added) +++ llvm/trunk/test/Transforms/MemCpyOpt/crash.ll Mon Sep 7 19:27:14 2009 @@ -0,0 +1,45 @@ +; RUN: opt %s -memcpyopt -disable-output +; PR4882 + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64" +target triple = "armv7-eabi" + +%struct.qw = type { [4 x float] } +%struct.bar = type { %struct.qw, %struct.qw, %struct.qw, %struct.qw, %struct.qw, float, float} + +define arm_aapcs_vfpcc void @test1(%struct.bar* %this) { +entry: + %0 = getelementptr inbounds %struct.bar* %this, i32 0, i32 0, i32 0, i32 0 + store float 0.000000e+00, float* %0, align 4 + %1 = getelementptr inbounds %struct.bar* %this, i32 0, i32 0, i32 0, i32 1 + store float 0.000000e+00, float* %1, align 4 + %2 = getelementptr inbounds %struct.bar* %this, i32 0, i32 0, i32 0, i32 2 + store float 0.000000e+00, float* %2, align 4 + %3 = getelementptr inbounds %struct.bar* %this, i32 0, i32 0, i32 0, i32 3 + store float 0.000000e+00, float* %3, align 4 + %4 = getelementptr inbounds %struct.bar* %this, i32 0, i32 1, i32 0, i32 0 + store float 0.000000e+00, float* %4, align 4 + %5 = getelementptr inbounds %struct.bar* %this, i32 0, i32 1, i32 0, i32 1 + store float 0.000000e+00, float* %5, align 4 + %6 = getelementptr inbounds %struct.bar* %this, i32 0, i32 1, i32 0, i32 2 + store float 0.000000e+00, float* %6, align 4 + %7 = getelementptr inbounds %struct.bar* %this, i32 0, i32 1, i32 0, i32 3 + store float 0.000000e+00, float* %7, align 4 + %8 = getelementptr inbounds %struct.bar* %this, i32 0, i32 3, i32 0, i32 1 + store float 0.000000e+00, float* %8, align 4 + %9 = getelementptr inbounds %struct.bar* %this, i32 0, i32 3, i32 0, i32 2 + store float 0.000000e+00, float* %9, align 4 + %10 = getelementptr inbounds %struct.bar* %this, i32 0, i32 3, i32 0, i32 3 + store float 0.000000e+00, float* %10, align 4 + %11 = getelementptr inbounds %struct.bar* %this, i32 0, i32 4, i32 0, i32 0 + store float 0.000000e+00, float* %11, align 4 + %12 = getelementptr inbounds %struct.bar* %this, i32 0, i32 4, i32 0, i32 1 + store float 0.000000e+00, float* %12, align 4 + %13 = getelementptr inbounds %struct.bar* %this, i32 0, i32 4, i32 0, i32 2 + store float 0.000000e+00, float* %13, align 4 + %14 = getelementptr inbounds %struct.bar* %this, i32 0, i32 4, i32 0, i32 3 + store float 0.000000e+00, float* %14, align 4 + %15 = getelementptr inbounds %struct.bar* %this, i32 0, i32 5 + store float 0.000000e+00, float* %15, align 4 + unreachable +} From sabre at nondot.org Mon Sep 7 20:22:54 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 01:22:54 -0000 Subject: [llvm-commits] [llvm] r81177 - /llvm/trunk/include/llvm/Analysis/Dominators.h Message-ID: <200909080122.n881MsCR032555@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 20:22:54 2009 New Revision: 81177 URL: http://llvm.org/viewvc/llvm-project?rev=81177&view=rev Log: fix PR4915, a crash in -debug mode. Modified: llvm/trunk/include/llvm/Analysis/Dominators.h Modified: llvm/trunk/include/llvm/Analysis/Dominators.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=81177&r1=81176&r2=81177&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Dominators.h (original) +++ llvm/trunk/include/llvm/Analysis/Dominators.h Mon Sep 7 20:22:54 2009 @@ -548,7 +548,9 @@ o << "DFSNumbers invalid: " << SlowQueries << " slow queries."; o << "\n"; - PrintDomTree(getRootNode(), o, 1); + // The postdom tree can have a null root if there are no returns. + if (getRootNode()) + PrintDomTree(getRootNode(), o, 1); } protected: From nicholas at mxc.ca Mon Sep 7 20:23:52 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 08 Sep 2009 01:23:52 -0000 Subject: [llvm-commits] [llvm] r81179 - /llvm/trunk/lib/VMCore/Verifier.cpp Message-ID: <200909080123.n881Nqkv032723@zion.cs.uiuc.edu> Author: nicholas Date: Mon Sep 7 20:23:52 2009 New Revision: 81179 URL: http://llvm.org/viewvc/llvm-project?rev=81179&view=rev Log: Verify types. Invalid types can be constructed when assertions are off. Make the verifier more robust by avoiding unprotected cast<> calls. Notably, Assert1(isa<>); cast<> is not safe as Assert1 does not terminate the program. 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=81179&r1=81178&r2=81179&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Mon Sep 7 20:23:52 2009 @@ -50,12 +50,14 @@ #include "llvm/ModuleProvider.h" #include "llvm/Pass.h" #include "llvm/PassManager.h" +#include "llvm/TypeSymbolTable.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Assembly/Writer.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/CFG.h" #include "llvm/Support/InstVisitor.h" +#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" @@ -105,8 +107,7 @@ static const PassInfo *const PreVerifyID = &PreVer; namespace { - struct VISIBILITY_HIDDEN - Verifier : public FunctionPass, public InstVisitor { + struct Verifier : public FunctionPass, public InstVisitor { static char ID; // Pass ID, replacement for typeid bool Broken; // Is this module found to be broken? bool RealPass; // Are we not being run by a PassManager? @@ -124,6 +125,9 @@ /// an instruction in the same block. SmallPtrSet InstsInThisBlock; + /// CheckedTypes - keep track of the types that have been checked already. + SmallSet CheckedTypes; + Verifier() : FunctionPass(&ID), Broken(false), RealPass(true), action(AbortProcessAction), @@ -282,6 +286,7 @@ bool isReturnValue, const Value *V); void VerifyFunctionAttrs(const FunctionType *FT, const AttrListPtr &Attrs, const Value *V); + void VerifyType(const Type *Ty); void WriteValue(const Value *V) { if (!V) return; @@ -322,6 +327,15 @@ WriteValue(V3); Broken = true; } + + void CheckFailed(const Twine &Message, const Type* T1, + const Type* T2 = 0, const Type* T3 = 0) { + MessagesStr << Message.str() << "\n"; + WriteType(T1); + WriteType(T2); + WriteType(T3); + Broken = true; + } }; } // End anonymous namespace @@ -360,14 +374,14 @@ Assert1(!GV.hasDLLImportLinkage() || GV.isDeclaration(), "Global is marked as dllimport, but not external", &GV); - + Assert1(!GV.hasAppendingLinkage() || isa(GV), "Only global variables can have appending linkage!", &GV); if (GV.hasAppendingLinkage()) { - GlobalVariable &GVar = cast(GV); - Assert1(isa(GVar.getType()->getElementType()), - "Only global arrays can have appending linkage!", &GV); + GlobalVariable *GVar = dyn_cast(&GV); + Assert1(GVar && isa(GVar->getType()->getElementType()), + "Only global arrays can have appending linkage!", GVar); } } @@ -445,6 +459,8 @@ } void Verifier::verifyTypeSymbolTable(TypeSymbolTable &ST) { + for (TypeSymbolTable::iterator I = ST.begin(), E = ST.end(); I != E; ++I) + VerifyType(I->second); } // VerifyParameterAttrs - Check the given attributes for an argument or return @@ -987,11 +1003,14 @@ "PHI nodes not grouped at top of basic block!", &PN, PN.getParent()); - // Check that all of the operands of the PHI node have the same type as the - // result. - for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) + // Check that all of the values of the PHI node have the same type as the + // result, and that the incoming blocks are really basic blocks. + for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) { Assert1(PN.getType() == PN.getIncomingValue(i)->getType(), "PHI node operands are not the same type as the result!", &PN); + Assert1(PN.getOperand(PHINode::getOperandNumForIncomingBlock(i)), + "PHI node incoming block is not a BasicBlock!", &PN); + } // All other PHI node constraints are checked in the visitBasicBlock method. @@ -1001,13 +1020,20 @@ void Verifier::VerifyCallSite(CallSite CS) { Instruction *I = CS.getInstruction(); - Assert1(isa(CS.getCalledValue()->getType()), - "Called function must be a pointer!", I); - const PointerType *FPTy = cast(CS.getCalledValue()->getType()); - Assert1(isa(FPTy->getElementType()), - "Called function is not pointer to function type!", I); + const PointerType *FPTy = + dyn_cast(CS.getCalledValue()->getType()); + if (!FPTy) { + CheckFailed("Called function must be a pointer!", I); + visitInstruction(*I); + return; + } - const FunctionType *FTy = cast(FPTy->getElementType()); + const FunctionType *FTy = dyn_cast(FPTy->getElementType()); + if (!FTy) { + CheckFailed("Called function is not pointer to function type!", I); + visitInstruction(*I); + return; + } // Verify that the correct number of arguments are being passed if (FTy->isVarArg()) @@ -1212,22 +1238,29 @@ } void Verifier::visitLoadInst(LoadInst &LI) { - const Type *ElTy = - cast(LI.getOperand(0)->getType())->getElementType(); - Assert2(ElTy == LI.getType(), - "Load result type does not match pointer operand type!", &LI, ElTy); - Assert1(ElTy != Type::getMetadataTy(LI.getContext()), - "Can't load metadata!", &LI); + const PointerType *PTy = dyn_cast(LI.getOperand(0)->getType()); + Assert1(PTy, "Load operand must be a pointer.", &LI); + if (PTy) { + const Type *ElTy = PTy->getElementType(); + Assert2(ElTy == LI.getType(), + "Load result type does not match pointer operand type!", &LI, ElTy); + Assert1(ElTy != Type::getMetadataTy(LI.getContext()), + "Can't load metadata!", &LI); + } visitInstruction(LI); } void Verifier::visitStoreInst(StoreInst &SI) { - const Type *ElTy = - cast(SI.getOperand(1)->getType())->getElementType(); - Assert2(ElTy == SI.getOperand(0)->getType(), - "Stored value type does not match pointer operand type!", &SI, ElTy); - Assert1(ElTy != Type::getMetadataTy(SI.getContext()), - "Can't store metadata!", &SI); + const PointerType *PTy = dyn_cast(SI.getOperand(1)->getType()); + Assert1(PTy, "Load operand must be a pointer.", &SI); + if (PTy) { + const Type *ElTy = PTy->getElementType(); + Assert2(ElTy == SI.getOperand(0)->getType(), + "Stored value type does not match pointer operand type!", + &SI, ElTy); + Assert1(ElTy != Type::getMetadataTy(SI.getContext()), + "Can't store metadata!", &SI); + } visitInstruction(SI); } @@ -1303,11 +1336,11 @@ // instruction, it is an error! for (User::use_iterator UI = I.use_begin(), UE = I.use_end(); UI != UE; ++UI) { - Assert1(isa(*UI), "Use of instruction is not an instruction!", - *UI); - Instruction *Used = cast(*UI); - Assert2(Used->getParent() != 0, "Instruction referencing instruction not" - " embedded in a basic block!", &I, Used); + if (Instruction *Used = dyn_cast(*UI)) + Assert2(Used->getParent() != 0, "Instruction referencing instruction not" + " embedded in a basic block!", &I, Used); + else + CheckFailed("Use of instruction is not an instruction!", *UI); } for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) { @@ -1357,7 +1390,9 @@ // value in the predecessor basic blocks they correspond to. BasicBlock *UseBlock = BB; if (isa(I)) - UseBlock = cast(I.getOperand(i+1)); + UseBlock = dyn_cast(I.getOperand(i+1)); + // Avoid crash. The verifier will find this module broken anyways. + if (!UseBlock) UseBlock = BB; if (isa(I) && UseBlock == OpBlock) { // Special case of a phi node in the normal destination or the unwind @@ -1390,9 +1425,9 @@ } else if (isa(I)) { // PHI nodes are more difficult than other nodes because they actually // "use" the value in the predecessor basic blocks they correspond to. - BasicBlock *PredBB = cast(I.getOperand(i+1)); - Assert2(DT->dominates(OpBlock, PredBB) || - !DT->isReachableFromEntry(PredBB), + BasicBlock *PredBB = dyn_cast(I.getOperand(i+1)); + Assert2(PredBB && (DT->dominates(OpBlock, PredBB) || + !DT->isReachableFromEntry(PredBB)), "Instruction does not dominate all uses!", Op, &I); } else { if (OpBlock == BB) { @@ -1413,6 +1448,67 @@ } } InstsInThisBlock.insert(&I); + + VerifyType(I.getType()); +} + +/// VerifyType - Verify that a type is well formed. +/// +void Verifier::VerifyType(const Type *Ty) { + // We insert complex types into CheckedTypes even if they failed verification + // to prevent emitting messages about them multiple times if + + switch (Ty->getTypeID()) { + case Type::FunctionTyID: { + if (!CheckedTypes.insert(Ty)) return; + const FunctionType *FTy = cast(Ty); + + const Type *RetTy = FTy->getReturnType(); + Assert2(FunctionType::isValidReturnType(RetTy), + "Function type with invalid return type", RetTy, FTy); + VerifyType(RetTy); + + for (int i = 0, e = FTy->getNumParams(); i != e; ++i) { + const Type *ElTy = FTy->getParamType(i); + Assert2(FunctionType::isValidArgumentType(ElTy), + "Function type with invalid parameter type", ElTy, FTy); + VerifyType(ElTy); + } + } break; + case Type::StructTyID: { + if (!CheckedTypes.insert(Ty)) return; + const StructType *STy = cast(Ty); + for (int i = 0, e = STy->getNumElements(); i != e; ++i) { + const Type *ElTy = STy->getElementType(i); + Assert2(StructType::isValidElementType(ElTy), + "Structure type with invalid element type", ElTy, STy); + VerifyType(ElTy); + } + } break; + case Type::ArrayTyID: { + if (!CheckedTypes.insert(Ty)) return; + const ArrayType *ATy = cast(Ty); + Assert1(ArrayType::isValidElementType(ATy->getElementType()), + "Array type with invalid element type", ATy); + VerifyType(ATy->getElementType()); + } break; + case Type::PointerTyID: { + if (!CheckedTypes.insert(Ty)) return; + const PointerType *PTy = cast(Ty); + Assert1(PointerType::isValidElementType(PTy->getElementType()), + "Pointer type with invalid element type", PTy); + VerifyType(PTy->getElementType()); + } + case Type::VectorTyID: { + if (!CheckedTypes.insert(Ty)) return; + const VectorType *VTy = cast(Ty); + Assert1(VectorType::isValidElementType(VTy->getElementType()), + "Vector type with invalid element type", VTy); + VerifyType(VTy->getElementType()); + } + default: + return; + } } // Flags used by TableGen to mark intrinsic parameters with the From evan.cheng at apple.com Mon Sep 7 20:43:22 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 7 Sep 2009 18:43:22 -0700 Subject: [llvm-commits] [PATCH] Add malloc call utility functions In-Reply-To: References: <1B994CDD-5E0A-4255-8B22-1781A229B2BB@apple.com> Message-ID: <7C34C391-C3B0-4677-BF43-717A17CBDD63@apple.com> Hi Victor, Some comments: +// This family of functions help identify calls to malloc. This comment isn't accurate, right? Please update. Thanks. +const CallInst* IsMallocCall(const Value* I); +const PointerType* GetMallocType(const CallInst* CI); I don't have a strong opinion about this. But our naming convention seems to be lower case 'is' and 'get'. See Constants.h. +CallInst* IsMallocCall(Value* I); This is not a very good name for what is does. Perhaps ExtractMallocCall IsMallocBitCast Perhaps isBitCastOfMallocCall? + // Determine type only if there is only 1 bitcast use of CI Period at the end please. :-) +#if 1 return wrap(unwrap(B)->CreateMalloc(unwrap(Ty), 0, Name)); +#else Please don't leave #if #else around. Thanks, Evan On Sep 4, 2009, at 5:58 PM, Victor Hernandez wrote: > Here is an update to this patch to incorporate suggested changes. > > I also went ahead and started modifying the optimization passes and > transforms to use the MallocHelper functions, so that I know I have > the right helper functions. The changes to the passes are not in > this patch, but will be coming next. > > Also I have included the LLParser, BitCodeReader, and VMCore changes > that use the new malloc codegen instead of MallocInst. Those > changes are disabled by default until the changes to the passes are > in. > > > > Victor > >> I am working on fixing the MallocInst/i64 alloca bug: >> http://llvm.org/bugs/show_bug.cgi?id=715 >> >> Here is the first of a series of patches that will result in >> tearing out MallocInst. Before I can tear it out, I need to update >> all of the optimization passes and transforms that operate on >> MallocInst to operate on malloc CallInst instead. >> >> This patch consists of a set of utility functions that create IR >> for malloc calls and identify that IR. It also rewrites >> LowerAllocations to use the new utility function, >> CallInst::CreateMalloc(). >> >> >> >> Victor >> >> --- >> Victor Hernandez vhernandez at apple.com >> _______________________________________________ >> 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 clattner at apple.com Mon Sep 7 20:43:24 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 7 Sep 2009 18:43:24 -0700 Subject: [llvm-commits] [llvm] r81179 - /llvm/trunk/lib/VMCore/Verifier.cpp In-Reply-To: <200909080123.n881Nqkv032723@zion.cs.uiuc.edu> References: <200909080123.n881Nqkv032723@zion.cs.uiuc.edu> Message-ID: On Sep 7, 2009, at 6:23 PM, Nick Lewycky wrote: > Author: nicholas > Date: Mon Sep 7 20:23:52 2009 > New Revision: 81179 > > URL: http://llvm.org/viewvc/llvm-project?rev=81179&view=rev > Log: > Verify types. Invalid types can be constructed when assertions are > off. > > Make the verifier more robust by avoiding unprotected cast<> calls. > Notably, > Assert1(isa<>); cast<> is not safe as Assert1 does not terminate the > program. Please add "isValidElementType" to LangRef type classifications and clarify the operation constraints as appropriate. > + void CheckFailed(const Twine &Message, const Type* T1, > + const Type* T2 = 0, const Type* T3 = 0) { Please don't put the *'s in the wrong place. > - // Check that all of the operands of the PHI node have the same > type as the > - // result. > - for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) > + // Check that all of the values of the PHI node have the same > type as the > + // result, and that the incoming blocks are really basic blocks. > + for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) { > Assert1(PN.getType() == PN.getIncomingValue(i)->getType(), > "PHI node operands are not the same type as the > result!", &PN); > + Assert1(PN.getOperand(PHINode::getOperandNumForIncomingBlock(i)), > + "PHI node incoming block is not a BasicBlock!", &PN); How is this checking that the operand is a basic block? At the least, this should have a comment. > void Verifier::visitLoadInst(LoadInst &LI) { > - const Type *ElTy = > - cast(LI.getOperand(0)->getType())->getElementType(); > - Assert2(ElTy == LI.getType(), > - "Load result type does not match pointer operand type!", > &LI, ElTy); > - Assert1(ElTy != Type::getMetadataTy(LI.getContext()), > - "Can't load metadata!", &LI); > + const PointerType *PTy = dyn_cast(LI.getOperand(0)- > >getType()); > + Assert1(PTy, "Load operand must be a pointer.", &LI); > + if (PTy) { > + const Type *ElTy = PTy->getElementType(); > + Assert2(ElTy == LI.getType(), > + "Load result type does not match pointer operand > type!", &LI, ElTy); > + Assert1(ElTy != Type::getMetadataTy(LI.getContext()), > + "Can't load metadata!", &LI); > + } This isn't needed. Assert1 does a "return" on error, many of the other changes aren't needed either. > +void Verifier::VerifyType(const Type *Ty) { > + // We insert complex types into CheckedTypes even if they failed > verification > + // to prevent emitting messages about them multiple times if Half formed thought. > + > + switch (Ty->getTypeID()) { > + case Type::FunctionTyID: { > + if (!CheckedTypes.insert(Ty)) return; Why don't you do the insert before the switch? > + const FunctionType *FTy = cast(Ty); > + > + const Type *RetTy = FTy->getReturnType(); > + Assert2(FunctionType::isValidReturnType(RetTy), > + "Function type with invalid return type", RetTy, FTy); > + VerifyType(RetTy); > + > + for (int i = 0, e = FTy->getNumParams(); i != e; ++i) { Please use 'unsigned i' here and in other places. Thanks for working on this! -Chris From gohman at apple.com Mon Sep 7 20:44:02 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 08 Sep 2009 01:44:02 -0000 Subject: [llvm-commits] [llvm] r81180 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp test/CodeGen/X86/store-empty-member.ll Message-ID: <200909080144.n881i2mp002874@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 7 20:44:02 2009 New Revision: 81180 URL: http://llvm.org/viewvc/llvm-project?rev=81180&view=rev Log: Fix an abort on a store of an empty struct member. getValue returns null in the case of an empty struct, so don't try to call getNumValues on it. Added: llvm/trunk/test/CodeGen/X86/store-empty-member.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=81180&r1=81179&r2=81180&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Sep 7 20:44:02 2009 @@ -861,6 +861,10 @@ for (User::const_op_iterator OI = C->op_begin(), OE = C->op_end(); OI != OE; ++OI) { SDNode *Val = getValue(*OI).getNode(); + // If the operand is an empty aggregate, there are no values. + if (!Val) continue; + // Add each leaf value from the operand to the Constants list + // to form a flattened list of all the values. for (unsigned i = 0, e = Val->getNumValues(); i != e; ++i) Constants.push_back(SDValue(Val, i)); } Added: llvm/trunk/test/CodeGen/X86/store-empty-member.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/store-empty-member.ll?rev=81180&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/store-empty-member.ll (added) +++ llvm/trunk/test/CodeGen/X86/store-empty-member.ll Mon Sep 7 20:44:02 2009 @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | llc -march=x86 | FileCheck %s + +; Don't crash on an empty struct member. + +; CHECK: movl $2, 4(%esp) +; CHECK: movl $1, (%esp) + +%testType = type {i32, [0 x i32], i32} + +define void @foo() nounwind { + %1 = alloca %testType + volatile store %testType {i32 1, [0 x i32] zeroinitializer, i32 2}, %testType* %1 + ret void +} From nicholas at mxc.ca Mon Sep 7 21:02:40 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 08 Sep 2009 02:02:40 -0000 Subject: [llvm-commits] [llvm] r81182 - /llvm/trunk/lib/VMCore/Verifier.cpp Message-ID: <200909080202.n8822evs005241@zion.cs.uiuc.edu> Author: nicholas Date: Mon Sep 7 21:02:39 2009 New Revision: 81182 URL: http://llvm.org/viewvc/llvm-project?rev=81182&view=rev Log: Simplify from my last change. Assert1 is a macro that makes its caller return, so "Assert1(isa<>); cast<>" is a valid idiom. Actually check the PHI node's odd-numbered operands for BasicBlock-ness, like the comment said. 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=81182&r1=81181&r2=81182&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Mon Sep 7 21:02:39 2009 @@ -319,8 +319,8 @@ Broken = true; } - void CheckFailed(const Twine &Message, const Value* V1, - const Type* T2, const Value* V3 = 0) { + void CheckFailed(const Twine &Message, const Value *V1, + const Type *T2, const Value *V3 = 0) { MessagesStr << Message.str() << "\n"; WriteValue(V1); WriteType(T2); @@ -328,8 +328,8 @@ Broken = true; } - void CheckFailed(const Twine &Message, const Type* T1, - const Type* T2 = 0, const Type* T3 = 0) { + void CheckFailed(const Twine &Message, const Type *T1, + const Type *T2 = 0, const Type *T3 = 0) { MessagesStr << Message.str() << "\n"; WriteType(T1); WriteType(T2); @@ -1008,7 +1008,8 @@ for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) { Assert1(PN.getType() == PN.getIncomingValue(i)->getType(), "PHI node operands are not the same type as the result!", &PN); - Assert1(PN.getOperand(PHINode::getOperandNumForIncomingBlock(i)), + Assert1(isa(PN.getOperand( + PHINode::getOperandNumForIncomingBlock(i))), "PHI node incoming block is not a BasicBlock!", &PN); } @@ -1020,20 +1021,13 @@ void Verifier::VerifyCallSite(CallSite CS) { Instruction *I = CS.getInstruction(); - const PointerType *FPTy = - dyn_cast(CS.getCalledValue()->getType()); - if (!FPTy) { - CheckFailed("Called function must be a pointer!", I); - visitInstruction(*I); - return; - } - - const FunctionType *FTy = dyn_cast(FPTy->getElementType()); - if (!FTy) { - CheckFailed("Called function is not pointer to function type!", I); - visitInstruction(*I); - return; - } + Assert1(isa(CS.getCalledValue()->getType()), + "Called function must be a pointer!", I); + const PointerType *FPTy = cast(CS.getCalledValue()->getType()); + + Assert1(isa(FPTy->getElementType()), + "Called function is not pointer to function type!", I); + const FunctionType *FTy = cast(FPTy->getElementType()); // Verify that the correct number of arguments are being passed if (FTy->isVarArg()) @@ -1240,27 +1234,23 @@ void Verifier::visitLoadInst(LoadInst &LI) { const PointerType *PTy = dyn_cast(LI.getOperand(0)->getType()); Assert1(PTy, "Load operand must be a pointer.", &LI); - if (PTy) { - const Type *ElTy = PTy->getElementType(); - Assert2(ElTy == LI.getType(), - "Load result type does not match pointer operand type!", &LI, ElTy); - Assert1(ElTy != Type::getMetadataTy(LI.getContext()), - "Can't load metadata!", &LI); - } + const Type *ElTy = PTy->getElementType(); + Assert2(ElTy == LI.getType(), + "Load result type does not match pointer operand type!", &LI, ElTy); + Assert1(ElTy != Type::getMetadataTy(LI.getContext()), + "Can't load metadata!", &LI); visitInstruction(LI); } void Verifier::visitStoreInst(StoreInst &SI) { const PointerType *PTy = dyn_cast(SI.getOperand(1)->getType()); Assert1(PTy, "Load operand must be a pointer.", &SI); - if (PTy) { - const Type *ElTy = PTy->getElementType(); - Assert2(ElTy == SI.getOperand(0)->getType(), - "Stored value type does not match pointer operand type!", - &SI, ElTy); - Assert1(ElTy != Type::getMetadataTy(SI.getContext()), - "Can't store metadata!", &SI); - } + const Type *ElTy = PTy->getElementType(); + Assert2(ElTy == SI.getOperand(0)->getType(), + "Stored value type does not match pointer operand type!", + &SI, ElTy); + Assert1(ElTy != Type::getMetadataTy(SI.getContext()), + "Can't store metadata!", &SI); visitInstruction(SI); } @@ -1339,8 +1329,10 @@ if (Instruction *Used = dyn_cast(*UI)) Assert2(Used->getParent() != 0, "Instruction referencing instruction not" " embedded in a basic block!", &I, Used); - else + else { CheckFailed("Use of instruction is not an instruction!", *UI); + return; + } } for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) { @@ -1391,8 +1383,8 @@ BasicBlock *UseBlock = BB; if (isa(I)) UseBlock = dyn_cast(I.getOperand(i+1)); - // Avoid crash. The verifier will find this module broken anyways. - if (!UseBlock) UseBlock = BB; + Assert2(UseBlock, "Invoke operand is PHI node with bad incoming-BB", + Op, &I); if (isa(I) && UseBlock == OpBlock) { // Special case of a phi node in the normal destination or the unwind @@ -1468,7 +1460,7 @@ "Function type with invalid return type", RetTy, FTy); VerifyType(RetTy); - for (int i = 0, e = FTy->getNumParams(); i != e; ++i) { + for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) { const Type *ElTy = FTy->getParamType(i); Assert2(FunctionType::isValidArgumentType(ElTy), "Function type with invalid parameter type", ElTy, FTy); @@ -1478,7 +1470,7 @@ case Type::StructTyID: { if (!CheckedTypes.insert(Ty)) return; const StructType *STy = cast(Ty); - for (int i = 0, e = STy->getNumElements(); i != e; ++i) { + for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) { const Type *ElTy = STy->getElementType(i); Assert2(StructType::isValidElementType(ElTy), "Structure type with invalid element type", ElTy, STy); From nicholas at mxc.ca Mon Sep 7 21:02:58 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 07 Sep 2009 19:02:58 -0700 Subject: [llvm-commits] [llvm] r81179 - /llvm/trunk/lib/VMCore/Verifier.cpp In-Reply-To: References: <200909080123.n881Nqkv032723@zion.cs.uiuc.edu> Message-ID: <4AA5BB52.1060002@mxc.ca> Chris Lattner wrote: > > On Sep 7, 2009, at 6:23 PM, Nick Lewycky wrote: > >> Author: nicholas >> Date: Mon Sep 7 20:23:52 2009 >> New Revision: 81179 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=81179&view=rev >> Log: >> Verify types. Invalid types can be constructed when assertions are off. >> >> Make the verifier more robust by avoiding unprotected cast<> calls. >> Notably, >> Assert1(isa<>); cast<> is not safe as Assert1 does not terminate the >> program. > > Please add "isValidElementType" to LangRef type classifications and > clarify the operation constraints as appropriate. Okay, I'll do that later, but soon. This patch isn't changing the language, but you're right that the LangRef isn't being as clear as it should. >> + void CheckFailed(const Twine &Message, const Type* T1, >> + const Type* T2 = 0, const Type* T3 = 0) { > > Please don't put the *'s in the wrong place. Fixed, and fixed where I copied it from. >> - // Check that all of the operands of the PHI node have the same >> type as the >> - // result. >> - for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) >> + // Check that all of the values of the PHI node have the same type >> as the >> + // result, and that the incoming blocks are really basic blocks. >> + for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) { >> Assert1(PN.getType() == PN.getIncomingValue(i)->getType(), >> "PHI node operands are not the same type as the result!", >> &PN); >> + Assert1(PN.getOperand(PHINode::getOperandNumForIncomingBlock(i)), >> + "PHI node incoming block is not a BasicBlock!", &PN); > > How is this checking that the operand is a basic block? At the least, > this should have a comment. Whoa, missing isa! >> void Verifier::visitLoadInst(LoadInst &LI) { >> - const Type *ElTy = >> - cast(LI.getOperand(0)->getType())->getElementType(); >> - Assert2(ElTy == LI.getType(), >> - "Load result type does not match pointer operand type!", >> &LI, ElTy); >> - Assert1(ElTy != Type::getMetadataTy(LI.getContext()), >> - "Can't load metadata!", &LI); >> + const PointerType *PTy = >> dyn_cast(LI.getOperand(0)->getType()); >> + Assert1(PTy, "Load operand must be a pointer.", &LI); >> + if (PTy) { >> + const Type *ElTy = PTy->getElementType(); >> + Assert2(ElTy == LI.getType(), >> + "Load result type does not match pointer operand type!", >> &LI, ElTy); >> + Assert1(ElTy != Type::getMetadataTy(LI.getContext()), >> + "Can't load metadata!", &LI); >> + } > > This isn't needed. Assert1 does a "return" on error, many of the other > changes aren't needed either. Thanks for pointing this out. I've reverted the needless changes. >> +void Verifier::VerifyType(const Type *Ty) { >> + // We insert complex types into CheckedTypes even if they failed >> verification >> + // to prevent emitting messages about them multiple times if > > Half formed thought. Fixed. >> + >> + switch (Ty->getTypeID()) { >> + case Type::FunctionTyID: { >> + if (!CheckedTypes.insert(Ty)) return; > > Why don't you do the insert before the switch? Because I don't want to insert the integers, double, labels, etc. They all go through the default case. >> + const FunctionType *FTy = cast(Ty); >> + >> + const Type *RetTy = FTy->getReturnType(); >> + Assert2(FunctionType::isValidReturnType(RetTy), >> + "Function type with invalid return type", RetTy, FTy); >> + VerifyType(RetTy); >> + >> + for (int i = 0, e = FTy->getNumParams(); i != e; ++i) { > > Please use 'unsigned i' here and in other places. Fixed. Thanks for the review! Nick From sabre at nondot.org Mon Sep 7 22:32:54 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 03:32:54 -0000 Subject: [llvm-commits] [llvm] r81183 - /llvm/trunk/include/llvm/Instructions.h Message-ID: <200909080332.n883Wt11016396@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 22:32:53 2009 New Revision: 81183 URL: http://llvm.org/viewvc/llvm-project?rev=81183&view=rev Log: add getVectorOperand/getIndexOperand accessors to ExtractElementInst. Fix some const correctness problems in SelectInst. Modified: llvm/trunk/include/llvm/Instructions.h Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=81183&r1=81182&r2=81183&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Mon Sep 7 22:32:53 2009 @@ -1217,10 +1217,13 @@ return new(3) SelectInst(C, S1, S2, NameStr, InsertAtEnd); } - Value *getCondition() const { return Op<0>(); } - Value *getTrueValue() const { return Op<1>(); } - Value *getFalseValue() const { return Op<2>(); } - + const Value *getCondition() const { return Op<0>(); } + const Value *getTrueValue() const { return Op<1>(); } + const Value *getFalseValue() const { return Op<2>(); } + Value *getCondition() { return Op<0>(); } + Value *getTrueValue() { return Op<1>(); } + Value *getFalseValue() { return Op<2>(); } + /// areInvalidOperands - Return a string if the specified operands are invalid /// for a select operation, otherwise return null. static const char *areInvalidOperands(Value *Cond, Value *True, Value *False); @@ -1312,6 +1315,16 @@ virtual ExtractElementInst *clone(LLVMContext &Context) const; + Value *getVectorOperand() { return Op<0>(); } + Value *getIndexOperand() { return Op<1>(); } + const Value *getVectorOperand() const { return Op<0>(); } + const Value *getIndexOperand() const { return Op<1>(); } + + const VectorType *getVectorOperandType() const { + return reinterpret_cast(Instruction::getType()); + } + + /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); From sabre at nondot.org Mon Sep 7 22:39:55 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 03:39:55 -0000 Subject: [llvm-commits] [llvm] r81184 - /llvm/trunk/include/llvm/Instructions.h Message-ID: <200909080339.n883dtQf017231@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 22:39:55 2009 New Revision: 81184 URL: http://llvm.org/viewvc/llvm-project?rev=81184&view=rev Log: fix pasto Modified: llvm/trunk/include/llvm/Instructions.h Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=81184&r1=81183&r2=81184&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Mon Sep 7 22:39:55 2009 @@ -1321,7 +1321,7 @@ const Value *getIndexOperand() const { return Op<1>(); } const VectorType *getVectorOperandType() const { - return reinterpret_cast(Instruction::getType()); + return reinterpret_cast(getVectorOperand()->getType()); } From ssen at apple.com Mon Sep 7 22:42:07 2009 From: ssen at apple.com (Shantonu Sen) Date: Mon, 7 Sep 2009 20:42:07 -0700 Subject: [llvm-commits] [PATCH] Remove obsolete autoconf stuff, and upgrade autoconf, cuts down configure size to 361K (from 1.1M!) In-Reply-To: <4AA56617.7000108@gmail.com> References: <4AA26CD9.10007@gmail.com> <6a8523d60909061449u5ce9b254t9a6398e5e313f4ee@mail.gmail.com> <70A73AA7-DF18-44A6-B773-AC05DDDEEB6D@apple.com> <4AA56617.7000108@gmail.com> Message-ID: <2491B621-2AF7-4171-8DAE-5EE76C3F4F95@apple.com> On Sep 7, 2009, at 12:59 PM, T?r?k Edwin wrote: > On 2009-09-07 21:46, Shantonu Sen wrote: >> This patch looks scary to me. Do we really want to invest in moving >> to >> a new autoconf/libtool/automake version that I'm told has known >> incompatibilities (which means it's unlikely to be used by anyone >> else)? > > I can't regenerate llvm's configure with autoconf 2.61 or autoconf > 2.64 > which are the only ones available on Debian. > The regeneration succeeds, but there is a syntax error in configure > when > run (a libtool macro is not expanded). > I'd like to support both autoconf 2.60 and 2.64. It's trivial to use whatever version of auto* AutoRegen.sh requires: [ssen at virgon]$ eval `grep ^want_ AutoRegen.sh | grep -v _clean | tr -d '\'` [ssen at virgon]$ ( mkdir -p src; cd src; for p in autoconf-$ {want_autoconf_version} automake-${want_aclocal_version} libtool-$ {want_libtool_version}; do curl -O ftp://ftp.gnu.org/pub/gnu/`echo $p | awk -F- '{print $1}'`/$p.tar.gz; tar zxf $p.tar.gz; cd $p; ./ configure --prefix=$PWD/../../dst && make && make install; cd ..; done; cd ..; echo "Now add $PWD/dst/bin to the front of your PATH" ) ... Now add /Volumes/HD/ltmp/ssen/llvm/autoconf/dst/bin to the front of your PATH [ssen at virgon]$ export PATH=/Volumes/HD/ltmp/ssen/llvm/autoconf/dst/bin: $PATH [ssen at virgon]$ ./AutoRegen.sh ... Every Linux distribution, Mac OS X install, FreeBSD, etc., has a different combination of auto*/libtool versions. LLVM has standardized on some versions of those tools, and developers should match. I don't think AutoRegen.sh should support ranges of tools, because it makes incremental changes to ./configure meaningless because every line will change. If it's autoconf-2.64, I think that should be what AutoRegen.sh requires, even if configure.ac accepts a lower version for local quick-fix development. I'm confused about libtool requirements. When I try reconfiguring with AutoRegen.sh, the resulting ./configure script has: checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes ../configure: line 5741: LT_PATH_NM: command not found checking for GNU make... make checking whether ln -s works... yes So is libtool required? If it is, please restore it's requirements to AutoRegen.sh, even if ltmain.sh is not used at build time. > Thanks for the review, comments below and new patch attached. > >> >> Some specific issues: >> 1) >>> dnl Indicate that we require autoconf 2.59 or later. Ths is needed >>> because we >>> dnl use some autoconf macros only available in 2.59. >>> -AC_PREREQ(2.59) >>> +AC_PREREQ(2.64) >> >> Please update the comments > > Sorry that should be AC_PREREQ(2.60), it should still work with > autoconf > 2.60. > I changed AutoRegen.sh to accept both. If you have autoconf 2.60 can > you > try whether ./AutoRegen.sh works for you with my patch applied? > >> >> 2) >>> -want_libtool_version='1\.5\.22' >> >> What version of libtool is being used? I can't figure it out. Where >> is >> it documented? > > In the newly attached I kept libtool at what LLVM currently has, only > one macro is used from it though, see below: AC_PROG_NM. > As such I don't think libtool needs to be upgraded. > >> >> 3) >>> 3. Copy /ltdl.m4 to llvm/autoconf/m4 >>> + 3. Copy /ltsugar.m4 to llvm/autoconf/m4 >>> 4. Copy /share/aclocal/libtool.m4 to llvm/autoconf/m4/ >>> libtool.m4 >> >> You didn't update any of the step numbering, leading to many >> duplicate >> numbered steps and gaps of steps. > > Dropped this section from README now, libtool doesn't need to be > updated > since we don't use libtool per se. > >> >> 4) I thought the policy was not to upgrade config.guess? Even if not, >> you've lost several local LLVM changes: >>> *:Darwin:*:*) >>> UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown >>> case $UNAME_PROCESSOR in >>> - *86) UNAME_PROCESSOR=i686 ;; >>> unknown) UNAME_PROCESSOR=powerpc ;; >>> esac >> >> I don't know what else was overwritten, but it can't be good. > > Didn't know it had LLVM local changes, I'll remove the config.* > updates > from my patch, and keep them as is. > >> >> 6) These changes use libtool internal macros, like >> "_LT_PROG_ECHO_BACKSLASH". These are not stable, and should not be >> used by configure scripts. >> >> I think this requirements more refinement. > > Yeah that is hackish, I've done it like that to cut down configure > size. > However libtool is currently only used to detect the extension of > shared > libraries, and for AC_PROG_NM. > Detecting the shared lib extension with libtool needs LT_INIT that > adds > another 300K bloat to configure, instead my latest patch determines > the shared lib extension with a much simpler m4 macro I copied from > LLVM's libtool.m4. > > I think the libtool.m4 in LLVM allows that, it only has this > copyright: > > ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 > ## Free Software Foundation, Inc. > ## Originally by Gordon Matzigkeit , 1996 > ## > ## This file is free software; the Free Software Foundation gives > ## unlimited permission to copy and/or distribute it, with or without > ## modifications, as long as this notice is preserved. > > full.patch.gz: > autoconf/depcomp | 522 > autoconf/ltmain.sh | 6863 ------- > autoconf/m4/bison.m4 | 15 > autoconf/m4/cxx_bidi_iterator.m4 | 22 > autoconf/m4/cxx_fwd_iterator.m4 | 22 > autoconf/m4/cxx_namespaces.m4 | 19 > autoconf/m4/cxx_std_iterator.m4 | 26 > autoconf/m4/flex.m4 | 17 > autoconf/m4/ltdl.m4 | 418 > autoconf/missing | 353 > b/autoconf/AutoRegen.sh | 10 > b/autoconf/README.TXT | 35 > b/autoconf/configure.ac | 40 > b/autoconf/install-sh | 530 > b/autoconf/m4/path_tclsh.m4 | 4 > b/autoconf/m4/shrext.m4 | 38 > b/autoconf/mkinstalldirs | 40 > b/configure |32893 > ++++---------------------------------- > b/include/llvm/Config/config.h.in | 168 > 19 files changed, 4522 insertions(+), 37513 deletions(-) > > > Best regards, > --Edwin > <0001-Update-configure.ac-to-work-with-autoconf-2.64.patch><0003- > Update-install-sh-and-mkinstalldirs.patch><0002-Remove-obsolete-m4- > macros-and-unused-programs.-Also-.patch.gz><0004-Regenerate- > configure-and-config.h.in.patch.gz> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090907/b771ffbf/attachment.html From sabre at nondot.org Mon Sep 7 22:44:52 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 03:44:52 -0000 Subject: [llvm-commits] [llvm] r81185 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/crash.ll Message-ID: <200909080344.n883iq2w017852@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 22:44:51 2009 New Revision: 81185 URL: http://llvm.org/viewvc/llvm-project?rev=81185&view=rev Log: instcombine transforms vector loads that are only used by extractelement operations into a bitcast of the pointer, then a gep, then a scalar load. Disable this when the vector only has one element, because it leads to infinite loops in instcombine (PR4908). This transformation seems like a really bad idea to me, as it will likely disable CSE of vector load/stores etc and can be better done in the code generator when profitable. This goes all the way back to the first days of packed types, r25299 specifically. I'll let those people who care about the performance of vector code decide what to do with this. Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/test/Transforms/InstCombine/crash.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=81185&r1=81184&r2=81185&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Sep 7 22:44:51 2009 @@ -12080,7 +12080,7 @@ // that element. When the elements are not identical, we cannot replace yet // (we do that below, but only when the index is constant). Constant *op0 = C->getOperand(0); - for (unsigned i = 1; i < C->getNumOperands(); ++i) + for (unsigned i = 1; i != C->getNumOperands(); ++i) if (C->getOperand(i) != op0) { op0 = 0; break; @@ -12093,8 +12093,7 @@ // find a previously computed scalar that was inserted into the vector. if (ConstantInt *IdxC = dyn_cast(EI.getOperand(1))) { unsigned IndexVal = IdxC->getZExtValue(); - unsigned VectorWidth = - cast(EI.getOperand(0)->getType())->getNumElements(); + unsigned VectorWidth = EI.getVectorOperandType()->getNumElements(); // If this is extracting an invalid index, turn this into undef, to avoid // crashing the code below. @@ -12146,25 +12145,31 @@ return BinaryOperator::Create(BO->getOpcode(), newEI0, newEI1); } } else if (LoadInst *LI = dyn_cast(I)) { - unsigned AS = LI->getPointerAddressSpace(); - Value *Ptr = Builder->CreateBitCast(I->getOperand(0), - PointerType::get(EI.getType(), AS), - I->getOperand(0)->getName()); - Value *GEP = - Builder->CreateInBoundsGEP(Ptr, EI.getOperand(1), - I->getName()+".gep"); - - LoadInst *Load = Builder->CreateLoad(GEP, "tmp"); - - // Make sure the Load goes before the load instruction in the source, - // not wherever the extract happens to be. - if (Instruction *P = dyn_cast(Ptr)) - P->moveBefore(I); - if (Instruction *G = dyn_cast(GEP)) - G->moveBefore(I); - Load->moveBefore(I); - - return ReplaceInstUsesWith(EI, Load); +// r25299 + // Instead of loading a vector, then doing an extract element out of it, + // just bitcast the pointer operand, do a gep, then load the result. + // This shrinks the vector load to a scalar load. + if (EI.getVectorOperandType()->getNumElements() != 1) { + unsigned AS = LI->getPointerAddressSpace(); + Value *Ptr = Builder->CreateBitCast(I->getOperand(0), + PointerType::get(EI.getType(), AS), + I->getOperand(0)->getName()); + Value *GEP = + Builder->CreateInBoundsGEP(Ptr, EI.getOperand(1), + I->getName()+".gep"); + + LoadInst *Load = Builder->CreateLoad(GEP, "tmp"); + + // Make sure the Load goes before the load instruction in the source, + // not wherever the extract happens to be. + if (Instruction *P = dyn_cast(Ptr)) + P->moveBefore(I); + if (Instruction *G = dyn_cast(GEP)) + G->moveBefore(I); + Load->moveBefore(I); + + return ReplaceInstUsesWith(EI, Load); + } } } if (InsertElementInst *IE = dyn_cast(I)) { Modified: llvm/trunk/test/Transforms/InstCombine/crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/crash.ll?rev=81185&r1=81184&r2=81185&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/crash.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/crash.ll Mon Sep 7 22:44:51 2009 @@ -31,3 +31,16 @@ ret <2 x i64> %conv3.i44 } + +; PR4908 +define void @test2(<1 x i16>* nocapture %b, i32* nocapture %c) nounwind ssp { +entry: + %arrayidx = getelementptr inbounds <1 x i16>* %b, i64 undef ; <<1 x i16>*> + %tmp2 = load <1 x i16>* %arrayidx ; <<1 x i16>> [#uses=1] + %tmp6 = bitcast <1 x i16> %tmp2 to i16 ; [#uses=1] + %tmp7 = zext i16 %tmp6 to i32 ; [#uses=1] + %ins = or i32 0, %tmp7 ; [#uses=1] + %arrayidx20 = getelementptr inbounds i32* %c, i64 undef ; [#uses=1] + store i32 %ins, i32* %arrayidx20 + ret void +} From sabre at nondot.org Mon Sep 7 22:47:42 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 03:47:42 -0000 Subject: [llvm-commits] [llvm] r81186 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200909080347.n883lgxm018214@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 22:47:41 2009 New Revision: 81186 URL: http://llvm.org/viewvc/llvm-project?rev=81186&view=rev Log: remove a turd 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=81186&r1=81185&r2=81186&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Sep 7 22:47:41 2009 @@ -12145,7 +12145,6 @@ return BinaryOperator::Create(BO->getOpcode(), newEI0, newEI1); } } else if (LoadInst *LI = dyn_cast(I)) { -// r25299 // Instead of loading a vector, then doing an extract element out of it, // just bitcast the pointer operand, do a gep, then load the result. // This shrinks the vector load to a scalar load. From clattner at apple.com Mon Sep 7 22:48:15 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 7 Sep 2009 20:48:15 -0700 Subject: [llvm-commits] [llvm] r81179 - /llvm/trunk/lib/VMCore/Verifier.cpp In-Reply-To: <4AA5BB52.1060002@mxc.ca> References: <200909080123.n881Nqkv032723@zion.cs.uiuc.edu> <4AA5BB52.1060002@mxc.ca> Message-ID: <632CD9C4-4018-4E5B-B30D-864FA299B2FF@apple.com> On Sep 7, 2009, at 7:02 PM, Nick Lewycky wrote: >>> + >>> + switch (Ty->getTypeID()) { >>> + case Type::FunctionTyID: { >>> + if (!CheckedTypes.insert(Ty)) return; >> Why don't you do the insert before the switch? > > Because I don't want to insert the integers, double, labels, etc. > They all go through the default case. Why not? -Chris From nicholas at mxc.ca Mon Sep 7 23:00:41 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 07 Sep 2009 21:00:41 -0700 Subject: [llvm-commits] [llvm] r81179 - /llvm/trunk/lib/VMCore/Verifier.cpp In-Reply-To: <632CD9C4-4018-4E5B-B30D-864FA299B2FF@apple.com> References: <200909080123.n881Nqkv032723@zion.cs.uiuc.edu> <4AA5BB52.1060002@mxc.ca> <632CD9C4-4018-4E5B-B30D-864FA299B2FF@apple.com> Message-ID: <4AA5D6E9.5080703@mxc.ca> Chris Lattner wrote: > On Sep 7, 2009, at 7:02 PM, Nick Lewycky wrote: >>>> + >>>> + switch (Ty->getTypeID()) { >>>> + case Type::FunctionTyID: { >>>> + if (!CheckedTypes.insert(Ty)) return; >>> Why don't you do the insert before the switch? >> >> Because I don't want to insert the integers, double, labels, etc. They >> all go through the default case. > > Why not? It's a waste of ram and cycles. We know that those are always valid, we never need to check them. We certainly don't need to store PATypeHolders for them in CheckedTypes. While I wouldn't really mind doing this for non-derived types, what made my mind up was IntegerType and the fact you could in theory have 100,000 different integer types. Of course, the way it's written now is a jump-threading testcase. If you want me to stop arguing and change it, just let me know. :) Nick From clattner at apple.com Mon Sep 7 23:20:16 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 7 Sep 2009 21:20:16 -0700 Subject: [llvm-commits] [llvm] r81179 - /llvm/trunk/lib/VMCore/Verifier.cpp In-Reply-To: <4AA5D6E9.5080703@mxc.ca> References: <200909080123.n881Nqkv032723@zion.cs.uiuc.edu> <4AA5BB52.1060002@mxc.ca> <632CD9C4-4018-4E5B-B30D-864FA299B2FF@apple.com> <4AA5D6E9.5080703@mxc.ca> Message-ID: <3014E3F5-8538-4790-8A33-D3D37DE54765@apple.com> On Sep 7, 2009, at 9:00 PM, Nick Lewycky wrote: > Chris Lattner wrote: >> On Sep 7, 2009, at 7:02 PM, Nick Lewycky wrote: >>>>> + >>>>> + switch (Ty->getTypeID()) { >>>>> + case Type::FunctionTyID: { >>>>> + if (!CheckedTypes.insert(Ty)) return; >>>> Why don't you do the insert before the switch? >>> >>> Because I don't want to insert the integers, double, labels, etc. >>> They all go through the default case. >> Why not? > > It's a waste of ram and cycles. We know that those are always valid, > we never need to check them. We certainly don't need to store > PATypeHolders for them in CheckedTypes. > > While I wouldn't really mind doing this for non-derived types, what > made my mind up was IntegerType and the fact you could in theory > have 100,000 different integer types. > > Of course, the way it's written now is a jump-threading testcase. If > you want me to stop arguing and change it, just let me know. :) Please just change it. I'd rather have the verifier be simple and small than trying to optimize out a dozen insertions. -chris From sabre at nondot.org Mon Sep 7 23:55:44 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 04:55:44 -0000 Subject: [llvm-commits] [llvm] r81187 - in /llvm/trunk: lib/Target/X86/X86FloatingPoint.cpp test/CodeGen/X86/fp-stack-O0-crash.ll Message-ID: <200909080455.n884tiBM026947@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 7 23:55:44 2009 New Revision: 81187 URL: http://llvm.org/viewvc/llvm-project?rev=81187&view=rev Log: fix PR4767, a crash because fp stackifier visited blocks in depth first order, so it wouldn't process unreachable blocks. When compiling at -O0, late dead block elimination isn't done and the bad instructions got to isel. Added: llvm/trunk/test/CodeGen/X86/fp-stack-O0-crash.ll Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=81187&r1=81186&r2=81187&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Mon Sep 7 23:55:44 2009 @@ -213,6 +213,14 @@ I != E; ++I) Changed |= processBasicBlock(MF, **I); + // Process any unreachable blocks in arbitrary order now. + if (MF.size() == Processed.size()) + return Changed; + + for (MachineFunction::iterator BB = MF.begin(), E = MF.end(); BB != E; ++BB) + if (Processed.insert(BB)) + Changed |= processBasicBlock(MF, *BB); + return Changed; } Added: llvm/trunk/test/CodeGen/X86/fp-stack-O0-crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fp-stack-O0-crash.ll?rev=81187&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/fp-stack-O0-crash.ll (added) +++ llvm/trunk/test/CodeGen/X86/fp-stack-O0-crash.ll Mon Sep 7 23:55:44 2009 @@ -0,0 +1,30 @@ +; RUN: llc %s -O0 -fast-isel -regalloc=local -o - +; PR4767 + +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 = "i386-apple-darwin10" + +define void @fn(x86_fp80 %x) nounwind ssp { +entry: + %x.addr = alloca x86_fp80 ; [#uses=5] + store x86_fp80 %x, x86_fp80* %x.addr + br i1 false, label %cond.true, label %cond.false + +cond.true: ; preds = %entry + %tmp = load x86_fp80* %x.addr ; [#uses=1] + %tmp1 = load x86_fp80* %x.addr ; [#uses=1] + %cmp = fcmp oeq x86_fp80 %tmp, %tmp1 ; [#uses=1] + br i1 %cmp, label %if.then, label %if.end + +cond.false: ; preds = %entry + %tmp2 = load x86_fp80* %x.addr ; [#uses=1] + %tmp3 = load x86_fp80* %x.addr ; [#uses=1] + %cmp4 = fcmp une x86_fp80 %tmp2, %tmp3 ; [#uses=1] + br i1 %cmp4, label %if.then, label %if.end + +if.then: ; preds = %cond.false, %cond.true + br label %if.end + +if.end: ; preds = %if.then, %cond.false, %cond.true + ret void +} From sabre at nondot.org Tue Sep 8 00:14:44 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 05:14:44 -0000 Subject: [llvm-commits] [llvm] r81188 - /llvm/trunk/docs/WritingAnLLVMPass.html Message-ID: <200909080514.n885EiPs029392@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 8 00:14:44 2009 New Revision: 81188 URL: http://llvm.org/viewvc/llvm-project?rev=81188&view=rev Log: update this to use raw_ostream Modified: llvm/trunk/docs/WritingAnLLVMPass.html Modified: llvm/trunk/docs/WritingAnLLVMPass.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMPass.html?rev=81188&r1=81187&r2=81188&view=diff ============================================================================== --- llvm/trunk/docs/WritingAnLLVMPass.html (original) +++ llvm/trunk/docs/WritingAnLLVMPass.html Tue Sep 8 00:14:44 2009 @@ -223,12 +223,14 @@
 #include "llvm/Pass.h"
 #include "llvm/Function.h"
+#include "llvm/Support/raw_ostream.h"
 

Which are needed because we are writing a Pass, and +href="http://llvm.org/doxygen/classllvm_1_1Pass.html">Pass, we are operating on Function's.

+href="http://llvm.org/doxygen/classllvm_1_1Function.html">Function's, +and we will be doing some printing.

Next we have:

@@ -273,7 +275,7 @@
 
 
     virtual bool runOnFunction(Function &F) {
-      llvm::cerr << "Hello: " << F.getName() << "\n";
+      errs() << "Hello: " << F.getName() << "\n";
       return false;
     }
   };  // end of struct Hello
@@ -312,6 +314,7 @@
 
 #include "llvm/Pass.h"
 #include "llvm/Function.h"
+#include "llvm/Support/raw_ostream.h"
 
 using namespace llvm;
 
@@ -322,7 +325,7 @@
     Hello() : FunctionPass(&ID) {}
 
     virtual bool runOnFunction(Function &F) {
-      llvm::cerr << "Hello: " << F.getName() << "\n";
+      errs() << "Hello: " << F.getName() << "\n";
       return false;
     }
   };




From sabre at nondot.org  Tue Sep  8 00:15:50 2009
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 08 Sep 2009 05:15:50 -0000
Subject: [llvm-commits] [llvm] r81189 -
	/llvm/trunk/docs/ProgrammersManual.html
Message-ID: <200909080515.n885Fo2R029530@zion.cs.uiuc.edu>

Author: lattner
Date: Tue Sep  8 00:15:50 2009
New Revision: 81189

URL: http://llvm.org/viewvc/llvm-project?rev=81189&view=rev
Log:
llvm::cerr is gone.

Modified:
    llvm/trunk/docs/ProgrammersManual.html

Modified: llvm/trunk/docs/ProgrammersManual.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.html?rev=81189&r1=81188&r2=81189&view=diff

==============================================================================
--- llvm/trunk/docs/ProgrammersManual.html (original)
+++ llvm/trunk/docs/ProgrammersManual.html Tue Sep  8 00:15:50 2009
@@ -1654,7 +1654,7 @@
 for (Function::iterator i = func->begin(), e = func->end(); i != e; ++i)
   // Print out the name of the basic block if it has one, and then the
   // number of instructions that it contains
-  llvm::cerr << "Basic block (name=" << i->getName() << ") has "
+  errs() << "Basic block (name=" << i->getName() << ") has "
              << i->size() << " instructions.\n";
 
@@ -1687,14 +1687,14 @@ for (BasicBlock::iterator i = blk->begin(), e = blk->end(); i != e; ++i) // The next statement works since operator<<(ostream&,...) // is overloaded for Instruction& - llvm::cerr << *i << "\n"; + errs() << *i << "\n";

However, this isn't really the best way to print out the contents of a BasicBlock! Since the ostream operators are overloaded for virtually anything you'll care about, you could have just invoked the print routine on the -basic block itself: llvm::cerr << *blk << "\n";.

+basic block itself: errs() << *blk << "\n";.

@@ -1720,7 +1720,7 @@ // F is a pointer to a Function instance for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) - llvm::cerr << *I << "\n"; + errs() << *I << "\n"; @@ -1799,7 +1799,7 @@ void printNextInstruction(Instruction* inst) { BasicBlock::iterator it(inst); ++it; // After this line, it refers to the instruction after *inst - if (it != inst->getParent()->end()) llvm::cerr << *it << "\n"; + if (it != inst->getParent()->end()) errs() << *it << "\n"; } @@ -1917,8 +1917,8 @@ for (Value::use_iterator i = F->use_begin(), e = F->use_end(); i != e; ++i) if (Instruction *Inst = dyn_cast<Instruction>(*i)) { - llvm::cerr << "F is used in instruction:\n"; - llvm::cerr << *Inst << "\n"; + errs() << "F is used in instruction:\n"; + errs() << *Inst << "\n"; } From daniel at zuster.org Tue Sep 8 00:31:18 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 08 Sep 2009 05:31:18 -0000 Subject: [llvm-commits] [llvm] r81190 - in /llvm/trunk: docs/CommandGuide/lit.pod utils/lit/ utils/lit/LitConfig.py utils/lit/LitFormats.py utils/lit/ProgressBar.py utils/lit/ShCommands.py utils/lit/ShTest.py utils/lit/ShUtil.py utils/lit/TODO utils/lit/TclTest.py utils/lit/TclUtil.py utils/lit/Test.py utils/lit/TestRunner.py utils/lit/TestingConfig.py utils/lit/Util.py utils/lit/lit.py Message-ID: <200909080531.n885VJbj031496@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 8 00:31:18 2009 New Revision: 81190 URL: http://llvm.org/viewvc/llvm-project?rev=81190&view=rev Log: Add 'lit' testing tool. - make install && man $(llvm-config --prefix)/share/man/man1/lit.1 for more information. Added: llvm/trunk/docs/CommandGuide/lit.pod llvm/trunk/utils/lit/ llvm/trunk/utils/lit/LitConfig.py llvm/trunk/utils/lit/LitFormats.py llvm/trunk/utils/lit/ProgressBar.py llvm/trunk/utils/lit/ShCommands.py llvm/trunk/utils/lit/ShTest.py llvm/trunk/utils/lit/ShUtil.py llvm/trunk/utils/lit/TODO llvm/trunk/utils/lit/TclTest.py llvm/trunk/utils/lit/TclUtil.py llvm/trunk/utils/lit/Test.py llvm/trunk/utils/lit/TestRunner.py llvm/trunk/utils/lit/TestingConfig.py llvm/trunk/utils/lit/Util.py llvm/trunk/utils/lit/lit.py (with props) Added: llvm/trunk/docs/CommandGuide/lit.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/lit.pod?rev=81190&view=auto ============================================================================== --- llvm/trunk/docs/CommandGuide/lit.pod (added) +++ llvm/trunk/docs/CommandGuide/lit.pod Tue Sep 8 00:31:18 2009 @@ -0,0 +1,222 @@ +=pod + +=head1 NAME + +lit - LLVM Integrated Tester + +=head1 SYNOPSIS + +B [I] [I] + +=head1 DESCRIPTION + +B is a portable tool for executing LLVM and Clang style test suites, +summarizing their results, and providing indication of failures. B is +designed to be a lightweight testing tool with as simple a user interface as +possible. + +B should be run with one or more I to run specified on the command +line. Tests can be either individual test files or directories to search for +tests (see L<"TEST DISCOVERY">). + +Each specified test will be executed (potentially in parallel) and once all +tests have been run B will print summary information on the number of tests +which passed or failed (see L<"TEST STATUS RESULTS">). The B program will +execute with a non-zero exit code if any tests fail. + +By default B will use a succinct progress display and will only print +summary information for test failures. See L<"OUTPUT OPTIONS"> for options +controlling the B progress display and output. + +B also includes a number of options for controlling how tests are exected +(specific features may depend on the particular test format). See L<"EXECUTION +OPTIONS"> for more information. + +Finally, B also supports additional options for only running a subset of +the options specified on the command line, see L<"SELECTION OPTIONS"> for +more information. + +=head1 GENERAL OPTIONS + +=over + +=item B<-h>, B<--help> + +Show the B help message. + +=item B<-j> I, B<--threads>=I + +Run I tests in parallel. By default, this is automatically chose to match the +number of detected available CPUs. + +=back + +=head1 OUTPUT OPTIONS + +=over + +=item B<-q>, B<--quiet> + +Suppress any output except for test failures. + +=item B<-s>, B<--succinct> + +Show less output, for example don't show information on tests that pass. + +=item B<-v>, B<--verbose> + +Show more information on test failures, for example the entire test output +instead of just the test result. + +=item B<--no-progress-bar> + +Do not use curses based progress bar. + +=back + +=head1 EXECUTION OPTIONS + +=over + +=item B<--path>=I + +Specify an addition I to use when searching for executables in tests. + +=item B<--vg> + +Run individual tests under valgrind (using the memcheck tool). The +I<--error-exitcode> argument for valgrind is used so that valgrind failures will +cause the program to exit with a non-zero status. + +=item B<--vg-arg>=I + +When I<--vg> is used, specify an additional argument to pass to valgrind itself. + +=item B<--time-tests> + +Track the wall time individual tests take to execute and includes the results in +the summary output. This is useful for determining which tests in a test suite +take the most time to execute. Note that this option is most useful with I<-j +1>. + +=back + +=head1 SELECTION OPTIONS + +=over + +=item B<--max-tests>=I + +Run at most I tests and then terminate. + +=item B<--max-time>=I + +Spend at most I seconds (approximately) running tests and then terminate. + +=item B<--shuffle> + +Run the tests in a random order. + +=back + +=head1 ADDITIONAL OPTIONS + +=over + +=item B<--debug> + +Run B in debug mode, for debugging configuration issues and B itself. + +=item B<--show-suites> + +List the discovered test suites as part of the standard output. + +=item B<--no-tcl-as-sh> + +Run Tcl scripts internally (instead of converting to shell scripts). + +=back + +=head1 EXIT STATUS + +B will exit with an exit code of 1 if there are any FAIL or XPASS +results. Otherwise, it will exit with the status 0. Other exit codes used for +non-test related failures (for example a user error or an internal program +error). + +=head1 TEST DISCOVERY + +The inputs passed to B can be either individual tests, or entire +directories or hierarchies of tests to run. When B starts up, the first +thing it does is convert the inputs into a complete list of tests to run as part +of I. + +In the B model, every test must exist inside some I. B +resolves the inputs specified on the command line to test suites by searching +upwards from the input path until it finds a I or I +file. These files serve as both a marker of test suites and as configuration +files which B loads in order to understand how to find and run the tests +inside the test suite. + +Once B has mapped the inputs into test suites it traverses the list of +inputs adding tests for individual files and recursively searching for tests in +directories. + +This behavior makes it easy to specify a subset of tests to run, while still +allowing the test suite configuration to control exactly how tests are +interpreted. In addition, B always identifies tests by the test suite they +are in, and their relative path inside the test suite. For appropriately +configured projects, this allows B to provide convenient and flexible +support for out-of-tree builds. + +=head1 TEST STATUS RESULTS + +Each test ultimately produces one of the following six results: + +=over + +=item B + +The test succeeded. + +=item B + +The test failed, but that is expected. This is used for test formats which allow +specifying that a test does not currently work, but wish to leave it in the test +suite. + +=item B + +The test succeeded, but it was expected to fail. This is used for tests which +were specified as expected to fail, but are now succeeding (generally because +the feautre they test was broken and has been fixed). + +=item B + +The test failed. + +=item B + +The test result could not be determined. For example, this occurs when the test +could not be run, the test itself is invalid, or the test was interrupted. + +=item B + +The test is not supported in this environment. This is used by test formats +which can report unsupported tests. + +=back + +Depending on the test format tests may produce additional information about +their status (generally only for failures). See the L +section for more information. + +=head1 SEE ALSO + +L + +=head1 AUTHOR + +Written by Daniel Dunbar and maintained by the LLVM Team (L). + +=cut Added: llvm/trunk/utils/lit/LitConfig.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/LitConfig.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/LitConfig.py (added) +++ llvm/trunk/utils/lit/LitConfig.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,71 @@ +class LitConfig: + """LitConfig - Configuration data for a 'lit' test runner instance, shared + across all tests. + + The LitConfig object is also used to communicate with client configuration + files, it is always passed in as the global variable 'lit' so that + configuration files can access common functionality and internal components + easily. + """ + + # Provide access to built-in formats. + import LitFormats as formats + + # Provide access to built-in utility functions. + import Util as util + + def __init__(self, progname, path, quiet, + useValgrind, valgrindArgs, + useTclAsSh, + noExecute, debug, isWindows): + # The name of the test runner. + self.progname = progname + # The items to add to the PATH environment variable. + self.path = list(map(str, path)) + self.quiet = bool(quiet) + self.useValgrind = bool(useValgrind) + self.valgrindArgs = list(valgrindArgs) + self.useTclAsSh = bool(useTclAsSh) + self.noExecute = noExecute + self.debug = debug + self.isWindows = bool(isWindows) + + self.numErrors = 0 + self.numWarnings = 0 + + def load_config(self, config, path): + """load_config(config, path) - Load a config object from an alternate + path.""" + from TestingConfig import TestingConfig + return TestingConfig.frompath(path, config.parent, self, + mustExist = True, + config = config) + + def _write_message(self, kind, message): + import inspect, os, sys + + # Get the file/line where this message was generated. + f = inspect.currentframe() + # Step out of _write_message, and then out of wrapper. + f = f.f_back.f_back + file,line,_,_,_ = inspect.getframeinfo(f) + location = '%s:%d' % (os.path.basename(file), line) + + print >>sys.stderr, '%s: %s: %s: %s' % (self.progname, location, + kind, message) + + def note(self, message): + self._write_message('note', message) + + def warning(self, message): + self._write_message('warning', message) + self.numWarnings += 1 + + def error(self, message): + self._write_message('error', message) + self.numErrors += 1 + + def fatal(self, message): + import sys + self._write_message('fatal', message) + sys.exit(2) Added: llvm/trunk/utils/lit/LitFormats.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/LitFormats.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/LitFormats.py (added) +++ llvm/trunk/utils/lit/LitFormats.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,2 @@ +from ShTest import ShTest +from TclTest import TclTest Added: llvm/trunk/utils/lit/ProgressBar.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/ProgressBar.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/ProgressBar.py (added) +++ llvm/trunk/utils/lit/ProgressBar.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,267 @@ +#!/usr/bin/env python + +# Source: http://code.activestate.com/recipes/475116/, with +# modifications by Daniel Dunbar. + +import sys, re, time + +class TerminalController: + """ + A class that can be used to portably generate formatted output to + a terminal. + + `TerminalController` defines a set of instance variables whose + values are initialized to the control sequence necessary to + perform a given action. These can be simply included in normal + output to the terminal: + + >>> term = TerminalController() + >>> print 'This is '+term.GREEN+'green'+term.NORMAL + + Alternatively, the `render()` method can used, which replaces + '${action}' with the string required to perform 'action': + + >>> term = TerminalController() + >>> print term.render('This is ${GREEN}green${NORMAL}') + + If the terminal doesn't support a given action, then the value of + the corresponding instance variable will be set to ''. As a + result, the above code will still work on terminals that do not + support color, except that their output will not be colored. + Also, this means that you can test whether the terminal supports a + given action by simply testing the truth value of the + corresponding instance variable: + + >>> term = TerminalController() + >>> if term.CLEAR_SCREEN: + ... print 'This terminal supports clearning the screen.' + + Finally, if the width and height of the terminal are known, then + they will be stored in the `COLS` and `LINES` attributes. + """ + # Cursor movement: + BOL = '' #: Move the cursor to the beginning of the line + UP = '' #: Move the cursor up one line + DOWN = '' #: Move the cursor down one line + LEFT = '' #: Move the cursor left one char + RIGHT = '' #: Move the cursor right one char + + # Deletion: + CLEAR_SCREEN = '' #: Clear the screen and move to home position + CLEAR_EOL = '' #: Clear to the end of the line. + CLEAR_BOL = '' #: Clear to the beginning of the line. + CLEAR_EOS = '' #: Clear to the end of the screen + + # Output modes: + BOLD = '' #: Turn on bold mode + BLINK = '' #: Turn on blink mode + DIM = '' #: Turn on half-bright mode + REVERSE = '' #: Turn on reverse-video mode + NORMAL = '' #: Turn off all modes + + # Cursor display: + HIDE_CURSOR = '' #: Make the cursor invisible + SHOW_CURSOR = '' #: Make the cursor visible + + # Terminal size: + COLS = None #: Width of the terminal (None for unknown) + LINES = None #: Height of the terminal (None for unknown) + + # Foreground colors: + BLACK = BLUE = GREEN = CYAN = RED = MAGENTA = YELLOW = WHITE = '' + + # Background colors: + BG_BLACK = BG_BLUE = BG_GREEN = BG_CYAN = '' + BG_RED = BG_MAGENTA = BG_YELLOW = BG_WHITE = '' + + _STRING_CAPABILITIES = """ + BOL=cr UP=cuu1 DOWN=cud1 LEFT=cub1 RIGHT=cuf1 + CLEAR_SCREEN=clear CLEAR_EOL=el CLEAR_BOL=el1 CLEAR_EOS=ed BOLD=bold + BLINK=blink DIM=dim REVERSE=rev UNDERLINE=smul NORMAL=sgr0 + HIDE_CURSOR=cinvis SHOW_CURSOR=cnorm""".split() + _COLORS = """BLACK BLUE GREEN CYAN RED MAGENTA YELLOW WHITE""".split() + _ANSICOLORS = "BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE".split() + + def __init__(self, term_stream=sys.stdout): + """ + Create a `TerminalController` and initialize its attributes + with appropriate values for the current terminal. + `term_stream` is the stream that will be used for terminal + output; if this stream is not a tty, then the terminal is + assumed to be a dumb terminal (i.e., have no capabilities). + """ + # Curses isn't available on all platforms + try: import curses + except: return + + # If the stream isn't a tty, then assume it has no capabilities. + if not term_stream.isatty(): return + + # Check the terminal type. If we fail, then assume that the + # terminal has no capabilities. + try: curses.setupterm() + except: return + + # Look up numeric capabilities. + self.COLS = curses.tigetnum('cols') + self.LINES = curses.tigetnum('lines') + + # Look up string capabilities. + for capability in self._STRING_CAPABILITIES: + (attrib, cap_name) = capability.split('=') + setattr(self, attrib, self._tigetstr(cap_name) or '') + + # Colors + set_fg = self._tigetstr('setf') + if set_fg: + for i,color in zip(range(len(self._COLORS)), self._COLORS): + setattr(self, color, curses.tparm(set_fg, i) or '') + set_fg_ansi = self._tigetstr('setaf') + if set_fg_ansi: + for i,color in zip(range(len(self._ANSICOLORS)), self._ANSICOLORS): + setattr(self, color, curses.tparm(set_fg_ansi, i) or '') + set_bg = self._tigetstr('setb') + if set_bg: + for i,color in zip(range(len(self._COLORS)), self._COLORS): + setattr(self, 'BG_'+color, curses.tparm(set_bg, i) or '') + set_bg_ansi = self._tigetstr('setab') + if set_bg_ansi: + for i,color in zip(range(len(self._ANSICOLORS)), self._ANSICOLORS): + setattr(self, 'BG_'+color, curses.tparm(set_bg_ansi, i) or '') + + def _tigetstr(self, cap_name): + # String capabilities can include "delays" of the form "$<2>". + # For any modern terminal, we should be able to just ignore + # these, so strip them out. + import curses + cap = curses.tigetstr(cap_name) or '' + return re.sub(r'\$<\d+>[/*]?', '', cap) + + def render(self, template): + """ + Replace each $-substitutions in the given template string with + the corresponding terminal control string (if it's defined) or + '' (if it's not). + """ + return re.sub(r'\$\$|\${\w+}', self._render_sub, template) + + def _render_sub(self, match): + s = match.group() + if s == '$$': return s + else: return getattr(self, s[2:-1]) + +####################################################################### +# Example use case: progress bar +####################################################################### + +class SimpleProgressBar: + """ + A simple progress bar which doesn't need any terminal support. + + This prints out a progress bar like: + 'Header: 0 .. 10.. 20.. ...' + """ + + def __init__(self, header): + self.header = header + self.atIndex = None + + def update(self, percent, message): + if self.atIndex is None: + sys.stdout.write(self.header) + self.atIndex = 0 + + next = int(percent*50) + if next == self.atIndex: + return + + for i in range(self.atIndex, next): + idx = i % 5 + if idx == 0: + sys.stdout.write('%-2d' % (i*2)) + elif idx == 1: + pass # Skip second char + elif idx < 4: + sys.stdout.write('.') + else: + sys.stdout.write(' ') + sys.stdout.flush() + self.atIndex = next + + def clear(self): + if self.atIndex is not None: + sys.stdout.write('\n') + sys.stdout.flush() + self.atIndex = None + +class ProgressBar: + """ + A 3-line progress bar, which looks like:: + + Header + 20% [===========----------------------------------] + progress message + + The progress bar is colored, if the terminal supports color + output; and adjusts to the width of the terminal. + """ + BAR = '%s${GREEN}[${BOLD}%s%s${NORMAL}${GREEN}]${NORMAL}%s\n' + HEADER = '${BOLD}${CYAN}%s${NORMAL}\n\n' + + def __init__(self, term, header, useETA=True): + self.term = term + if not (self.term.CLEAR_EOL and self.term.UP and self.term.BOL): + raise ValueError("Terminal isn't capable enough -- you " + "should use a simpler progress dispaly.") + self.width = self.term.COLS or 75 + self.bar = term.render(self.BAR) + self.header = self.term.render(self.HEADER % header.center(self.width)) + self.cleared = 1 #: true if we haven't drawn the bar yet. + self.useETA = useETA + if self.useETA: + self.startTime = time.time() + self.update(0, '') + + def update(self, percent, message): + if self.cleared: + sys.stdout.write(self.header) + self.cleared = 0 + prefix = '%3d%% ' % (percent*100,) + suffix = '' + if self.useETA: + elapsed = time.time() - self.startTime + if percent > .0001 and elapsed > 1: + total = elapsed / percent + eta = int(total - elapsed) + h = eta//3600. + m = (eta//60) % 60 + s = eta % 60 + suffix = ' ETA: %02d:%02d:%02d'%(h,m,s) + barWidth = self.width - len(prefix) - len(suffix) - 2 + n = int(barWidth*percent) + if len(message) < self.width: + message = message + ' '*(self.width - len(message)) + else: + message = '... ' + message[-(self.width-4):] + sys.stdout.write( + self.term.BOL + self.term.UP + self.term.CLEAR_EOL + + (self.bar % (prefix, '='*n, '-'*(barWidth-n), suffix)) + + self.term.CLEAR_EOL + message) + + def clear(self): + if not self.cleared: + sys.stdout.write(self.term.BOL + self.term.CLEAR_EOL + + self.term.UP + self.term.CLEAR_EOL + + self.term.UP + self.term.CLEAR_EOL) + self.cleared = 1 + +def test(): + import time + tc = TerminalController() + p = ProgressBar(tc, 'Tests') + for i in range(101): + p.update(i/100., str(i)) + time.sleep(.3) + +if __name__=='__main__': + test() Added: llvm/trunk/utils/lit/ShCommands.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/ShCommands.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/ShCommands.py (added) +++ llvm/trunk/utils/lit/ShCommands.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,86 @@ +import ShUtil + +class Command: + def __init__(self, args, redirects): + self.args = list(args) + self.redirects = list(redirects) + + def __repr__(self): + return 'Command(%r, %r)' % (self.args, self.redirects) + + def __cmp__(self, other): + if not isinstance(other, Command): + return -1 + + return cmp((self.args, self.redirects), + (other.args, other.redirects)) + + def toShell(self, file): + for arg in self.args: + if "'" not in arg: + quoted = "'%s'" % arg + elif '"' not in arg and '$' not in arg: + quoted = '"%s"' % arg + else: + raise NotImplementedError,'Unable to quote %r' % arg + print >>file, quoted, + + # For debugging / validation. + dequoted = list(ShUtil.ShLexer(quoted).lex()) + if dequoted != [arg]: + raise NotImplementedError,'Unable to quote %r' % arg + + for r in self.redirects: + if len(r[0]) == 1: + print >>file, "%s '%s'" % (r[0][0], r[1]), + else: + print >>file, "%s%s '%s'" % (r[0][1], r[0][0], r[1]), + +class Pipeline: + def __init__(self, commands, negate=False, pipe_err=False): + self.commands = commands + self.negate = negate + self.pipe_err = pipe_err + + def __repr__(self): + return 'Pipeline(%r, %r, %r)' % (self.commands, self.negate, + self.pipe_err) + + def __cmp__(self, other): + if not isinstance(other, Pipeline): + return -1 + + return cmp((self.commands, self.negate, self.pipe_err), + (other.commands, other.negate, self.pipe_err)) + + def toShell(self, file, pipefail=False): + if pipefail != self.pipe_err: + raise ValueError,'Inconsistent "pipefail" attribute!' + if self.negate: + print >>file, '!', + for cmd in self.commands: + cmd.toShell(file) + if cmd is not self.commands[-1]: + print >>file, '|\n ', + +class Seq: + def __init__(self, lhs, op, rhs): + assert op in (';', '&', '||', '&&') + self.op = op + self.lhs = lhs + self.rhs = rhs + + def __repr__(self): + return 'Seq(%r, %r, %r)' % (self.lhs, self.op, self.rhs) + + def __cmp__(self, other): + if not isinstance(other, Seq): + return -1 + + return cmp((self.lhs, self.op, self.rhs), + (other.lhs, other.op, other.rhs)) + + def toShell(self, file, pipefail=False): + self.lhs.toShell(file, pipefail) + print >>file, ' %s\n' % self.op + self.rhs.toShell(file, pipefail) Added: llvm/trunk/utils/lit/ShTest.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/ShTest.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/ShTest.py (added) +++ llvm/trunk/utils/lit/ShTest.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,12 @@ +import TestRunner + +class ShTest: + def __init__(self, execute_external = False, require_and_and = False): + self.execute_external = execute_external + self.require_and_and = require_and_and + + def execute(self, test, litConfig): + return TestRunner.executeShTest(test, litConfig, + self.execute_external, + self.require_and_and) + Added: llvm/trunk/utils/lit/ShUtil.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/ShUtil.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/ShUtil.py (added) +++ llvm/trunk/utils/lit/ShUtil.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,346 @@ +import itertools + +import Util +from ShCommands import Command, Pipeline, Seq + +class ShLexer: + def __init__(self, data, win32Escapes = False): + self.data = data + self.pos = 0 + self.end = len(data) + self.win32Escapes = win32Escapes + + def eat(self): + c = self.data[self.pos] + self.pos += 1 + return c + + def look(self): + return self.data[self.pos] + + def maybe_eat(self, c): + """ + maybe_eat(c) - Consume the character c if it is the next character, + returning True if a character was consumed. """ + if self.data[self.pos] == c: + self.pos += 1 + return True + return False + + def lex_arg_fast(self, c): + # Get the leading whitespace free section. + chunk = self.data[self.pos - 1:].split(None, 1)[0] + + # If it has special characters, the fast path failed. + if ('|' in chunk or '&' in chunk or + '<' in chunk or '>' in chunk or + "'" in chunk or '"' in chunk or + '\\' in chunk): + return None + + self.pos = self.pos - 1 + len(chunk) + return chunk + + def lex_arg_slow(self, c): + if c in "'\"": + str = self.lex_arg_quoted(c) + else: + str = c + while self.pos != self.end: + c = self.look() + if c.isspace() or c in "|&": + break + elif c in '><': + # This is an annoying case; we treat '2>' as a single token so + # we don't have to track whitespace tokens. + + # If the parse string isn't an integer, do the usual thing. + if not str.isdigit(): + break + + # Otherwise, lex the operator and convert to a redirection + # token. + num = int(str) + tok = self.lex_one_token() + assert isinstance(tok, tuple) and len(tok) == 1 + return (tok[0], num) + elif c == '"': + self.eat() + str += self.lex_arg_quoted('"') + elif not self.win32Escapes and c == '\\': + # Outside of a string, '\\' escapes everything. + self.eat() + if self.pos == self.end: + Util.warning("escape at end of quoted argument in: %r" % + self.data) + return str + str += self.eat() + else: + str += self.eat() + return str + + def lex_arg_quoted(self, delim): + str = '' + while self.pos != self.end: + c = self.eat() + if c == delim: + return str + elif c == '\\' and delim == '"': + # Inside a '"' quoted string, '\\' only escapes the quote + # character and backslash, otherwise it is preserved. + if self.pos == self.end: + Util.warning("escape at end of quoted argument in: %r" % + self.data) + return str + c = self.eat() + if c == '"': # + str += '"' + elif c == '\\': + str += '\\' + else: + str += '\\' + c + else: + str += c + Util.warning("missing quote character in %r" % self.data) + return str + + def lex_arg_checked(self, c): + pos = self.pos + res = self.lex_arg_fast(c) + end = self.pos + + self.pos = pos + reference = self.lex_arg_slow(c) + if res is not None: + if res != reference: + raise ValueError,"Fast path failure: %r != %r" % (res, reference) + if self.pos != end: + raise ValueError,"Fast path failure: %r != %r" % (self.pos, end) + return reference + + def lex_arg(self, c): + return self.lex_arg_fast(c) or self.lex_arg_slow(c) + + def lex_one_token(self): + """ + lex_one_token - Lex a single 'sh' token. """ + + c = self.eat() + if c in ';!': + return (c,) + if c == '|': + if self.maybe_eat('|'): + return ('||',) + return (c,) + if c == '&': + if self.maybe_eat('&'): + return ('&&',) + if self.maybe_eat('>'): + return ('&>',) + return (c,) + if c == '>': + if self.maybe_eat('&'): + return ('>&',) + if self.maybe_eat('>'): + return ('>>',) + return (c,) + if c == '<': + if self.maybe_eat('&'): + return ('<&',) + if self.maybe_eat('>'): + return ('<<',) + return (c,) + + return self.lex_arg(c) + + def lex(self): + while self.pos != self.end: + if self.look().isspace(): + self.eat() + else: + yield self.lex_one_token() + +### + +class ShParser: + def __init__(self, data, win32Escapes = False): + self.data = data + self.tokens = ShLexer(data, win32Escapes = win32Escapes).lex() + + def lex(self): + try: + return self.tokens.next() + except StopIteration: + return None + + def look(self): + next = self.lex() + if next is not None: + self.tokens = itertools.chain([next], self.tokens) + return next + + def parse_command(self): + tok = self.lex() + if not tok: + raise ValueError,"empty command!" + if isinstance(tok, tuple): + raise ValueError,"syntax error near unexpected token %r" % tok[0] + + args = [tok] + redirects = [] + while 1: + tok = self.look() + + # EOF? + if tok is None: + break + + # If this is an argument, just add it to the current command. + if isinstance(tok, str): + args.append(self.lex()) + continue + + # Otherwise see if it is a terminator. + assert isinstance(tok, tuple) + if tok[0] in ('|',';','&','||','&&'): + break + + # Otherwise it must be a redirection. + op = self.lex() + arg = self.lex() + if not arg: + raise ValueError,"syntax error near token %r" % op[0] + redirects.append((op, arg)) + + return Command(args, redirects) + + def parse_pipeline(self): + negate = False + if self.look() == ('!',): + self.lex() + negate = True + + commands = [self.parse_command()] + while self.look() == ('|',): + self.lex() + commands.append(self.parse_command()) + return Pipeline(commands, negate) + + def parse(self): + lhs = self.parse_pipeline() + + while self.look(): + operator = self.lex() + assert isinstance(operator, tuple) and len(operator) == 1 + + if not self.look(): + raise ValueError, "missing argument to operator %r" % operator[0] + + # FIXME: Operator precedence!! + lhs = Seq(lhs, operator[0], self.parse_pipeline()) + + return lhs + +### + +import unittest + +class TestShLexer(unittest.TestCase): + def lex(self, str, *args, **kwargs): + return list(ShLexer(str, *args, **kwargs).lex()) + + def test_basic(self): + self.assertEqual(self.lex('a|b>c&d',), 'c', ('&',), 'd', + ('<',), 'e']) + + def test_redirection_tokens(self): + self.assertEqual(self.lex('a2>c'), + ['a2', ('>',), 'c']) + self.assertEqual(self.lex('a 2>c'), + ['a', ('>',2), 'c']) + + def test_quoting(self): + self.assertEqual(self.lex(""" 'a' """), + ['a']) + self.assertEqual(self.lex(""" "hello\\"world" """), + ['hello"world']) + self.assertEqual(self.lex(""" "hello\\'world" """), + ["hello\\'world"]) + self.assertEqual(self.lex(""" "hello\\\\world" """), + ["hello\\world"]) + self.assertEqual(self.lex(""" he"llo wo"rld """), + ["hello world"]) + self.assertEqual(self.lex(""" a\\ b a\\\\b """), + ["a b", "a\\b"]) + self.assertEqual(self.lex(""" "" "" """), + ["", ""]) + self.assertEqual(self.lex(""" a\\ b """, win32Escapes = True), + ['a\\', 'b']) + +class TestShParse(unittest.TestCase): + def parse(self, str): + return ShParser(str).parse() + + def test_basic(self): + self.assertEqual(self.parse('echo hello'), + Pipeline([Command(['echo', 'hello'], [])], False)) + self.assertEqual(self.parse('echo ""'), + Pipeline([Command(['echo', ''], [])], False)) + + def test_redirection(self): + self.assertEqual(self.parse('echo hello > c'), + Pipeline([Command(['echo', 'hello'], + [((('>'),), 'c')])], False)) + self.assertEqual(self.parse('echo hello > c >> d'), + Pipeline([Command(['echo', 'hello'], [(('>',), 'c'), + (('>>',), 'd')])], False)) + self.assertEqual(self.parse('a 2>&1'), + Pipeline([Command(['a'], [(('>&',2), '1')])], False)) + + def test_pipeline(self): + self.assertEqual(self.parse('a | b'), + Pipeline([Command(['a'], []), + Command(['b'], [])], + False)) + + self.assertEqual(self.parse('a | b | c'), + Pipeline([Command(['a'], []), + Command(['b'], []), + Command(['c'], [])], + False)) + + self.assertEqual(self.parse('! a'), + Pipeline([Command(['a'], [])], + True)) + + def test_list(self): + self.assertEqual(self.parse('a ; b'), + Seq(Pipeline([Command(['a'], [])], False), + ';', + Pipeline([Command(['b'], [])], False))) + + self.assertEqual(self.parse('a & b'), + Seq(Pipeline([Command(['a'], [])], False), + '&', + Pipeline([Command(['b'], [])], False))) + + self.assertEqual(self.parse('a && b'), + Seq(Pipeline([Command(['a'], [])], False), + '&&', + Pipeline([Command(['b'], [])], False))) + + self.assertEqual(self.parse('a || b'), + Seq(Pipeline([Command(['a'], [])], False), + '||', + Pipeline([Command(['b'], [])], False))) + + self.assertEqual(self.parse('a && b || c'), + Seq(Seq(Pipeline([Command(['a'], [])], False), + '&&', + Pipeline([Command(['b'], [])], False)), + '||', + Pipeline([Command(['c'], [])], False))) + +if __name__ == '__main__': + unittest.main() Added: llvm/trunk/utils/lit/TODO URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/TODO?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/TODO (added) +++ llvm/trunk/utils/lit/TODO Tue Sep 8 00:31:18 2009 @@ -0,0 +1,19 @@ + - Move temp directory name into local test config. + + - Add --show-unsupported, don't show by default? + + - Finish documentation. + + - Optionally use multiprocessing. + + - Support llvmc and ocaml tests. + + - Support valgrind in all configs, and LLVM style valgrind. + + - Provide test suite config for running unit tests. + + - Support a timeout / ulimit. + + - Support "disabling" tests? The advantage of making this distinct from XFAIL + is it makes it more obvious that it is a temporary measure (and lit can put + in a separate category). Added: llvm/trunk/utils/lit/TclTest.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/TclTest.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/TclTest.py (added) +++ llvm/trunk/utils/lit/TclTest.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,7 @@ +import TestRunner + +class TclTest: + def execute(self, test, litConfig): + return TestRunner.executeTclTest(test, litConfig) + + Added: llvm/trunk/utils/lit/TclUtil.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/TclUtil.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/TclUtil.py (added) +++ llvm/trunk/utils/lit/TclUtil.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,322 @@ +import itertools + +from ShCommands import Command, Pipeline + +def tcl_preprocess(data): + # Tcl has a preprocessing step to replace escaped newlines. + i = data.find('\\\n') + if i == -1: + return data + + # Replace '\\\n' and subsequent whitespace by a single space. + n = len(data) + str = data[:i] + i += 2 + while i < n and data[i] in ' \t': + i += 1 + return str + ' ' + data[i:] + +class TclLexer: + """TclLexer - Lex a string into "words", following the Tcl syntax.""" + + def __init__(self, data): + self.data = tcl_preprocess(data) + self.pos = 0 + self.end = len(self.data) + + def at_end(self): + return self.pos == self.end + + def eat(self): + c = self.data[self.pos] + self.pos += 1 + return c + + def look(self): + return self.data[self.pos] + + def maybe_eat(self, c): + """ + maybe_eat(c) - Consume the character c if it is the next character, + returning True if a character was consumed. """ + if self.data[self.pos] == c: + self.pos += 1 + return True + return False + + def escape(self, c): + if c == 'a': + return '\x07' + elif c == 'b': + return '\x08' + elif c == 'f': + return '\x0c' + elif c == 'n': + return '\n' + elif c == 'r': + return '\r' + elif c == 't': + return '\t' + elif c == 'v': + return '\x0b' + elif c in 'uxo': + raise ValueError,'Invalid quoted character %r' % c + else: + return c + + def lex_braced(self): + # Lex until whitespace or end of string, the opening brace has already + # been consumed. + + str = '' + while 1: + if self.at_end(): + raise ValueError,"Unterminated '{' quoted word" + + c = self.eat() + if c == '}': + break + elif c == '{': + str += '{' + self.lex_braced() + '}' + elif c == '\\' and self.look() in '{}': + str += self.eat() + else: + str += c + + return str + + def lex_quoted(self): + str = '' + + while 1: + if self.at_end(): + raise ValueError,"Unterminated '\"' quoted word" + + c = self.eat() + if c == '"': + break + elif c == '\\': + if self.at_end(): + raise ValueError,'Missing quoted character' + + str += self.escape(self.eat()) + else: + str += c + + return str + + def lex_unquoted(self, process_all=False): + # Lex until whitespace or end of string. + str = '' + while not self.at_end(): + if not process_all: + if self.look().isspace() or self.look() == ';': + break + + c = self.eat() + if c == '\\': + if self.at_end(): + raise ValueError,'Missing quoted character' + + str += self.escape(self.eat()) + elif c == '[': + raise NotImplementedError, ('Command substitution is ' + 'not supported') + elif c == '$' and not self.at_end() and (self.look().isalpha() or + self.look() == '{'): + raise NotImplementedError, ('Variable substitution is ' + 'not supported') + else: + str += c + + return str + + def lex_one_token(self): + if self.maybe_eat('"'): + return self.lex_quoted() + elif self.maybe_eat('{'): + # Check for argument substitution. + if not self.maybe_eat('*'): + return self.lex_braced() + + if not self.maybe_eat('}'): + return '*' + self.lex_braced() + + if self.at_end() or self.look().isspace(): + return '*' + + raise NotImplementedError, "Argument substitution is unsupported" + else: + return self.lex_unquoted() + + def lex(self): + while not self.at_end(): + c = self.look() + if c in ' \t': + self.eat() + elif c in ';\n': + self.eat() + yield (';',) + else: + yield self.lex_one_token() + +class TclExecCommand: + kRedirectPrefixes1 = ('<', '>') + kRedirectPrefixes2 = ('<@', '<<', '2>', '>&', '>>', '>@') + kRedirectPrefixes3 = ('2>@', '2>>', '>>&', '>&@') + kRedirectPrefixes4 = ('2>@1',) + + def __init__(self, args): + self.args = iter(args) + + def lex(self): + try: + return self.args.next() + except StopIteration: + return None + + def look(self): + next = self.lex() + if next is not None: + self.args = itertools.chain([next], self.args) + return next + + def parse_redirect(self, tok, length): + if len(tok) == length: + arg = self.lex() + if next is None: + raise ValueError,'Missing argument to %r redirection' % tok + else: + tok,arg = tok[:length],tok[length:] + + if tok[0] == '2': + op = (tok[1:],2) + else: + op = (tok,) + return (op, arg) + + def parse_pipeline(self): + if self.look() is None: + raise ValueError,"Expected at least one argument to exec" + + commands = [Command([],[])] + while 1: + arg = self.lex() + if arg is None: + break + elif arg == '|': + commands.append(Command([],[])) + elif arg == '|&': + # Write this as a redirect of stderr; it must come first because + # stdout may have already been redirected. + commands[-1].redirects.insert(0, (('>&',2),'1')) + commands.append(Command([],[])) + elif arg[:4] in TclExecCommand.kRedirectPrefixes4: + commands[-1].redirects.append(self.parse_redirect(arg, 4)) + elif arg[:3] in TclExecCommand.kRedirectPrefixes3: + commands[-1].redirects.append(self.parse_redirect(arg, 3)) + elif arg[:2] in TclExecCommand.kRedirectPrefixes2: + commands[-1].redirects.append(self.parse_redirect(arg, 2)) + elif arg[:1] in TclExecCommand.kRedirectPrefixes1: + commands[-1].redirects.append(self.parse_redirect(arg, 1)) + else: + commands[-1].args.append(arg) + + return Pipeline(commands, False, pipe_err=True) + + def parse(self): + ignoreStderr = False + keepNewline = False + + # Parse arguments. + while 1: + next = self.look() + if not isinstance(next, str) or next[0] != '-': + break + + if next == '--': + self.lex() + break + elif next == '-ignorestderr': + ignoreStderr = True + elif next == '-keepnewline': + keepNewline = True + else: + raise ValueError,"Invalid exec argument %r" % next + + return (ignoreStderr, keepNewline, self.parse_pipeline()) + +### + +import unittest + +class TestTclLexer(unittest.TestCase): + def lex(self, str, *args, **kwargs): + return list(TclLexer(str, *args, **kwargs).lex()) + + def test_preprocess(self): + self.assertEqual(tcl_preprocess('a b'), 'a b') + self.assertEqual(tcl_preprocess('a\\\nb c'), 'a b c') + + def test_unquoted(self): + self.assertEqual(self.lex('a b c'), + ['a', 'b', 'c']) + self.assertEqual(self.lex(r'a\nb\tc\ '), + ['a\nb\tc ']) + self.assertEqual(self.lex(r'a \\\$b c $\\'), + ['a', r'\$b', 'c', '$\\']) + + def test_braced(self): + self.assertEqual(self.lex('a {b c} {}'), + ['a', 'b c', '']) + self.assertEqual(self.lex(r'a {b {c\n}}'), + ['a', 'b {c\\n}']) + self.assertEqual(self.lex(r'a {b\{}'), + ['a', 'b{']) + self.assertEqual(self.lex(r'{*}'), ['*']) + self.assertEqual(self.lex(r'{*} a'), ['*', 'a']) + self.assertEqual(self.lex(r'{*} a'), ['*', 'a']) + self.assertEqual(self.lex('{a\\\n b}'), + ['a b']) + + def test_quoted(self): + self.assertEqual(self.lex('a "b c"'), + ['a', 'b c']) + + def test_terminators(self): + self.assertEqual(self.lex('a\nb'), + ['a', (';',), 'b']) + self.assertEqual(self.lex('a;b'), + ['a', (';',), 'b']) + self.assertEqual(self.lex('a ; b'), + ['a', (';',), 'b']) + +class TestTclExecCommand(unittest.TestCase): + def parse(self, str): + return TclExecCommand(list(TclLexer(str).lex())).parse() + + def test_basic(self): + self.assertEqual(self.parse('echo hello'), + (False, False, + Pipeline([Command(['echo', 'hello'], [])], + False, True))) + self.assertEqual(self.parse('echo hello | grep hello'), + (False, False, + Pipeline([Command(['echo', 'hello'], []), + Command(['grep', 'hello'], [])], + False, True))) + + def test_redirect(self): + self.assertEqual(self.parse('echo hello > a >b >>c 2> d |& e'), + (False, False, + Pipeline([Command(['echo', 'hello'], + [(('>',),'a'), + (('>',),'b'), + (('>>',),'c'), + (('>',2),'d'), + (('>&',2),'1')]), + Command(['e'], [])], + False, True))) + +if __name__ == '__main__': + unittest.main() Added: llvm/trunk/utils/lit/Test.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/Test.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/Test.py (added) +++ llvm/trunk/utils/lit/Test.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,71 @@ +import os + +# Test results. + +class TestResult: + def __init__(self, name, isFailure): + self.name = name + self.isFailure = isFailure + +PASS = TestResult('PASS', False) +XFAIL = TestResult('XFAIL', False) +FAIL = TestResult('FAIL', True) +XPASS = TestResult('XPASS', True) +UNRESOLVED = TestResult('UNRESOLVED', True) +UNSUPPORTED = TestResult('UNSUPPORTED', False) + +# Test classes. + +class TestFormat: + """TestFormat - Test information provider.""" + + def __init__(self, name): + self.name = name + +class TestSuite: + """TestSuite - Information on a group of tests. + + A test suite groups together a set of logically related tests. + """ + + def __init__(self, name, source_root, exec_root, config): + self.name = name + self.source_root = source_root + self.exec_root = exec_root + # The test suite configuration. + self.config = config + + def getSourcePath(self, components): + return os.path.join(self.source_root, *components) + + def getExecPath(self, components): + return os.path.join(self.exec_root, *components) + +class Test: + """Test - Information on a single test instance.""" + + def __init__(self, suite, path_in_suite, config): + self.suite = suite + self.path_in_suite = path_in_suite + self.config = config + # The test result code, once complete. + self.result = None + # Any additional output from the test, once complete. + self.output = None + # The wall time to execute this test, if timing and once complete. + self.elapsed = None + + def setResult(self, result, output, elapsed): + assert self.result is None, "Test result already set!" + self.result = result + self.output = output + self.elapsed = elapsed + + def getFullName(self): + return self.suite.config.name + '::' + '/'.join(self.path_in_suite) + + def getSourcePath(self): + return self.suite.getSourcePath(self.path_in_suite) + + def getExecPath(self): + return self.suite.getExecPath(self.path_in_suite) Added: llvm/trunk/utils/lit/TestRunner.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/TestRunner.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/TestRunner.py (added) +++ llvm/trunk/utils/lit/TestRunner.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,460 @@ +import os, signal, subprocess, sys +import StringIO + +import ShUtil +import Test +import Util + +def executeCommand(command, cwd=None, env=None): + p = subprocess.Popen(command, cwd=cwd, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=env) + out,err = p.communicate() + exitCode = p.wait() + + # Detect Ctrl-C in subprocess. + if exitCode == -signal.SIGINT: + raise KeyboardInterrupt + + return out, err, exitCode + +def executeShCmd(cmd, cfg, cwd, results): + if isinstance(cmd, ShUtil.Seq): + if cmd.op == ';': + res = executeShCmd(cmd.lhs, cfg, cwd, results) + return executeShCmd(cmd.rhs, cfg, cwd, results) + + if cmd.op == '&': + raise NotImplementedError,"unsupported test command: '&'" + + if cmd.op == '||': + res = executeShCmd(cmd.lhs, cfg, cwd, results) + if res != 0: + res = executeShCmd(cmd.rhs, cfg, cwd, results) + return res + if cmd.op == '&&': + res = executeShCmd(cmd.lhs, cfg, cwd, results) + if res is None: + return res + + if res == 0: + res = executeShCmd(cmd.rhs, cfg, cwd, results) + return res + + raise ValueError,'Unknown shell command: %r' % cmd.op + + assert isinstance(cmd, ShUtil.Pipeline) + procs = [] + input = subprocess.PIPE + for j in cmd.commands: + redirects = [(0,), (1,), (2,)] + for r in j.redirects: + if r[0] == ('>',2): + redirects[2] = [r[1], 'w', None] + elif r[0] == ('>&',2) and r[1] in '012': + redirects[2] = redirects[int(r[1])] + elif r[0] == ('>&',) or r[0] == ('&>',): + redirects[1] = redirects[2] = [r[1], 'w', None] + elif r[0] == ('>',): + redirects[1] = [r[1], 'w', None] + elif r[0] == ('<',): + redirects[0] = [r[1], 'r', None] + else: + raise NotImplementedError,"Unsupported redirect: %r" % (r,) + + final_redirects = [] + for index,r in enumerate(redirects): + if r == (0,): + result = input + elif r == (1,): + if index == 0: + raise NotImplementedError,"Unsupported redirect for stdin" + elif index == 1: + result = subprocess.PIPE + else: + result = subprocess.STDOUT + elif r == (2,): + if index != 2: + raise NotImplementedError,"Unsupported redirect on stdout" + result = subprocess.PIPE + else: + if r[2] is None: + r[2] = open(r[0], r[1]) + result = r[2] + final_redirects.append(result) + + stdin, stdout, stderr = final_redirects + + # If stderr wants to come from stdout, but stdout isn't a pipe, then put + # stderr on a pipe and treat it as stdout. + if (stderr == subprocess.STDOUT and stdout != subprocess.PIPE): + stderr = subprocess.PIPE + stderrIsStdout = True + else: + stderrIsStdout = False + procs.append(subprocess.Popen(j.args, cwd=cwd, + stdin = stdin, + stdout = stdout, + stderr = stderr, + env = cfg.environment, + close_fds = True)) + + # Immediately close stdin for any process taking stdin from us. + if stdin == subprocess.PIPE: + procs[-1].stdin.close() + procs[-1].stdin = None + + # Update the current stdin source. + if stdout == subprocess.PIPE: + input = procs[-1].stdout + elif stderrIsStdout: + input = procs[-1].stderr + else: + input = subprocess.PIPE + + # FIXME: There is a potential for deadlock here, when we have a pipe and + # some process other than the last one ends up blocked on stderr. + procData = [None] * len(procs) + procData[-1] = procs[-1].communicate() + for i in range(len(procs) - 1): + if procs[i].stdout is not None: + out = procs[i].stdout.read() + else: + out = '' + if procs[i].stderr is not None: + err = procs[i].stderr.read() + else: + err = '' + procData[i] = (out,err) + + exitCode = None + for i,(out,err) in enumerate(procData): + res = procs[i].wait() + # Detect Ctrl-C in subprocess. + if res == -signal.SIGINT: + raise KeyboardInterrupt + + results.append((cmd.commands[i], out, err, res)) + if cmd.pipe_err: + # Python treats the exit code as a signed char. + if res < 0: + exitCode = min(exitCode, res) + else: + exitCode = max(exitCode, res) + else: + exitCode = res + + if cmd.negate: + exitCode = not exitCode + + return exitCode + +def executeScriptInternal(test, litConfig, tmpBase, commands, cwd): + ln = ' &&\n'.join(commands) + try: + cmd = ShUtil.ShParser(ln, litConfig.isWindows).parse() + except: + return (Test.FAIL, "shell parser error on: %r" % ln) + + results = [] + exitCode = executeShCmd(cmd, test.config, cwd, results) + + out = err = '' + for i,(cmd, cmd_out,cmd_err,res) in enumerate(results): + out += 'Command %d: %s\n' % (i, ' '.join('"%s"' % s for s in cmd.args)) + out += 'Command %d Result: %r\n' % (i, res) + out += 'Command %d Output:\n%s\n\n' % (i, cmd_out) + out += 'Command %d Stderr:\n%s\n\n' % (i, cmd_err) + + return out, err, exitCode + +def executeTclScriptInternal(test, litConfig, tmpBase, commands, cwd): + import TclUtil + cmds = [] + for ln in commands: + # Given the unfortunate way LLVM's test are written, the line gets + # backslash substitution done twice. + ln = TclUtil.TclLexer(ln).lex_unquoted(process_all = True) + + try: + tokens = list(TclUtil.TclLexer(ln).lex()) + except: + return (Test.FAIL, "Tcl lexer error on: %r" % ln) + + # Validate there are no control tokens. + for t in tokens: + if not isinstance(t, str): + return (Test.FAIL, + "Invalid test line: %r containing %r" % (ln, t)) + + try: + cmds.append(TclUtil.TclExecCommand(tokens).parse_pipeline()) + except: + return (TestStatus.Fail, "Tcl 'exec' parse error on: %r" % ln) + + cmd = cmds[0] + for c in cmds[1:]: + cmd = ShUtil.Seq(cmd, '&&', c) + + if litConfig.useTclAsSh: + script = tmpBase + '.script' + + # Write script file + f = open(script,'w') + print >>f, 'set -o pipefail' + cmd.toShell(f, pipefail = True) + f.close() + + if 0: + print >>sys.stdout, cmd + print >>sys.stdout, open(script).read() + print >>sys.stdout + return '', '', 0 + + command = ['/bin/sh', script] + out,err,exitCode = executeCommand(command, cwd=cwd, + env=test.config.environment) + + # Tcl commands fail on standard error output. + if err: + exitCode = 1 + out = 'Command has output on stderr!\n\n' + out + + return out,err,exitCode + else: + results = [] + exitCode = executeShCmd(cmd, test.config, cwd, results) + + out = err = '' + + # Tcl commands fail on standard error output. + if [True for _,_,err,res in results if err]: + exitCode = 1 + out += 'Command has output on stderr!\n\n' + + for i,(cmd, cmd_out, cmd_err, res) in enumerate(results): + out += 'Command %d: %s\n' % (i, ' '.join('"%s"' % s for s in cmd.args)) + out += 'Command %d Result: %r\n' % (i, res) + out += 'Command %d Output:\n%s\n\n' % (i, cmd_out) + out += 'Command %d Stderr:\n%s\n\n' % (i, cmd_err) + + return out, err, exitCode + +def executeScript(test, litConfig, tmpBase, commands, cwd): + script = tmpBase + '.script' + if litConfig.isWindows: + script += '.bat' + + # Write script file + f = open(script,'w') + if litConfig.isWindows: + f.write('\nif %ERRORLEVEL% NEQ 0 EXIT\n'.join(commands)) + else: + f.write(' &&\n'.join(commands)) + f.write('\n') + f.close() + + if litConfig.isWindows: + command = ['cmd','/c', script] + else: + command = ['/bin/sh', script] + if litConfig.useValgrind: + # FIXME: Running valgrind on sh is overkill. We probably could just + # run on clang with no real loss. + valgrindArgs = ['valgrind', '-q', + '--tool=memcheck', '--trace-children=yes', + '--error-exitcode=123'] + valgrindArgs.extend(litConfig.valgrindArgs) + + command = valgrindArgs + command + + return executeCommand(command, cwd=cwd, env=test.config.environment) + +def parseIntegratedTestScript(test, xfailHasColon, requireAndAnd): + """parseIntegratedTestScript - Scan an LLVM/Clang style integrated test + script and extract the lines to 'RUN' as well as 'XFAIL' and 'XTARGET' + information. The RUN lines also will have variable substitution performed. + """ + + # Get the temporary location, this is always relative to the test suite + # root, not test source root. + # + # FIXME: This should not be here? + sourcepath = test.getSourcePath() + execpath = test.getExecPath() + execdir,execbase = os.path.split(execpath) + tmpBase = os.path.join(execdir, 'Output', execbase) + + # We use #_MARKER_# to hide %% while we do the other substitutions. + substitutions = [('%%', '#_MARKER_#')] + substitutions.extend(test.config.substitutions) + substitutions.extend([('%s', sourcepath), + ('%S', os.path.dirname(sourcepath)), + ('%p', os.path.dirname(sourcepath)), + ('%t', tmpBase + '.tmp'), + ('#_MARKER_#', '%')]) + + # Collect the test lines from the script. + script = [] + xfails = [] + xtargets = [] + for ln in open(sourcepath): + if 'RUN:' in ln: + # Isolate the command to run. + index = ln.index('RUN:') + ln = ln[index+4:] + + # Trim trailing whitespace. + ln = ln.rstrip() + + # Collapse lines with trailing '\\'. + if script and script[-1][-1] == '\\': + script[-1] = script[-1][:-1] + ln + else: + script.append(ln) + elif xfailHasColon and 'XFAIL:' in ln: + items = ln[ln.index('XFAIL:') + 6:].split(',') + xfails.extend([s.strip() for s in items]) + elif not xfailHasColon and 'XFAIL' in ln: + items = ln[ln.index('XFAIL') + 5:].split(',') + xfails.extend([s.strip() for s in items]) + elif 'XTARGET:' in ln: + items = ln[ln.index('XTARGET:') + 8:].split(',') + xtargets.extend([s.strip() for s in items]) + elif 'END.' in ln: + # Check for END. lines. + if ln[ln.index('END.'):].strip() == 'END.': + break + + # Apply substitutions to the script. + def processLine(ln): + # Apply substitutions + for a,b in substitutions: + ln = ln.replace(a,b) + + # Strip the trailing newline and any extra whitespace. + return ln.strip() + script = map(processLine, script) + + # Verify the script contains a run line. + if not script: + return (Test.UNRESOLVED, "Test has no run line!") + + if script[-1][-1] == '\\': + return (Test.UNRESOLVED, "Test has unterminated run lines (with '\\')") + + # Validate interior lines for '&&', a lovely historical artifact. + if requireAndAnd: + for i in range(len(script) - 1): + ln = script[i] + + if not ln.endswith('&&'): + return (Test.FAIL, + ("MISSING \'&&\': %s\n" + + "FOLLOWED BY : %s\n") % (ln, script[i + 1])) + + # Strip off '&&' + script[i] = ln[:-2] + + return script,xfails,xtargets,tmpBase,execdir + +def formatTestOutput(status, out, err, exitCode, script): + output = StringIO.StringIO() + print >>output, "Script:" + print >>output, "--" + print >>output, '\n'.join(script) + print >>output, "--" + print >>output, "Exit Code: %r" % exitCode + print >>output, "Command Output (stdout):" + print >>output, "--" + output.write(out) + print >>output, "--" + print >>output, "Command Output (stderr):" + print >>output, "--" + output.write(err) + print >>output, "--" + return (status, output.getvalue()) + +def executeTclTest(test, litConfig): + if test.config.unsupported: + return (Test.UNSUPPORTED, 'Test is unsupported') + + res = parseIntegratedTestScript(test, True, False) + if len(res) == 2: + return res + + script, xfails, xtargets, tmpBase, execdir = res + + if litConfig.noExecute: + return (Test.PASS, '') + + # Create the output directory if it does not already exist. + Util.mkdir_p(os.path.dirname(tmpBase)) + + res = executeTclScriptInternal(test, litConfig, tmpBase, script, execdir) + if len(res) == 2: + return res + + isXFail = False + for item in xfails: + if item == '*' or item in test.suite.config.target_triple: + isXFail = True + break + + # If this is XFAIL, see if it is expected to pass on this target. + if isXFail: + for item in xtargets: + if item == '*' or item in test.suite.config.target_triple: + isXFail = False + break + + out,err,exitCode = res + if isXFail: + ok = exitCode != 0 + status = (Test.XPASS, Test.XFAIL)[ok] + else: + ok = exitCode == 0 + status = (Test.FAIL, Test.PASS)[ok] + + if ok: + return (status,'') + + return formatTestOutput(status, out, err, exitCode, script) + +def executeShTest(test, litConfig, useExternalSh, requireAndAnd): + if test.config.unsupported: + return (Test.UNSUPPORTED, 'Test is unsupported') + + res = parseIntegratedTestScript(test, False, requireAndAnd) + if len(res) == 2: + return res + + script, xfails, xtargets, tmpBase, execdir = res + + if litConfig.noExecute: + return (Test.PASS, '') + + # Create the output directory if it does not already exist. + Util.mkdir_p(os.path.dirname(tmpBase)) + + if useExternalSh: + res = executeScript(test, litConfig, tmpBase, script, execdir) + else: + res = executeScriptInternal(test, litConfig, tmpBase, script, execdir) + if len(res) == 2: + return res + + out,err,exitCode = res + if xfails: + ok = exitCode != 0 + status = (Test.XPASS, Test.XFAIL)[ok] + else: + ok = exitCode == 0 + status = (Test.FAIL, Test.PASS)[ok] + + if ok: + return (status,'') + + return formatTestOutput(status, out, err, exitCode, script) Added: llvm/trunk/utils/lit/TestingConfig.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/TestingConfig.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/TestingConfig.py (added) +++ llvm/trunk/utils/lit/TestingConfig.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,95 @@ +import os + +class TestingConfig: + """" + TestingConfig - Information on the tests inside a suite. + """ + + @staticmethod + def frompath(path, parent, litConfig, mustExist, config = None): + if config is None: + # Set the environment based on the command line arguments. + environment = { + 'PATH' : os.pathsep.join(litConfig.path + + [os.environ.get('PATH','')]), + 'SYSTEMROOT' : os.environ.get('SYSTEMROOT',''), + } + + config = TestingConfig(parent, + name = '', + suffixes = set(), + test_format = None, + environment = environment, + substitutions = [], + unsupported = False, + on_clone = None, + test_exec_root = None, + test_source_root = None, + excludes = []) + + if os.path.exists(path): + # FIXME: Improve detection and error reporting of errors in the + # config file. + f = open(path) + cfg_globals = dict(globals()) + cfg_globals['config'] = config + cfg_globals['lit'] = litConfig + cfg_globals['__file__'] = path + try: + exec f in cfg_globals + except SystemExit,status: + # We allow normal system exit inside a config file to just + # return control without error. + if status.args: + raise + f.close() + elif mustExist: + litConfig.fatal('unable to load config from %r ' % path) + + config.finish(litConfig) + return config + + def __init__(self, parent, name, suffixes, test_format, + environment, substitutions, unsupported, on_clone, + test_exec_root, test_source_root, excludes): + self.parent = parent + self.name = str(name) + self.suffixes = set(suffixes) + self.test_format = test_format + self.environment = dict(environment) + self.substitutions = list(substitutions) + self.unsupported = unsupported + self.on_clone = on_clone + self.test_exec_root = test_exec_root + self.test_source_root = test_source_root + self.excludes = set(excludes) + + def clone(self, path): + # FIXME: Chain implementations? + # + # FIXME: Allow extra parameters? + cfg = TestingConfig(self, self.name, self.suffixes, self.test_format, + self.environment, self.substitutions, + self.unsupported, self.on_clone, + self.test_exec_root, self.test_source_root, + self.excludes) + if cfg.on_clone: + cfg.on_clone(self, cfg, path) + return cfg + + def finish(self, litConfig): + """finish() - Finish this config object, after loading is complete.""" + + self.name = str(self.name) + self.suffixes = set(self.suffixes) + self.environment = dict(self.environment) + self.substitutions = list(self.substitutions) + if self.test_exec_root is not None: + # FIXME: This should really only be suite in test suite config + # files. Should we distinguish them? + self.test_exec_root = str(self.test_exec_root) + if self.test_source_root is not None: + # FIXME: This should really only be suite in test suite config + # files. Should we distinguish them? + self.test_source_root = str(self.test_source_root) + self.excludes = set(self.excludes) Added: llvm/trunk/utils/lit/Util.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/Util.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/Util.py (added) +++ llvm/trunk/utils/lit/Util.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,124 @@ +import os, sys + +def detectCPUs(): + """ + Detects the number of CPUs on a system. Cribbed from pp. + """ + # Linux, Unix and MacOS: + if hasattr(os, "sysconf"): + if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"): + # Linux & Unix: + ncpus = os.sysconf("SC_NPROCESSORS_ONLN") + if isinstance(ncpus, int) and ncpus > 0: + return ncpus + else: # OSX: + return int(os.popen2("sysctl -n hw.ncpu")[1].read()) + # Windows: + if os.environ.has_key("NUMBER_OF_PROCESSORS"): + ncpus = int(os.environ["NUMBER_OF_PROCESSORS"]); + if ncpus > 0: + return ncpus + return 1 # Default + +def mkdir_p(path): + """mkdir_p(path) - Make the "path" directory, if it does not exist; this + will also make directories for any missing parent directories.""" + import errno + + if not path or os.path.exists(path): + return + + parent = os.path.dirname(path) + if parent != path: + mkdir_p(parent) + + try: + os.mkdir(path) + except OSError,e: + # Ignore EEXIST, which may occur during a race condition. + if e.errno != errno.EEXIST: + raise + +def capture(args): + import subprocess + """capture(command) - Run the given command (or argv list) in a shell and + return the standard output.""" + p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out,_ = p.communicate() + return out + +def which(command, paths = None): + """which(command, [paths]) - Look up the given command in the paths string + (or the PATH environment variable, if unspecified).""" + + if paths is None: + paths = os.environ.get('PATH','') + + # Check for absolute match first. + if os.path.exists(command): + return command + + # Would be nice if Python had a lib function for this. + if not paths: + paths = os.defpath + + # Get suffixes to search. + pathext = os.environ.get('PATHEXT', '').split(os.pathsep) + + # Search the paths... + for path in paths.split(os.pathsep): + for ext in pathext: + p = os.path.join(path, command + ext) + if os.path.exists(p): + return p + + return None + +def printHistogram(items, title = 'Items'): + import itertools, math + + items.sort(key = lambda (_,v): v) + + maxValue = max([v for _,v in items]) + + # Select first "nice" bar height that produces more than 10 bars. + power = int(math.ceil(math.log(maxValue, 10))) + for inc in itertools.cycle((5, 2, 2.5, 1)): + barH = inc * 10**power + N = int(math.ceil(maxValue / barH)) + if N > 10: + break + elif inc == 1: + power -= 1 + + histo = [set() for i in range(N)] + for name,v in items: + bin = min(int(N * v/maxValue), N-1) + histo[bin].add(name) + + barW = 40 + hr = '-' * (barW + 34) + print '\nSlowest %s:' % title + print hr + for name,value in items[-20:]: + print '%.2fs: %s' % (value, name) + print '\n%s Times:' % title + print hr + pDigits = int(math.ceil(math.log(maxValue, 10))) + pfDigits = max(0, 3-pDigits) + if pfDigits: + pDigits += pfDigits + 1 + cDigits = int(math.ceil(math.log(len(items), 10))) + print "[%s] :: [%s] :: [%s]" % ('Range'.center((pDigits+1)*2 + 3), + 'Percentage'.center(barW), + 'Count'.center(cDigits*2 + 1)) + print hr + for i,row in enumerate(histo): + pct = float(len(row)) / len(items) + w = int(barW * pct) + print "[%*.*fs,%*.*fs)" % (pDigits, pfDigits, i*barH, + pDigits, pfDigits, (i+1)*barH), + print ":: [%s%s] :: [%*d/%*d]" % ('*'*w, ' '*(barW-w), + cDigits, len(row), + cDigits, len(items)) + Added: llvm/trunk/utils/lit/lit.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit.py?rev=81190&view=auto ============================================================================== --- llvm/trunk/utils/lit/lit.py (added) +++ llvm/trunk/utils/lit/lit.py Tue Sep 8 00:31:18 2009 @@ -0,0 +1,519 @@ +#!/usr/bin/env python + +""" +lit - LLVM Integrated Tester. + +See lit.pod for more information. +""" + +import math, os, platform, random, re, sys, time, threading, traceback + +import ProgressBar +import TestRunner +import Util + +from TestingConfig import TestingConfig +import LitConfig +import Test + +# FIXME: Rename to 'config.lit', 'site.lit', and 'local.lit' ? +kConfigName = 'lit.cfg' +kSiteConfigName = 'lit.site.cfg' +kLocalConfigName = 'lit.local.cfg' + +class TestingProgressDisplay: + def __init__(self, opts, numTests, progressBar=None): + self.opts = opts + self.numTests = numTests + self.current = None + self.lock = threading.Lock() + self.progressBar = progressBar + self.completed = 0 + + def update(self, test): + # Avoid locking overhead in quiet mode + if self.opts.quiet and not test.result.isFailure: + return + + # Output lock. + self.lock.acquire() + try: + self.handleUpdate(test) + finally: + self.lock.release() + + def finish(self): + if self.progressBar: + self.progressBar.clear() + elif self.opts.quiet: + pass + elif self.opts.succinct: + sys.stdout.write('\n') + + def handleUpdate(self, test): + self.completed += 1 + if self.progressBar: + self.progressBar.update(float(self.completed)/self.numTests, + test.getFullName()) + + if self.opts.succinct and not test.result.isFailure: + return + + if self.progressBar: + self.progressBar.clear() + + print '%s: %s (%d of %d)' % (test.result.name, test.getFullName(), + self.completed, self.numTests) + + if test.result.isFailure and self.opts.showOutput: + print "%s TEST '%s' FAILED %s" % ('*'*20, test.getFullName(), + '*'*20) + print test.output + print "*" * 20 + + sys.stdout.flush() + +class TestProvider: + def __init__(self, tests, maxTime): + self.maxTime = maxTime + self.iter = iter(tests) + self.lock = threading.Lock() + self.startTime = time.time() + + def get(self): + # Check if we have run out of time. + if self.maxTime is not None: + if time.time() - self.startTime > self.maxTime: + return None + + # Otherwise take the next test. + self.lock.acquire() + try: + item = self.iter.next() + except StopIteration: + item = None + self.lock.release() + return item + +class Tester(threading.Thread): + def __init__(self, litConfig, provider, display): + threading.Thread.__init__(self) + self.litConfig = litConfig + self.provider = provider + self.display = display + + def run(self): + while 1: + item = self.provider.get() + if item is None: + break + self.runTest(item) + + def runTest(self, test): + result = None + startTime = time.time() + try: + result, output = test.config.test_format.execute(test, + self.litConfig) + except KeyboardInterrupt: + # This is a sad hack. Unfortunately subprocess goes + # bonkers with ctrl-c and we start forking merrily. + print '\nCtrl-C detected, goodbye.' + os.kill(0,9) + except: + if self.litConfig.debug: + raise + result = Test.UNRESOLVED + output = 'Exception during script execution:\n' + output += traceback.format_exc() + output += '\n' + elapsed = time.time() - startTime + + test.setResult(result, output, elapsed) + self.display.update(test) + +def dirContainsTestSuite(path): + cfgpath = os.path.join(path, kSiteConfigName) + if os.path.exists(cfgpath): + return cfgpath + cfgpath = os.path.join(path, kConfigName) + if os.path.exists(cfgpath): + return cfgpath + +def getTestSuite(item, litConfig, cache): + """getTestSuite(item, litConfig, cache) -> (suite, relative_path) + + Find the test suite containing @arg item. + + @retval (None, ...) - Indicates no test suite contains @arg item. + @retval (suite, relative_path) - The suite that @arg item is in, and its + relative path inside that suite. + """ + def search1(path): + # Check for a site config or a lit config. + cfgpath = dirContainsTestSuite(path) + + # If we didn't find a config file, keep looking. + if not cfgpath: + parent,base = os.path.split(path) + if parent == item: + return (None, ()) + + ts, relative = search(parent) + return (ts, relative + (base,)) + + # We found a config file, load it. + if litConfig.debug: + litConfig.note('loading suite config %r' % cfgpath) + + cfg = TestingConfig.frompath(cfgpath, None, litConfig, mustExist = True) + source_root = os.path.realpath(cfg.test_source_root or path) + exec_root = os.path.realpath(cfg.test_exec_root or path) + return Test.TestSuite(cfg.name, source_root, exec_root, cfg), () + + def search(path): + # Check for an already instantiated test suite. + res = cache.get(path) + if res is None: + cache[path] = res = search1(path) + return res + + # Canonicalize the path. + item = os.path.realpath(item) + + # Skip files and virtual components. + components = [] + while not os.path.isdir(item): + parent,base = os.path.split(item) + if parent == item: + return (None, ()) + components.append(base) + item = parent + components.reverse() + + ts, relative = search(item) + return ts, tuple(relative + tuple(components)) + +def getLocalConfig(ts, path_in_suite, litConfig, cache): + def search1(path_in_suite): + # Get the parent config. + if not path_in_suite: + parent = ts.config + else: + parent = search(path_in_suite[:-1]) + + # Load the local configuration. + source_path = ts.getSourcePath(path_in_suite) + cfgpath = os.path.join(source_path, kLocalConfigName) + if litConfig.debug: + litConfig.note('loading local config %r' % cfgpath) + return TestingConfig.frompath(cfgpath, parent, litConfig, + mustExist = False, + config = parent.clone(cfgpath)) + + def search(path_in_suite): + key = (ts, path_in_suite) + res = cache.get(key) + if res is None: + cache[key] = res = search1(path_in_suite) + return res + + return search(path_in_suite) + +def getTests(path, litConfig, testSuiteCache, localConfigCache): + # Find the test suite for this input and its relative path. + ts,path_in_suite = getTestSuite(path, litConfig, testSuiteCache) + if ts is None: + litConfig.warning('unable to find test suite for %r' % path) + return () + + if litConfig.debug: + litConfig.note('resolved input %r to %r::%r' % (path, ts.name, + path_in_suite)) + + return getTestsInSuite(ts, path_in_suite, litConfig, + testSuiteCache, localConfigCache) + +def getTestsInSuite(ts, path_in_suite, litConfig, + testSuiteCache, localConfigCache): + # Check that the source path exists (errors here are reported by the + # caller). + source_path = ts.getSourcePath(path_in_suite) + if not os.path.exists(source_path): + return + + # Check if the user named a test directly. + if not os.path.isdir(source_path): + lc = getLocalConfig(ts, path_in_suite[:-1], litConfig, localConfigCache) + yield Test.Test(ts, path_in_suite, lc) + return + + # Otherwise we have a directory to search for tests, start by getting the + # local configuration. + lc = getLocalConfig(ts, path_in_suite, litConfig, localConfigCache) + for filename in os.listdir(source_path): + # FIXME: This doesn't belong here? + if filename == 'Output' or filename in lc.excludes: + continue + + filepath = os.path.join(source_path, filename) + if os.path.isdir(filepath): + # If this directory contains a test suite, reload it. + if dirContainsTestSuite(filepath): + for res in getTests(filepath, litConfig, + testSuiteCache, localConfigCache): + yield res + else: + # Otherwise, continue loading from inside this test suite. + for res in getTestsInSuite(ts, path_in_suite + (filename,), + litConfig, testSuiteCache, + localConfigCache): + yield res + else: + # Otherwise add tests for matching suffixes. + base,ext = os.path.splitext(filename) + if ext in lc.suffixes: + yield Test.Test(ts, path_in_suite + (filename,), lc) + +def runTests(numThreads, litConfig, provider, display): + # If only using one testing thread, don't use threads at all; this lets us + # profile, among other things. + if numThreads == 1: + t = Tester(litConfig, provider, display) + t.run() + return + + # Otherwise spin up the testing threads and wait for them to finish. + testers = [Tester(litConfig, provider, display) + for i in range(numThreads)] + for t in testers: + t.start() + try: + for t in testers: + t.join() + except KeyboardInterrupt: + sys.exit(2) + +def main(): + global options + from optparse import OptionParser, OptionGroup + parser = OptionParser("usage: %prog [options] {file-or-path}") + + parser.add_option("-j", "--threads", dest="numThreads", metavar="N", + help="Number of testing threads", + type=int, action="store", default=None) + + group = OptionGroup(parser, "Output Format") + # FIXME: I find these names very confusing, although I like the + # functionality. + group.add_option("-q", "--quiet", dest="quiet", + help="Suppress no error output", + action="store_true", default=False) + group.add_option("-s", "--succinct", dest="succinct", + help="Reduce amount of output", + action="store_true", default=False) + group.add_option("-v", "--verbose", dest="showOutput", + help="Show all test output", + action="store_true", default=False) + group.add_option("", "--no-progress-bar", dest="useProgressBar", + help="Do not use curses based progress bar", + action="store_false", default=True) + parser.add_option_group(group) + + group = OptionGroup(parser, "Test Execution") + group.add_option("", "--path", dest="path", + help="Additional paths to add to testing environment", + action="append", type=str, default=[]) + group.add_option("", "--vg", dest="useValgrind", + help="Run tests under valgrind", + action="store_true", default=False) + group.add_option("", "--vg-arg", dest="valgrindArgs", metavar="ARG", + help="Specify an extra argument for valgrind", + type=str, action="append", default=[]) + group.add_option("", "--time-tests", dest="timeTests", + help="Track elapsed wall time for each test", + action="store_true", default=False) + group.add_option("", "--no-execute", dest="noExecute", + help="Don't execute any tests (assume PASS)", + action="store_true", default=False) + parser.add_option_group(group) + + group = OptionGroup(parser, "Test Selection") + group.add_option("", "--max-tests", dest="maxTests", metavar="N", + help="Maximum number of tests to run", + action="store", type=int, default=None) + group.add_option("", "--max-time", dest="maxTime", metavar="N", + help="Maximum time to spend testing (in seconds)", + action="store", type=float, default=None) + group.add_option("", "--shuffle", dest="shuffle", + help="Run tests in random order", + action="store_true", default=False) + parser.add_option_group(group) + + group = OptionGroup(parser, "Debug and Experimental Options") + group.add_option("", "--debug", dest="debug", + help="Enable debugging (for 'lit' development)", + action="store_true", default=False) + group.add_option("", "--show-suites", dest="showSuites", + help="Show discovered test suites", + action="store_true", default=False) + group.add_option("", "--no-tcl-as-sh", dest="useTclAsSh", + help="Don't run Tcl scripts using 'sh'", + action="store_false", default=True) + parser.add_option_group(group) + + (opts, args) = parser.parse_args() + + if not args: + parser.error('No inputs specified') + + if opts.numThreads is None: + opts.numThreads = Util.detectCPUs() + + inputs = args + + # Create the global config object. + litConfig = LitConfig.LitConfig(progname = os.path.basename(sys.argv[0]), + path = opts.path, + quiet = opts.quiet, + useValgrind = opts.useValgrind, + valgrindArgs = opts.valgrindArgs, + useTclAsSh = opts.useTclAsSh, + noExecute = opts.noExecute, + debug = opts.debug, + isWindows = (platform.system()=='Windows')) + + # Load the tests from the inputs. + tests = [] + testSuiteCache = {} + localConfigCache = {} + for input in inputs: + prev = len(tests) + tests.extend(getTests(input, litConfig, + testSuiteCache, localConfigCache)) + if prev == len(tests): + litConfig.warning('input %r contained no tests' % input) + + # If there were any errors during test discovery, exit now. + if litConfig.numErrors: + print >>sys.stderr, '%d errors, exiting.' % litConfig.numErrors + sys.exit(2) + + if opts.showSuites: + suitesAndTests = dict([(ts,[]) + for ts,_ in testSuiteCache.values()]) + for t in tests: + suitesAndTests[t.suite].append(t) + + print '-- Test Suites --' + suitesAndTests = suitesAndTests.items() + suitesAndTests.sort(key = lambda (ts,_): ts.name) + for ts,tests in suitesAndTests: + print ' %s - %d tests' %(ts.name, len(tests)) + print ' Source Root: %s' % ts.source_root + print ' Exec Root : %s' % ts.exec_root + + # Select and order the tests. + numTotalTests = len(tests) + if opts.shuffle: + random.shuffle(tests) + else: + tests.sort(key = lambda t: t.getFullName()) + if opts.maxTests is not None: + tests = tests[:opts.maxTests] + + extra = '' + if len(tests) != numTotalTests: + extra = ' of %d' % numTotalTests + header = '-- Testing: %d%s tests, %d threads --'%(len(tests),extra, + opts.numThreads) + + progressBar = None + if not opts.quiet: + if opts.succinct and opts.useProgressBar: + try: + tc = ProgressBar.TerminalController() + progressBar = ProgressBar.ProgressBar(tc, header) + except ValueError: + print header + progressBar = ProgressBar.SimpleProgressBar('Testing: ') + else: + print header + + # Don't create more threads than tests. + opts.numThreads = min(len(tests), opts.numThreads) + + startTime = time.time() + display = TestingProgressDisplay(opts, len(tests), progressBar) + provider = TestProvider(tests, opts.maxTime) + runTests(opts.numThreads, litConfig, provider, display) + display.finish() + + if not opts.quiet: + print 'Testing Time: %.2fs'%(time.time() - startTime) + + # Update results for any tests which weren't run. + for t in tests: + if t.result is None: + t.setResult(Test.UNRESOLVED, '', 0.0) + + # List test results organized by kind. + hasFailures = False + byCode = {} + for t in tests: + if t.result not in byCode: + byCode[t.result] = [] + byCode[t.result].append(t) + if t.result.isFailure: + hasFailures = True + + # FIXME: Show unresolved and (optionally) unsupported tests. + for title,code in (('Unexpected Passing Tests', Test.XPASS), + ('Failing Tests', Test.FAIL)): + elts = byCode.get(code) + if not elts: + continue + print '*'*20 + print '%s (%d):' % (title, len(elts)) + for t in elts: + print ' %s' % t.getFullName() + print + + if opts.timeTests: + byTime = list(tests) + byTime.sort(key = lambda t: t.elapsed) + if byTime: + Util.printHistogram([(t.getFullName(), t.elapsed) for t in byTime], + title='Tests') + + for name,code in (('Expected Passes ', Test.PASS), + ('Expected Failures ', Test.XFAIL), + ('Unsupported Tests ', Test.UNSUPPORTED), + ('Unresolved Tests ', Test.UNRESOLVED), + ('Unexpected Passes ', Test.XPASS), + ('Unexpected Failures', Test.FAIL),): + if opts.quiet and not code.isFailure: + continue + N = len(byCode.get(code,[])) + if N: + print ' %s: %d' % (name,N) + + # If we encountered any additional errors, exit abnormally. + if litConfig.numErrors: + print >>sys.stderr, '\n%d error(s), exiting.' % litConfig.numErrors + sys.exit(2) + + # Warn about warnings. + if litConfig.numWarnings: + print >>sys.stderr, '\n%d warning(s) in tests.' % litConfig.numWarnings + + if hasFailures: + sys.exit(1) + sys.exit(0) + +if __name__=='__main__': + # Bump the GIL check interval, its more important to get any one thread to a + # blocking operation (hopefully exec) than to try and unblock other threads. + import sys + sys.setcheckinterval(1000) + main() Propchange: llvm/trunk/utils/lit/lit.py ------------------------------------------------------------------------------ svn:executable = * From daniel at zuster.org Tue Sep 8 00:31:44 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 08 Sep 2009 05:31:44 -0000 Subject: [llvm-commits] [llvm] r81191 - in /llvm/trunk: Makefile.rules test/Makefile test/lit.cfg Message-ID: <200909080531.n885ViaN031573@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 8 00:31:44 2009 New Revision: 81191 URL: http://llvm.org/viewvc/llvm-project?rev=81191&view=rev Log: Add 'lit' support for llvm tests. - This adds 'make check-lit' from the top-level Makefile. Added: llvm/trunk/test/lit.cfg Modified: llvm/trunk/Makefile.rules llvm/trunk/test/Makefile Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=81191&r1=81190&r2=81191&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Tue Sep 8 00:31:44 2009 @@ -1594,6 +1594,18 @@ $(EchoCmd) No test directory ; \ fi +check-lit:: + $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \ + if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \ + $(EchoCmd) Running test suite ; \ + $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-lit ; \ + else \ + $(EchoCmd) No Makefile in test directory ; \ + fi ; \ + else \ + $(EchoCmd) No test directory ; \ + fi + ############################################################################### # UNITTESTS: Running the unittests test suite ############################################################################### Modified: llvm/trunk/test/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Makefile?rev=81191&r1=81190&r2=81191&view=diff ============================================================================== --- llvm/trunk/test/Makefile (original) +++ llvm/trunk/test/Makefile Tue Sep 8 00:31:44 2009 @@ -28,12 +28,18 @@ ifdef VERBOSE RUNTESTFLAGS := $(VERBOSE) +LIT_ARGS := -v +else +LIT_ARGS := -s -v endif ifdef TESTSUITE +LIT_TESTSUITE := $(TESTSUITE) CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE)) CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE)) RUNTESTFLAGS += --tool $(CLEANED_TESTSUITE) +else +LIT_TESTSUITE := . endif ifdef VG @@ -69,6 +75,13 @@ @echo "*** dejagnu not found. Make sure 'runtest' is in your PATH, then reconfigure LLVM." endif +check-local-lit:: lit.site.cfg + ( $(ULIMIT) \ + $(LLVM_SRC_ROOT)/utils/lit/lit.py \ + --path "$(LLVMToolDir)" \ + --path "$(LLVM_SRC_ROOT)/test/Scripts" \ + $(LIT_ARGS) $(LIT_TESTSUITE) ) + ifdef TESTONE CLEANED_TESTONE := $(patsubst %/,%,$(TESTONE)) CLEANED_TESTONE := $(patsubst test/%,%,$(CLEANED_TESTONE)) @@ -148,3 +161,14 @@ @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp + +lit.site.cfg: site.exp + @echo "Making 'lit.site.cfg' file..." + @echo "## Autogenerated by Makefile ##" > $@ + @echo "# Do not edit!" >> $@ + @echo >> $@ + @echo "# Preserve some key paths for use by main LLVM test suite config." >> $@ + @echo "config.llvm_obj_root = \"\"\"$(LLVM_OBJ_ROOT)\"\"\"" >> $@ + @echo >> $@ + @echo "# Let the main config do the real work." >> $@ + @echo "lit.load_config(config, \"\"\"$(LLVM_SRC_ROOT)/test/lit.cfg\"\"\")" >> $@ Added: llvm/trunk/test/lit.cfg URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=81191&view=auto ============================================================================== --- llvm/trunk/test/lit.cfg (added) +++ llvm/trunk/test/lit.cfg Tue Sep 8 00:31:44 2009 @@ -0,0 +1,151 @@ +# -*- Python -*- + +# Configuration file for the 'lit' test runner. + +import os + +# name: The name of this test suite. +config.name = 'LLVM' + +# testFormat: The test format to use to interpret tests. +config.test_format = lit.formats.TclTest() + +# suffixes: A list of file extensions to treat as test files, this is actually +# set by on_clone(). +config.suffixes = [] + +# test_source_root: The root path where tests are located. +config.test_source_root = os.path.dirname(__file__) + +# test_exec_root: The root path where tests should be run. +llvm_obj_root = getattr(config, 'llvm_obj_root', None) +if llvm_obj_root is not None: + config.test_exec_root = os.path.join(llvm_obj_root, 'test') + +### + +import os + +# Check that the object root is known. +if config.test_exec_root is None: + # Otherwise, we haven't loaded the site specific configuration (the user is + # probably trying to run on a test file directly, and either the site + # configuration hasn't been created by the build system, or we are in an + # out-of-tree build situation). + + # Try to detect the situation where we are using an out-of-tree build by + # looking for 'llvm-config'. + # + # FIXME: I debated (i.e., wrote and threw away) adding logic to + # automagically generate the lit.site.cfg if we are in some kind of fresh + # build situation. This means knowing how to invoke the build system + # though, and I decided it was too much magic. + + llvm_config = lit.util.which('llvm-config', config.environment['PATH']) + if not llvm_config: + lit.fatal('No site specific configuration available!') + + # Get the source and object roots. + llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip() + llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip() + + # Validate that we got a tree which points to here. + this_src_root = os.path.dirname(config.test_source_root) + if os.path.realpath(llvm_src_root) != os.path.realpath(this_src_root): + lit.fatal('No site specific configuration available!') + + # Check that the site specific configuration exists. + site_cfg = os.path.join(llvm_obj_root, 'test', 'lit.site.cfg') + if not os.path.exists(site_cfg): + lit.fatal('No site specific configuration available!') + + # Okay, that worked. Notify the user of the automagic, and reconfigure. + lit.note('using out-of-tree build at %r' % llvm_obj_root) + lit.load_config(config, site_cfg) + raise SystemExit + +### + +# Load site data from DejaGNU's site.exp. +import re +site_exp = {} +# FIXME: Implement lit.site.cfg. +for line in open(os.path.join(config.llvm_obj_root, 'test', 'site.exp')): + m = re.match('set ([^ ]+) "([^"]*)"', line) + if m: + site_exp[m.group(1)] = m.group(2) + +# Add substitutions. +for sub in ['prcontext', 'llvmgcc', 'llvmgxx', 'compile_cxx', 'compile_c', + 'link', 'shlibext', 'ocamlopt', 'llvmdsymutil', 'llvmlibsdir', + 'bugpoint_topts']: + if sub in ('llvmgcc', 'llvmgxx'): + config.substitutions.append(('%' + sub, + site_exp[sub] + ' -emit-llvm -w')) + else: + config.substitutions.append(('%' + sub, site_exp[sub])) + +excludes = [] + +# Provide target_triple for use in XFAIL and XTARGET. +config.target_triple = site_exp['target_triplet'] + +# Provide llvm_supports_target for use in local configs. +targets = set(site_exp["TARGETS_TO_BUILD"].split()) +def llvm_supports_target(name): + return name in targets + +langs = set(site_exp['llvmgcc_langs'].split(',')) +def llvm_gcc_supports(name): + return name in langs + +# Provide on_clone hook for reading 'dg.exp'. +import os +simpleLibData = re.compile(r"""load_lib llvm.exp + +RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\]""", + re.MULTILINE) +conditionalLibData = re.compile(r"""load_lib llvm.exp + +if.*\[ ?(llvm[^ ]*) ([^ ]*) ?\].*{ + *RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\] +\}""", re.MULTILINE) +def on_clone(parent, cfg, for_path): + def addSuffixes(match): + if match[0] == '{' and match[-1] == '}': + cfg.suffixes = ['.' + s for s in match[1:-1].split(',')] + else: + cfg.suffixes = ['.' + match] + + libPath = os.path.join(os.path.dirname(for_path), + 'dg.exp') + if not os.path.exists(libPath): + cfg.unsupported = True + return + + # Reset unsupported, in case we inherited it. + cfg.unsupported = False + lib = open(libPath).read().strip() + + # Check for a simple library. + m = simpleLibData.match(lib) + if m: + addSuffixes(m.group(1)) + return + + # Check for a conditional test set. + m = conditionalLibData.match(lib) + if m: + funcname,arg,match = m.groups() + addSuffixes(match) + + func = globals().get(funcname) + if not func: + lit.error('unsupported predicate %r' % funcname) + elif not func(arg): + cfg.unsupported = True + return + # Otherwise, give up. + lit.error('unable to understand %r:\n%s' % (libPath, lib)) + +config.on_clone = on_clone From daniel at zuster.org Tue Sep 8 00:37:51 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 08 Sep 2009 05:37:51 -0000 Subject: [llvm-commits] [llvm] r81192 - /llvm/trunk/utils/lit/TestRunner.py Message-ID: <200909080537.n885bp14032335@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 8 00:37:51 2009 New Revision: 81192 URL: http://llvm.org/viewvc/llvm-project?rev=81192&view=rev Log: Fix a refactoro. Modified: llvm/trunk/utils/lit/TestRunner.py Modified: llvm/trunk/utils/lit/TestRunner.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/TestRunner.py?rev=81192&r1=81191&r2=81192&view=diff ============================================================================== --- llvm/trunk/utils/lit/TestRunner.py (original) +++ llvm/trunk/utils/lit/TestRunner.py Tue Sep 8 00:37:51 2009 @@ -192,7 +192,7 @@ try: cmds.append(TclUtil.TclExecCommand(tokens).parse_pipeline()) except: - return (TestStatus.Fail, "Tcl 'exec' parse error on: %r" % ln) + return (Test.FAIL, "Tcl 'exec' parse error on: %r" % ln) cmd = cmds[0] for c in cmds[1:]: From sabre at nondot.org Tue Sep 8 00:40:43 2009 From: sabre at nondot.org (Chris Lattner) Date: Mon, 7 Sep 2009 22:40:43 -0700 Subject: [llvm-commits] [llvm] r80760 - /llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp In-Reply-To: <6a8523d60909031454i5fc2142by6100bfd42f9c1299@mail.gmail.com> References: <200909020439.n824d4Rm008330@zion.cs.uiuc.edu> <6a8523d60909031454i5fc2142by6100bfd42f9c1299@mail.gmail.com> Message-ID: <3988C433-2533-4855-A8DE-8EE6CDAF87CE@nondot.org> On Sep 3, 2009, at 2:54 PM, Daniel Dunbar wrote: > There seems to still be an expensive checks failure in this code, the > clang test suite triggers this failure: > -- This is fixed on ToT. -Chris From nicholas at mxc.ca Tue Sep 8 00:46:15 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 08 Sep 2009 05:46:15 -0000 Subject: [llvm-commits] [llvm] r81193 - /llvm/trunk/lib/VMCore/Verifier.cpp Message-ID: <200909080546.n885kFx3000904@zion.cs.uiuc.edu> Author: nicholas Date: Tue Sep 8 00:46:15 2009 New Revision: 81193 URL: http://llvm.org/viewvc/llvm-project?rev=81193&view=rev Log: Hoist out the test+insert to CheckedTypes. This doesn't seem to affect performance. 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=81193&r1=81192&r2=81193&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Sep 8 00:46:15 2009 @@ -1447,12 +1447,10 @@ /// VerifyType - Verify that a type is well formed. /// void Verifier::VerifyType(const Type *Ty) { - // We insert complex types into CheckedTypes even if they failed verification - // to prevent emitting messages about them multiple times if + if (!CheckedTypes.insert(Ty)) return; switch (Ty->getTypeID()) { case Type::FunctionTyID: { - if (!CheckedTypes.insert(Ty)) return; const FunctionType *FTy = cast(Ty); const Type *RetTy = FTy->getReturnType(); @@ -1468,7 +1466,6 @@ } } break; case Type::StructTyID: { - if (!CheckedTypes.insert(Ty)) return; const StructType *STy = cast(Ty); for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) { const Type *ElTy = STy->getElementType(i); @@ -1478,28 +1475,25 @@ } } break; case Type::ArrayTyID: { - if (!CheckedTypes.insert(Ty)) return; const ArrayType *ATy = cast(Ty); Assert1(ArrayType::isValidElementType(ATy->getElementType()), "Array type with invalid element type", ATy); VerifyType(ATy->getElementType()); } break; case Type::PointerTyID: { - if (!CheckedTypes.insert(Ty)) return; const PointerType *PTy = cast(Ty); Assert1(PointerType::isValidElementType(PTy->getElementType()), "Pointer type with invalid element type", PTy); VerifyType(PTy->getElementType()); - } + } break; case Type::VectorTyID: { - if (!CheckedTypes.insert(Ty)) return; const VectorType *VTy = cast(Ty); Assert1(VectorType::isValidElementType(VTy->getElementType()), "Vector type with invalid element type", VTy); VerifyType(VTy->getElementType()); - } + } break; default: - return; + break; } } From daniel at zuster.org Tue Sep 8 00:46:28 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 08 Sep 2009 05:46:28 -0000 Subject: [llvm-commits] [llvm] r81194 - in /llvm/trunk/utils/lit: ShCommands.py TclUtil.py Message-ID: <200909080546.n885kSal000937@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 8 00:46:28 2009 New Revision: 81194 URL: http://llvm.org/viewvc/llvm-project?rev=81194&view=rev Log: Fix typo that worked on python 2.6. Also, fix unit tests. Modified: llvm/trunk/utils/lit/ShCommands.py llvm/trunk/utils/lit/TclUtil.py Modified: llvm/trunk/utils/lit/ShCommands.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/ShCommands.py?rev=81194&r1=81193&r2=81194&view=diff ============================================================================== --- llvm/trunk/utils/lit/ShCommands.py (original) +++ llvm/trunk/utils/lit/ShCommands.py Tue Sep 8 00:46:28 2009 @@ -1,5 +1,3 @@ -import ShUtil - class Command: def __init__(self, args, redirects): self.args = list(args) @@ -26,6 +24,7 @@ print >>file, quoted, # For debugging / validation. + import ShUtil dequoted = list(ShUtil.ShLexer(quoted).lex()) if dequoted != [arg]: raise NotImplementedError,'Unable to quote %r' % arg Modified: llvm/trunk/utils/lit/TclUtil.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/TclUtil.py?rev=81194&r1=81193&r2=81194&view=diff ============================================================================== --- llvm/trunk/utils/lit/TclUtil.py (original) +++ llvm/trunk/utils/lit/TclUtil.py Tue Sep 8 00:46:28 2009 @@ -184,7 +184,7 @@ def parse_redirect(self, tok, length): if len(tok) == length: arg = self.lex() - if next is None: + if arg is None: raise ValueError,'Missing argument to %r redirection' % tok else: tok,arg = tok[:length],tok[length:] @@ -310,11 +310,11 @@ self.assertEqual(self.parse('echo hello > a >b >>c 2> d |& e'), (False, False, Pipeline([Command(['echo', 'hello'], - [(('>',),'a'), + [(('>&',2),'1'), + (('>',),'a'), (('>',),'b'), (('>>',),'c'), - (('>',2),'d'), - (('>&',2),'1')]), + (('>',2),'d')]), Command(['e'], [])], False, True))) From nicholas at mxc.ca Tue Sep 8 00:46:26 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 07 Sep 2009 22:46:26 -0700 Subject: [llvm-commits] [llvm] r81179 - /llvm/trunk/lib/VMCore/Verifier.cpp In-Reply-To: <3014E3F5-8538-4790-8A33-D3D37DE54765@apple.com> References: <200909080123.n881Nqkv032723@zion.cs.uiuc.edu> <4AA5BB52.1060002@mxc.ca> <632CD9C4-4018-4E5B-B30D-864FA299B2FF@apple.com> <4AA5D6E9.5080703@mxc.ca> <3014E3F5-8538-4790-8A33-D3D37DE54765@apple.com> Message-ID: <4AA5EFB2.3060204@mxc.ca> Chris Lattner wrote: > > On Sep 7, 2009, at 9:00 PM, Nick Lewycky wrote: > >> Chris Lattner wrote: >>> On Sep 7, 2009, at 7:02 PM, Nick Lewycky wrote: >>>>>> + >>>>>> + switch (Ty->getTypeID()) { >>>>>> + case Type::FunctionTyID: { >>>>>> + if (!CheckedTypes.insert(Ty)) return; >>>>> Why don't you do the insert before the switch? >>>> >>>> Because I don't want to insert the integers, double, labels, etc. >>>> They all go through the default case. >>> Why not? >> >> It's a waste of ram and cycles. We know that those are always valid, >> we never need to check them. We certainly don't need to store >> PATypeHolders for them in CheckedTypes. >> >> While I wouldn't really mind doing this for non-derived types, what >> made my mind up was IntegerType and the fact you could in theory have >> 100,000 different integer types. >> >> Of course, the way it's written now is a jump-threading testcase. If >> you want me to stop arguing and change it, just let me know. :) > > Please just change it. I'd rather have the verifier be simple and small > than trying to optimize out a dozen insertions. Done. Nick From sabre at nondot.org Tue Sep 8 00:49:26 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 05:49:26 -0000 Subject: [llvm-commits] [llvm] r81195 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Message-ID: <200909080549.n885nQv5001313@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 8 00:49:25 2009 New Revision: 81195 URL: http://llvm.org/viewvc/llvm-project?rev=81195&view=rev Log: add a hack to lower MOV16r0 to MOV32r0 in MCInstLower, eliminating the problem with subreg32 modifiers. This gets all of Olden working with the new asmprinter. Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=81195&r1=81194&r2=81195&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Tue Sep 8 00:49:25 2009 @@ -39,6 +39,13 @@ } +static void lower_subreg32(MCInst *MI, unsigned OpNo) { + // Convert registers in the addr mode according to subreg32. + unsigned Reg = MI->getOperand(OpNo).getReg(); + if (Reg != 0) + MI->getOperand(OpNo).setReg(getX86SubSuperRegister(Reg, MVT::i32)); +} + static void lower_lea64_32mem(MCInst *MI, unsigned OpNo) { // Convert registers in the addr mode according to subreg64. @@ -302,6 +309,11 @@ // Handle the 'subreg rewriting' for the lea64_32mem operand. lower_lea64_32mem(&TmpInst, 1); break; + + case X86::MOV16r0: + TmpInst.setOpcode(X86::MOV32r0); + lower_subreg32(&TmpInst, 0); + break; } printInstruction(&TmpInst); From sabre at nondot.org Tue Sep 8 01:03:07 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 06:03:07 -0000 Subject: [llvm-commits] [llvm] r81196 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Message-ID: <200909080603.n88638nE003028@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 8 01:03:07 2009 New Revision: 81196 URL: http://llvm.org/viewvc/llvm-project?rev=81196&view=rev Log: ADd support for "lowering" the X86::MOVZX16rr8/X86::MOVZX16rm8 subreg32 modifiers. Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=81196&r1=81195&r2=81196&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Tue Sep 8 01:03:07 2009 @@ -309,11 +309,18 @@ // Handle the 'subreg rewriting' for the lea64_32mem operand. lower_lea64_32mem(&TmpInst, 1); break; - case X86::MOV16r0: TmpInst.setOpcode(X86::MOV32r0); lower_subreg32(&TmpInst, 0); break; + case X86::MOVZX16rr8: + TmpInst.setOpcode(X86::MOVZX32rr8); + lower_subreg32(&TmpInst, 0); + break; + case X86::MOVZX16rm8: + TmpInst.setOpcode(X86::MOVZX32rm8); + lower_subreg32(&TmpInst, 0); + break; } printInstruction(&TmpInst); From daniel at zuster.org Tue Sep 8 01:08:08 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 08 Sep 2009 06:08:08 -0000 Subject: [llvm-commits] [llvm] r81197 - /llvm/trunk/utils/lit/TestRunner.py Message-ID: <200909080608.n88688dg003662@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 8 01:08:07 2009 New Revision: 81197 URL: http://llvm.org/viewvc/llvm-project?rev=81197&view=rev Log: lit needs bash for tcl-as-sh execution, we use set -o pipefail. Modified: llvm/trunk/utils/lit/TestRunner.py Modified: llvm/trunk/utils/lit/TestRunner.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/TestRunner.py?rev=81197&r1=81196&r2=81197&view=diff ============================================================================== --- llvm/trunk/utils/lit/TestRunner.py (original) +++ llvm/trunk/utils/lit/TestRunner.py Tue Sep 8 01:08:07 2009 @@ -213,7 +213,7 @@ print >>sys.stdout return '', '', 0 - command = ['/bin/sh', script] + command = ['/bin/bash', script] out,err,exitCode = executeCommand(command, cwd=cwd, env=test.config.environment) From sabre at nondot.org Tue Sep 8 01:19:15 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 06:19:15 -0000 Subject: [llvm-commits] [llvm] r81198 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Message-ID: <200909080619.n886JFGj005182@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 8 01:19:15 2009 New Revision: 81198 URL: http://llvm.org/viewvc/llvm-project?rev=81198&view=rev Log: add a bunch more evil lowering code to work around various :subreg32 modifiers in the .td files. This gets us down to 18 failures in codegen/x86 with the new asmprinter. Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=81198&r1=81197&r2=81198&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Tue Sep 8 01:19:15 2009 @@ -50,12 +50,12 @@ static void lower_lea64_32mem(MCInst *MI, unsigned OpNo) { // Convert registers in the addr mode according to subreg64. for (unsigned i = 0; i != 4; ++i) { - if (!MI->getOperand(i).isReg()) continue; + if (!MI->getOperand(OpNo+i).isReg()) continue; - unsigned Reg = MI->getOperand(i).getReg(); + unsigned Reg = MI->getOperand(OpNo+i).getReg(); if (Reg == 0) continue; - MI->getOperand(i).setReg(getX86SubSuperRegister(Reg, MVT::i64)); + MI->getOperand(OpNo+i).setReg(getX86SubSuperRegister(Reg, MVT::i64)); } } @@ -321,6 +321,42 @@ TmpInst.setOpcode(X86::MOVZX32rm8); lower_subreg32(&TmpInst, 0); break; + case X86::MOVSX16rr8: + TmpInst.setOpcode(X86::MOVSX32rr8); + lower_subreg32(&TmpInst, 0); + break; + case X86::MOVSX16rm8: + TmpInst.setOpcode(X86::MOVSX32rm8); + lower_subreg32(&TmpInst, 0); + break; + case X86::MOVZX64rr32: + TmpInst.setOpcode(X86::MOV32rr); + lower_subreg32(&TmpInst, 0); + break; + case X86::MOVZX64rm32: + TmpInst.setOpcode(X86::MOV32rm); + lower_subreg32(&TmpInst, 0); + break; + case X86::MOV64ri64i32: + TmpInst.setOpcode(X86::MOV32ri); + lower_subreg32(&TmpInst, 0); + break; + case X86::MOVZX64rr8: + TmpInst.setOpcode(X86::MOVZX32rr8); + lower_subreg32(&TmpInst, 0); + break; + case X86::MOVZX64rm8: + TmpInst.setOpcode(X86::MOVZX32rm8); + lower_subreg32(&TmpInst, 0); + break; + case X86::MOVZX64rr16: + TmpInst.setOpcode(X86::MOVZX32rr16); + lower_subreg32(&TmpInst, 0); + break; + case X86::MOVZX64rm16: + TmpInst.setOpcode(X86::MOVZX32rm16); + lower_subreg32(&TmpInst, 0); + break; } printInstruction(&TmpInst); From sabre at nondot.org Tue Sep 8 01:25:12 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 06:25:12 -0000 Subject: [llvm-commits] [llvm] r81199 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Message-ID: <200909080625.n886PCf4006001@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 8 01:25:12 2009 New Revision: 81199 URL: http://llvm.org/viewvc/llvm-project?rev=81199&view=rev Log: add support for some missing modifiers on jumptable/constant pool entries. Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=81199&r1=81198&r2=81199&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Tue Sep 8 01:25:12 2009 @@ -134,6 +134,16 @@ case X86II::MO_DARWIN_NONLAZY_PIC_BASE: case X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE: break; + // FIXME: These probably should be a modifier on the symbol or something?? + case X86II::MO_TLSGD: Name += "@TLSGD"; break; + case X86II::MO_GOTTPOFF: Name += "@GOTTPOFF"; break; + case X86II::MO_INDNTPOFF: Name += "@INDNTPOFF"; break; + case X86II::MO_TPOFF: Name += "@TPOFF"; break; + case X86II::MO_NTPOFF: Name += "@NTPOFF"; break; + case X86II::MO_GOTPCREL: Name += "@GOTPCREL"; break; + case X86II::MO_GOT: Name += "@GOT"; break; + case X86II::MO_GOTOFF: Name += "@GOTOFF"; break; + case X86II::MO_PLT: Name += "@PLT"; break; } // Create a symbol for the name. @@ -155,6 +165,16 @@ case X86II::MO_DARWIN_NONLAZY_PIC_BASE: case X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE: break; + // FIXME: These probably should be a modifier on the symbol or something?? + case X86II::MO_TLSGD: Name += "@TLSGD"; break; + case X86II::MO_GOTTPOFF: Name += "@GOTTPOFF"; break; + case X86II::MO_INDNTPOFF: Name += "@INDNTPOFF"; break; + case X86II::MO_TPOFF: Name += "@TPOFF"; break; + case X86II::MO_NTPOFF: Name += "@NTPOFF"; break; + case X86II::MO_GOTPCREL: Name += "@GOTPCREL"; break; + case X86II::MO_GOT: Name += "@GOT"; break; + case X86II::MO_GOTOFF: Name += "@GOTOFF"; break; + case X86II::MO_PLT: Name += "@PLT"; break; } // Create a symbol for the name. From sabre at nondot.org Tue Sep 8 01:26:40 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 06:26:40 -0000 Subject: [llvm-commits] [llvm] r81200 - /llvm/trunk/test/CodeGen/X86/packed_struct.ll Message-ID: <200909080626.n886QeO8006188@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 8 01:26:40 2009 New Revision: 81200 URL: http://llvm.org/viewvc/llvm-project?rev=81200&view=rev Log: disable some irrelevant eh emission Modified: llvm/trunk/test/CodeGen/X86/packed_struct.ll Modified: llvm/trunk/test/CodeGen/X86/packed_struct.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/packed_struct.ll?rev=81200&r1=81199&r2=81200&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/packed_struct.ll (original) +++ llvm/trunk/test/CodeGen/X86/packed_struct.ll Tue Sep 8 01:26:40 2009 @@ -15,7 +15,7 @@ @foos = external global %struct.anon ; <%struct.anon*> [#uses=3] @bara = weak global [4 x <{ i32, i8 }>] zeroinitializer ; <[4 x <{ i32, i8 }>]*> [#uses=2] -define i32 @foo() { +define i32 @foo() nounwind { entry: %tmp = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 1) ; [#uses=1] %tmp3 = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 2) ; [#uses=1] @@ -25,7 +25,7 @@ ret i32 %tmp7 } -define i8 @bar() { +define i8 @bar() nounwind { entry: %tmp = load i8* getelementptr ([4 x <{ i32, i8 }>]* @bara, i32 0, i32 0, i32 1) ; [#uses=1] %tmp4 = load i8* getelementptr ([4 x <{ i32, i8 }>]* @bara, i32 0, i32 3, i32 1) ; [#uses=1] From sabre at nondot.org Tue Sep 8 01:27:48 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 06:27:48 -0000 Subject: [llvm-commits] [llvm] r81201 - /llvm/trunk/lib/MC/MCExpr.cpp Message-ID: <200909080627.n886Rnai006338@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 8 01:27:48 2009 New Revision: 81201 URL: http://llvm.org/viewvc/llvm-project?rev=81201&view=rev Log: tidy whitespace. Modified: llvm/trunk/lib/MC/MCExpr.cpp Modified: llvm/trunk/lib/MC/MCExpr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=81201&r1=81200&r2=81201&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCExpr.cpp (original) +++ llvm/trunk/lib/MC/MCExpr.cpp Tue Sep 8 01:27:48 2009 @@ -80,16 +80,13 @@ /* *** */ -const MCBinaryExpr * MCBinaryExpr::Create(Opcode Opc, - const MCExpr *LHS, - const MCExpr *RHS, - MCContext &Ctx) { +const MCBinaryExpr *MCBinaryExpr::Create(Opcode Opc, const MCExpr *LHS, + const MCExpr *RHS, MCContext &Ctx) { return new (Ctx) MCBinaryExpr(Opc, LHS, RHS); } -const MCUnaryExpr * MCUnaryExpr::Create(Opcode Opc, - const MCExpr *Expr, - MCContext &Ctx) { +const MCUnaryExpr *MCUnaryExpr::Create(Opcode Opc, const MCExpr *Expr, + MCContext &Ctx) { return new (Ctx) MCUnaryExpr(Opc, Expr); } From sabre at nondot.org Tue Sep 8 01:34:07 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 06:34:07 -0000 Subject: [llvm-commits] [llvm] r81202 - /llvm/trunk/lib/MC/MCExpr.cpp Message-ID: <200909080634.n886Y7jT007214@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 8 01:34:07 2009 New Revision: 81202 URL: http://llvm.org/viewvc/llvm-project?rev=81202&view=rev Log: make formatting of expressions more closely match the existing asmprinter. Modified: llvm/trunk/lib/MC/MCExpr.cpp Modified: llvm/trunk/lib/MC/MCExpr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=81202&r1=81201&r2=81202&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCExpr.cpp (original) +++ llvm/trunk/lib/MC/MCExpr.cpp Tue Sep 8 01:34:07 2009 @@ -39,9 +39,16 @@ case MCExpr::Binary: { const MCBinaryExpr &BE = cast(*this); - OS << '('; - BE.getLHS()->print(OS, MAI); - OS << ' '; + + // Only print parens around the LHS if it is non-trivial. + if (isa(BE.getLHS()) || isa(BE.getLHS())) { + BE.getLHS()->print(OS, MAI); + } else { + OS << '('; + BE.getLHS()->print(OS, MAI); + OS << ')'; + } + switch (BE.getOpcode()) { default: assert(0 && "Invalid opcode!"); case MCBinaryExpr::Add: OS << '+'; break; @@ -63,9 +70,15 @@ case MCBinaryExpr::Sub: OS << '-'; break; case MCBinaryExpr::Xor: OS << '^'; break; } - OS << ' '; - BE.getRHS()->print(OS, MAI); - OS << ')'; + + // Only print parens around the LHS if it is non-trivial. + if (isa(BE.getRHS()) || isa(BE.getRHS())) { + BE.getRHS()->print(OS, MAI); + } else { + OS << '('; + BE.getRHS()->print(OS, MAI); + OS << ')'; + } return; } } From sabre at nondot.org Tue Sep 8 01:37:35 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 06:37:35 -0000 Subject: [llvm-commits] [llvm] r81203 - /llvm/trunk/lib/MC/MCExpr.cpp Message-ID: <200909080637.n886bZI1007651@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 8 01:37:35 2009 New Revision: 81203 URL: http://llvm.org/viewvc/llvm-project?rev=81203&view=rev Log: Print "X-42" instead of "X+-42". Modified: llvm/trunk/lib/MC/MCExpr.cpp Modified: llvm/trunk/lib/MC/MCExpr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=81203&r1=81202&r2=81203&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCExpr.cpp (original) +++ llvm/trunk/lib/MC/MCExpr.cpp Tue Sep 8 01:37:35 2009 @@ -51,7 +51,17 @@ switch (BE.getOpcode()) { default: assert(0 && "Invalid opcode!"); - case MCBinaryExpr::Add: OS << '+'; break; + case MCBinaryExpr::Add: + // Print "X-42" instead of "X+-42". + if (const MCConstantExpr *RHSC = dyn_cast(BE.getRHS())) { + if (RHSC->getValue() < 0) { + OS << RHSC->getValue(); + return; + } + } + + OS << '+'; + break; case MCBinaryExpr::And: OS << '&'; break; case MCBinaryExpr::Div: OS << '/'; break; case MCBinaryExpr::EQ: OS << "=="; break; From evan.cheng at apple.com Tue Sep 8 01:39:07 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 08 Sep 2009 06:39:07 -0000 Subject: [llvm-commits] [llvm] r81204 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/X86/2009-09-07-CoalescerBug.ll Message-ID: <200909080639.n886d8mR007846@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 8 01:39:07 2009 New Revision: 81204 URL: http://llvm.org/viewvc/llvm-project?rev=81204&view=rev Log: When remat'ing and destination virtual register has a sub-register index. Make sure the sub-register class matches the register class of the remat'ed instruction definition register class. Added: llvm/trunk/test/CodeGen/X86/2009-09-07-CoalescerBug.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=81204&r1=81203&r2=81204&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Sep 8 01:39:07 2009 @@ -660,6 +660,22 @@ return false; } + // If destination register has a sub-register index on it, make sure it mtches + // the instruction register class. + if (DstSubIdx) { + const TargetInstrDesc &TID = DefMI->getDesc(); + if (TID.getNumDefs() != 1) + return false; + const TargetRegisterClass *DstRC = mri_->getRegClass(DstReg); + const TargetRegisterClass *DstSubRC = + DstRC->getSubRegisterRegClass(DstSubIdx); + const TargetRegisterClass *DefRC = TID.OpInfo[0].getRegClass(tri_); + if (DefRC == DstRC) + DstSubIdx = 0; + else if (DefRC != DstSubRC) + return false; + } + MachineInstrIndex DefIdx = li_->getDefIndex(CopyIdx); const LiveRange *DLR= li_->getInterval(DstReg).getLiveRangeContaining(DefIdx); DLR->valno->setCopy(0); Added: llvm/trunk/test/CodeGen/X86/2009-09-07-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-09-07-CoalescerBug.ll?rev=81204&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-09-07-CoalescerBug.ll (added) +++ llvm/trunk/test/CodeGen/X86/2009-09-07-CoalescerBug.ll Tue Sep 8 01:39:07 2009 @@ -0,0 +1,48 @@ +; RUN: llvm-as < %s | llc -triple=x86_64-unknown-freebsd7.2 -code-model=kernel | FileCheck %s +; PR4689 + +%struct.__s = type { [8 x i8] } +%struct.pcb = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i16, i8* } +%struct.pcpu = type { i32*, i32*, i32*, i32*, %struct.pcb*, i64, i32, i32, i32, i32 } + +define i64 @hammer_time(i64 %modulep, i64 %physfree) nounwind ssp noredzone noimplicitfloat { +; CHECK: hammer_time: +; CHECK: movq $Xrsvd, %rax +; CHECK: movq $Xrsvd, %rdi +; CHECK: movq $Xrsvd, %r8 +entry: + br i1 undef, label %if.then, label %if.end + +if.then: ; preds = %entry + br label %if.end + +if.end: ; preds = %if.then, %entry + br label %for.body + +for.body: ; preds = %for.inc, %if.end + switch i32 undef, label %if.then76 [ + i32 9, label %for.inc + i32 10, label %for.inc + i32 11, label %for.inc + i32 12, label %for.inc + ] + +if.then76: ; preds = %for.body + unreachable + +for.inc: ; preds = %for.body, %for.body, %for.body, %for.body + br i1 undef, label %for.end, label %for.body + +for.end: ; preds = %for.inc + call void asm sideeffect "mov $1,%gs:$0", "=*m,r,~{dirflag},~{fpsr},~{flags}"(%struct.__s* bitcast (%struct.pcb** getelementptr (%struct.pcpu* null, i32 0, i32 4) to %struct.__s*), i64 undef) nounwind + br label %for.body170 + +for.body170: ; preds = %for.body170, %for.end + store i64 or (i64 and (i64 or (i64 ptrtoint (void (i32, i32, i32, i32)* @Xrsvd to i64), i64 2097152), i64 2162687), i64 or (i64 or (i64 and (i64 shl (i64 ptrtoint (void (i32, i32, i32, i32)* @Xrsvd to i64), i64 32), i64 -281474976710656), i64 140737488355328), i64 15393162788864)), i64* undef + br i1 undef, label %for.end175, label %for.body170 + +for.end175: ; preds = %for.body170 + unreachable +} + +declare void @Xrsvd(i32, i32, i32, i32) ssp noredzone noimplicitfloat From edwintorok at gmail.com Tue Sep 8 02:06:17 2009 From: edwintorok at gmail.com (=?ISO-8859-1?Q?T=F6r=F6k_Edwin?=) Date: Tue, 08 Sep 2009 10:06:17 +0300 Subject: [llvm-commits] [llvm] r81170 - /llvm/trunk/docs/LangRef.html In-Reply-To: <200909072333.n87NXqwI018462@zion.cs.uiuc.edu> References: <200909072333.n87NXqwI018462@zion.cs.uiuc.edu> Message-ID: <4AA60269.1090101@gmail.com> On 2009-09-08 02:33, Chris Lattner wrote: > Author: lattner > Date: Mon Sep 7 18:33:52 2009 > New Revision: 81170 > > URL: http://llvm.org/viewvc/llvm-project?rev=81170&view=rev > Log: > add some more notes. > > Modified: > llvm/trunk/docs/LangRef.html > > Modified: llvm/trunk/docs/LangRef.html > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=81170&r1=81169&r2=81170&view=diff > > ============================================================================== > --- llvm/trunk/docs/LangRef.html (original) > +++ llvm/trunk/docs/LangRef.html Mon Sep 7 18:33:52 2009 > @@ -2118,7 +2118,46 @@ > so the value is not neccesarily consistent over time. In fact, %A and %C need > to have the same semantics of the core LLVM "replace all uses with" concept > would not hold.

> - > + > +
> +
> +  %A = fdiv undef, %X
> +  %B = fdiv %X, undef
> +Safe:
> +  %A = undef
> +b: unreachable
> +
> +
> + > +

These examples show the crucial difference between an undefined > +value and undefined behavior. An undefined value (like undef) is > +allowed to have an arbitrary bit-pattern. This means that the %A operation > +can be constant folded to undef because the undef could be an SNaN, and fdiv is > +not (currently) defined on SNaN's. However, in the second example, we can make > +a more aggressive assumption: because the undef is allowed to be an arbitrary > +value, we are allowed to assume that it could be zero. Since a divide by zero > +is has undefined behavior, we are allowed to assume that the operation > is has? Best regards, --Edwin From asl at math.spbu.ru Tue Sep 8 02:30:03 2009 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 08 Sep 2009 07:30:03 -0000 Subject: [llvm-commits] [llvm] r81205 - /llvm/trunk/test/CodeGen/X86/2009-09-07-CoalescerBug.ll Message-ID: <200909080730.n887U3mT014211@zion.cs.uiuc.edu> Author: asl Date: Tue Sep 8 02:30:03 2009 New Revision: 81205 URL: http://llvm.org/viewvc/llvm-project?rev=81205&view=rev Log: Unbreak Modified: llvm/trunk/test/CodeGen/X86/2009-09-07-CoalescerBug.ll Modified: llvm/trunk/test/CodeGen/X86/2009-09-07-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-09-07-CoalescerBug.ll?rev=81205&r1=81204&r2=81205&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-09-07-CoalescerBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-09-07-CoalescerBug.ll Tue Sep 8 02:30:03 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -triple=x86_64-unknown-freebsd7.2 -code-model=kernel | FileCheck %s +; RUN: llvm-as < %s | llc -mtriple=x86_64-unknown-freebsd7.2 -code-model=kernel | FileCheck %s ; PR4689 %struct.__s = type { [8 x i8] } From nicolas.geoffray at lip6.fr Tue Sep 8 02:36:18 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 08 Sep 2009 07:36:18 -0000 Subject: [llvm-commits] [llvm] r81206 - /llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Message-ID: <200909080736.n887aIEr015109@zion.cs.uiuc.edu> Author: geoffray Date: Tue Sep 8 02:36:18 2009 New Revision: 81206 URL: http://llvm.org/viewvc/llvm-project?rev=81206&view=rev Log: Also emit a label for TargetInstrInfo::GC_LABEL. Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=81206&r1=81205&r2=81206&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Tue Sep 8 02:36:18 2009 @@ -592,6 +592,7 @@ break; case TargetInstrInfo::DBG_LABEL: case TargetInstrInfo::EH_LABEL: + case TargetInstrInfo::GC_LABEL: MCE.emitLabel(MI.getOperand(0).getImm()); break; case TargetInstrInfo::IMPLICIT_DEF: From nicolas.geoffray at lip6.fr Tue Sep 8 02:39:27 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 08 Sep 2009 07:39:27 -0000 Subject: [llvm-commits] [llvm] r81207 - /llvm/trunk/lib/CodeGen/GCStrategy.cpp Message-ID: <200909080739.n887dRhO018002@zion.cs.uiuc.edu> Author: geoffray Date: Tue Sep 8 02:39:27 2009 New Revision: 81207 URL: http://llvm.org/viewvc/llvm-project?rev=81207&view=rev Log: When emitting a label for a PostCall safe point, the machine instruction to insert before can be end(). getDebugLoc on end() returns an invalid value, therefore use the debug loc of the call instruction, and give it to InsertLabel. Modified: llvm/trunk/lib/CodeGen/GCStrategy.cpp Modified: llvm/trunk/lib/CodeGen/GCStrategy.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCStrategy.cpp?rev=81207&r1=81206&r2=81207&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/GCStrategy.cpp (original) +++ llvm/trunk/lib/CodeGen/GCStrategy.cpp Tue Sep 8 02:39:27 2009 @@ -72,7 +72,8 @@ void FindSafePoints(MachineFunction &MF); void VisitCallPoint(MachineBasicBlock::iterator MI); unsigned InsertLabel(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI) const; + MachineBasicBlock::iterator MI, + DebugLoc DL) const; void FindStackOffsets(MachineFunction &MF); @@ -329,11 +330,13 @@ } unsigned MachineCodeAnalysis::InsertLabel(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI) const { + MachineBasicBlock::iterator MI, + DebugLoc DL) const { unsigned Label = MMI->NextLabelID(); - // N.B. we assume that MI is *not* equal to the "end()" iterator. - BuildMI(MBB, MI, MI->getDebugLoc(), + + BuildMI(MBB, MI, DL, TII->get(TargetInstrInfo::GC_LABEL)).addImm(Label); + return Label; } @@ -344,10 +347,12 @@ ++RAI; if (FI->getStrategy().needsSafePoint(GC::PreCall)) - FI->addSafePoint(GC::PreCall, InsertLabel(*CI->getParent(), CI)); + FI->addSafePoint(GC::PreCall, InsertLabel(*CI->getParent(), CI, + CI->getDebugLoc())); if (FI->getStrategy().needsSafePoint(GC::PostCall)) - FI->addSafePoint(GC::PostCall, InsertLabel(*CI->getParent(), RAI)); + FI->addSafePoint(GC::PostCall, InsertLabel(*CI->getParent(), RAI, + CI->getDebugLoc())); } void MachineCodeAnalysis::FindSafePoints(MachineFunction &MF) { From baldrick at free.fr Tue Sep 8 03:10:58 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 08 Sep 2009 08:10:58 -0000 Subject: [llvm-commits] [gcc-plugin] r81208 - in /gcc-plugin/trunk: llvm-convert.cpp llvm-internal.h Message-ID: <200909080810.n888Aw1d032540@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 8 03:10:57 2009 New Revision: 81208 URL: http://llvm.org/viewvc/llvm-project?rev=81208&view=rev Log: Convert GIMPLE_COND to LLVM. One complication here is that the true and false labels are always NULL in the gimple. That's because the CFG is available and you are supposed to extract the target blocks from the CFG instead. The other complication is that we only have the left- and right-hand sides of the comparison (and the comparison code) rather than a tree, which meant reworking EmitCompare somewhat. Modified: gcc-plugin/trunk/llvm-convert.cpp gcc-plugin/trunk/llvm-internal.h Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81208&r1=81207&r2=81208&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 8 03:10:57 2009 @@ -86,6 +86,11 @@ static LLVMContext &Context = getGlobalContext(); +/// dump - Print a gimple statement to standard error. +void dump(gimple stmt) { + print_gimple_stmt(stderr, stmt, 0, TDF_RAW); +} + // Check for GCC bug 17347: C++ FE sometimes creates bogus ctor trees // which we should throw out #define BOGUS_CTOR(exp) \ @@ -195,6 +200,8 @@ /// getLabelDeclBlock - Lazily get and create a basic block for the specified /// label. +/// TODO: remove uses of gimple_block_label, keep a map of GCC basic blocks to +/// LLVM basic blocks rather than going via labels and DECL_LLVM. static BasicBlock *getLabelDeclBlock(tree LabelDecl) { assert(TREE_CODE(LabelDecl) == LABEL_DECL && "Isn't a label!?"); if (DECL_LLVM_SET_P(LabelDecl)) @@ -745,7 +752,6 @@ switch (gimple_code(gimple_stmt)) { case GIMPLE_ASSIGN: - case GIMPLE_COND: case GIMPLE_GOTO: case GIMPLE_LABEL: case GIMPLE_RETURN: @@ -772,8 +778,12 @@ break; } + case GIMPLE_COND: + RenderGIMPLE_COND(gimple_stmt); + break; + default: - print_gimple_stmt(stderr, gimple_stmt, 0, TDF_RAW); + dump(gimple_stmt); llvm_unreachable("Unhandled GIMPLE statement during LLVM emission!"); } } @@ -839,7 +849,6 @@ case LABEL_EXPR: Result = EmitLABEL_EXPR(exp); break; case GOTO_EXPR: Result = EmitGOTO_EXPR(exp); break; case RETURN_EXPR: Result = EmitRETURN_EXPR(exp, DestLoc); break; - case COND_EXPR: Result = EmitCOND_EXPR(exp); break; case SWITCH_EXPR: Result = EmitSWITCH_EXPR(exp); break; // Exception handling. @@ -1769,78 +1778,6 @@ return 0; } -Value *TreeToLLVM::EmitCOND_EXPR(tree exp) { - tree exp_cond = COND_EXPR_COND(exp); - - // Emit the conditional expression. Special case comparisons since they are - // very common and we want to avoid an extension to 'int' of the intermediate - // result. - unsigned UIPred = 0, SIPred = 0, FPPred = ~0; - Value *Cond; - switch (TREE_CODE(exp_cond)) { - default: break; - case LT_EXPR: - UIPred = ICmpInst::ICMP_ULT; - SIPred = ICmpInst::ICMP_SLT; - FPPred = FCmpInst::FCMP_OLT; - break; - case LE_EXPR: - UIPred = ICmpInst::ICMP_ULE; - SIPred = ICmpInst::ICMP_SLE; - FPPred = FCmpInst::FCMP_OLE; - break; - case GT_EXPR: - UIPred = ICmpInst::ICMP_UGT; - SIPred = ICmpInst::ICMP_SGT; - FPPred = FCmpInst::FCMP_OGT; - break; - case GE_EXPR: - UIPred = ICmpInst::ICMP_UGE; - SIPred = ICmpInst::ICMP_SGE; - FPPred = FCmpInst::FCMP_OGE; - break; - case EQ_EXPR: - UIPred = SIPred = ICmpInst::ICMP_EQ; - FPPred = FCmpInst::FCMP_OEQ; - break; - case NE_EXPR: - UIPred = SIPred = ICmpInst::ICMP_NE; - FPPred = FCmpInst::FCMP_UNE; - break; - case UNORDERED_EXPR: FPPred = FCmpInst::FCMP_UNO; break; - case ORDERED_EXPR: FPPred = FCmpInst::FCMP_ORD; break; - case UNLT_EXPR: FPPred = FCmpInst::FCMP_ULT; break; - case UNLE_EXPR: FPPred = FCmpInst::FCMP_ULE; break; - case UNGT_EXPR: FPPred = FCmpInst::FCMP_UGT; break; - case UNGE_EXPR: FPPred = FCmpInst::FCMP_UGE; break; - case UNEQ_EXPR: FPPred = FCmpInst::FCMP_UEQ; break; - case LTGT_EXPR: FPPred = FCmpInst::FCMP_ONE; break; - } - - // If the operand wasn't a compare, emit it fully generally. If it was, emit - // it with EmitCompare to get the result as an i1. - if (FPPred == ~0U) { - Cond = Emit(exp_cond, 0); - // Comparison against zero to convert the result to i1. - if (Cond->getType() != Type::getInt1Ty(Context)) - Cond = Builder.CreateIsNotNull(Cond, "toBool"); - } else { - Cond = EmitCompare(exp_cond, UIPred, SIPred, FPPred, Type::getInt1Ty(Context)); - assert(Cond->getType() == Type::getInt1Ty(Context)); - } - - tree Then = COND_EXPR_THEN(exp); - tree Else = COND_EXPR_ELSE(exp); - assert(TREE_CODE(Then) == GOTO_EXPR && TREE_CODE(Else) == GOTO_EXPR - && "Not a gimple if?"); - - BasicBlock *ThenDest = getLabelDeclBlock(TREE_OPERAND(Then, 0)); - BasicBlock *ElseDest = getLabelDeclBlock(TREE_OPERAND(Else, 0)); - Builder.CreateCondBr(Cond, ThenDest, ElseDest); - EmitBlock(BasicBlock::Create(Context, "")); - return 0; -} - Value *TreeToLLVM::EmitSWITCH_EXPR(tree exp) { tree Cases = SWITCH_LABELS(exp); @@ -3281,6 +3218,65 @@ return CastToUIntType(V, ConvertType(TREE_TYPE(exp))); } +/// EmitCompare - Compare LHS with RHS using the appropriate comparison code. +/// The result is an i1 boolean. +Value *TreeToLLVM::EmitCompare(tree lhs, tree rhs, + unsigned UIOpc, unsigned SIOpc, unsigned FPPred) { + tree lhs_ty = TREE_TYPE(lhs); + tree rhs_ty = TREE_TYPE(rhs); + + if (FLOAT_TYPE_P(lhs_ty)) + return Builder.CreateFCmp(FCmpInst::Predicate(FPPred), + Emit(lhs, 0), Emit(rhs, 0)); + + if (TREE_CODE(lhs_ty) == COMPLEX_TYPE) { + // TODO: Reduce duplication with EmitComplexBinOp. + const Type *ComplexTy = ConvertType(lhs_ty); + + MemRef LHSTmp = CreateTempLoc(ComplexTy); + MemRef RHSTmp = CreateTempLoc(ComplexTy); + Emit(lhs, &LHSTmp); + Emit(rhs, &RHSTmp); + + Value *LHSr, *LHSi; + EmitLoadFromComplex(LHSr, LHSi, LHSTmp); + Value *RHSr, *RHSi; + EmitLoadFromComplex(RHSr, RHSi, RHSTmp); + + Value *DSTr, *DSTi; + if (LHSr->getType()->isFloatingPoint()) { + DSTr = Builder.CreateFCmp(FCmpInst::Predicate(FPPred), LHSr, RHSr); + DSTi = Builder.CreateFCmp(FCmpInst::Predicate(FPPred), LHSi, RHSi); + if (FPPred == FCmpInst::FCMP_OEQ) + return Builder.CreateAnd(DSTr, DSTi); + assert(FPPred == FCmpInst::FCMP_UNE && "Unhandled complex comparison!"); + return Builder.CreateOr(DSTr, DSTi); + } + + assert(SIOpc == UIOpc && "(In)equality comparison depends on sign!"); + DSTr = Builder.CreateICmp(ICmpInst::Predicate(UIOpc), LHSr, RHSr); + DSTi = Builder.CreateICmp(ICmpInst::Predicate(UIOpc), LHSi, RHSi); + if (UIOpc == ICmpInst::ICMP_EQ) + return Builder.CreateAnd(DSTr, DSTi); + assert(UIOpc == ICmpInst::ICMP_NE && "Unhandled complex comparison!"); + return Builder.CreateOr(DSTr, DSTi); + } + + // Handle the integer/pointer cases. + + // Get the compare operands, in the right type. Comparison of struct is not + // allowed, so this is safe as we already handled complex (struct) type. + Value *LHS = Emit(lhs, 0); + Value *RHS = Emit(rhs, 0); + bool LHSIsSigned = !TYPE_UNSIGNED(lhs_ty); + bool RHSIsSigned = !TYPE_UNSIGNED(rhs_ty); + RHS = CastToAnyType(RHS, RHSIsSigned, LHS->getType(), LHSIsSigned); + + // Determine which predicate to use based on signedness. + ICmpInst::Predicate pred = ICmpInst::Predicate(LHSIsSigned ? SIOpc : UIOpc); + return Builder.CreateICmp(pred, LHS, RHS); +} + /// EmitCompare - 'exp' is a comparison of two values. Opc is the base LLVM /// comparison to use. isUnord is true if this is a floating point comparison /// that should also be true if either operand is a NaN. Note that Opc can be @@ -3291,45 +3287,13 @@ /// corresponds to. Value *TreeToLLVM::EmitCompare(tree exp, unsigned UIOpc, unsigned SIOpc, unsigned FPPred, const Type *DestTy) { - // Get the type of the operands - tree Op0Ty = TREE_TYPE(TREE_OPERAND(exp,0)); - - Value *Result; - - // Deal with complex types - if (TREE_CODE(Op0Ty) == COMPLEX_TYPE) { - Result = EmitComplexBinOp(exp, 0); // Complex ==/!= - } else { - // Get the compare operands, in the right type. Comparison of struct is not - // allowed, so this is safe as we already handled complex (struct) type. - Value *LHS = Emit(TREE_OPERAND(exp, 0), 0); - Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); - bool LHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0))); - bool RHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 1))); - RHS = CastToAnyType(RHS, RHSIsSigned, LHS->getType(), LHSIsSigned); - assert(LHS->getType() == RHS->getType() && "Binop type equality failure!"); - - if (FLOAT_TYPE_P(Op0Ty)) { - // Handle floating point comparisons, if we get here. - Result = Builder.CreateFCmp(FCmpInst::Predicate(FPPred), LHS, RHS); - } else { - // Handle the integer/pointer cases. Determine which predicate to use based - // on signedness. - ICmpInst::Predicate pred = - ICmpInst::Predicate(TYPE_UNSIGNED(Op0Ty) ? UIOpc : SIOpc); - - // Get the compare instructions - Result = Builder.CreateICmp(pred, LHS, RHS); - } - } - assert(Result->getType() == Type::getInt1Ty(Context) && "Expected i1 result for compare"); + Value *Result = EmitCompare(TREE_OPERAND(exp, 0), TREE_OPERAND(exp, 1), + UIOpc, SIOpc, FPPred); if (DestTy == 0) DestTy = ConvertType(TREE_TYPE(exp)); // The GCC type is probably an int, not a bool. ZExt to the right size. - if (Result->getType() == DestTy) - return Result; return Builder.CreateZExt(Result, DestTy); } @@ -8047,3 +8011,69 @@ "It's a bitfield reference or we didn't get to the field!"); return FieldPtr; } + +//===----------------------------------------------------------------------===// +// ... Convert GIMPLE to LLVM ... +//===----------------------------------------------------------------------===// + +Value *TreeToLLVM::RenderGIMPLE_COND(gimple stmt) { + // Compute the LLVM opcodes corresponding to the GCC comparison. + unsigned UIPred = 0, SIPred = 0, FPPred = 0; + switch (gimple_cond_code(stmt)) { + case LT_EXPR: + UIPred = ICmpInst::ICMP_ULT; + SIPred = ICmpInst::ICMP_SLT; + FPPred = FCmpInst::FCMP_OLT; + break; + case LE_EXPR: + UIPred = ICmpInst::ICMP_ULE; + SIPred = ICmpInst::ICMP_SLE; + FPPred = FCmpInst::FCMP_OLE; + break; + case GT_EXPR: + UIPred = ICmpInst::ICMP_UGT; + SIPred = ICmpInst::ICMP_SGT; + FPPred = FCmpInst::FCMP_OGT; + break; + case GE_EXPR: + UIPred = ICmpInst::ICMP_UGE; + SIPred = ICmpInst::ICMP_SGE; + FPPred = FCmpInst::FCMP_OGE; + break; + case EQ_EXPR: + UIPred = SIPred = ICmpInst::ICMP_EQ; + FPPred = FCmpInst::FCMP_OEQ; + break; + case NE_EXPR: + UIPred = SIPred = ICmpInst::ICMP_NE; + FPPred = FCmpInst::FCMP_UNE; + break; + case UNORDERED_EXPR: FPPred = FCmpInst::FCMP_UNO; break; + case ORDERED_EXPR: FPPred = FCmpInst::FCMP_ORD; break; + case UNLT_EXPR: FPPred = FCmpInst::FCMP_ULT; break; + case UNLE_EXPR: FPPred = FCmpInst::FCMP_ULE; break; + case UNGT_EXPR: FPPred = FCmpInst::FCMP_UGT; break; + case UNGE_EXPR: FPPred = FCmpInst::FCMP_UGE; break; + case UNEQ_EXPR: FPPred = FCmpInst::FCMP_UEQ; break; + case LTGT_EXPR: FPPred = FCmpInst::FCMP_ONE; break; + + default: + dump(stmt); + llvm_unreachable("Unhandled condition code!"); + } + + // Emit the comparison. + Value *Cond = EmitCompare(gimple_cond_lhs(stmt), gimple_cond_rhs(stmt), + UIPred, SIPred, FPPred); + + // Extract the target basic blocks. + edge true_edge, false_edge; + extract_true_false_edges_from_block(gimple_bb(stmt), &true_edge, &false_edge); + BasicBlock *IfTrue = getLabelDeclBlock(gimple_block_label(true_edge->dest)); + BasicBlock *IfFalse = getLabelDeclBlock(gimple_block_label(false_edge->dest)); + + // Branch based on the condition. + Builder.CreateCondBr(Cond, IfTrue, IfFalse); + EmitBlock(BasicBlock::Create(Context)); + return 0; +} Modified: gcc-plugin/trunk/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-internal.h?rev=81208&r1=81207&r2=81208&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-internal.h (original) +++ gcc-plugin/trunk/llvm-internal.h Tue Sep 8 03:10:57 2009 @@ -492,6 +492,12 @@ BasicBlock *getPostPad(unsigned RegionNo); private: + + // Render* - Convert GIMPLE to LLVM. + + Value *RenderGIMPLE_COND(gimple_statement_d *); + +private: void EmitAutomaticVariableDecl(tree_node *decl); /// isNoopCast - Return true if a cast from V to Ty does not change any bits. @@ -509,12 +515,11 @@ // Emit* - These are delegates from Emit, and have the same parameter // characteristics. - + // Control flow. Value *EmitLABEL_EXPR(tree_node *exp); Value *EmitGOTO_EXPR(tree_node *exp); Value *EmitRETURN_EXPR(tree_node *exp, const MemRef *DestLoc); - Value *EmitCOND_EXPR(tree_node *exp); Value *EmitSWITCH_EXPR(tree_node *exp); // Expressions. @@ -536,6 +541,8 @@ Value *EmitBIT_NOT_EXPR(tree_node *exp); Value *EmitTRUTH_NOT_EXPR(tree_node *exp); Value *EmitEXACT_DIV_EXPR(tree_node *exp, const MemRef *DestLoc); + Value *EmitCompare(tree_node *lhs, tree_node *rhs, + unsigned UIPred, unsigned SIPred, unsigned FPPred); Value *EmitCompare(tree_node *exp, unsigned UIPred, unsigned SIPred, unsigned FPPred, const Type *DestTy = 0); Value *EmitBinOp(tree_node *exp, const MemRef *DestLoc, unsigned Opc); From baldrick at free.fr Tue Sep 8 04:02:13 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 08 Sep 2009 09:02:13 -0000 Subject: [llvm-commits] [gcc-plugin] r81209 - in /gcc-plugin/trunk: llvm-convert.cpp llvm-internal.h Message-ID: <200909080902.n8892E1p007109@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 8 04:02:13 2009 New Revision: 81209 URL: http://llvm.org/viewvc/llvm-project?rev=81209&view=rev Log: When no label is available, work directly with basic blocks rather than constructing a label. Name basic blocks using the same scheme as GCC. Modified: gcc-plugin/trunk/llvm-convert.cpp gcc-plugin/trunk/llvm-internal.h Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81209&r1=81208&r2=81209&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 8 04:02:13 2009 @@ -198,24 +198,6 @@ TheTreeToLLVM = 0; } -/// getLabelDeclBlock - Lazily get and create a basic block for the specified -/// label. -/// TODO: remove uses of gimple_block_label, keep a map of GCC basic blocks to -/// LLVM basic blocks rather than going via labels and DECL_LLVM. -static BasicBlock *getLabelDeclBlock(tree LabelDecl) { - assert(TREE_CODE(LabelDecl) == LABEL_DECL && "Isn't a label!?"); - if (DECL_LLVM_SET_P(LabelDecl)) - return cast(DECL_LLVM(LabelDecl)); - - const char *Name = "bb"; - if (DECL_NAME(LabelDecl)) - Name = IDENTIFIER_POINTER(DECL_NAME(LabelDecl)); - - BasicBlock *NewBB = BasicBlock::Create(Context, Name); - SET_DECL_LLVM(LabelDecl, NewBB); - return NewBB; -} - /// llvm_store_scalar_argument - Store scalar argument ARGVAL of type /// LLVMTY at location LOC. static void llvm_store_scalar_argument(Value *Loc, Value *ArgVal, @@ -742,6 +724,27 @@ return Fn; } +/// getBasicBlock - Find or create the LLVM basic block corresponding to BB. +BasicBlock *TreeToLLVM::getBasicBlock(basic_block bb) { + DenseMap::iterator I = BasicBlocks.find(bb); + if (I != BasicBlocks.end()) + return I->second; + Twine Name(bb->index); + return BasicBlocks[bb] = BasicBlock::Create(Context, "bb " + Name); +} + +/// getLabelDeclBlock - Lazily get and create a basic block for the specified +/// label. +BasicBlock *TreeToLLVM::getLabelDeclBlock(tree LabelDecl) { + assert(TREE_CODE(LabelDecl) == LABEL_DECL && "Isn't a label!?"); + if (DECL_LLVM_SET_P(LabelDecl)) + return cast(DECL_LLVM(LabelDecl)); + + BasicBlock *BB = getBasicBlock(label_to_block(LabelDecl)); + SET_DECL_LLVM(LabelDecl, BB); + return BB; +} + extern "C" tree gimple_to_tree(gimple); extern "C" void release_stmt_tree (gimple, tree); @@ -794,7 +797,7 @@ if (e->flags & EDGE_FALLTHRU) break; if (e && e->dest != bb->next_bb) { - Builder.CreateBr(getLabelDeclBlock(gimple_block_label (e->dest))); + Builder.CreateBr(getBasicBlock(e->dest)); EmitBlock(BasicBlock::Create(Context, "")); } } @@ -7866,7 +7869,7 @@ "Taking the address of a label that isn't in the current fn!?"); } - BasicBlock *BB = getLabelDeclBlock(exp); + BasicBlock *BB = TheTreeToLLVM->getLabelDeclBlock(exp); Constant *C = TheTreeToLLVM->getIndirectGotoBlockNumber(BB); return TheFolder->CreateIntToPtr(C, PointerType::getUnqual(Type::getInt8Ty(Context))); @@ -8069,8 +8072,8 @@ // Extract the target basic blocks. edge true_edge, false_edge; extract_true_false_edges_from_block(gimple_bb(stmt), &true_edge, &false_edge); - BasicBlock *IfTrue = getLabelDeclBlock(gimple_block_label(true_edge->dest)); - BasicBlock *IfFalse = getLabelDeclBlock(gimple_block_label(false_edge->dest)); + BasicBlock *IfTrue = getBasicBlock(true_edge->dest); + BasicBlock *IfFalse = getBasicBlock(false_edge->dest); // Branch based on the condition. Builder.CreateCondBr(Cond, IfTrue, IfFalse); Modified: gcc-plugin/trunk/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-internal.h?rev=81209&r1=81208&r2=81209&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-internal.h (original) +++ gcc-plugin/trunk/llvm-internal.h Tue Sep 8 04:02:13 2009 @@ -320,6 +320,9 @@ /// same as &Fn->back(). LLVMBuilder Builder; + /// BasicBlocks - Map from GCC to LLVM basic blocks. + DenseMap BasicBlocks; + // AllocaInsertionPoint - Place to insert alloca instructions. Lazily created // and managed by CreateTemporary. Instruction *AllocaInsertionPoint; @@ -450,7 +453,16 @@ /// FinishFunctionBody - Once the body of the function has been emitted, this /// cleans up and returns the result function. Function *FinishFunctionBody(); - + + /// getBasicBlock - Find or create the LLVM basic block corresponding to BB. + BasicBlock *getBasicBlock(basic_block bb); + +public: + /// getLabelDeclBlock - Lazily get and create a basic block for the specified + /// label. + BasicBlock *getLabelDeclBlock(tree_node *LabelDecl); + +private: /// Emit - Convert the specified tree node to LLVM code. If the node is an /// expression that fits into an LLVM scalar value, the result is returned. If /// the result is an aggregate, it is stored into the location specified by From baldrick at free.fr Tue Sep 8 04:18:10 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 08 Sep 2009 09:18:10 -0000 Subject: [llvm-commits] [gcc-plugin] r81210 - /gcc-plugin/trunk/llvm-convert.cpp Message-ID: <200909080918.n889IBTc009508@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 8 04:18:10 2009 New Revision: 81210 URL: http://llvm.org/viewvc/llvm-project?rev=81210&view=rev Log: According to the gimple verifier, either we are dealing with pointer types (in which case it shouldn't matter which conversion is done) or at least one type conversion is useless. So do the maybe non-useless conversion. I suspect this is all pointless since the LLVM types will be the same in the non pointer case, but hey! Modified: gcc-plugin/trunk/llvm-convert.cpp Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81210&r1=81209&r2=81210&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 8 04:18:10 2009 @@ -3228,10 +3228,6 @@ tree lhs_ty = TREE_TYPE(lhs); tree rhs_ty = TREE_TYPE(rhs); - if (FLOAT_TYPE_P(lhs_ty)) - return Builder.CreateFCmp(FCmpInst::Predicate(FPPred), - Emit(lhs, 0), Emit(rhs, 0)); - if (TREE_CODE(lhs_ty) == COMPLEX_TYPE) { // TODO: Reduce duplication with EmitComplexBinOp. const Type *ComplexTy = ConvertType(lhs_ty); @@ -3265,15 +3261,21 @@ return Builder.CreateOr(DSTr, DSTi); } - // Handle the integer/pointer cases. - - // Get the compare operands, in the right type. Comparison of struct is not + // Get the compare operands in the right type. Comparison of struct is not // allowed, so this is safe as we already handled complex (struct) type. Value *LHS = Emit(lhs, 0); Value *RHS = Emit(rhs, 0); bool LHSIsSigned = !TYPE_UNSIGNED(lhs_ty); bool RHSIsSigned = !TYPE_UNSIGNED(rhs_ty); - RHS = CastToAnyType(RHS, RHSIsSigned, LHS->getType(), LHSIsSigned); + + // If one of the type conversions is useless, perform the other conversion. + if (useless_type_conversion_p(lhs_ty, rhs_ty)) + RHS = CastToAnyType(RHS, RHSIsSigned, LHS->getType(), LHSIsSigned); + else + LHS = CastToAnyType(LHS, LHSIsSigned, RHS->getType(), RHSIsSigned); + + if (FLOAT_TYPE_P(lhs_ty)) + return Builder.CreateFCmp(FCmpInst::Predicate(FPPred), LHS, RHS); // Determine which predicate to use based on signedness. ICmpInst::Predicate pred = ICmpInst::Predicate(LHSIsSigned ? SIOpc : UIOpc); From baldrick at free.fr Tue Sep 8 05:46:10 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 08 Sep 2009 10:46:10 -0000 Subject: [llvm-commits] [gcc-plugin] r81211 - in /gcc-plugin/trunk: llvm-convert.cpp llvm-internal.h Message-ID: <200909081046.n88AkANC021175@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 8 05:46:10 2009 New Revision: 81211 URL: http://llvm.org/viewvc/llvm-project?rev=81211&view=rev Log: Add support for GCC phi nodes. While there, correct a bug in basic block output: now that basic blocks are output in dom order and not in the order they are stored, the test for when we can omit outputting a fallthrough branch instruction was no longer correct. It might also have caused problems if the upcoming block had phi nodes. So just output the branch always. Modified: gcc-plugin/trunk/llvm-convert.cpp gcc-plugin/trunk/llvm-internal.h Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81211&r1=81210&r2=81211&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 8 05:46:10 2009 @@ -749,9 +749,23 @@ extern "C" void release_stmt_tree (gimple, tree); void TreeToLLVM::EmitBasicBlock(basic_block bb) { - for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi); - gsi_next (&gsi)) { - gimple gimple_stmt = gsi_stmt (gsi); + if (bb != ENTRY_BLOCK_PTR) + EmitBlock(getBasicBlock(bb)); + + // Render phi nodes. + for (gimple_stmt_iterator gsi = gsi_start_phis(bb); !gsi_end_p(gsi); + gsi_next(&gsi)) { + gimple phi = gsi_stmt(gsi); + // Skip virtual operands. + if (!is_gimple_reg(gimple_phi_result(phi))) + continue; + RenderGIMPLE_PHI(phi); + } + + // Render statements. + for (gimple_stmt_iterator gsi = gsi_start_bb(bb); !gsi_end_p(gsi); + gsi_next(&gsi)) { + gimple gimple_stmt = gsi_stmt(gsi); switch (gimple_code(gimple_stmt)) { case GIMPLE_ASSIGN: @@ -791,15 +805,15 @@ } } + // Add a branch to the fallthru block. edge e; edge_iterator ei; FOR_EACH_EDGE (e, ei, bb->succs) - if (e->flags & EDGE_FALLTHRU) + if (e->flags & EDGE_FALLTHRU) { + Builder.CreateBr(getBasicBlock(e->dest)); + EmitBlock(BasicBlock::Create(Context)); break; - if (e && e->dest != bb->next_bb) { - Builder.CreateBr(getBasicBlock(e->dest)); - EmitBlock(BasicBlock::Create(Context, "")); - } + } } static void emit_basic_block(struct dom_walk_data *walk_data, basic_block bb) { @@ -1756,7 +1770,7 @@ // Builder.CreateBr(DestBB); } - EmitBlock(BasicBlock::Create(Context, "")); + EmitBlock(BasicBlock::Create(Context)); return 0; } @@ -1777,7 +1791,7 @@ // Emit a branch to the exit label. Builder.CreateBr(ReturnBB); - EmitBlock(BasicBlock::Create(Context, "")); + EmitBlock(BasicBlock::Create(Context)); return 0; } @@ -1791,7 +1805,7 @@ // Emit the switch instruction. SwitchInst *SI = Builder.CreateSwitch(SwitchExp, Builder.GetInsertBlock(), TREE_VEC_LENGTH(Cases)); - EmitBlock(BasicBlock::Create(Context, "")); + EmitBlock(BasicBlock::Create(Context)); // Default location starts out as fall-through SI->setSuccessor(0, Builder.GetInsertBlock()); @@ -1853,7 +1867,7 @@ else { Builder.CreateBr(DefaultDest); // Emit a "fallthrough" block, which is almost certainly dead. - EmitBlock(BasicBlock::Create(Context, "")); + EmitBlock(BasicBlock::Create(Context)); } } @@ -2384,7 +2398,7 @@ // if (fndecl && TREE_THIS_VOLATILE(fndecl)) { Builder.CreateUnreachable(); - EmitBlock(BasicBlock::Create(Context, "")); + EmitBlock(BasicBlock::Create(Context)); } return Result; } @@ -3781,7 +3795,7 @@ Builder.CreateBr(UnwindBB); } - EmitBlock(BasicBlock::Create(Context, "")); + EmitBlock(BasicBlock::Create(Context)); return 0; } @@ -5063,7 +5077,7 @@ Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::trap)); // Emit an explicit unreachable instruction. Builder.CreateUnreachable(); - EmitBlock(BasicBlock::Create(Context, "")); + EmitBlock(BasicBlock::Create(Context)); return true; //TODO // Convert annotation built-in to llvm.annotation intrinsic. @@ -5931,7 +5945,7 @@ Builder.CreateCall(Intrinsic::getDeclaration(TheModule, IID), Args.begin(), Args.end()); Result = Builder.CreateUnreachable(); - EmitBlock(BasicBlock::Create(Context, "")); + EmitBlock(BasicBlock::Create(Context)); return true; } @@ -8021,7 +8035,27 @@ // ... Convert GIMPLE to LLVM ... //===----------------------------------------------------------------------===// -Value *TreeToLLVM::RenderGIMPLE_COND(gimple stmt) { +void TreeToLLVM::RenderGIMPLE_PHI(gimple stmt) { + // Create the corresponding LLVM phi node. + const Type *Ty = ConvertType(TREE_TYPE(gimple_phi_result(stmt))); + PHINode *Phi = Builder.CreatePHI(Ty); + + // Populate the phi operands. + Phi->reserveOperandSpace(gimple_phi_num_args(stmt)); + for (size_t i = 0; i < gimple_phi_num_args(stmt); ++i) { + BasicBlock *BB = getBasicBlock(gimple_phi_arg_edge(stmt, i)->src); + Value *Val = Emit(gimple_phi_arg(stmt, i)->def, 0); + Phi->addIncoming(Val, BB); + } + + // The phi defines the associated ssa name. + tree name = gimple_phi_result(stmt); + assert(TREE_CODE(name) == SSA_NAME && "PHI result not an SSA name!"); + assert(SSANames.find(name) == SSANames.end() && "Multiply defined SSA name!"); + SSANames[name] = Phi; +} + +void TreeToLLVM::RenderGIMPLE_COND(gimple stmt) { // Compute the LLVM opcodes corresponding to the GCC comparison. unsigned UIPred = 0, SIPred = 0, FPPred = 0; switch (gimple_cond_code(stmt)) { @@ -8080,5 +8114,4 @@ // Branch based on the condition. Builder.CreateCondBr(Cond, IfTrue, IfFalse); EmitBlock(BasicBlock::Create(Context)); - return 0; } Modified: gcc-plugin/trunk/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-internal.h?rev=81211&r1=81210&r2=81211&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-internal.h (original) +++ gcc-plugin/trunk/llvm-internal.h Tue Sep 8 05:46:10 2009 @@ -507,7 +507,8 @@ // Render* - Convert GIMPLE to LLVM. - Value *RenderGIMPLE_COND(gimple_statement_d *); + void RenderGIMPLE_PHI(gimple_statement_d *); + void RenderGIMPLE_COND(gimple_statement_d *); private: void EmitAutomaticVariableDecl(tree_node *decl); From baldrick at free.fr Tue Sep 8 05:47:09 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 08 Sep 2009 10:47:09 -0000 Subject: [llvm-commits] [gcc-plugin] r81212 - /gcc-plugin/trunk/llvm-convert.cpp Message-ID: <200909081047.n88Al9Wt021297@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 8 05:47:09 2009 New Revision: 81212 URL: http://llvm.org/viewvc/llvm-project?rev=81212&view=rev Log: Comment a micro-optimization. Modified: gcc-plugin/trunk/llvm-convert.cpp Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81212&r1=81211&r2=81212&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 8 05:47:09 2009 @@ -749,6 +749,7 @@ extern "C" void release_stmt_tree (gimple, tree); void TreeToLLVM::EmitBasicBlock(basic_block bb) { + // Avoid outputting a pointless branch at the end of the entry block. if (bb != ENTRY_BLOCK_PTR) EmitBlock(getBasicBlock(bb)); From baldrick at free.fr Tue Sep 8 06:11:27 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 08 Sep 2009 11:11:27 -0000 Subject: [llvm-commits] [gcc-plugin] r81213 - /gcc-plugin/trunk/llvm-convert.cpp Message-ID: <200909081111.n88BBRGU024371@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 8 06:11:26 2009 New Revision: 81213 URL: http://llvm.org/viewvc/llvm-project?rev=81213&view=rev Log: There is no need to output an empty basic block after rendering a gimple statement that satisfies stmt_ends_bb_p, like GIMPLE_COND. Modified: gcc-plugin/trunk/llvm-convert.cpp Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81213&r1=81212&r2=81213&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 8 06:11:26 2009 @@ -8114,5 +8114,4 @@ // Branch based on the condition. Builder.CreateCondBr(Cond, IfTrue, IfFalse); - EmitBlock(BasicBlock::Create(Context)); } From baldrick at free.fr Tue Sep 8 06:19:15 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 08 Sep 2009 13:19:15 +0200 Subject: [llvm-commits] [llvm] r81167 - /llvm/trunk/docs/LangRef.html In-Reply-To: <200909072252.n87MqeUV013174@zion.cs.uiuc.edu> References: <200909072252.n87MqeUV013174@zion.cs.uiuc.edu> Message-ID: <4AA63DB3.7020408@free.fr> Hi Chris, nice explanation! > +so the value is not neccesarily consistent over time. In fact, %A and %C need > +to have the same semantics of the core LLVM "replace all uses with" concept of the core -> or the core Ciao, Duncan. From baldrick at free.fr Tue Sep 8 06:19:19 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 08 Sep 2009 13:19:19 +0200 Subject: [llvm-commits] [llvm] r81164 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp In-Reply-To: <200909072242.n87Mg56N011876@zion.cs.uiuc.edu> References: <200909072242.n87Mg56N011876@zion.cs.uiuc.edu> Message-ID: <4AA63DB7.3090500@free.fr> Hi Dan, > Don't commit addresses of aggregate values. This avoids problems with > an aggregate store overlapping a different aggregate store, despite > the stores having distinct addresses. the same thing can happen for non-aggregates, for example storing an i32 and storing an i8 into the middle of it... Ciao, Duncan. From baldrick at free.fr Tue Sep 8 07:42:01 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 08 Sep 2009 12:42:01 -0000 Subject: [llvm-commits] [gcc-plugin] r81214 - /gcc-plugin/trunk/llvm-convert.cpp Message-ID: <200909081242.n88Cg11V003861@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 8 07:42:01 2009 New Revision: 81214 URL: http://llvm.org/viewvc/llvm-project?rev=81214&view=rev Log: The operands of CALL_EXPR moved around, access them using accessor macros instead. This gets function calling working: the plugin can now compile: #include int main(void) { printf("hello world!\n"); return 0; } Modified: gcc-plugin/trunk/llvm-convert.cpp Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81214&r1=81213&r2=81214&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 8 07:42:01 2009 @@ -2370,20 +2370,22 @@ return Res; } - Value *Callee = Emit(TREE_OPERAND(exp, 0), 0); - - assert(TREE_TYPE (TREE_OPERAND (exp, 0)) && - (TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == POINTER_TYPE || - TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == REFERENCE_TYPE) + tree call_expr = CALL_EXPR_FN(exp); + assert(TREE_TYPE (call_expr) && + (TREE_CODE(TREE_TYPE (call_expr)) == POINTER_TYPE || + TREE_CODE(TREE_TYPE (call_expr)) == REFERENCE_TYPE) && "Not calling a function pointer?"); - tree function_type = TREE_TYPE(TREE_TYPE (TREE_OPERAND (exp, 0))); + + tree function_type = TREE_TYPE(TREE_TYPE (call_expr)); + Value *Callee = Emit(call_expr, 0); CallingConv::ID CallingConv; AttrListPtr PAL; - const Type *Ty = TheTypeConverter->ConvertFunctionType(function_type, - fndecl, - TREE_OPERAND(exp, 2), - CallingConv, PAL); + const Type *Ty = + TheTypeConverter->ConvertFunctionType(function_type, + fndecl, + CALL_EXPR_STATIC_CHAIN(exp), + CallingConv, PAL); // If this is a direct call to a function using a static chain then we need // to ensure the function type is the one just calculated: it has an extra @@ -2706,7 +2708,7 @@ tree fndecl = get_callee_fndecl(exp); tree fntype = fndecl ? - TREE_TYPE(fndecl) : TREE_TYPE (TREE_TYPE(TREE_OPERAND (exp, 0))); + TREE_TYPE(fndecl) : TREE_TYPE (TREE_TYPE(CALL_EXPR_FN(exp))); // Determine the calling convention. CallingConv::ID CallingConvention = CallingConv::C; @@ -2728,12 +2730,12 @@ fndecl ? DECL_BUILT_IN(fndecl) : false); // Pass the static chain, if any, as the first parameter. - if (TREE_OPERAND(exp, 2)) - CallOperands.push_back(Emit(TREE_OPERAND(exp, 2), 0)); + if (CALL_EXPR_STATIC_CHAIN(exp)) + CallOperands.push_back(Emit(CALL_EXPR_STATIC_CHAIN(exp), 0)); // Loop over the arguments, expanding them and adding them to the op list. std::vector ScalarArgs; - for (tree arg = TREE_OPERAND(exp, 1); arg; arg = TREE_CHAIN(arg)) { + for (tree arg = CALL_EXPR_ARGS(exp); arg; arg = TREE_CHAIN(arg)) { tree type = TREE_TYPE(TREE_VALUE(arg)); const Type *ArgTy = ConvertType(type); @@ -4702,7 +4704,7 @@ // Get the result type and operand line in an easy to consume format. const Type *ResultType = ConvertType(TREE_TYPE(TREE_TYPE(fndecl))); std::vector Operands; - for (tree Op = TREE_OPERAND(exp, 1); Op; Op = TREE_CHAIN(Op)) { + for (tree Op = CALL_EXPR_ARGS(exp); Op; Op = TREE_CHAIN(Op)) { tree OpVal = TREE_VALUE(Op); if (isAggregateTreeType(TREE_TYPE(OpVal))) { MemRef OpLoc = CreateTempLoc(ConvertType(TREE_TYPE(OpVal))); @@ -4745,7 +4747,7 @@ Value * TreeToLLVM::BuildBinaryAtomicBuiltin(tree exp, Intrinsic::ID id) { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); Value* C[2] = { Emit(TREE_VALUE(arglist), 0), Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) @@ -4769,7 +4771,7 @@ Value * TreeToLLVM::BuildCmpAndSwapAtomicBuiltin(tree exp, tree type, bool isBool) { const Type *ResultTy = ConvertType(type); - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); Value* C[3] = { Emit(TREE_VALUE(arglist), 0), Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0), @@ -4900,7 +4902,7 @@ return EmitBuiltinUnwindInit(exp, Result); case BUILT_IN_OBJECT_SIZE: { - tree ArgList = TREE_OPERAND (exp, 1); + tree ArgList = CALL_EXPR_ARGS(exp); if (!validate_arglist(ArgList, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) { error("Invalid builtin_object_size argument types"); return false; @@ -4928,7 +4930,7 @@ case BUILT_IN_CLZ: // These GCC builtins always return int. case BUILT_IN_CLZL: case BUILT_IN_CLZLL: { - Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Amt = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); EmitBuiltinUnaryOp(Amt, Result, Intrinsic::ctlz); const Type *DestTy = ConvertType(TREE_TYPE(exp)); Result = Builder.CreateIntCast(Result, DestTy, "cast"); @@ -4937,7 +4939,7 @@ case BUILT_IN_CTZ: // These GCC builtins always return int. case BUILT_IN_CTZL: case BUILT_IN_CTZLL: { - Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Amt = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); EmitBuiltinUnaryOp(Amt, Result, Intrinsic::cttz); const Type *DestTy = ConvertType(TREE_TYPE(exp)); Result = Builder.CreateIntCast(Result, DestTy, "cast"); @@ -4946,7 +4948,7 @@ case BUILT_IN_PARITYLL: case BUILT_IN_PARITYL: case BUILT_IN_PARITY: { - Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Amt = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); EmitBuiltinUnaryOp(Amt, Result, Intrinsic::ctpop); Result = Builder.CreateBinOp(Instruction::And, Result, ConstantInt::get(Result->getType(), 1)); @@ -4955,7 +4957,7 @@ case BUILT_IN_POPCOUNT: // These GCC builtins always return int. case BUILT_IN_POPCOUNTL: case BUILT_IN_POPCOUNTLL: { - Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Amt = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); EmitBuiltinUnaryOp(Amt, Result, Intrinsic::ctpop); const Type *DestTy = ConvertType(TREE_TYPE(exp)); Result = Builder.CreateIntCast(Result, DestTy, "cast"); @@ -4963,7 +4965,7 @@ } case BUILT_IN_BSWAP32: case BUILT_IN_BSWAP64: { - Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Amt = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); EmitBuiltinUnaryOp(Amt, Result, Intrinsic::bswap); const Type *DestTy = ConvertType(TREE_TYPE(exp)); Result = Builder.CreateIntCast(Result, DestTy, "cast"); @@ -4999,7 +5001,7 @@ case BUILT_IN_LOGL: // If errno math has been disabled, expand these to llvm.log calls. if (!flag_errno_math) { - Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Amt = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); EmitBuiltinUnaryOp(Amt, Result, Intrinsic::log); Result = CastToFPType(Result, ConvertType(TREE_TYPE(exp))); return true; @@ -5010,7 +5012,7 @@ case BUILT_IN_LOG2L: // If errno math has been disabled, expand these to llvm.log2 calls. if (!flag_errno_math) { - Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Amt = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); EmitBuiltinUnaryOp(Amt, Result, Intrinsic::log2); Result = CastToFPType(Result, ConvertType(TREE_TYPE(exp))); return true; @@ -5021,7 +5023,7 @@ case BUILT_IN_LOG10L: // If errno math has been disabled, expand these to llvm.log10 calls. if (!flag_errno_math) { - Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Amt = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); EmitBuiltinUnaryOp(Amt, Result, Intrinsic::log10); Result = CastToFPType(Result, ConvertType(TREE_TYPE(exp))); return true; @@ -5032,7 +5034,7 @@ case BUILT_IN_EXPL: // If errno math has been disabled, expand these to llvm.exp calls. if (!flag_errno_math) { - Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Amt = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); EmitBuiltinUnaryOp(Amt, Result, Intrinsic::exp); Result = CastToFPType(Result, ConvertType(TREE_TYPE(exp))); return true; @@ -5043,7 +5045,7 @@ case BUILT_IN_EXP2L: // If errno math has been disabled, expand these to llvm.exp2 calls. if (!flag_errno_math) { - Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Amt = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); EmitBuiltinUnaryOp(Amt, Result, Intrinsic::exp2); Result = CastToFPType(Result, ConvertType(TREE_TYPE(exp))); return true; @@ -5054,7 +5056,7 @@ case BUILT_IN_FFSLL: { // FFS(X) -> (x == 0 ? 0 : CTTZ(x)+1) // The argument and return type of cttz should match the argument type of // the ffs, but should ignore the return type of ffs. - Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Amt = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); EmitBuiltinUnaryOp(Amt, Result, Intrinsic::cttz); Result = Builder.CreateAdd(Result, ConstantInt::get(Result->getType(), 1)); @@ -5092,7 +5094,7 @@ //TODO file = Builder.getFolder().CreateBitCast(file, SBP); //TODO //TODO // Get arguments. -//TODO tree arglist = TREE_OPERAND(exp, 1); +//TODO tree arglist = CALL_EXPR_ARGS(exp); //TODO Value *ExprVal = Emit(TREE_VALUE(arglist), 0); //TODO const Type *Ty = ExprVal->getType(); //TODO Value *StrVal = Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0); @@ -5254,7 +5256,7 @@ case BUILT_IN_ADD_AND_FETCH_2: case BUILT_IN_ADD_AND_FETCH_4: { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); Value* C[2] = { Emit(TREE_VALUE(arglist), 0), Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) @@ -5292,7 +5294,7 @@ case BUILT_IN_SUB_AND_FETCH_2: case BUILT_IN_SUB_AND_FETCH_4: { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); Value* C[2] = { Emit(TREE_VALUE(arglist), 0), Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) @@ -5330,7 +5332,7 @@ case BUILT_IN_OR_AND_FETCH_2: case BUILT_IN_OR_AND_FETCH_4: { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); Value* C[2] = { Emit(TREE_VALUE(arglist), 0), Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) @@ -5368,7 +5370,7 @@ case BUILT_IN_AND_AND_FETCH_2: case BUILT_IN_AND_AND_FETCH_4: { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); Value* C[2] = { Emit(TREE_VALUE(arglist), 0), Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) @@ -5406,7 +5408,7 @@ case BUILT_IN_XOR_AND_FETCH_2: case BUILT_IN_XOR_AND_FETCH_4: { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); Value* C[2] = { Emit(TREE_VALUE(arglist), 0), Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) @@ -5444,7 +5446,7 @@ case BUILT_IN_NAND_AND_FETCH_2: case BUILT_IN_NAND_AND_FETCH_4: { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); Value* C[2] = { Emit(TREE_VALUE(arglist), 0), Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0) @@ -5497,7 +5499,7 @@ default: abort(); } - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); tree t1 = build1 (INDIRECT_REF, type, TREE_VALUE (arglist)); TREE_THIS_VOLATILE(t1) = 1; tree t = build2 (MODIFY_EXPR, type, t1, @@ -5512,7 +5514,7 @@ #if 1 // FIXME: Should handle these GCC extensions eventually. case BUILT_IN_LONGJMP: { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) { tree value = TREE_VALUE(TREE_CHAIN(arglist)); @@ -5562,7 +5564,7 @@ } Value *TreeToLLVM::EmitBuiltinSQRT(tree exp) { - Value *Amt = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Amt = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); const Type* Ty = Amt->getType(); return Builder.CreateCall(Intrinsic::getDeclaration(TheModule, @@ -5571,7 +5573,7 @@ } Value *TreeToLLVM::EmitBuiltinPOWI(tree exp) { - tree ArgList = TREE_OPERAND (exp, 1); + tree ArgList = CALL_EXPR_ARGS(exp); if (!validate_arglist(ArgList, REAL_TYPE, INTEGER_TYPE, VOID_TYPE)) return 0; @@ -5589,7 +5591,7 @@ } Value *TreeToLLVM::EmitBuiltinPOW(tree exp) { - tree ArgList = TREE_OPERAND (exp, 1); + tree ArgList = CALL_EXPR_ARGS(exp); if (!validate_arglist(ArgList, REAL_TYPE, REAL_TYPE, VOID_TYPE)) return 0; @@ -5611,7 +5613,7 @@ } bool TreeToLLVM::EmitBuiltinExtendPointer(tree exp, Value *&Result) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); Value *Amt = Emit(TREE_VALUE(arglist), 0); bool AmtIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_VALUE(arglist))); bool ExpIsSigned = !TYPE_UNSIGNED(TREE_TYPE(exp)); @@ -5652,7 +5654,7 @@ /// depending on the value of isMemMove. bool TreeToLLVM::EmitBuiltinMemCopy(tree exp, Value *&Result, bool isMemMove, bool SizeCheck) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (SizeCheck) { if (!validate_arglist(arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -5685,7 +5687,7 @@ } bool TreeToLLVM::EmitBuiltinMemSet(tree exp, Value *&Result, bool SizeCheck) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (SizeCheck) { if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -5713,7 +5715,7 @@ } bool TreeToLLVM::EmitBuiltinBZero(tree exp, Value *&Result) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) return false; @@ -5728,7 +5730,7 @@ } bool TreeToLLVM::EmitBuiltinPrefetch(tree exp) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (!validate_arglist(arglist, POINTER_TYPE, 0)) return false; @@ -5782,7 +5784,7 @@ /// EmitBuiltinReturnAddr - Emit an llvm.returnaddress or llvm.frameaddress /// instruction, depending on whether isFrame is true or not. bool TreeToLLVM::EmitBuiltinReturnAddr(tree exp, Value *&Result, bool isFrame) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (!validate_arglist(arglist, INTEGER_TYPE, VOID_TYPE)) return false; @@ -5803,7 +5805,7 @@ } bool TreeToLLVM::EmitBuiltinExtractReturnAddr(tree exp, Value *&Result) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); Value *Ptr = Emit(TREE_VALUE(arglist), 0); @@ -5820,7 +5822,7 @@ } bool TreeToLLVM::EmitBuiltinFrobReturnAddr(tree exp, Value *&Result) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); Value *Ptr = Emit(TREE_VALUE(arglist), 0); @@ -5836,7 +5838,7 @@ } bool TreeToLLVM::EmitBuiltinStackSave(tree exp, Value *&Result) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (!validate_arglist(arglist, VOID_TYPE)) return false; @@ -5873,7 +5875,7 @@ #endif bool TreeToLLVM::EmitBuiltinDwarfCFA(tree exp, Value *&Result) { - if (!validate_arglist(TREE_OPERAND(exp, 1), VOID_TYPE)) + if (!validate_arglist(CALL_EXPR_ARGS(exp), VOID_TYPE)) return false; int cfa_offset = ARG_POINTER_CFA_OFFSET(exp); @@ -5887,7 +5889,7 @@ } bool TreeToLLVM::EmitBuiltinDwarfSPColumn(tree exp, Value *&Result) { - if (!validate_arglist(TREE_OPERAND(exp, 1), VOID_TYPE)) + if (!validate_arglist(CALL_EXPR_ARGS(exp), VOID_TYPE)) return false; unsigned int dwarf_regnum = DWARF_FRAME_REGNUM(STACK_POINTER_REGNUM); @@ -5898,7 +5900,7 @@ bool TreeToLLVM::EmitBuiltinEHReturnDataRegno(tree exp, Value *&Result) { #ifdef EH_RETURN_DATA_REGNO - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (!validate_arglist(arglist, INTEGER_TYPE, VOID_TYPE)) return false; @@ -5925,7 +5927,7 @@ } bool TreeToLLVM::EmitBuiltinEHReturn(tree exp, Value *&Result) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (!validate_arglist(arglist, INTEGER_TYPE, POINTER_TYPE, VOID_TYPE)) return false; @@ -5957,7 +5959,7 @@ bool wrote_return_column = false; static bool reg_modes_initialized = false; - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (!validate_arglist(arglist, POINTER_TYPE, VOID_TYPE)) return false; @@ -6014,7 +6016,7 @@ } bool TreeToLLVM::EmitBuiltinUnwindInit(tree exp, Value *&Result) { - if (!validate_arglist(TREE_OPERAND(exp, 1), VOID_TYPE)) + if (!validate_arglist(CALL_EXPR_ARGS(exp), VOID_TYPE)) return false; Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, @@ -6024,7 +6026,7 @@ } bool TreeToLLVM::EmitBuiltinStackRestore(tree exp) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (!validate_arglist(arglist, POINTER_TYPE, VOID_TYPE)) return false; @@ -6038,7 +6040,7 @@ bool TreeToLLVM::EmitBuiltinAlloca(tree exp, Value *&Result) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (!validate_arglist(arglist, INTEGER_TYPE, VOID_TYPE)) return false; Value *Amt = Emit(TREE_VALUE(arglist), 0); @@ -6051,7 +6053,7 @@ Value *&Result) { // Ignore the hint for now, just expand the expr. This is safe, but not // optimal. - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (arglist == NULL_TREE || TREE_CHAIN(arglist) == NULL_TREE) return true; Result = Emit(TREE_VALUE(arglist), DestLoc); @@ -6059,7 +6061,7 @@ } bool TreeToLLVM::EmitBuiltinVAStart(tree exp) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); tree fntype = TREE_TYPE(current_function_decl); if (TYPE_ARG_TYPES(fntype) == 0 || @@ -6084,7 +6086,7 @@ } bool TreeToLLVM::EmitBuiltinVAEnd(tree exp) { - Value *Arg = Emit(TREE_VALUE(TREE_OPERAND(exp, 1)), 0); + Value *Arg = Emit(TREE_VALUE(CALL_EXPR_ARGS(exp)), 0); Arg = BitCastToType(Arg, PointerType::getUnqual(Type::getInt8Ty(Context))); Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::vaend), Arg); @@ -6092,8 +6094,8 @@ } bool TreeToLLVM::EmitBuiltinVACopy(tree exp) { - tree Arg1T = TREE_VALUE(TREE_OPERAND(exp, 1)); - tree Arg2T = TREE_VALUE(TREE_CHAIN(TREE_OPERAND(exp, 1))); + tree Arg1T = TREE_VALUE(CALL_EXPR_ARGS(exp)); + tree Arg2T = TREE_VALUE(TREE_CHAIN(CALL_EXPR_ARGS(exp))); Value *Arg1 = Emit(Arg1T, 0); // Emit the address of the destination. // The second arg of llvm.va_copy is a pointer to a valist. @@ -6123,7 +6125,7 @@ } bool TreeToLLVM::EmitBuiltinInitTrampoline(tree exp, Value *&Result) { - tree arglist = TREE_OPERAND(exp, 1); + tree arglist = CALL_EXPR_ARGS(exp); if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) return false; From rich at pennware.com Tue Sep 8 07:47:31 2009 From: rich at pennware.com (Richard Pennington) Date: Tue, 08 Sep 2009 12:47:31 -0000 Subject: [llvm-commits] [llvm] r81215 - in /llvm/trunk/lib/Target/Sparc: AsmPrinter/SparcAsmPrinter.cpp SparcMCAsmInfo.cpp SparcRegisterInfo.cpp Message-ID: <200909081247.n88ClViP004586@zion.cs.uiuc.edu> Author: rich Date: Tue Sep 8 07:47:30 2009 New Revision: 81215 URL: http://llvm.org/viewvc/llvm-project?rev=81215&view=rev Log: Add source debug information to the Sparc code generator. Modified: llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp llvm/trunk/lib/Target/Sparc/SparcMCAsmInfo.cpp llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.cpp Modified: llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp?rev=81215&r1=81214&r2=81215&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp Tue Sep 8 07:47:30 2009 @@ -104,6 +104,8 @@ O << "\t.type\t" << CurrentFnName << ", #function\n"; O << CurrentFnName << ":\n"; + // Emit pre-function debug information. + DW->BeginFunction(&MF); // Number each basic block so that we can consistently refer to them // in PC-relative references. @@ -130,6 +132,9 @@ } } + // Emit post-function debug information. + DW->EndFunction(&MF); + // We didn't modify anything. return false; } Modified: llvm/trunk/lib/Target/Sparc/SparcMCAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcMCAsmInfo.cpp?rev=81215&r1=81214&r2=81215&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcMCAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcMCAsmInfo.cpp Tue Sep 8 07:47:30 2009 @@ -22,6 +22,9 @@ ZeroDirective = "\t.skip\t"; CommentString = "!"; COMMDirectiveTakesAlignment = true; + HasLEB128 = true; + AbsoluteDebugSectionOffsets = true; + SupportsDebugInformation = true; SunStyleELFSectionSwitchSyntax = true; UsesELFSectionDirectiveForBSS = true; Modified: llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.cpp?rev=81215&r1=81214&r2=81215&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.cpp Tue Sep 8 07:47:30 2009 @@ -169,13 +169,11 @@ } unsigned SparcRegisterInfo::getRARegister() const { - llvm_unreachable("What is the return address register"); - return 0; + return SP::I7; } unsigned SparcRegisterInfo::getFrameRegister(MachineFunction &MF) const { - llvm_unreachable("What is the frame register"); - return SP::G1; + return SP::I6; } unsigned SparcRegisterInfo::getEHExceptionRegister() const { @@ -189,8 +187,7 @@ } int SparcRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const { - llvm_unreachable("What is the dwarf register number"); - return -1; + return SparcGenRegisterInfo::getDwarfRegNumFull(RegNum, 0); } #include "SparcGenRegisterInfo.inc" From xerxes at zafena.se Tue Sep 8 08:00:09 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Tue, 08 Sep 2009 15:00:09 +0200 Subject: [llvm-commits] [llvm] r81202 - /llvm/trunk/lib/MC/MCExpr.cpp In-Reply-To: <200909080634.n886Y7jT007214@zion.cs.uiuc.edu> References: <200909080634.n886Y7jT007214@zion.cs.uiuc.edu> Message-ID: <4AA65559.6050807@zafena.se> Hi Chris! This change of yours triggered three failing regressions on all buildbot platforms: FAIL: /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/conditional_asm.s Failed with exit(1) at line 1 while running: llvm-mc -triple i386-unknown-unknown /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/conditional_asm.s -I /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser | FileCheck /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/conditional_asm.s /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/conditional_asm.s:3:10: error: expected string not found in input # CHECK: .byte (1 + 1) ^ :1:1: note: scanning from here .section __TEXT,__text,regular,pure_instructions ^ FAIL: /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/labels.s Failed with exit(1) at line 1 while running: llvm-mc -triple i686-apple-darwin10 /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/labels.s | FileCheck /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/labels.s /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/labels.s:18:11: error: expected string not found in input // CHECK: addl $24, (a$b + 10)(%eax) ^ :12:1: note: scanning from here addl $24, a$b+10(%eax) ^ FAIL: /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/x86_operands.s Failed with exit(1) at line 1 while running: llvm-mc -triple i386-unknown-unknown /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/x86_operands.s | FileCheck /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/x86_operands.s /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/x86_operands.s:8:10: error: expected string not found in input # CHECK: addl $(1 + 2), %eax ^ :3:1: note: scanning from here addl $1+2, %eax ^ If these failures are OK then I guess you should update the testcase to reflect the change. Cheers and have a great day! Xerxes Chris Lattner skrev: > Author: lattner > Date: Tue Sep 8 01:34:07 2009 > New Revision: 81202 > > URL: http://llvm.org/viewvc/llvm-project?rev=81202&view=rev > Log: > make formatting of expressions more closely match the existing asmprinter. > > Modified: > llvm/trunk/lib/MC/MCExpr.cpp > > Modified: llvm/trunk/lib/MC/MCExpr.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=81202&r1=81201&r2=81202&view=diff > > ============================================================================== > --- llvm/trunk/lib/MC/MCExpr.cpp (original) > +++ llvm/trunk/lib/MC/MCExpr.cpp Tue Sep 8 01:34:07 2009 > @@ -39,9 +39,16 @@ > > case MCExpr::Binary: { > const MCBinaryExpr &BE = cast(*this); > - OS << '('; > - BE.getLHS()->print(OS, MAI); > - OS << ' '; > + > + // Only print parens around the LHS if it is non-trivial. > + if (isa(BE.getLHS()) || isa(BE.getLHS())) { > + BE.getLHS()->print(OS, MAI); > + } else { > + OS << '('; > + BE.getLHS()->print(OS, MAI); > + OS << ')'; > + } > + > switch (BE.getOpcode()) { > default: assert(0 && "Invalid opcode!"); > case MCBinaryExpr::Add: OS << '+'; break; > @@ -63,9 +70,15 @@ > case MCBinaryExpr::Sub: OS << '-'; break; > case MCBinaryExpr::Xor: OS << '^'; break; > } > - OS << ' '; > - BE.getRHS()->print(OS, MAI); > - OS << ')'; > + > + // Only print parens around the LHS if it is non-trivial. > + if (isa(BE.getRHS()) || isa(BE.getRHS())) { > + BE.getRHS()->print(OS, MAI); > + } else { > + OS << '('; > + BE.getRHS()->print(OS, MAI); > + OS << ')'; > + } > return; > } > } > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From gohman at apple.com Tue Sep 8 09:14:24 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 08 Sep 2009 14:14:24 -0000 Subject: [llvm-commits] [llvm] r81217 - in /llvm/trunk/test/MC/AsmParser: conditional_asm.s labels.s x86_operands.s Message-ID: <200909081414.n88EEP9O015739@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 8 09:14:24 2009 New Revision: 81217 URL: http://llvm.org/viewvc/llvm-project?rev=81217&view=rev Log: Unbreak these tests. Chris, please verify that these changes are intended. Modified: llvm/trunk/test/MC/AsmParser/conditional_asm.s llvm/trunk/test/MC/AsmParser/labels.s llvm/trunk/test/MC/AsmParser/x86_operands.s Modified: llvm/trunk/test/MC/AsmParser/conditional_asm.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/conditional_asm.s?rev=81217&r1=81216&r2=81217&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/conditional_asm.s (original) +++ llvm/trunk/test/MC/AsmParser/conditional_asm.s Tue Sep 8 09:14:24 2009 @@ -1,6 +1,6 @@ # RUN: llvm-mc -triple i386-unknown-unknown %s -I %p | FileCheck %s -# CHECK: .byte (1 + 1) +# CHECK: .byte 1+1 .if 1+2 .if 1-1 .byte 1 Modified: llvm/trunk/test/MC/AsmParser/labels.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/labels.s?rev=81217&r1=81216&r2=81217&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/labels.s (original) +++ llvm/trunk/test/MC/AsmParser/labels.s Tue Sep 8 09:14:24 2009 @@ -15,7 +15,7 @@ foo: // CHECK: addl $24, a$b(%eax) addl $24, "a$b"(%eax) -// CHECK: addl $24, (a$b + 10)(%eax) +// CHECK: addl $24, a$b+10(%eax) addl $24, ("a$b" + 10)(%eax) // CHECK: b$c = 10 @@ -52,7 +52,7 @@ // CHECX: .lsym "a 8",1 // .lsym "a 8", 1 -// CHECK: "a 9" = (a - b) +// CHECK: "a 9" = a-b .set "a 9", a - b // CHECK: .long "a 9" Modified: llvm/trunk/test/MC/AsmParser/x86_operands.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/x86_operands.s?rev=81217&r1=81216&r2=81217&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/x86_operands.s (original) +++ llvm/trunk/test/MC/AsmParser/x86_operands.s Tue Sep 8 09:14:24 2009 @@ -5,11 +5,11 @@ # Immediates # CHECK: addl $1, %eax addl $1, %eax -# CHECK: addl $(1 + 2), %eax +# CHECK: addl $1+2, %eax addl $(1+2), %eax # CHECK: addl $a, %eax addl $a, %eax -# CHECK: addl $(1 + 2), %eax +# CHECK: addl $1+2, %eax addl $1 + 2, %eax # Disambiguation @@ -18,15 +18,15 @@ #addl $1, 4+4 # FIXME: Add back when we can match this. #addl $1, (4+4) -# CHECK: addl $1, (4 + 4)(%eax) +# CHECK: addl $1, 4+4(%eax) addl $1, 4+4(%eax) -# CHECK: addl $1, (4 + 4)(%eax) +# CHECK: addl $1, 4+4(%eax) addl $1, (4+4)(%eax) # CHECK: addl $1, 8(%eax) addl $1, 8(%eax) # CHECK: addl $1, 0(%eax) addl $1, (%eax) -# CHECK: addl $1, (4 + 4)(,%eax) +# CHECK: addl $1, 4+4(,%eax) addl $1, (4+4)(,%eax) # Indirect Memory Operands From baldrick at free.fr Tue Sep 8 09:14:24 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 08 Sep 2009 14:14:24 -0000 Subject: [llvm-commits] [gcc-plugin] r81216 - in /gcc-plugin/trunk: llvm-convert.cpp llvm-internal.h Message-ID: <200909081414.n88EEPBd015741@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 8 09:14:24 2009 New Revision: 81216 URL: http://llvm.org/viewvc/llvm-project?rev=81216&view=rev Log: Emit phi nodes in two stages: first define the phi and associate it with the corresponding ssa name without populating the phi node with operands. This is because ssa names occurring as operands may not have been defined yet (phi nodes are special this way). After all basic blocks have been output, revist the phi nodes and populate them with operands. The plugin can now compile loops thanks to this fix. Modified: gcc-plugin/trunk/llvm-convert.cpp gcc-plugin/trunk/llvm-internal.h Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81216&r1=81215&r2=81216&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 8 09:14:24 2009 @@ -637,6 +637,40 @@ } Function *TreeToLLVM::FinishFunctionBody() { + // Populate phi nodes with their operands now that all ssa names have been + // defined. + for (unsigned i = 0, e = PendingPhis.size(); i < e; ++i) { + PhiRecord &P = PendingPhis[i]; + + P.PHI->reserveOperandSpace(gimple_phi_num_args(P.gcc_phi)); + for (size_t i = 0; i < gimple_phi_num_args(P.gcc_phi); ++i) { + // Find the incoming basic block. + basic_block bb = gimple_phi_arg_edge(P.gcc_phi, i)->src; + DenseMap::iterator BI = BasicBlocks.find(bb); + // If it does not exist then it was unreachable - skip this phi argument. + if (BI == BasicBlocks.end()) + continue; + + // Obtain the incoming value. It is important not to add new instructions + // to the function, which is why this is done by hand. + tree def = gimple_phi_arg(P.gcc_phi, i)->def; + Value *Val; + + // The incoming value is either an ssa name or a constant. + // FIXME: Not clear what is allowed here exactly. + if (TREE_CODE(def) == SSA_NAME) { + DenseMap::iterator NI = SSANames.find(def); + assert(NI != SSANames.end() && "PHI operand never defined!"); + Val = NI->second; + } else { + Val = TreeConstantToLLVM::Convert(def); + } + + P.PHI->addIncoming(Val, BI->second); + } + } + PendingPhis.clear(); + // Insert the return block at the end of the function. EmitBlock(ReturnBB); @@ -753,14 +787,29 @@ if (bb != ENTRY_BLOCK_PTR) EmitBlock(getBasicBlock(bb)); - // Render phi nodes. + // Create an LLVM phi node for each GCC phi and define the associated ssa name + // using it. Do not populate with operands at this point since some ssa names + // the phi uses may not have been defined yet - phis are special this way. for (gimple_stmt_iterator gsi = gsi_start_phis(bb); !gsi_end_p(gsi); gsi_next(&gsi)) { - gimple phi = gsi_stmt(gsi); - // Skip virtual operands. - if (!is_gimple_reg(gimple_phi_result(phi))) - continue; - RenderGIMPLE_PHI(phi); + gimple gcc_phi = gsi_stmt(gsi); + // Skip virtual operands. + if (!is_gimple_reg(gimple_phi_result(gcc_phi))) + continue; + + // Create the LLVM phi node. + const Type *Ty = ConvertType(TREE_TYPE(gimple_phi_result(gcc_phi))); + PHINode *PHI = Builder.CreatePHI(Ty); + + // The phi defines the associated ssa name. + tree name = gimple_phi_result(gcc_phi); + assert(TREE_CODE(name) == SSA_NAME && "PHI result not an SSA name!"); + assert(SSANames.find(name) == SSANames.end() && "Multiply defined SSA name!"); + SSANames[name] = PHI; + + // The phi operands will be populated later - remember the phi node. + PhiRecord P = { gcc_phi, PHI }; + PendingPhis.push_back(P); } // Render statements. @@ -8038,26 +8087,6 @@ // ... Convert GIMPLE to LLVM ... //===----------------------------------------------------------------------===// -void TreeToLLVM::RenderGIMPLE_PHI(gimple stmt) { - // Create the corresponding LLVM phi node. - const Type *Ty = ConvertType(TREE_TYPE(gimple_phi_result(stmt))); - PHINode *Phi = Builder.CreatePHI(Ty); - - // Populate the phi operands. - Phi->reserveOperandSpace(gimple_phi_num_args(stmt)); - for (size_t i = 0; i < gimple_phi_num_args(stmt); ++i) { - BasicBlock *BB = getBasicBlock(gimple_phi_arg_edge(stmt, i)->src); - Value *Val = Emit(gimple_phi_arg(stmt, i)->def, 0); - Phi->addIncoming(Val, BB); - } - - // The phi defines the associated ssa name. - tree name = gimple_phi_result(stmt); - assert(TREE_CODE(name) == SSA_NAME && "PHI result not an SSA name!"); - assert(SSANames.find(name) == SSANames.end() && "Multiply defined SSA name!"); - SSANames[name] = Phi; -} - void TreeToLLVM::RenderGIMPLE_COND(gimple stmt) { // Compute the LLVM opcodes corresponding to the GCC comparison. unsigned UIPred = 0, SIPred = 0, FPPred = 0; Modified: gcc-plugin/trunk/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-internal.h?rev=81216&r1=81215&r2=81216&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-internal.h (original) +++ gcc-plugin/trunk/llvm-internal.h Tue Sep 8 09:14:24 2009 @@ -302,6 +302,12 @@ bool isBitfield() const { return BitStart != 255; } }; +/// PhiRecord - This struct holds the LLVM PHI node associated with a GCC phi. +struct PhiRecord { + gimple gcc_phi; + PHINode *PHI; +}; + /// TreeToLLVM - An instance of this class is created and used to convert the /// body of each function to LLVM. /// @@ -320,9 +326,6 @@ /// same as &Fn->back(). LLVMBuilder Builder; - /// BasicBlocks - Map from GCC to LLVM basic blocks. - DenseMap BasicBlocks; - // AllocaInsertionPoint - Place to insert alloca instructions. Lazily created // and managed by CreateTemporary. Instruction *AllocaInsertionPoint; @@ -331,6 +334,12 @@ // definitions. Instruction *SSAInsertionPoint; + /// BasicBlocks - Map from GCC to LLVM basic blocks. + DenseMap BasicBlocks; + + /// PendingPhis - Phi nodes which have not yet been populated with operands. + SmallVector PendingPhis; + // SSANames - Map from GCC ssa names to the defining LLVM value. DenseMap SSANames; @@ -507,7 +516,6 @@ // Render* - Convert GIMPLE to LLVM. - void RenderGIMPLE_PHI(gimple_statement_d *); void RenderGIMPLE_COND(gimple_statement_d *); private: From baldrick at free.fr Tue Sep 8 09:25:14 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 08 Sep 2009 14:25:14 -0000 Subject: [llvm-commits] [gcc-plugin] r81218 - /gcc-plugin/trunk/llvm-convert.cpp Message-ID: <200909081425.n88EPEHN017118@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 8 09:25:14 2009 New Revision: 81218 URL: http://llvm.org/viewvc/llvm-project?rev=81218&view=rev Log: Further furious fighting with phi nodes. The incoming ssa name may be a "default definition", in which case it may not have been output. Call EmitSSA_NAME which knows how to handle this case. It places any code it generates at an appropriate point in the entry block. Modified: gcc-plugin/trunk/llvm-convert.cpp Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81218&r1=81217&r2=81218&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 8 09:25:14 2009 @@ -651,20 +651,18 @@ if (BI == BasicBlocks.end()) continue; - // Obtain the incoming value. It is important not to add new instructions - // to the function, which is why this is done by hand. + // Obtain the incoming value. Any new instructions added to the function + // must be carefully placed, so analyze each case by hand rather than just + // calling Emit. tree def = gimple_phi_arg(P.gcc_phi, i)->def; Value *Val; // The incoming value is either an ssa name or a constant. // FIXME: Not clear what is allowed here exactly. - if (TREE_CODE(def) == SSA_NAME) { - DenseMap::iterator NI = SSANames.find(def); - assert(NI != SSANames.end() && "PHI operand never defined!"); - Val = NI->second; - } else { + if (TREE_CODE(def) == SSA_NAME) + Val = EmitSSA_NAME(def); + else Val = TreeConstantToLLVM::Convert(def); - } P.PHI->addIncoming(Val, BI->second); } From sabre at nondot.org Tue Sep 8 10:13:16 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 08 Sep 2009 15:13:16 -0000 Subject: [llvm-commits] [llvm] r81219 - /llvm/trunk/docs/LangRef.html Message-ID: <200909081513.n88FDG0g023464@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 8 10:13:16 2009 New Revision: 81219 URL: http://llvm.org/viewvc/llvm-project?rev=81219&view=rev Log: fix a couple typos pointed out by edwin and duncan Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=81219&r1=81218&r2=81219&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Sep 8 10:13:16 2009 @@ -2116,7 +2116,7 @@ "variable" doesn't actually have a live range. Instead, the value is logically read from arbitrary registers that happen to be around when needed, so the value is not neccesarily consistent over time. In fact, %A and %C need -to have the same semantics of the core LLVM "replace all uses with" concept +to have the same semantics or the core LLVM "replace all uses with" concept would not hold.

@@ -2136,7 +2136,7 @@ not (currently) defined on SNaN's. However, in the second example, we can make a more aggressive assumption: because the undef is allowed to be an arbitrary value, we are allowed to assume that it could be zero. Since a divide by zero -is has undefined behavior, we are allowed to assume that the operation +it has undefined behavior, we are allowed to assume that the operation does not execute at all. This allows us to delete the divide and all code after it: since the undefined operation "can't happen", the optimizer can assume that it occurs in dead code. From clattner at apple.com Tue Sep 8 10:14:18 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 8 Sep 2009 08:14:18 -0700 Subject: [llvm-commits] [llvm] r81217 - in /llvm/trunk/test/MC/AsmParser: conditional_asm.s labels.s x86_operands.s In-Reply-To: <200909081414.n88EEP9O015739@zion.cs.uiuc.edu> References: <200909081414.n88EEP9O015739@zion.cs.uiuc.edu> Message-ID: On Sep 8, 2009, at 7:14 AM, Dan Gohman wrote: > Author: djg > Date: Tue Sep 8 09:14:24 2009 > New Revision: 81217 > > URL: http://llvm.org/viewvc/llvm-project?rev=81217&view=rev > Log: > Unbreak these tests. Chris, please verify that these changes are > intended. Yep, looks right, thank you Dan. I accidentally missed checking in test/ when I committed. :-/ -Chris From sabre at nondot.org Tue Sep 8 10:15:11 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 8 Sep 2009 08:15:11 -0700 Subject: [llvm-commits] [llvm] r81202 - /llvm/trunk/lib/MC/MCExpr.cpp In-Reply-To: <4AA65559.6050807@zafena.se> References: <200909080634.n886Y7jT007214@zion.cs.uiuc.edu> <4AA65559.6050807@zafena.se> Message-ID: <025B0523-C8ED-4056-9A24-CF1E5D9C7334@nondot.org> Fixed on mainline (by Dan), sorry! -Chris On Sep 8, 2009, at 6:00 AM, Xerxes R?nby wrote: > Hi Chris! > > This change of yours triggered three failing regressions on all > buildbot > platforms: > > FAIL: /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/ > conditional_asm.s > Failed with exit(1) at line 1 > while running: llvm-mc -triple i386-unknown-unknown /wd/buildbot/ > llvm-arm-linux/build/test/MC/AsmParser/conditional_asm.s -I /wd/ > buildbot/llvm-arm-linux/build/test/MC/AsmParser | FileCheck /wd/ > buildbot/llvm-arm-linux/build/test/MC/AsmParser/conditional_asm.s > /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/ > conditional_asm.s:3:10: error: expected string not found in input > # CHECK: .byte (1 + 1) > ^ > :1:1: note: scanning from here > .section __TEXT,__text,regular,pure_instructions > ^ > > FAIL: /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/labels.s > Failed with exit(1) at line 1 > while running: llvm-mc -triple i686-apple-darwin10 /wd/buildbot/llvm- > arm-linux/build/test/MC/AsmParser/labels.s | FileCheck /wd/buildbot/ > llvm-arm-linux/build/test/MC/AsmParser/labels.s > /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/labels.s:18:11: > error: expected string not found in input > // CHECK: addl $24, (a$b + 10)(%eax) > ^ > :12:1: note: scanning from here > addl $24, a$b+10(%eax) > ^ > > FAIL: /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/ > x86_operands.s > Failed with exit(1) at line 1 > while running: llvm-mc -triple i386-unknown-unknown /wd/buildbot/ > llvm-arm-linux/build/test/MC/AsmParser/x86_operands.s | FileCheck / > wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/x86_operands.s > /wd/buildbot/llvm-arm-linux/build/test/MC/AsmParser/x86_operands.s: > 8:10: error: expected string not found in input > # CHECK: addl $(1 + 2), %eax > ^ > :3:1: note: scanning from here > addl $1+2, %eax > ^ > > If these failures are OK then I guess you should update the testcase > to reflect the change. > > Cheers and have a great day! > Xerxes > > Chris Lattner skrev: >> Author: lattner >> Date: Tue Sep 8 01:34:07 2009 >> New Revision: 81202 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=81202&view=rev >> Log: >> make formatting of expressions more closely match the existing >> asmprinter. >> >> Modified: >> llvm/trunk/lib/MC/MCExpr.cpp >> >> Modified: llvm/trunk/lib/MC/MCExpr.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=81202&r1=81201&r2=81202&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/MC/MCExpr.cpp (original) >> +++ llvm/trunk/lib/MC/MCExpr.cpp Tue Sep 8 01:34:07 2009 >> @@ -39,9 +39,16 @@ >> >> case MCExpr::Binary: { >> const MCBinaryExpr &BE = cast(*this); >> - OS << '('; >> - BE.getLHS()->print(OS, MAI); >> - OS << ' '; >> + >> + // Only print parens around the LHS if it is non-trivial. >> + if (isa(BE.getLHS()) || isa >> (BE.getLHS())) { >> + BE.getLHS()->print(OS, MAI); >> + } else { >> + OS << '('; >> + BE.getLHS()->print(OS, MAI); >> + OS << ')'; >> + } >> + >> switch (BE.getOpcode()) { >> default: assert(0 && "Invalid opcode!"); >> case MCBinaryExpr::Add: OS << '+'; break; >> @@ -63,9 +70,15 @@ >> case MCBinaryExpr::Sub: OS << '-'; break; >> case MCBinaryExpr::Xor: OS << '^'; break; >> } >> - OS << ' '; >> - BE.getRHS()->print(OS, MAI); >> - OS << ')'; >> + >> + // Only print parens around the LHS if it is non-trivial. >> + if (isa(BE.getRHS()) || isa >> (BE.getRHS())) { >> + BE.getRHS()->print(OS, MAI); >> + } else { >> + OS << '('; >> + BE.getRHS()->print(OS, MAI); >> + OS << ')'; >> + } >> return; >> } >> } >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> From asl at math.spbu.ru Tue Sep 8 10:22:32 2009 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 08 Sep 2009 15:22:32 -0000 Subject: [llvm-commits] [llvm] r81220 - in /llvm/trunk: lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMInstrNEON.td lib/Target/ARM/ARMRegisterInfo.td test/CodeGen/ARM/vmlal_lane.ll test/CodeGen/ARM/vmlsl_lane.ll test/CodeGen/ARM/vmul_lane.ll test/CodeGen/ARM/vmull_lane.ll test/CodeGen/ARM/vqRdmulh_lane.ll test/CodeGen/ARM/vqdmlal_lanes.ll test/CodeGen/ARM/vqdmlsl_lanes.ll test/CodeGen/ARM/vqdmulh_lane.ll test/CodeGen/ARM/vqdmull_lane.ll Message-ID: <200909081522.n88FMXjB024664@zion.cs.uiuc.edu> Author: asl Date: Tue Sep 8 10:22:32 2009 New Revision: 81220 URL: http://llvm.org/viewvc/llvm-project?rev=81220&view=rev Log: Add NEON 'laned' operations. This fixes another bunch of gcc testsuite fails and makes the code faster. Added: llvm/trunk/test/CodeGen/ARM/vmlal_lane.ll llvm/trunk/test/CodeGen/ARM/vmlsl_lane.ll llvm/trunk/test/CodeGen/ARM/vmul_lane.ll llvm/trunk/test/CodeGen/ARM/vmull_lane.ll llvm/trunk/test/CodeGen/ARM/vqRdmulh_lane.ll llvm/trunk/test/CodeGen/ARM/vqdmlal_lanes.ll llvm/trunk/test/CodeGen/ARM/vqdmlsl_lanes.ll llvm/trunk/test/CodeGen/ARM/vqdmulh_lane.ll llvm/trunk/test/CodeGen/ARM/vqdmull_lane.ll Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp llvm/trunk/lib/Target/ARM/ARMInstrNEON.td llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=81220&r1=81219&r2=81220&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Tue Sep 8 10:22:32 2009 @@ -612,14 +612,24 @@ if (I != MBB.end()) DL = I->getDebugLoc(); if (DestRC != SrcRC) { - if (((DestRC == ARM::DPRRegisterClass) && - (SrcRC == ARM::DPR_VFP2RegisterClass)) || - ((SrcRC == ARM::DPRRegisterClass) && - (DestRC == ARM::DPR_VFP2RegisterClass))) { - // Allow copy between DPR and DPR_VFP2. - } else { + // Allow DPR / DPR_VFP2 / DPR_8 cross-class copies + if (DestRC == ARM::DPRRegisterClass) { + if (SrcRC == ARM::DPR_VFP2RegisterClass || + SrcRC == ARM::DPR_8RegisterClass) { + } else + return false; + } else if (DestRC == ARM::DPR_VFP2RegisterClass) { + if (SrcRC == ARM::DPRRegisterClass || + SrcRC == ARM::DPR_8RegisterClass) { + } else + return false; + } else if (DestRC == ARM::DPR_8RegisterClass) { + if (SrcRC == ARM::DPRRegisterClass || + SrcRC == ARM::DPR_VFP2RegisterClass) { + } else + return false; + } else return false; - } } if (DestRC == ARM::GPRRegisterClass) { @@ -629,7 +639,8 @@ AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::FCPYS), DestReg) .addReg(SrcReg)); } else if ((DestRC == ARM::DPRRegisterClass) || - (DestRC == ARM::DPR_VFP2RegisterClass)) { + (DestRC == ARM::DPR_VFP2RegisterClass) || + (DestRC == ARM::DPR_8RegisterClass)) { AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::FCPYD), DestReg) .addReg(SrcReg)); } else if (DestRC == ARM::QPRRegisterClass) { @@ -652,7 +663,9 @@ AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::STR)) .addReg(SrcReg, getKillRegState(isKill)) .addFrameIndex(FI).addReg(0).addImm(0)); - } else if (RC == ARM::DPRRegisterClass || RC == ARM::DPR_VFP2RegisterClass) { + } else if (RC == ARM::DPRRegisterClass || + RC == ARM::DPR_VFP2RegisterClass || + RC == ARM::DPR_8RegisterClass) { AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::FSTD)) .addReg(SrcReg, getKillRegState(isKill)) .addFrameIndex(FI).addImm(0)); @@ -678,7 +691,9 @@ if (RC == ARM::GPRRegisterClass) { AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::LDR), DestReg) .addFrameIndex(FI).addReg(0).addImm(0)); - } else if (RC == ARM::DPRRegisterClass || RC == ARM::DPR_VFP2RegisterClass) { + } else if (RC == ARM::DPRRegisterClass || + RC == ARM::DPR_VFP2RegisterClass || + RC == ARM::DPR_8RegisterClass) { AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::FLDD), DestReg) .addFrameIndex(FI).addImm(0)); } else if (RC == ARM::SPRRegisterClass) { Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=81220&r1=81219&r2=81220&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Tue Sep 8 10:22:32 2009 @@ -475,6 +475,31 @@ [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src1), (OpTy DPR:$src2))))]> { let isCommutable = Commutable; } +class N3VDSL op21_20, bits<4> op11_8, + string OpcodeStr, ValueType Ty, SDNode ShOp> + : N3V<0, 1, op21_20, op11_8, 1, 0, + (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane), + NoItinerary, + !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", + [(set (Ty DPR:$dst), + (Ty (ShOp (Ty DPR:$src1), + (Ty (NEONvduplane (Ty DPR_VFP2:$src2), + imm:$lane)))))]> { + let isCommutable = 0; +} +class N3VDSL16 op21_20, bits<4> op11_8, + string OpcodeStr, ValueType Ty, SDNode ShOp> + : N3V<0, 1, op21_20, op11_8, 1, 0, + (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane), + NoItinerary, + !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", + [(set (Ty DPR:$dst), + (Ty (ShOp (Ty DPR:$src1), + (Ty (NEONvduplane (Ty DPR_8:$src2), + imm:$lane)))))]> { + let isCommutable = 0; +} + class N3VQ op21_20, bits<4> op11_8, bit op4, string OpcodeStr, ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable> @@ -484,6 +509,30 @@ [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src1), (OpTy QPR:$src2))))]> { let isCommutable = Commutable; } +class N3VQSL op21_20, bits<4> op11_8, + string OpcodeStr, ValueType ResTy, ValueType OpTy, SDNode ShOp> + : N3V<1, 1, op21_20, op11_8, 1, 0, + (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane), + NoItinerary, + !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", + [(set (ResTy QPR:$dst), + (ResTy (ShOp (ResTy QPR:$src1), + (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2), + imm:$lane)))))]> { + let isCommutable = 0; +} +class N3VQSL16 op21_20, bits<4> op11_8, + string OpcodeStr, ValueType ResTy, ValueType OpTy, SDNode ShOp> + : N3V<1, 1, op21_20, op11_8, 1, 0, + (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane), + NoItinerary, + !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", + [(set (ResTy QPR:$dst), + (ResTy (ShOp (ResTy QPR:$src1), + (ResTy (NEONvduplane (OpTy DPR_8:$src2), + imm:$lane)))))]> { + let isCommutable = 0; +} // Basic 3-register operations, scalar single-precision class N3VDs op21_20, bits<4> op11_8, bit op4, @@ -511,6 +560,31 @@ [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1), (OpTy DPR:$src2))))]> { let isCommutable = Commutable; } +class N3VDIntSL op21_20, bits<4> op11_8, + string OpcodeStr, ValueType Ty, Intrinsic IntOp> + : N3V<0, 1, op21_20, op11_8, 1, 0, + (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane), + NoItinerary, + !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", + [(set (Ty DPR:$dst), + (Ty (IntOp (Ty DPR:$src1), + (Ty (NEONvduplane (Ty DPR_VFP2:$src2), + imm:$lane)))))]> { + let isCommutable = 0; +} +class N3VDIntSL16 op21_20, bits<4> op11_8, + string OpcodeStr, ValueType Ty, Intrinsic IntOp> + : N3V<0, 1, op21_20, op11_8, 1, 0, + (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane), + NoItinerary, + !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", + [(set (Ty DPR:$dst), + (Ty (IntOp (Ty DPR:$src1), + (Ty (NEONvduplane (Ty DPR_8:$src2), + imm:$lane)))))]> { + let isCommutable = 0; +} + class N3VQInt op21_20, bits<4> op11_8, bit op4, string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable> @@ -520,6 +594,30 @@ [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1), (OpTy QPR:$src2))))]> { let isCommutable = Commutable; } +class N3VQIntSL op21_20, bits<4> op11_8, + string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp> + : N3V<1, 1, op21_20, op11_8, 1, 0, + (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane), + NoItinerary, + !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", + [(set (ResTy QPR:$dst), + (ResTy (IntOp (ResTy QPR:$src1), + (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2), + imm:$lane)))))]> { + let isCommutable = 0; +} +class N3VQIntSL16 op21_20, bits<4> op11_8, + string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp> + : N3V<1, 1, op21_20, op11_8, 1, 0, + (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane), + NoItinerary, + !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", + [(set (ResTy QPR:$dst), + (ResTy (IntOp (ResTy QPR:$src1), + (ResTy (NEONvduplane (OpTy DPR_8:$src2), + imm:$lane)))))]> { + let isCommutable = 0; +} // Multiply-Add/Sub operations, both double- and quad-register. class N3VDMulOp op21_20, bits<4> op11_8, bit op4, @@ -529,6 +627,31 @@ !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst", [(set DPR:$dst, (Ty (OpNode DPR:$src1, (Ty (MulOp DPR:$src2, DPR:$src3)))))]>; +class N3VDMulOpSL op21_20, bits<4> op11_8, + string OpcodeStr, ValueType Ty, SDNode MulOp, SDNode ShOp> + : N3V<0, 1, op21_20, op11_8, 1, 0, + (outs DPR:$dst), + (ins DPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), + NoItinerary, + !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst", + [(set (Ty DPR:$dst), + (Ty (ShOp (Ty DPR:$src1), + (Ty (MulOp DPR:$src2, + (Ty (NEONvduplane (Ty DPR_VFP2:$src3), + imm:$lane)))))))]>; +class N3VDMulOpSL16 op21_20, bits<4> op11_8, + string OpcodeStr, ValueType Ty, SDNode MulOp, SDNode ShOp> + : N3V<0, 1, op21_20, op11_8, 1, 0, + (outs DPR:$dst), + (ins DPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane), + NoItinerary, + !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst", + [(set (Ty DPR:$dst), + (Ty (ShOp (Ty DPR:$src1), + (Ty (MulOp DPR:$src2, + (Ty (NEONvduplane (Ty DPR_8:$src3), + imm:$lane)))))))]>; + class N3VQMulOp op21_20, bits<4> op11_8, bit op4, string OpcodeStr, ValueType Ty, SDNode MulOp, SDNode OpNode> : N3V; +class N3VQMulOpSL op21_20, bits<4> op11_8, + string OpcodeStr, ValueType ResTy, ValueType OpTy, + SDNode MulOp, SDNode ShOp> + : N3V<1, 1, op21_20, op11_8, 1, 0, + (outs QPR:$dst), + (ins QPR:$src1, QPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), + NoItinerary, + !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst", + [(set (ResTy QPR:$dst), + (ResTy (ShOp (ResTy QPR:$src1), + (ResTy (MulOp QPR:$src2, + (ResTy (NEONvduplane (OpTy DPR_VFP2:$src3), + imm:$lane)))))))]>; +class N3VQMulOpSL16 op21_20, bits<4> op11_8, + string OpcodeStr, ValueType ResTy, ValueType OpTy, + SDNode MulOp, SDNode ShOp> + : N3V<1, 1, op21_20, op11_8, 1, 0, + (outs QPR:$dst), + (ins QPR:$src1, QPR:$src2, DPR_8:$src3, nohash_imm:$lane), + NoItinerary, + !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst", + [(set (ResTy QPR:$dst), + (ResTy (ShOp (ResTy QPR:$src1), + (ResTy (MulOp QPR:$src2, + (ResTy (NEONvduplane (OpTy DPR_8:$src3), + imm:$lane)))))))]>; // Multiply-Add/Sub operations, scalar single-precision class N3VDMulOps op21_20, bits<4> op11_8, bit op4, @@ -581,6 +730,32 @@ !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst", [(set QPR:$dst, (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2), (TyD DPR:$src3))))]>; +class N3VLInt3SL op21_20, bits<4> op11_8, + string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp> + : N3V; +class N3VLInt3SL16 op21_20, bits<4> op11_8, + string OpcodeStr, ValueType ResTy, ValueType OpTy, + Intrinsic IntOp> + : N3V; + // Narrowing 3-register intrinsics. class N3VNInt op21_20, bits<4> op11_8, bit op4, @@ -603,6 +778,27 @@ [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src1), (TyD DPR:$src2))))]> { let isCommutable = Commutable; } +class N3VLIntSL op21_20, bits<4> op11_8, + string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp> + : N3V; +class N3VLIntSL16 op21_20, bits<4> op11_8, + string OpcodeStr, ValueType ResTy, ValueType OpTy, + Intrinsic IntOp> + : N3V; // Wide 3-register intrinsics. class N3VWInt op21_20, bits<4> op11_8, bit op4, @@ -761,6 +957,13 @@ v4i32, v4i32, OpNode, Commutable>; } +multiclass N3VSL_HS op11_8, string OpcodeStr, SDNode ShOp> { + def v4i16 : N3VDSL16<0b01, op11_8, !strconcat(OpcodeStr, "16"), v4i16, ShOp>; + def v2i32 : N3VDSL<0b10, op11_8, !strconcat(OpcodeStr, "32"), v2i32, ShOp>; + def v8i16 : N3VQSL16<0b01, op11_8, !strconcat(OpcodeStr, "16"), v8i16, v4i16, ShOp>; + def v4i32 : N3VQSL<0b10, op11_8, !strconcat(OpcodeStr, "32"), v4i32, v2i32, ShOp>; +} + // ....then also with element size 64 bits: multiclass N3V_QHSD op11_8, bit op4, string OpcodeStr, SDNode OpNode, bit Commutable = 0> @@ -817,6 +1020,13 @@ v4i32, v4i32, IntOp, Commutable>; } +multiclass N3VIntSL_HS op11_8, string OpcodeStr, Intrinsic IntOp> { + def v4i16 : N3VDIntSL16<0b01, op11_8, !strconcat(OpcodeStr, "16"), v4i16, IntOp>; + def v2i32 : N3VDIntSL<0b10, op11_8, !strconcat(OpcodeStr, "32"), v2i32, IntOp>; + def v8i16 : N3VQIntSL16<0b01, op11_8, !strconcat(OpcodeStr, "16"), v8i16, v4i16, IntOp>; + def v4i32 : N3VQIntSL<0b10, op11_8, !strconcat(OpcodeStr, "32"), v4i32, v2i32, IntOp>; +} + // ....then also with element size of 8 bits: multiclass N3VInt_QHS op11_8, bit op4, string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> @@ -862,6 +1072,14 @@ v2i64, v2i32, IntOp, Commutable>; } +multiclass N3VLIntSL_HS op11_8, + string OpcodeStr, Intrinsic IntOp> { + def v4i16 : N3VLIntSL16; + def v2i32 : N3VLIntSL; +} + // ....then also with element size of 8 bits: multiclass N3VLInt_QHS op11_8, bit op4, string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> @@ -905,6 +1123,16 @@ !strconcat(OpcodeStr, "32"), v4i32, mul, OpNode>; } +multiclass N3VMulOpSL_HS op11_8, string OpcodeStr, SDNode ShOp> { + def v4i16 : N3VDMulOpSL16<0b01, op11_8, + !strconcat(OpcodeStr, "16"), v4i16, mul, ShOp>; + def v2i32 : N3VDMulOpSL<0b10, op11_8, + !strconcat(OpcodeStr, "32"), v2i32, mul, ShOp>; + def v8i16 : N3VQMulOpSL16<0b01, op11_8, + !strconcat(OpcodeStr, "16"), v8i16, v4i16, mul, ShOp>; + def v4i32 : N3VQMulOpSL<0b10, op11_8, + !strconcat(OpcodeStr, "32"), v4i32, v2i32, mul, ShOp>; +} // Neon 3-argument intrinsics, // element sizes of 8, 16 and 32 bits: @@ -939,6 +1167,14 @@ !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>; } +multiclass N3VLInt3SL_HS op11_8, + string OpcodeStr, Intrinsic IntOp> { + def v4i16 : N3VLInt3SL16; + def v2i32 : N3VLInt3SL; +} + // ....then also with element size of 8 bits: multiclass N3VLInt3_QHS op11_8, bit op4, string OpcodeStr, Intrinsic IntOp> @@ -1134,17 +1370,71 @@ int_arm_neon_vmulp, 1>; def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, "vmul.f32", v2f32, v2f32, fmul, 1>; def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, "vmul.f32", v4f32, v4f32, fmul, 1>; +defm VMULsl : N3VSL_HS<0b1000, "vmul.i", mul>; +def VMULslfd : N3VDSL<0b10, 0b1001, "vmul.f32", v2f32, fmul>; +def VMULslfq : N3VQSL<0b10, 0b1001, "vmul.f32", v4f32, v2f32, fmul>; +def : Pat<(v8i16 (mul (v8i16 QPR:$src1), + (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))), + (v8i16 (VMULslv8i16 (v8i16 QPR:$src1), + (v4i16 (EXTRACT_SUBREG QPR:$src2, + (DSubReg_i16_reg imm:$lane))), + (SubReg_i16_lane imm:$lane)))>; +def : Pat<(v4i32 (mul (v4i32 QPR:$src1), + (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))), + (v4i32 (VMULslv4i32 (v4i32 QPR:$src1), + (v2i32 (EXTRACT_SUBREG QPR:$src2, + (DSubReg_i32_reg imm:$lane))), + (SubReg_i32_lane imm:$lane)))>; +def : Pat<(v4f32 (fmul (v4f32 QPR:$src1), + (v4f32 (NEONvduplane (v4f32 QPR:$src2), imm:$lane)))), + (v4f32 (VMULslfq (v4f32 QPR:$src1), + (v2f32 (EXTRACT_SUBREG QPR:$src2, + (DSubReg_i32_reg imm:$lane))), + (SubReg_i32_lane imm:$lane)))>; + // VQDMULH : Vector Saturating Doubling Multiply Returning High Half defm VQDMULH : N3VInt_HS<0,0,0b1011,0, "vqdmulh.s", int_arm_neon_vqdmulh, 1>; +defm VQDMULHsl: N3VIntSL_HS<0b1100, "vqdmulh.s", int_arm_neon_vqdmulh>; +def : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1), + (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))), + (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1), + (v4i16 (EXTRACT_SUBREG QPR:$src2, + (DSubReg_i16_reg imm:$lane))), + (SubReg_i16_lane imm:$lane)))>; +def : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1), + (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))), + (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1), + (v2i32 (EXTRACT_SUBREG QPR:$src2, + (DSubReg_i32_reg imm:$lane))), + (SubReg_i32_lane imm:$lane)))>; + // VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half -defm VQRDMULH : N3VInt_HS<1,0,0b1011,0, "vqrdmulh.s", int_arm_neon_vqrdmulh, 1>; +defm VQRDMULH : N3VInt_HS<1,0,0b1011,0, "vqrdmulh.s", int_arm_neon_vqrdmulh, 1>; +defm VQRDMULHsl : N3VIntSL_HS<0b1101, "vqrdmulh.s", int_arm_neon_vqrdmulh>; +def : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1), + (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))), + (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1), + (v4i16 (EXTRACT_SUBREG QPR:$src2, + (DSubReg_i16_reg imm:$lane))), + (SubReg_i16_lane imm:$lane)))>; +def : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1), + (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))), + (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1), + (v2i32 (EXTRACT_SUBREG QPR:$src2, + (DSubReg_i32_reg imm:$lane))), + (SubReg_i32_lane imm:$lane)))>; + // VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D) defm VMULLs : N3VLInt_QHS<0,1,0b1100,0, "vmull.s", int_arm_neon_vmulls, 1>; defm VMULLu : N3VLInt_QHS<1,1,0b1100,0, "vmull.u", int_arm_neon_vmullu, 1>; def VMULLp : N3VLInt<0, 1, 0b00, 0b1110, 0, "vmull.p8", v8i16, v8i8, int_arm_neon_vmullp, 1>; +defm VMULLsls : N3VLIntSL_HS<0, 0b1010, "vmull.s", int_arm_neon_vmulls>; +defm VMULLslu : N3VLIntSL_HS<1, 0b1010, "vmull.u", int_arm_neon_vmullu>; + // VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D) defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, "vqdmull.s", int_arm_neon_vqdmull, 1>; +defm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, "vqdmull.s", int_arm_neon_vqdmull>; // Vector Multiply-Accumulate and Multiply-Subtract Operations. @@ -1152,20 +1442,93 @@ defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, "vmla.i", add>; def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, "vmla.f32", v2f32, fmul, fadd>; def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, "vmla.f32", v4f32, fmul, fadd>; +defm VMLAsl : N3VMulOpSL_HS<0b0000, "vmla.i", add>; +def VMLAslfd : N3VDMulOpSL<0b10, 0b0001, "vmla.f32", v2f32, fmul, fadd>; +def VMLAslfq : N3VQMulOpSL<0b10, 0b0001, "vmla.f32", v4f32, v2f32, fmul, fadd>; + +def : Pat<(v8i16 (add (v8i16 QPR:$src1), + (mul (v8i16 QPR:$src2), + (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))), + (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), + (v8i16 QPR:$src2), + (v4i16 (EXTRACT_SUBREG QPR:$src3, + (DSubReg_i16_reg imm:$lane))), + (SubReg_i16_lane imm:$lane)))>; + +def : Pat<(v4i32 (add (v4i32 QPR:$src1), + (mul (v4i32 QPR:$src2), + (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))), + (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), + (v4i32 QPR:$src2), + (v2i32 (EXTRACT_SUBREG QPR:$src3, + (DSubReg_i32_reg imm:$lane))), + (SubReg_i32_lane imm:$lane)))>; + +def : Pat<(v4f32 (fadd (v4f32 QPR:$src1), + (fmul (v4f32 QPR:$src2), + (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))), + (v4f32 (VMLAslfq (v4f32 QPR:$src1), + (v4f32 QPR:$src2), + (v2f32 (EXTRACT_SUBREG QPR:$src3, + (DSubReg_i32_reg imm:$lane))), + (SubReg_i32_lane imm:$lane)))>; + // VMLAL : Vector Multiply Accumulate Long (Q += D * D) defm VMLALs : N3VLInt3_QHS<0,1,0b1000,0, "vmlal.s", int_arm_neon_vmlals>; defm VMLALu : N3VLInt3_QHS<1,1,0b1000,0, "vmlal.u", int_arm_neon_vmlalu>; + +defm VMLALsls : N3VLInt3SL_HS<0, 0b0010, "vmlal.s", int_arm_neon_vmlals>; +defm VMLALslu : N3VLInt3SL_HS<1, 0b0010, "vmlal.u", int_arm_neon_vmlalu>; + // VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D) defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, "vqdmlal.s", int_arm_neon_vqdmlal>; +defm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal.s", int_arm_neon_vqdmlal>; + // VMLS : Vector Multiply Subtract (integer and floating-point) defm VMLS : N3VMulOp_QHS<0, 0, 0b1001, 0, "vmls.i", sub>; def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, "vmls.f32", v2f32, fmul, fsub>; def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, "vmls.f32", v4f32, fmul, fsub>; +defm VMLSsl : N3VMulOpSL_HS<0b0100, "vmls.i", sub>; +def VMLSslfd : N3VDMulOpSL<0b10, 0b0101, "vmls.f32", v2f32, fmul, fsub>; +def VMLSslfq : N3VQMulOpSL<0b10, 0b0101, "vmls.f32", v4f32, v2f32, fmul, fsub>; + +def : Pat<(v8i16 (sub (v8i16 QPR:$src1), + (mul (v8i16 QPR:$src2), + (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))), + (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), + (v8i16 QPR:$src2), + (v4i16 (EXTRACT_SUBREG QPR:$src3, + (DSubReg_i16_reg imm:$lane))), + (SubReg_i16_lane imm:$lane)))>; + +def : Pat<(v4i32 (sub (v4i32 QPR:$src1), + (mul (v4i32 QPR:$src2), + (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))), + (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), + (v4i32 QPR:$src2), + (v2i32 (EXTRACT_SUBREG QPR:$src3, + (DSubReg_i32_reg imm:$lane))), + (SubReg_i32_lane imm:$lane)))>; + +def : Pat<(v4f32 (fsub (v4f32 QPR:$src1), + (fmul (v4f32 QPR:$src2), + (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))), + (v4f32 (VMLSslfq (v4f32 QPR:$src1), + (v4f32 QPR:$src2), + (v2f32 (EXTRACT_SUBREG QPR:$src3, + (DSubReg_i32_reg imm:$lane))), + (SubReg_i32_lane imm:$lane)))>; + // VMLSL : Vector Multiply Subtract Long (Q -= D * D) defm VMLSLs : N3VLInt3_QHS<0,1,0b1010,0, "vmlsl.s", int_arm_neon_vmlsls>; defm VMLSLu : N3VLInt3_QHS<1,1,0b1010,0, "vmlsl.u", int_arm_neon_vmlslu>; + +defm VMLSLsls : N3VLInt3SL_HS<0, 0b0110, "vmlsl.s", int_arm_neon_vmlsls>; +defm VMLSLslu : N3VLInt3SL_HS<1, 0b0110, "vmlsl.u", int_arm_neon_vmlslu>; + // VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D) defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, "vqdmlsl.s", int_arm_neon_vqdmlsl>; +defm VQDMLSLsl: N3VLInt3SL_HS<0, 0b111, "vqdmlsl.s", int_arm_neon_vqdmlsl>; // Vector Subtract Operations. Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td?rev=81220&r1=81219&r2=81220&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td Tue Sep 8 10:22:32 2009 @@ -61,7 +61,7 @@ // Aliases of the F* registers used to hold 64-bit fp values (doubles) def D0 : ARMReg< 0, "d0", [S0, S1]>; -def D1 : ARMReg< 1, "d1", [S2, S3]>; +def D1 : ARMReg< 1, "d1", [S2, S3]>; def D2 : ARMReg< 2, "d2", [S4, S5]>; def D3 : ARMReg< 3, "d3", [S6, S7]>; def D4 : ARMReg< 4, "d4", [S8, S9]>; @@ -89,7 +89,7 @@ // Advanced SIMD (NEON) defines 16 quad-word aliases def Q0 : ARMReg< 0, "q0", [D0, D1]>; -def Q1 : ARMReg< 1, "q1", [D2, D3]>; +def Q1 : ARMReg< 1, "q1", [D2, D3]>; def Q2 : ARMReg< 2, "q2", [D4, D5]>; def Q3 : ARMReg< 3, "q3", [D6, D7]>; def Q4 : ARMReg< 4, "q4", [D8, D9]>; @@ -269,16 +269,16 @@ }]; let MethodBodies = [{ // VFP2 - static const unsigned ARM_DPR_VFP2[] = { - ARM::D0, ARM::D1, ARM::D2, ARM::D3, - ARM::D4, ARM::D5, ARM::D6, ARM::D7, - ARM::D8, ARM::D9, ARM::D10, ARM::D11, + static const unsigned ARM_DPR_VFP2[] = { + ARM::D0, ARM::D1, ARM::D2, ARM::D3, + ARM::D4, ARM::D5, ARM::D6, ARM::D7, + ARM::D8, ARM::D9, ARM::D10, ARM::D11, ARM::D12, ARM::D13, ARM::D14, ARM::D15 }; // VFP3 static const unsigned ARM_DPR_VFP3[] = { - ARM::D0, ARM::D1, ARM::D2, ARM::D3, - ARM::D4, ARM::D5, ARM::D6, ARM::D7, - ARM::D8, ARM::D9, ARM::D10, ARM::D11, + ARM::D0, ARM::D1, ARM::D2, ARM::D3, + ARM::D4, ARM::D5, ARM::D6, ARM::D7, + ARM::D8, ARM::D9, ARM::D10, ARM::D11, ARM::D12, ARM::D13, ARM::D14, ARM::D15, ARM::D16, ARM::D17, ARM::D18, ARM::D19, ARM::D20, ARM::D21, ARM::D22, ARM::D23, @@ -307,12 +307,19 @@ // Subset of DPR that are accessible with VFP2 (and so that also have // 32-bit SPR subregs). -def DPR_VFP2 : RegisterClass<"ARM", [f64, v2f32], 64, +def DPR_VFP2 : RegisterClass<"ARM", [f64, v2i32, v2f32], 64, [D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15]> { let SubRegClassList = [SPR, SPR]; } +// Subset of DPR which can be used as a source of NEON scalars for 16-bit +// operations +def DPR_8 : RegisterClass<"ARM", [f64, v4i16, v2f32], 64, + [D0, D1, D2, D3, D4, D5, D6, D7]> { + let SubRegClassList = [SPR, SPR]; +} + // Generic 128-bit vector register class. def QPR : RegisterClass<"ARM", [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], 128, [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, @@ -364,4 +371,3 @@ Q8, Q9, Q10, Q11, Q12, Q13, Q14, Q15], [D1, D3, D5, D7, D9, D11, D13, D15, D17, D19, D21, D23, D25, D27, D29, D31]>; - Added: llvm/trunk/test/CodeGen/ARM/vmlal_lane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vmlal_lane.ll?rev=81220&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vmlal_lane.ll (added) +++ llvm/trunk/test/CodeGen/ARM/vmlal_lane.ll Tue Sep 8 10:22:32 2009 @@ -0,0 +1,47 @@ +; RUN: llc -mattr=+neon < %s | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32" +target triple = "thumbv7-elf" + +define arm_aapcs_vfpcc <4 x i32> @test_vmlal_lanes16(<4 x i32> %arg0_int32x4_t, <4 x i16> %arg1_int16x4_t, <4 x i16> %arg2_int16x4_t) nounwind readnone { +entry: +; CHECK: test_vmlal_lanes16 +; CHECK: vmlal.s16 q0, d2, d3[1] + %0 = shufflevector <4 x i16> %arg2_int16x4_t, <4 x i16> undef, <4 x i32> ; <<4 x i16>> [#uses=1] + %1 = tail call <4 x i32> @llvm.arm.neon.vmlals.v4i32(<4 x i32> %arg0_int32x4_t, <4 x i16> %arg1_int16x4_t, <4 x i16> %0) ; <<4 x i32>> [#uses=1] + ret <4 x i32> %1 +} + +declare <4 x i32> @llvm.arm.neon.vmlals.v4i32(<4 x i32>, <4 x i16>, <4 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <2 x i64> @test_vmlal_lanes32(<2 x i64> %arg0_int64x2_t, <2 x i32> %arg1_int32x2_t, <2 x i32> %arg2_int32x2_t) nounwind readnone { +entry: +; CHECK: test_vmlal_lanes32 +; CHECK: vmlal.s32 q0, d2, d3[1] + %0 = shufflevector <2 x i32> %arg2_int32x2_t, <2 x i32> undef, <2 x i32> ; <<2 x i32>> [#uses=1] + %1 = tail call <2 x i64> @llvm.arm.neon.vmlals.v2i64(<2 x i64> %arg0_int64x2_t, <2 x i32> %arg1_int32x2_t, <2 x i32> %0) ; <<2 x i64>> [#uses=1] + ret <2 x i64> %1 +} + +declare <2 x i64> @llvm.arm.neon.vmlals.v2i64(<2 x i64>, <2 x i32>, <2 x i32>) nounwind readnone + +define arm_aapcs_vfpcc <4 x i32> @test_vmlal_laneu16(<4 x i32> %arg0_uint32x4_t, <4 x i16> %arg1_uint16x4_t, <4 x i16> %arg2_uint16x4_t) nounwind readnone { +entry: +; CHECK: test_vmlal_laneu16 +; CHECK: vmlal.u16 q0, d2, d3[1] + %0 = shufflevector <4 x i16> %arg2_uint16x4_t, <4 x i16> undef, <4 x i32> ; <<4 x i16>> [#uses=1] + %1 = tail call <4 x i32> @llvm.arm.neon.vmlalu.v4i32(<4 x i32> %arg0_uint32x4_t, <4 x i16> %arg1_uint16x4_t, <4 x i16> %0) ; <<4 x i32>> [#uses=1] + ret <4 x i32> %1 +} + +declare <4 x i32> @llvm.arm.neon.vmlalu.v4i32(<4 x i32>, <4 x i16>, <4 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <2 x i64> @test_vmlal_laneu32(<2 x i64> %arg0_uint64x2_t, <2 x i32> %arg1_uint32x2_t, <2 x i32> %arg2_uint32x2_t) nounwind readnone { +entry: +; CHECK: test_vmlal_laneu32 +; CHECK: vmlal.u32 q0, d2, d3[1] + %0 = shufflevector <2 x i32> %arg2_uint32x2_t, <2 x i32> undef, <2 x i32> ; <<2 x i32>> [#uses=1] + %1 = tail call <2 x i64> @llvm.arm.neon.vmlalu.v2i64(<2 x i64> %arg0_uint64x2_t, <2 x i32> %arg1_uint32x2_t, <2 x i32> %0) ; <<2 x i64>> [#uses=1] + ret <2 x i64> %1 +} + +declare <2 x i64> @llvm.arm.neon.vmlalu.v2i64(<2 x i64>, <2 x i32>, <2 x i32>) nounwind readnone Added: llvm/trunk/test/CodeGen/ARM/vmlsl_lane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vmlsl_lane.ll?rev=81220&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vmlsl_lane.ll (added) +++ llvm/trunk/test/CodeGen/ARM/vmlsl_lane.ll Tue Sep 8 10:22:32 2009 @@ -0,0 +1,47 @@ +; RUN: llc -mattr=+neon < %s | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32" +target triple = "thumbv7-elf" + +define arm_aapcs_vfpcc <4 x i32> @test_vmlsl_lanes16(<4 x i32> %arg0_int32x4_t, <4 x i16> %arg1_int16x4_t, <4 x i16> %arg2_int16x4_t) nounwind readnone { +entry: +; CHECK: test_vmlsl_lanes16 +; CHECK: vmlsl.s16 q0, d2, d3[1] + %0 = shufflevector <4 x i16> %arg2_int16x4_t, <4 x i16> undef, <4 x i32> ; <<4 x i16>> [#uses=1] + %1 = tail call <4 x i32> @llvm.arm.neon.vmlsls.v4i32(<4 x i32> %arg0_int32x4_t, <4 x i16> %arg1_int16x4_t, <4 x i16> %0) ; <<4 x i32>> [#uses=1] + ret <4 x i32> %1 +} + +declare <4 x i32> @llvm.arm.neon.vmlsls.v4i32(<4 x i32>, <4 x i16>, <4 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <2 x i64> @test_vmlsl_lanes32(<2 x i64> %arg0_int64x2_t, <2 x i32> %arg1_int32x2_t, <2 x i32> %arg2_int32x2_t) nounwind readnone { +entry: +; CHECK: test_vmlsl_lanes32 +; CHECK: vmlsl.s32 q0, d2, d3[1] + %0 = shufflevector <2 x i32> %arg2_int32x2_t, <2 x i32> undef, <2 x i32> ; <<2 x i32>> [#uses=1] + %1 = tail call <2 x i64> @llvm.arm.neon.vmlsls.v2i64(<2 x i64> %arg0_int64x2_t, <2 x i32> %arg1_int32x2_t, <2 x i32> %0) ; <<2 x i64>> [#uses=1] + ret <2 x i64> %1 +} + +declare <2 x i64> @llvm.arm.neon.vmlsls.v2i64(<2 x i64>, <2 x i32>, <2 x i32>) nounwind readnone + +define arm_aapcs_vfpcc <4 x i32> @test_vmlsl_laneu16(<4 x i32> %arg0_uint32x4_t, <4 x i16> %arg1_uint16x4_t, <4 x i16> %arg2_uint16x4_t) nounwind readnone { +entry: +; CHECK: test_vmlsl_laneu16 +; CHECK: vmlsl.u16 q0, d2, d3[1] + %0 = shufflevector <4 x i16> %arg2_uint16x4_t, <4 x i16> undef, <4 x i32> ; <<4 x i16>> [#uses=1] + %1 = tail call <4 x i32> @llvm.arm.neon.vmlslu.v4i32(<4 x i32> %arg0_uint32x4_t, <4 x i16> %arg1_uint16x4_t, <4 x i16> %0) ; <<4 x i32>> [#uses=1] + ret <4 x i32> %1 +} + +declare <4 x i32> @llvm.arm.neon.vmlslu.v4i32(<4 x i32>, <4 x i16>, <4 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <2 x i64> @test_vmlsl_laneu32(<2 x i64> %arg0_uint64x2_t, <2 x i32> %arg1_uint32x2_t, <2 x i32> %arg2_uint32x2_t) nounwind readnone { +entry: +; CHECK: test_vmlsl_laneu32 +; CHECK: vmlsl.u32 q0, d2, d3[1] + %0 = shufflevector <2 x i32> %arg2_uint32x2_t, <2 x i32> undef, <2 x i32> ; <<2 x i32>> [#uses=1] + %1 = tail call <2 x i64> @llvm.arm.neon.vmlslu.v2i64(<2 x i64> %arg0_uint64x2_t, <2 x i32> %arg1_uint32x2_t, <2 x i32> %0) ; <<2 x i64>> [#uses=1] + ret <2 x i64> %1 +} + +declare <2 x i64> @llvm.arm.neon.vmlslu.v2i64(<2 x i64>, <2 x i32>, <2 x i32>) nounwind readnone Added: llvm/trunk/test/CodeGen/ARM/vmul_lane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vmul_lane.ll?rev=81220&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vmul_lane.ll (added) +++ llvm/trunk/test/CodeGen/ARM/vmul_lane.ll Tue Sep 8 10:22:32 2009 @@ -0,0 +1,57 @@ +; RUN: llc -mattr=+neon < %s | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32" +target triple = "thumbv7-elf" + +define arm_aapcs_vfpcc <2 x float> @test_vmul_lanef32(<2 x float> %arg0_float32x2_t, <2 x float> %arg1_float32x2_t) nounwind readnone { +entry: +; CHECK: test_vmul_lanef32: +; CHECK: vmul.f32 d0, d0, d1[0] + %0 = shufflevector <2 x float> %arg1_float32x2_t, <2 x float> undef, <2 x i32> zeroinitializer ; <<2 x float>> [#uses=1] + %1 = fmul <2 x float> %0, %arg0_float32x2_t ; <<2 x float>> [#uses=1] + ret <2 x float> %1 +} + +define arm_aapcs_vfpcc <4 x i16> @test_vmul_lanes16(<4 x i16> %arg0_int16x4_t, <4 x i16> %arg1_int16x4_t) nounwind readnone { +entry: +; CHECK: test_vmul_lanes16: +; CHECK: vmul.i16 d0, d0, d1[1] + %0 = shufflevector <4 x i16> %arg1_int16x4_t, <4 x i16> undef, <4 x i32> ; <<4 x i16>> [#uses$ + %1 = mul <4 x i16> %0, %arg0_int16x4_t ; <<4 x i16>> [#uses=1] + ret <4 x i16> %1 +} + +define arm_aapcs_vfpcc <2 x i32> @test_vmul_lanes32(<2 x i32> %arg0_int32x2_t, <2 x i32> %arg1_int32x2_t) nounwind readnone { +entry: +; CHECK: test_vmul_lanes32: +; CHECK: vmul.i32 d0, d0, d1[1] + %0 = shufflevector <2 x i32> %arg1_int32x2_t, <2 x i32> undef, <2 x i32> ; <<2 x i32>> [#uses=1] + %1 = mul <2 x i32> %0, %arg0_int32x2_t ; <<2 x i32>> [#uses=1] + ret <2 x i32> %1 +} + +define arm_aapcs_vfpcc <4 x float> @test_vmulQ_lanef32(<4 x float> %arg0_float32x4_t, <2 x float> %arg1_float32x2_t) nounwind readnone { +entry: +; CHECK: test_vmulQ_lanef32: +; CHECK: vmul.f32 q0, q0, d2[1] + %0 = shufflevector <2 x float> %arg1_float32x2_t, <2 x float> undef, <4 x i32> ; <<4 x float>$ + %1 = fmul <4 x float> %0, %arg0_float32x4_t ; <<4 x float>> [#uses=1] + ret <4 x float> %1 +} + +define arm_aapcs_vfpcc <8 x i16> @test_vmulQ_lanes16(<8 x i16> %arg0_int16x8_t, <4 x i16> %arg1_int16x4_t) nounwind readnone { +entry: +; CHECK: test_vmulQ_lanes16: +; CHECK: vmul.i16 q0, q0, d2[1] + %0 = shufflevector <4 x i16> %arg1_int16x4_t, <4 x i16> undef, <8 x i32> + %1 = mul <8 x i16> %0, %arg0_int16x8_t ; <<8 x i16>> [#uses=1] + ret <8 x i16> %1 +} + +define arm_aapcs_vfpcc <4 x i32> @test_vmulQ_lanes32(<4 x i32> %arg0_int32x4_t, <2 x i32> %arg1_int32x2_t) nounwind readnone { +entry: +; CHECK: test_vmulQ_lanes32: +; CHECK: vmul.i32 q0, q0, d2[1] + %0 = shufflevector <2 x i32> %arg1_int32x2_t, <2 x i32> undef, <4 x i32> ; <<4 x i32>> [#uses$ + %1 = mul <4 x i32> %0, %arg0_int32x4_t ; <<4 x i32>> [#uses=1] + ret <4 x i32> %1 +} Added: llvm/trunk/test/CodeGen/ARM/vmull_lane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vmull_lane.ll?rev=81220&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vmull_lane.ll (added) +++ llvm/trunk/test/CodeGen/ARM/vmull_lane.ll Tue Sep 8 10:22:32 2009 @@ -0,0 +1,47 @@ +; RUN: llc -mattr=+neon < %s | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32" +target triple = "thumbv7-elf" + +define arm_aapcs_vfpcc <4 x i32> @test_vmull_lanes16(<4 x i16> %arg0_int16x4_t, <4 x i16> %arg1_int16x4_t) nounwind readnone { +entry: +; CHECK: test_vmull_lanes16 +; CHECK: vmull.s16 q0, d0, d1[1] + %0 = shufflevector <4 x i16> %arg1_int16x4_t, <4 x i16> undef, <4 x i32> ; <<4 x i16>> [#uses=1] + %1 = tail call <4 x i32> @llvm.arm.neon.vmulls.v4i32(<4 x i16> %arg0_int16x4_t, <4 x i16> %0) ; <<4 x i32>> [#uses=1] + ret <4 x i32> %1 +} + +declare <4 x i32> @llvm.arm.neon.vmulls.v4i32(<4 x i16>, <4 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <2 x i64> @test_vmull_lanes32(<2 x i32> %arg0_int32x2_t, <2 x i32> %arg1_int32x2_t) nounwind readnone { +entry: +; CHECK: test_vmull_lanes32 +; CHECK: vmull.s32 q0, d0, d1[1] + %0 = shufflevector <2 x i32> %arg1_int32x2_t, <2 x i32> undef, <2 x i32> ; <<2 x i32>> [#uses=1] + %1 = tail call <2 x i64> @llvm.arm.neon.vmulls.v2i64(<2 x i32> %arg0_int32x2_t, <2 x i32> %0) ; <<2 x i64>> [#uses=1] + ret <2 x i64> %1 +} + +declare <2 x i64> @llvm.arm.neon.vmulls.v2i64(<2 x i32>, <2 x i32>) nounwind readnone + +define arm_aapcs_vfpcc <4 x i32> @test_vmull_laneu16(<4 x i16> %arg0_uint16x4_t, <4 x i16> %arg1_uint16x4_t) nounwind readnone { +entry: +; CHECK: test_vmull_laneu16 +; CHECK: vmull.u16 q0, d0, d1[1] + %0 = shufflevector <4 x i16> %arg1_uint16x4_t, <4 x i16> undef, <4 x i32> ; <<4 x i16>> [#uses=1] + %1 = tail call <4 x i32> @llvm.arm.neon.vmullu.v4i32(<4 x i16> %arg0_uint16x4_t, <4 x i16> %0) ; <<4 x i32>> [#uses=1] + ret <4 x i32> %1 +} + +declare <4 x i32> @llvm.arm.neon.vmullu.v4i32(<4 x i16>, <4 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <2 x i64> @test_vmull_laneu32(<2 x i32> %arg0_uint32x2_t, <2 x i32> %arg1_uint32x2_t) nounwind readnone { +entry: +; CHECK: test_vmull_laneu32 +; CHECK: vmull.u32 q0, d0, d1[1] + %0 = shufflevector <2 x i32> %arg1_uint32x2_t, <2 x i32> undef, <2 x i32> ; <<2 x i32>> [#uses=1] + %1 = tail call <2 x i64> @llvm.arm.neon.vmullu.v2i64(<2 x i32> %arg0_uint32x2_t, <2 x i32> %0) ; <<2 x i64>> [#uses=1] + ret <2 x i64> %1 +} + +declare <2 x i64> @llvm.arm.neon.vmullu.v2i64(<2 x i32>, <2 x i32>) nounwind readnone Added: llvm/trunk/test/CodeGen/ARM/vqRdmulh_lane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vqRdmulh_lane.ll?rev=81220&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vqRdmulh_lane.ll (added) +++ llvm/trunk/test/CodeGen/ARM/vqRdmulh_lane.ll Tue Sep 8 10:22:32 2009 @@ -0,0 +1,47 @@ +; RUN: llc -mattr=+neon < %s | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32" +target triple = "thumbv7-elf" + +define arm_aapcs_vfpcc <8 x i16> @test_vqRdmulhQ_lanes16(<8 x i16> %arg0_int16x8_t, <4 x i16> %arg1_int16x4_t) nounwind readnone { +entry: +; CHECK: test_vqRdmulhQ_lanes16 +; CHECK: vqrdmulh.s16 q0, q0, d2[1] + %0 = shufflevector <4 x i16> %arg1_int16x4_t, <4 x i16> undef, <8 x i32> ; <<8 x i16>> [#uses=1] + %1 = tail call <8 x i16> @llvm.arm.neon.vqrdmulh.v8i16(<8 x i16> %arg0_int16x8_t, <8 x i16> %0) ; <<8 x i16>> [#uses=1] + ret <8 x i16> %1 +} + +declare <8 x i16> @llvm.arm.neon.vqrdmulh.v8i16(<8 x i16>, <8 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <4 x i32> @test_vqRdmulhQ_lanes32(<4 x i32> %arg0_int32x4_t, <2 x i32> %arg1_int32x2_t) nounwind readnone { +entry: +; CHECK: test_vqRdmulhQ_lanes32 +; CHECK: vqrdmulh.s32 q0, q0, d2[1] + %0 = shufflevector <2 x i32> %arg1_int32x2_t, <2 x i32> undef, <4 x i32> ; <<4 x i32>> [#uses=1] + %1 = tail call <4 x i32> @llvm.arm.neon.vqrdmulh.v4i32(<4 x i32> %arg0_int32x4_t, <4 x i32> %0) ; <<4 x i32>> [#uses=1] + ret <4 x i32> %1 +} + +declare <4 x i32> @llvm.arm.neon.vqrdmulh.v4i32(<4 x i32>, <4 x i32>) nounwind readnone + +define arm_aapcs_vfpcc <4 x i16> @test_vqRdmulh_lanes16(<4 x i16> %arg0_int16x4_t, <4 x i16> %arg1_int16x4_t) nounwind readnone { +entry: +; CHECK: test_vqRdmulh_lanes16 +; CHECK: vqrdmulh.s16 d0, d0, d1[1] + %0 = shufflevector <4 x i16> %arg1_int16x4_t, <4 x i16> undef, <4 x i32> ; <<4 x i16>> [#uses=1] + %1 = tail call <4 x i16> @llvm.arm.neon.vqrdmulh.v4i16(<4 x i16> %arg0_int16x4_t, <4 x i16> %0) ; <<4 x i16>> [#uses=1] + ret <4 x i16> %1 +} + +declare <4 x i16> @llvm.arm.neon.vqrdmulh.v4i16(<4 x i16>, <4 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <2 x i32> @test_vqRdmulh_lanes32(<2 x i32> %arg0_int32x2_t, <2 x i32> %arg1_int32x2_t) nounwind readnone { +entry: +; CHECK: test_vqRdmulh_lanes32 +; CHECK: vqrdmulh.s32 d0, d0, d1[1] + %0 = shufflevector <2 x i32> %arg1_int32x2_t, <2 x i32> undef, <2 x i32> ; <<2 x i32>> [#uses=1] + %1 = tail call <2 x i32> @llvm.arm.neon.vqrdmulh.v2i32(<2 x i32> %arg0_int32x2_t, <2 x i32> %0) ; <<2 x i32>> [#uses=1] + ret <2 x i32> %1 +} + +declare <2 x i32> @llvm.arm.neon.vqrdmulh.v2i32(<2 x i32>, <2 x i32>) nounwind readnone Added: llvm/trunk/test/CodeGen/ARM/vqdmlal_lanes.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vqdmlal_lanes.ll?rev=81220&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vqdmlal_lanes.ll (added) +++ llvm/trunk/test/CodeGen/ARM/vqdmlal_lanes.ll Tue Sep 8 10:22:32 2009 @@ -0,0 +1,25 @@ +; RUN: llc -mattr=+neon < %s | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32" +target triple = "thumbv7-elf" + +define arm_aapcs_vfpcc <4 x i32> @test_vqdmlal_lanes16(<4 x i32> %arg0_int32x4_t, <4 x i16> %arg1_int16x4_t, <4 x i16> %arg2_int16x4_t) nounwind readnone { +entry: +; CHECK: test_vqdmlal_lanes16 +; CHECK: vqdmlal.s16 q0, d2, d3[1] + %0 = shufflevector <4 x i16> %arg2_int16x4_t, <4 x i16> undef, <4 x i32> ; <<4 x i16>> [#uses=1] + %1 = tail call <4 x i32> @llvm.arm.neon.vqdmlal.v4i32(<4 x i32> %arg0_int32x4_t, <4 x i16> %arg1_int16x4_t, <4 x i16> %0) ; <<4 x i32>> [#uses=1] + ret <4 x i32> %1 +} + +declare <4 x i32> @llvm.arm.neon.vqdmlal.v4i32(<4 x i32>, <4 x i16>, <4 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <2 x i64> @test_vqdmlal_lanes32(<2 x i64> %arg0_int64x2_t, <2 x i32> %arg1_int32x2_t, <2 x i32> %arg2_int32x2_t) nounwind readnone { +entry: +; CHECK: test_vqdmlal_lanes32 +; CHECK: vqdmlal.s32 q0, d2, d3[1] + %0 = shufflevector <2 x i32> %arg2_int32x2_t, <2 x i32> undef, <2 x i32> ; <<2 x i32>> [#uses=1] + %1 = tail call <2 x i64> @llvm.arm.neon.vqdmlal.v2i64(<2 x i64> %arg0_int64x2_t, <2 x i32> %arg1_int32x2_t, <2 x i32> %0) ; <<2 x i64>> [#uses=1] + ret <2 x i64> %1 +} + +declare <2 x i64> @llvm.arm.neon.vqdmlal.v2i64(<2 x i64>, <2 x i32>, <2 x i32>) nounwind readnone Added: llvm/trunk/test/CodeGen/ARM/vqdmlsl_lanes.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vqdmlsl_lanes.ll?rev=81220&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vqdmlsl_lanes.ll (added) +++ llvm/trunk/test/CodeGen/ARM/vqdmlsl_lanes.ll Tue Sep 8 10:22:32 2009 @@ -0,0 +1,25 @@ +; RUN: llc -mattr=+neon < %s | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32" +target triple = "thumbv7-elf" + +define arm_aapcs_vfpcc <4 x i32> @test_vqdmlsl_lanes16(<4 x i32> %arg0_int32x4_t, <4 x i16> %arg1_int16x4_t, <4 x i16> %arg2_int16x4_t) nounwind readnone { +entry: +; CHECK: test_vqdmlsl_lanes16 +; CHECK: vqdmlsl.s16 q0, d2, d3[1] + %0 = shufflevector <4 x i16> %arg2_int16x4_t, <4 x i16> undef, <4 x i32> ; <<4 x i16>> [#uses=1] + %1 = tail call <4 x i32> @llvm.arm.neon.vqdmlsl.v4i32(<4 x i32> %arg0_int32x4_t, <4 x i16> %arg1_int16x4_t, <4 x i16> %0) ; <<4 x i32>> [#uses=1] + ret <4 x i32> %1 +} + +declare <4 x i32> @llvm.arm.neon.vqdmlsl.v4i32(<4 x i32>, <4 x i16>, <4 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <2 x i64> @test_vqdmlsl_lanes32(<2 x i64> %arg0_int64x2_t, <2 x i32> %arg1_int32x2_t, <2 x i32> %arg2_int32x2_t) nounwind readnone { +entry: +; CHECK: test_vqdmlsl_lanes32 +; CHECK: vqdmlsl.s32 q0, d2, d3[1] + %0 = shufflevector <2 x i32> %arg2_int32x2_t, <2 x i32> undef, <2 x i32> ; <<2 x i32>> [#uses=1] + %1 = tail call <2 x i64> @llvm.arm.neon.vqdmlsl.v2i64(<2 x i64> %arg0_int64x2_t, <2 x i32> %arg1_int32x2_t, <2 x i32> %0) ; <<2 x i64>> [#uses=1] + ret <2 x i64> %1 +} + +declare <2 x i64> @llvm.arm.neon.vqdmlsl.v2i64(<2 x i64>, <2 x i32>, <2 x i32>) nounwind readnone Added: llvm/trunk/test/CodeGen/ARM/vqdmulh_lane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vqdmulh_lane.ll?rev=81220&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vqdmulh_lane.ll (added) +++ llvm/trunk/test/CodeGen/ARM/vqdmulh_lane.ll Tue Sep 8 10:22:32 2009 @@ -0,0 +1,47 @@ +; RUN: llc -mattr=+neon < %s | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32" +target triple = "thumbv7-elf" + +define arm_aapcs_vfpcc <8 x i16> @test_vqdmulhQ_lanes16(<8 x i16> %arg0_int16x8_t, <4 x i16> %arg1_int16x4_t) nounwind readnone { +entry: +; CHECK: test_vqdmulhQ_lanes16 +; CHECK: vqdmulh.s16 q0, q0, d2[1] + %0 = shufflevector <4 x i16> %arg1_int16x4_t, <4 x i16> undef, <8 x i32> ; <<8 x i16>> [#uses=1] + %1 = tail call <8 x i16> @llvm.arm.neon.vqdmulh.v8i16(<8 x i16> %arg0_int16x8_t, <8 x i16> %0) ; <<8 x i16>> [#uses=1] + ret <8 x i16> %1 +} + +declare <8 x i16> @llvm.arm.neon.vqdmulh.v8i16(<8 x i16>, <8 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <4 x i32> @test_vqdmulhQ_lanes32(<4 x i32> %arg0_int32x4_t, <2 x i32> %arg1_int32x2_t) nounwind readnone { +entry: +; CHECK: test_vqdmulhQ_lanes32 +; CHECK: vqdmulh.s32 q0, q0, d2[1] + %0 = shufflevector <2 x i32> %arg1_int32x2_t, <2 x i32> undef, <4 x i32> ; <<4 x i32>> [#uses=1] + %1 = tail call <4 x i32> @llvm.arm.neon.vqdmulh.v4i32(<4 x i32> %arg0_int32x4_t, <4 x i32> %0) ; <<4 x i32>> [#uses=1] + ret <4 x i32> %1 +} + +declare <4 x i32> @llvm.arm.neon.vqdmulh.v4i32(<4 x i32>, <4 x i32>) nounwind readnone + +define arm_aapcs_vfpcc <4 x i16> @test_vqdmulh_lanes16(<4 x i16> %arg0_int16x4_t, <4 x i16> %arg1_int16x4_t) nounwind readnone { +entry: +; CHECK: test_vqdmulh_lanes16 +; CHECK: vqdmulh.s16 d0, d0, d1[1] + %0 = shufflevector <4 x i16> %arg1_int16x4_t, <4 x i16> undef, <4 x i32> ; <<4 x i16>> [#uses=1] + %1 = tail call <4 x i16> @llvm.arm.neon.vqdmulh.v4i16(<4 x i16> %arg0_int16x4_t, <4 x i16> %0) ; <<4 x i16>> [#uses=1] + ret <4 x i16> %1 +} + +declare <4 x i16> @llvm.arm.neon.vqdmulh.v4i16(<4 x i16>, <4 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <2 x i32> @test_vqdmulh_lanes32(<2 x i32> %arg0_int32x2_t, <2 x i32> %arg1_int32x2_t) nounwind readnone { +entry: +; CHECK: test_vqdmulh_lanes32 +; CHECK: vqdmulh.s32 d0, d0, d1[1] + %0 = shufflevector <2 x i32> %arg1_int32x2_t, <2 x i32> undef, <2 x i32> ; <<2 x i32>> [#uses=1] + %1 = tail call <2 x i32> @llvm.arm.neon.vqdmulh.v2i32(<2 x i32> %arg0_int32x2_t, <2 x i32> %0) ; <<2 x i32>> [#uses=1] + ret <2 x i32> %1 +} + +declare <2 x i32> @llvm.arm.neon.vqdmulh.v2i32(<2 x i32>, <2 x i32>) nounwind readnone Added: llvm/trunk/test/CodeGen/ARM/vqdmull_lane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vqdmull_lane.ll?rev=81220&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vqdmull_lane.ll (added) +++ llvm/trunk/test/CodeGen/ARM/vqdmull_lane.ll Tue Sep 8 10:22:32 2009 @@ -0,0 +1,25 @@ +; RUN: llc -mattr=+neon < %s | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32" +target triple = "thumbv7-elf" + +define arm_aapcs_vfpcc <4 x i32> @test_vqdmull_lanes16(<4 x i16> %arg0_int16x4_t, <4 x i16> %arg1_int16x4_t) nounwind readnone { +entry: +; CHECK: test_vqdmull_lanes16 +; CHECK: vqdmull.s16 q0, d0, d1[1] + %0 = shufflevector <4 x i16> %arg1_int16x4_t, <4 x i16> undef, <4 x i32> ; <<4 x i16>> [#uses=1] + %1 = tail call <4 x i32> @llvm.arm.neon.vqdmull.v4i32(<4 x i16> %arg0_int16x4_t, <4 x i16> %0) ; <<4 x i32>> [#uses=1] + ret <4 x i32> %1 +} + +declare <4 x i32> @llvm.arm.neon.vqdmull.v4i32(<4 x i16>, <4 x i16>) nounwind readnone + +define arm_aapcs_vfpcc <2 x i64> @test_vqdmull_lanes32(<2 x i32> %arg0_int32x2_t, <2 x i32> %arg1_int32x2_t) nounwind readnone { +entry: +; CHECK: test_vqdmull_lanes32 +; CHECK: vqdmull.s32 q0, d0, d1[1] + %0 = shufflevector <2 x i32> %arg1_int32x2_t, <2 x i32> undef, <2 x i32> ; <<2 x i32>> [#uses=1] + %1 = tail call <2 x i64> @llvm.arm.neon.vqdmull.v2i64(<2 x i32> %arg0_int32x2_t, <2 x i32> %0) ; <<2 x i64>> [#uses=1] + ret <2 x i64> %1 +} + +declare <2 x i64> @llvm.arm.neon.vqdmull.v2i64(<2 x i32>, <2 x i32>) nounwind readnone From gohman at apple.com Tue Sep 8 10:45:01 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 08 Sep 2009 15:45:01 -0000 Subject: [llvm-commits] [llvm] r81221 - in /llvm/trunk: include/llvm/Analysis/LoopInfo.h include/llvm/Transforms/Utils/BasicBlockUtils.h lib/Analysis/LoopInfo.cpp lib/Transforms/Scalar/LICM.cpp lib/Transforms/Scalar/LoopStrengthReduce.cpp lib/Transforms/Scalar/LoopUnswitch.cpp lib/Transforms/Utils/BasicBlockUtils.cpp lib/Transforms/Utils/BreakCriticalEdges.cpp lib/Transforms/Utils/LCSSA.cpp lib/Transforms/Utils/LoopSimplify.cpp test/Transforms/LoopUnswitch/2009-09-05-DomAssert.ll test/Transforms/LoopUnswitch/preserve-analyses.ll Message-ID: <200909081545.n88Fj1Tu027659@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 8 10:45:00 2009 New Revision: 81221 URL: http://llvm.org/viewvc/llvm-project?rev=81221&view=rev Log: Re-apply r80926, with fixes: keep the domtree informed of new blocks that get created during loop unswitching, and fix SplitBlockPredecessors' LCSSA updating code to create new PHIs instead of trying to just move existing ones. Also, optimize Loop::verifyLoop, since it gets called a lot. Use searches on a sorted list of blocks instead of calling the "contains" function, as is done in other places in the Loop class, since "contains" does a linear search. Also, don't call verifyLoop from LoopSimplify or LCSSA, as the PassManager is already calling verifyLoop as part of LoopInfo's verifyAnalysis. Added: llvm/trunk/test/Transforms/LoopUnswitch/preserve-analyses.ll Removed: llvm/trunk/test/Transforms/LoopUnswitch/2009-09-05-DomAssert.ll Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h llvm/trunk/lib/Analysis/LoopInfo.cpp llvm/trunk/lib/Transforms/Scalar/LICM.cpp llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp llvm/trunk/lib/Transforms/Utils/LCSSA.cpp llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=81221&r1=81220&r2=81221&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue Sep 8 10:45:00 2009 @@ -376,14 +376,85 @@ /// verifyLoop - Verify loop structure void verifyLoop() const { #ifndef NDEBUG - assert (getHeader() && "Loop header is missing"); - assert (getLoopPreheader() && "Loop preheader is missing"); - assert (getLoopLatch() && "Loop latch is missing"); - for (iterator I = SubLoops.begin(), E = SubLoops.end(); I != E; ++I) - (*I)->verifyLoop(); + assert(!Blocks.empty() && "Loop header is missing"); + assert(getHeader() && "Loop header is missing"); + + // Sort the blocks vector so that we can use binary search to do quick + // lookups. + SmallVector LoopBBs(block_begin(), block_end()); + std::sort(LoopBBs.begin(), LoopBBs.end()); + + // Check the individual blocks. + for (block_iterator I = block_begin(), E = block_end(); I != E; ++I) { + BlockT *BB = *I; + bool HasInsideLoopSuccs = false; + bool HasInsideLoopPreds = false; + SmallVector OutsideLoopPreds; + + typedef GraphTraits BlockTraits; + for (typename BlockTraits::ChildIteratorType SI = + BlockTraits::child_begin(BB), SE = BlockTraits::child_end(BB); + SI != SE; ++SI) + if (std::binary_search(LoopBBs.begin(), LoopBBs.end(), *SI)) { + HasInsideLoopSuccs = true; + break; + } + typedef GraphTraits > InvBlockTraits; + for (typename InvBlockTraits::ChildIteratorType PI = + InvBlockTraits::child_begin(BB), PE = InvBlockTraits::child_end(BB); + PI != PE; ++PI) { + if (std::binary_search(LoopBBs.begin(), LoopBBs.end(), *PI)) + HasInsideLoopPreds = true; + else + OutsideLoopPreds.push_back(*PI); + } + + if (BB == getHeader()) { + assert(!OutsideLoopPreds.empty() && "Loop is unreachable!"); + } else if (!OutsideLoopPreds.empty()) { + // A non-header loop shouldn't be reachable from outside the loop, + // though it is permitted if the predecessor is not itself actually + // reachable. + BlockT *EntryBB = BB->getParent()->begin(); + for (df_iterator NI = df_begin(EntryBB), + NE = df_end(EntryBB); NI != NE; ++NI) + for (unsigned i = 0, e = OutsideLoopPreds.size(); i != e; ++i) + assert(*NI != OutsideLoopPreds[i] && + "Loop has multiple entry points!"); + } + assert(HasInsideLoopPreds && "Loop block has no in-loop predecessors!"); + assert(HasInsideLoopSuccs && "Loop block has no in-loop successors!"); + assert(BB != getHeader()->getParent()->begin() && + "Loop contains function entry block!"); + } + + // Check the subloops. + for (iterator I = begin(), E = end(); I != E; ++I) + // Each block in each subloop should be contained within this loop. + for (block_iterator BI = (*I)->block_begin(), BE = (*I)->block_end(); + BI != BE; ++BI) { + assert(std::binary_search(LoopBBs.begin(), LoopBBs.end(), *BI) && + "Loop does not contain all the blocks of a subloop!"); + } + + // Check the parent loop pointer. + if (ParentLoop) { + assert(std::find(ParentLoop->begin(), ParentLoop->end(), this) != + ParentLoop->end() && + "Loop is not a subloop of its parent!"); + } #endif } + /// verifyLoop - Verify loop structure of this loop and all nested loops. + void verifyLoopNest() const { + // Verify this loop. + verifyLoop(); + // Verify the subloops. + for (iterator I = begin(), E = end(); I != E; ++I) + (*I)->verifyLoopNest(); + } + void print(raw_ostream &OS, unsigned Depth = 0) const { OS.indent(Depth*2) << "Loop at depth " << getLoopDepth() << " containing: "; @@ -873,6 +944,8 @@ /// virtual bool runOnFunction(Function &F); + virtual void verifyAnalysis() const; + virtual void releaseMemory() { LI.releaseMemory(); } virtual void print(raw_ostream &O, const Module* M = 0) const; 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=81221&r1=81220&r2=81221&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/BasicBlockUtils.h Tue Sep 8 10:45:00 2009 @@ -126,10 +126,10 @@ /// dest go to one block instead of each going to a different block, but isn't /// the standard definition of a "critical edge". /// -bool SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P = 0, - bool MergeIdenticalEdges = false); +BasicBlock *SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, + Pass *P = 0, bool MergeIdenticalEdges = false); -inline bool SplitCriticalEdge(BasicBlock *BB, succ_iterator SI, Pass *P = 0) { +inline BasicBlock *SplitCriticalEdge(BasicBlock *BB, succ_iterator SI, Pass *P = 0) { return SplitCriticalEdge(BB->getTerminator(), SI.getSuccessorIndex(), P); } @@ -143,7 +143,7 @@ TerminatorInst *TI = (*PI)->getTerminator(); for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) if (TI->getSuccessor(i) == Succ) - MadeChange |= SplitCriticalEdge(TI, i, P); + MadeChange |= !!SplitCriticalEdge(TI, i, P); return MadeChange; } @@ -151,8 +151,9 @@ /// and return true, otherwise return false. This method requires that there be /// an edge between the two blocks. If P is specified, it updates the analyses /// described above. -inline bool SplitCriticalEdge(BasicBlock *Src, BasicBlock *Dst, Pass *P = 0, - bool MergeIdenticalEdges = false) { +inline BasicBlock *SplitCriticalEdge(BasicBlock *Src, BasicBlock *Dst, + Pass *P = 0, + bool MergeIdenticalEdges = false) { TerminatorInst *TI = Src->getTerminator(); unsigned i = 0; while (1) { @@ -180,8 +181,12 @@ /// Preds array, which has NumPreds elements in it. The new block is given a /// suffix of 'Suffix'. This function returns the new block. /// -/// This currently updates the LLVM IR, AliasAnalysis, DominatorTree and -/// DominanceFrontier, but no other analyses. +/// This currently updates the LLVM IR, AliasAnalysis, DominatorTree, +/// DominanceFrontier, LoopInfo, and LCCSA but no other analyses. +/// In particular, it does not preserve LoopSimplify (because it's +/// complicated to handle the case where one of the edges being split +/// is an exit of a loop with other exits). +/// BasicBlock *SplitBlockPredecessors(BasicBlock *BB, BasicBlock *const *Preds, unsigned NumPreds, const char *Suffix, Pass *P = 0); Modified: llvm/trunk/lib/Analysis/LoopInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopInfo.cpp?rev=81221&r1=81220&r2=81221&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LoopInfo.cpp (original) +++ llvm/trunk/lib/Analysis/LoopInfo.cpp Tue Sep 8 10:45:00 2009 @@ -300,6 +300,9 @@ /// void Loop::getUniqueExitBlocks(SmallVectorImpl &ExitBlocks) const { + assert(isLoopSimplifyForm() && + "getUniqueExitBlocks assumes the loop is in canonical form!"); + // Sort the blocks vector so that we can use binary search to do quick // lookups. SmallVector LoopBBs(block_begin(), block_end()); @@ -371,6 +374,13 @@ return false; } +void LoopInfo::verifyAnalysis() const { + for (iterator I = begin(), E = end(); I != E; ++I) { + assert(!(*I)->getParentLoop() && "Top-level loop has a parent!"); + (*I)->verifyLoopNest(); + } +} + void LoopInfo::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired(); Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=81221&r1=81220&r2=81221&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Tue Sep 8 10:45:00 2009 @@ -91,6 +91,7 @@ AU.addRequired(); AU.addPreserved(); AU.addPreserved(); + AU.addPreservedID(LoopSimplifyID); } bool doFinalization() { Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=81221&r1=81220&r2=81221&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Sep 8 10:45:00 2009 @@ -484,36 +484,37 @@ // loop because multiple copies sometimes do useful sinking of code in // that case(?). Instruction *OldLoc = dyn_cast(OperandValToReplace); + BasicBlock *PHIPred = PN->getIncomingBlock(i); if (L->contains(OldLoc->getParent())) { // If this is a critical edge, split the edge so that we do not insert // the code on all predecessor/successor paths. We do this unless this // is the canonical backedge for this loop, as this can make some // inserted code be in an illegal position. - BasicBlock *PHIPred = PN->getIncomingBlock(i); if (e != 1 && PHIPred->getTerminator()->getNumSuccessors() > 1 && (PN->getParent() != L->getHeader() || !L->contains(PHIPred))) { // First step, split the critical edge. - SplitCriticalEdge(PHIPred, PN->getParent(), P, false); + BasicBlock *NewBB = SplitCriticalEdge(PHIPred, PN->getParent(), + P, false); // Next step: move the basic block. In particular, if the PHI node // is outside of the loop, and PredTI is in the loop, we want to // move the block to be immediately before the PHI block, not // immediately after PredTI. - if (L->contains(PHIPred) && !L->contains(PN->getParent())) { - BasicBlock *NewBB = PN->getIncomingBlock(i); + if (L->contains(PHIPred) && !L->contains(PN->getParent())) NewBB->moveBefore(PN->getParent()); - } // Splitting the edge can reduce the number of PHI entries we have. e = PN->getNumIncomingValues(); + PHIPred = NewBB; + i = PN->getBasicBlockIndex(PHIPred); } } - Value *&Code = InsertedCode[PN->getIncomingBlock(i)]; + Value *&Code = InsertedCode[PHIPred]; if (!Code) { // Insert the code into the end of the predecessor block. Instruction *InsertPt = (L->contains(OldLoc->getParent())) ? - PN->getIncomingBlock(i)->getTerminator() : + PHIPred->getTerminator() : OldLoc->getParent()->getTerminator(); Code = InsertCodeForBaseAtPosition(NewBase, PN->getType(), Rewriter, InsertPt, L, LI); Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=81221&r1=81220&r2=81221&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Tue Sep 8 10:45:00 2009 @@ -112,6 +112,10 @@ private: + virtual void releaseMemory() { + UnswitchedVals.clear(); + } + /// RemoveLoopFromWorklist - If the specified loop is on the loop worklist, /// remove it. void RemoveLoopFromWorklist(Loop *L) { @@ -518,7 +522,12 @@ std::swap(TrueDest, FalseDest); // Insert the new branch. - BranchInst::Create(TrueDest, FalseDest, BranchVal, InsertPt); + BranchInst *BI = BranchInst::Create(TrueDest, FalseDest, BranchVal, InsertPt); + + // If either edge is critical, split it. This helps preserve LoopSimplify + // form for enclosing loops. + SplitCriticalEdge(BI, 0, this); + SplitCriticalEdge(BI, 1, this); } /// UnswitchTrivialCondition - Given a loop that has a trivial unswitchable @@ -575,47 +584,11 @@ for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) { BasicBlock *ExitBlock = ExitBlocks[i]; - std::vector Preds(pred_begin(ExitBlock), pred_end(ExitBlock)); - - for (unsigned j = 0, e = Preds.size(); j != e; ++j) { - BasicBlock* NewExitBlock = SplitEdge(Preds[j], ExitBlock, this); - BasicBlock* StartBlock = Preds[j]; - BasicBlock* EndBlock; - if (NewExitBlock->getSinglePredecessor() == ExitBlock) { - EndBlock = NewExitBlock; - NewExitBlock = EndBlock->getSinglePredecessor(); - } else { - EndBlock = ExitBlock; - } - - std::set InsertedPHIs; - PHINode* OldLCSSA = 0; - for (BasicBlock::iterator I = EndBlock->begin(); - (OldLCSSA = dyn_cast(I)); ++I) { - Value* OldValue = OldLCSSA->getIncomingValueForBlock(NewExitBlock); - PHINode* NewLCSSA = PHINode::Create(OldLCSSA->getType(), - OldLCSSA->getName() + ".us-lcssa", - NewExitBlock->getTerminator()); - NewLCSSA->addIncoming(OldValue, StartBlock); - OldLCSSA->setIncomingValue(OldLCSSA->getBasicBlockIndex(NewExitBlock), - NewLCSSA); - InsertedPHIs.insert(NewLCSSA); - } - - BasicBlock::iterator InsertPt = EndBlock->getFirstNonPHI(); - for (BasicBlock::iterator I = NewExitBlock->begin(); - (OldLCSSA = dyn_cast(I)) && InsertedPHIs.count(OldLCSSA) == 0; - ++I) { - PHINode *NewLCSSA = PHINode::Create(OldLCSSA->getType(), - OldLCSSA->getName() + ".us-lcssa", - InsertPt); - OldLCSSA->replaceAllUsesWith(NewLCSSA); - NewLCSSA->addIncoming(OldLCSSA, NewExitBlock); - } - - } + SmallVector Preds(pred_begin(ExitBlock), + pred_end(ExitBlock)); + SplitBlockPredecessors(ExitBlock, Preds.data(), Preds.size(), + ".us-lcssa", this); } - } /// UnswitchNontrivialCondition - We determined that the loop is profitable @@ -945,27 +918,35 @@ // FIXME: This is a hack. We need to keep the successor around // and hooked up so as to preserve the loop structure, because // trying to update it is complicated. So instead we preserve the - // loop structure and put the block on an dead code path. - - BasicBlock *SISucc = SI->getSuccessor(i); - BasicBlock* Old = SI->getParent(); - BasicBlock* Split = SplitBlock(Old, SI, this); - - Instruction* OldTerm = Old->getTerminator(); - BranchInst::Create(Split, SISucc, - ConstantInt::getTrue(Context), OldTerm); - - LPM->deleteSimpleAnalysisValue(Old->getTerminator(), L); - Old->getTerminator()->eraseFromParent(); - - PHINode *PN; - for (BasicBlock::iterator II = SISucc->begin(); - (PN = dyn_cast(II)); ++II) { - Value *InVal = PN->removeIncomingValue(Split, false); - PN->addIncoming(InVal, Old); - } - - SI->removeCase(i); + // loop structure and put the block on a dead code path. + BasicBlock *Switch = SI->getParent(); + SplitEdge(Switch, SI->getSuccessor(i), this); + // Compute the successors instead of relying on the return value + // of SplitEdge, since it may have split the switch successor + // after PHI nodes. + BasicBlock *NewSISucc = SI->getSuccessor(i); + BasicBlock *OldSISucc = *succ_begin(NewSISucc); + // Create an "unreachable" destination. + BasicBlock *Abort = BasicBlock::Create(Context, "us-unreachable", + Switch->getParent(), + OldSISucc); + new UnreachableInst(Context, Abort); + // Force the new case destination to branch to the "unreachable" + // block while maintaining a (dead) CFG edge to the old block. + NewSISucc->getTerminator()->eraseFromParent(); + BranchInst::Create(Abort, OldSISucc, + ConstantInt::getTrue(Context), NewSISucc); + // Release the PHI operands for this edge. + for (BasicBlock::iterator II = NewSISucc->begin(); + PHINode *PN = dyn_cast(II); ++II) + PN->setIncomingValue(PN->getBasicBlockIndex(Switch), + UndefValue::get(PN->getType())); + // Tell the domtree about the new block. We don't fully update + // the domtree here -- instead we force it to do a full recomputation + // after the pass is complete -- but we do need to inform it of + // new blocks. + if (DT) + DT->addNewBlock(Abort, NewSISucc); break; } } Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=81221&r1=81220&r2=81221&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Tue Sep 8 10:45:00 2009 @@ -24,6 +24,7 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/Local.h" +#include "llvm/Transforms/Scalar.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ValueHandle.h" #include @@ -319,7 +320,8 @@ ++SplitIt; BasicBlock *New = Old->splitBasicBlock(SplitIt, Old->getName()+".split"); - // The new block lives in whichever loop the old one did. + // The new block lives in whichever loop the old one did. This preserves + // LCSSA as well, because we force the split point to be after any PHI nodes. if (LoopInfo* LI = P->getAnalysisIfAvailable()) if (Loop *L = LI->getLoopFor(Old)) L->addBasicBlockToLoop(New, LI->getBase()); @@ -353,8 +355,12 @@ /// Preds array, which has NumPreds elements in it. The new block is given a /// suffix of 'Suffix'. /// -/// This currently updates the LLVM IR, AliasAnalysis, DominatorTree and -/// DominanceFrontier, but no other analyses. +/// This currently updates the LLVM IR, AliasAnalysis, DominatorTree, +/// DominanceFrontier, LoopInfo, and LCCSA but no other analyses. +/// In particular, it does not preserve LoopSimplify (because it's +/// complicated to handle the case where one of the edges being split +/// is an exit of a loop with other exits). +/// BasicBlock *llvm::SplitBlockPredecessors(BasicBlock *BB, BasicBlock *const *Preds, unsigned NumPreds, const char *Suffix, @@ -366,19 +372,44 @@ // The new block unconditionally branches to the old block. BranchInst *BI = BranchInst::Create(BB, NewBB); + LoopInfo *LI = P ? P->getAnalysisIfAvailable() : 0; + Loop *L = LI ? LI->getLoopFor(BB) : 0; + bool PreserveLCSSA = P->mustPreserveAnalysisID(LCSSAID); + // Move the edges from Preds to point to NewBB instead of BB. - for (unsigned i = 0; i != NumPreds; ++i) + // While here, if we need to preserve loop analyses, collect + // some information about how this split will affect loops. + bool HasLoopExit = false; + bool IsLoopEntry = !!L; + bool SplitMakesNewLoopHeader = false; + for (unsigned i = 0; i != NumPreds; ++i) { Preds[i]->getTerminator()->replaceUsesOfWith(BB, NewBB); - + + if (LI) { + // If we need to preserve LCSSA, determine if any of + // the preds is a loop exit. + if (PreserveLCSSA) + if (Loop *PL = LI->getLoopFor(Preds[i])) + if (!PL->contains(BB)) + HasLoopExit = true; + // If we need to preserve LoopInfo, note whether any of the + // preds crosses an interesting loop boundary. + if (L) { + if (L->contains(Preds[i])) + IsLoopEntry = false; + else + SplitMakesNewLoopHeader = true; + } + } + } + // Update dominator tree and dominator frontier if available. DominatorTree *DT = P ? P->getAnalysisIfAvailable() : 0; if (DT) DT->splitBlock(NewBB); if (DominanceFrontier *DF = P ? P->getAnalysisIfAvailable():0) DF->splitBlock(NewBB); - AliasAnalysis *AA = P ? P->getAnalysisIfAvailable() : 0; - - + // Insert a new PHI node into NewBB for every PHI node in BB and that new PHI // node becomes an incoming value for BB's phi node. However, if the Preds // list is empty, we need to insert dummy entries into the PHI nodes in BB to @@ -389,20 +420,42 @@ cast(I)->addIncoming(UndefValue::get(I->getType()), NewBB); return NewBB; } + + AliasAnalysis *AA = P ? P->getAnalysisIfAvailable() : 0; + + if (L) { + if (IsLoopEntry) { + if (Loop *PredLoop = LI->getLoopFor(Preds[0])) { + // Add the new block to the nearest enclosing loop (and not an + // adjacent loop). + while (PredLoop && !PredLoop->contains(BB)) + PredLoop = PredLoop->getParentLoop(); + if (PredLoop) + PredLoop->addBasicBlockToLoop(NewBB, LI->getBase()); + } + } else { + L->addBasicBlockToLoop(NewBB, LI->getBase()); + if (SplitMakesNewLoopHeader) + L->moveToHeader(NewBB); + } + } // Otherwise, create a new PHI node in NewBB for each PHI node in BB. for (BasicBlock::iterator I = BB->begin(); isa(I); ) { PHINode *PN = cast(I++); // Check to see if all of the values coming in are the same. If so, we - // don't need to create a new PHI node. - Value *InVal = PN->getIncomingValueForBlock(Preds[0]); - for (unsigned i = 1; i != NumPreds; ++i) - if (InVal != PN->getIncomingValueForBlock(Preds[i])) { - InVal = 0; - break; - } - + // don't need to create a new PHI node, unless it's needed for LCSSA. + Value *InVal = 0; + if (!HasLoopExit) { + InVal = PN->getIncomingValueForBlock(Preds[0]); + for (unsigned i = 1; i != NumPreds; ++i) + if (InVal != PN->getIncomingValueForBlock(Preds[i])) { + InVal = 0; + break; + } + } + if (InVal) { // If all incoming values for the new PHI would be the same, just don't // make a new PHI. Instead, just remove the incoming values from the old @@ -427,13 +480,6 @@ // Add an incoming value to the PHI node in the loop for the preheader // edge. PN->addIncoming(InVal, NewBB); - - // Check to see if we can eliminate this phi node. - if (Value *V = PN->hasConstantValue(DT)) { - PN->replaceAllUsesWith(V); - if (AA) AA->deleteValue(PN); - PN->eraseFromParent(); - } } return NewBB; Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=81221&r1=81220&r2=81221&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Tue Sep 8 10:45:00 2009 @@ -122,9 +122,9 @@ /// false otherwise. This ensures that all edges to that dest go to one block /// instead of each going to a different block. // -bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P, - bool MergeIdenticalEdges) { - if (!isCriticalEdge(TI, SuccNum, MergeIdenticalEdges)) return false; +BasicBlock *llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, + Pass *P, bool MergeIdenticalEdges) { + if (!isCriticalEdge(TI, SuccNum, MergeIdenticalEdges)) return 0; BasicBlock *TIBB = TI->getParent(); BasicBlock *DestBB = TI->getSuccessor(SuccNum); @@ -172,7 +172,7 @@ // If we don't have a pass object, we can't update anything... - if (P == 0) return true; + if (P == 0) return NewBB; // Now update analysis information. Since the only predecessor of NewBB is // the TIBB, TIBB clearly dominates NewBB. TIBB usually doesn't dominate @@ -254,9 +254,9 @@ // Update LoopInfo if it is around. if (LoopInfo *LI = P->getAnalysisIfAvailable()) { - // If one or the other blocks were not in a loop, the new block is not - // either, and thus LI doesn't need to be updated. - if (Loop *TIL = LI->getLoopFor(TIBB)) + if (Loop *TIL = LI->getLoopFor(TIBB)) { + // If one or the other blocks were not in a loop, the new block is not + // either, and thus LI doesn't need to be updated. if (Loop *DestLoop = LI->getLoopFor(DestBB)) { if (TIL == DestLoop) { // Both in the same loop, the NewBB joins loop. @@ -278,6 +278,65 @@ P->addBasicBlockToLoop(NewBB, LI->getBase()); } } + // If TIBB is in a loop and DestBB is outside of that loop, split the + // other exit blocks of the loop that also have predecessors outside + // the loop, to maintain a LoopSimplify guarantee. + if (!TIL->contains(DestBB) && + P->mustPreserveAnalysisID(LoopSimplifyID)) { + // For each unique exit block... + SmallVector ExitBlocks; + TIL->getExitBlocks(ExitBlocks); + for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) { + // Collect all the preds that are inside the loop, and note + // whether there are any preds outside the loop. + SmallVector Preds; + bool AllPredsInLoop = false; + BasicBlock *Exit = ExitBlocks[i]; + for (pred_iterator I = pred_begin(Exit), E = pred_end(Exit); + I != E; ++I) + if (TIL->contains(*I)) + Preds.push_back(*I); + else + AllPredsInLoop = true; + // If there are any preds not in the loop, we'll need to split + // the edges. The Preds.empty() check is needed because a block + // may appear multiple times in the list. We can't use + // getUniqueExitBlocks above because that depends on LoopSimplify + // form, which we're in the process of restoring! + if (Preds.empty() || !AllPredsInLoop) continue; + BasicBlock *NewBB = SplitBlockPredecessors(Exit, + Preds.data(), Preds.size(), + "split", P); + // Update LCSSA form by creating new PHIs in the new exit blocks + // as needed. + if (P->mustPreserveAnalysisID(LCSSAID)) + for (BasicBlock::iterator I = Exit->begin(); + PHINode *PN = dyn_cast(I); ++I) { + unsigned Idx = PN->getBasicBlockIndex(NewBB); + Value *V = PN->getIncomingValue(Idx); + // If the PHI is already suitable, don't create a new one. + if (PHINode *VP = dyn_cast(V)) + if (VP->getParent() == NewBB) + continue; + // A new PHI is needed. Create one and populate it. + PHINode *NewPN = + PHINode::Create(PN->getType(), "split", NewBB->getTerminator()); + for (unsigned i = 0, e = Preds.size(); i != e; ++i) + NewPN->addIncoming(V, Preds[i]); + PN->setIncomingValue(Idx, NewPN); + } + } + } + // LCSSA form was updated above for the case where LoopSimplify is + // available, which means that all predecessors of loop exit blocks + // are within the loop. Without LoopSimplify form, it would be + // necessary to insert a new phi. + assert((!P->mustPreserveAnalysisID(LCSSAID) || + P->mustPreserveAnalysisID(LoopSimplifyID)) && + "SplitCriticalEdge doesn't know how to update LCCSA form " + "without LoopSimplify!"); + } } - return true; + + return NewBB; } Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=81221&r1=81220&r2=81221&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Tue Sep 8 10:45:00 2009 @@ -58,6 +58,7 @@ DominatorTree *DT; std::vector LoopBlocks; PredIteratorCache PredCache; + Loop *L; virtual bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -72,9 +73,9 @@ AU.setPreservesCFG(); AU.addRequiredID(LoopSimplifyID); AU.addPreservedID(LoopSimplifyID); - AU.addRequired(); + AU.addRequiredTransitive(); AU.addPreserved(); - AU.addRequired(); + AU.addRequiredTransitive(); AU.addPreserved(); AU.addPreserved(); @@ -86,6 +87,15 @@ AU.addPreserved(); } private: + + /// verifyAnalysis() - Verify loop nest. + virtual void verifyAnalysis() const { +#ifndef NDEBUG + // Check the special guarantees that LCSSA makes. + assert(L->isLCSSAForm()); +#endif + } + void getLoopValuesUsedOutsideLoop(Loop *L, SetVector &AffectedValues, const SmallVector& exitBlocks); @@ -107,7 +117,8 @@ const PassInfo *const llvm::LCSSAID = &X; /// runOnFunction - Process all loops in the function, inner-most out. -bool LCSSA::runOnLoop(Loop *L, LPPassManager &LPM) { +bool LCSSA::runOnLoop(Loop *l, LPPassManager &LPM) { + L = l; PredCache.clear(); LI = &LPM.getAnalysis(); Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=81221&r1=81220&r2=81221&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Tue Sep 8 10:45:00 2009 @@ -69,8 +69,8 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { // We need loop information to identify the loops... - AU.addRequired(); - AU.addRequired(); + AU.addRequiredTransitive(); + AU.addRequiredTransitive(); AU.addPreserved(); AU.addPreserved(); @@ -83,9 +83,11 @@ void verifyAnalysis() const { #ifndef NDEBUG LoopInfo *NLI = &getAnalysis(); - for (LoopInfo::iterator I = NLI->begin(), E = NLI->end(); I != E; ++I) - (*I)->verifyLoop(); -#endif + for (LoopInfo::iterator I = NLI->begin(), E = NLI->end(); I != E; ++I) { + // Check the special guarantees that LoopSimplify makes. + assert((*I)->isLoopSimplifyForm()); + } +#endif } private: @@ -346,15 +348,6 @@ BasicBlock *NewBB = SplitBlockPredecessors(Header, &OutsideBlocks[0], OutsideBlocks.size(), ".preheader", this); - - - //===--------------------------------------------------------------------===// - // Update analysis results now that we have performed the transformation - // - - // We know that we have loop information to update... update it now. - if (Loop *Parent = L->getParentLoop()) - Parent->addBasicBlockToLoop(NewBB, LI->getBase()); // Make sure that NewBB is put someplace intelligent, which doesn't mess up // code layout too horribly. @@ -377,17 +370,6 @@ LoopBlocks.size(), ".loopexit", this); - // Update Loop Information - we know that the new block will be in whichever - // loop the Exit block is in. Note that it may not be in that immediate loop, - // if the successor is some other loop header. In that case, we continue - // walking up the loop tree to find a loop that contains both the successor - // block and the predecessor block. - Loop *SuccLoop = LI->getLoopFor(Exit); - while (SuccLoop && !SuccLoop->contains(L->getHeader())) - SuccLoop = SuccLoop->getParentLoop(); - if (SuccLoop) - SuccLoop->addBasicBlockToLoop(NewBB, LI->getBase()); - return NewBB; } @@ -521,10 +503,6 @@ else LI->changeTopLevelLoop(L, NewOuter); - // This block is going to be our new header block: add it to this loop and all - // parent loops. - NewOuter->addBasicBlockToLoop(NewBB, LI->getBase()); - // L is now a subloop of our outer loop. NewOuter->addChildLoop(L); @@ -532,6 +510,10 @@ I != E; ++I) NewOuter->addBlockEntry(*I); + // Now reset the header in L, which had been moved by + // SplitBlockPredecessors for the outer loop. + L->moveToHeader(Header); + // Determine which blocks should stay in L and which should be moved out to // the Outer loop now. std::set BlocksInL; Removed: llvm/trunk/test/Transforms/LoopUnswitch/2009-09-05-DomAssert.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnswitch/2009-09-05-DomAssert.ll?rev=81220&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopUnswitch/2009-09-05-DomAssert.ll (original) +++ llvm/trunk/test/Transforms/LoopUnswitch/2009-09-05-DomAssert.ll (removed) @@ -1,52 +0,0 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -disable-output -; rdar://7197574 - -target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32" -target triple = "thumbv7-apple-darwin9" - %struct.frame = type { i16*, i16*, i16* } - -declare arm_apcscc i32 @ercCollect8PredBlocks(i32* nocapture, i32, i32, i32* nocapture, i32, i32, i32, i8 zeroext) nounwind - -define arm_apcscc void @concealBlocks(i32 %lastColumn, i32 %lastRow, i32 %comp, %struct.frame* nocapture %recfr, i32 %picSizeX, i32* nocapture %condition) nounwind { -entry: - br i1 undef, label %bb.nph12, label %return - -bb28: ; preds = %bb.nph12 - unreachable - -bb42: ; preds = %bb.nph12 - br label %bb43 - -bb43: ; preds = %bb61, %bb42 - %0 = call arm_apcscc i32 @ercCollect8PredBlocks(i32* undef, i32 undef, i32 0, i32* %condition, i32 %lastRow, i32 %lastColumn, i32 undef, i8 zeroext 1) nounwind ; [#uses=0] - switch i32 %comp, label %bb58 [ - i32 0, label %bb52 - i32 1, label %bb54 - i32 2, label %bb56 - ] - -bb52: ; preds = %bb43 - br label %bb58 - -bb54: ; preds = %bb43 - br label %bb58 - -bb56: ; preds = %bb43 - unreachable - -bb58: ; preds = %bb54, %bb52, %bb43 - br i1 %1, label %bb59, label %bb61 - -bb59: ; preds = %bb58 - br label %bb61 - -bb61: ; preds = %bb59, %bb58 - br label %bb43 - -bb.nph12: ; preds = %entry - %1 = icmp eq i32 %comp, 0 ; [#uses=1] - br i1 undef, label %bb28, label %bb42 - -return: ; preds = %entry - ret void -} Added: llvm/trunk/test/Transforms/LoopUnswitch/preserve-analyses.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnswitch/preserve-analyses.ll?rev=81221&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopUnswitch/preserve-analyses.ll (added) +++ llvm/trunk/test/Transforms/LoopUnswitch/preserve-analyses.ll Tue Sep 8 10:45:00 2009 @@ -0,0 +1,645 @@ +; RUN: opt -loop-unswitch %s -disable-output + +; Loop unswitch should be able to unswitch these loops and +; preserve LCSSA and LoopSimplify forms. + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64" +target triple = "armv6-apple-darwin9" + +%struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } +%struct._RuneCharClass = type { [14 x i8], i32 } +%struct._RuneEntry = type { i32, i32, i32, i32* } +%struct._RuneLocale = type { [8 x i8], [32 x i8], i32 (i8*, i32, i8**)*, i32 (i32, i8*, i32, i8**)*, i32, [256 x i32], [256 x i32], [256 x i32], %struct._RuneRange, %struct._RuneRange, %struct._RuneRange, i8*, i32, i32, %struct._RuneCharClass* } +%struct._RuneRange = type { i32, %struct._RuneEntry* } +%struct.__sFILEX = type opaque +%struct.__sbuf = type { i8*, i32 } +%struct.colstr = type { i8*, i8* } +%struct.optstr = type { i8*, i32* } + + at expflg = external global i32 ; [#uses=0] + at ctrflg = external global i32 ; [#uses=0] + at boxflg = external global i32 ; [#uses=0] + at dboxflg = external global i32 ; [#uses=0] + at tab = external global i32 ; [#uses=0] + at F1 = external global i32 ; [#uses=0] + at F2 = external global i32 ; [#uses=0] + at allflg = external global i32 ; [#uses=0] + at leftover = external global i32 ; [#uses=0] + at textflg = external global i32 ; [#uses=0] + at left1flg = external global i32 ; [#uses=0] + at rightl = external global i32 ; [#uses=0] + at iline = external global i32 ; [#uses=0] + at ifile = external global i8* ; [#uses=0] + at .str = external constant [6 x i8], align 1 ; <[6 x i8]*> [#uses=0] + at texname = external global i32 ; [#uses=0] + at texct = external global i32 ; [#uses=0] + at texstr = external global [63 x i8], align 4 ; <[63 x i8]*> [#uses=0] + at nlin = external global i32 ; [#uses=0] + at ncol = external global i32 ; [#uses=0] + at nclin = external global i32 ; [#uses=0] + at nslin = external global i32 ; [#uses=0] + at style = external global [100 x [20 x i32]] ; <[100 x [20 x i32]]*> [#uses=0] + at ctop = external global [100 x [20 x i32]] ; <[100 x [20 x i32]]*> [#uses=0] + at font = external global [100 x [20 x [2 x i8]]] ; <[100 x [20 x [2 x i8]]]*> [#uses=0] + at csize = external global [100 x [20 x [4 x i8]]] ; <[100 x [20 x [4 x i8]]]*> [#uses=0] + at vsize = external global [100 x [20 x [4 x i8]]] ; <[100 x [20 x [4 x i8]]]*> [#uses=0] + at cll = external global [20 x [10 x i8]] ; <[20 x [10 x i8]]*> [#uses=0] + at stynum = external global [201 x i32] ; <[201 x i32]*> [#uses=0] + at lefline = external global [100 x [20 x i32]] ; <[100 x [20 x i32]]*> [#uses=0] + at fullbot = external global [200 x i32] ; <[200 x i32]*> [#uses=0] + at instead = external global [200 x i8*] ; <[200 x i8*]*> [#uses=0] + at evenflg = external global i32 ; [#uses=0] + at evenup = external global [20 x i32] ; <[20 x i32]*> [#uses=0] + at linsize = external global i32 ; [#uses=0] + at pr1403 = external global i32 ; [#uses=0] + at delim1 = external global i32 ; [#uses=1] + at delim2 = external global i32 ; [#uses=1] + at table = external global [200 x %struct.colstr*] ; <[200 x %struct.colstr*]*> [#uses=0] + at cspace = external global i8* ; [#uses=0] + at cstore = external global i8* ; [#uses=0] + at exstore = external global i8* ; [#uses=0] + at exlim = external global i8* ; [#uses=0] + at sep = external global [20 x i32] ; <[20 x i32]*> [#uses=0] + at used = external global [20 x i32] ; <[20 x i32]*> [#uses=0] + at lused = external global [20 x i32] ; <[20 x i32]*> [#uses=0] + at rused = external global [20 x i32] ; <[20 x i32]*> [#uses=0] + at linestop = external global [200 x i32] ; <[200 x i32]*> [#uses=0] + at last = external global i8* ; [#uses=0] + at linstart = external global i32 ; [#uses=0] + at tabin = external global %struct.FILE* ; <%struct.FILE**> [#uses=0] + at tabout = external global %struct.FILE* ; <%struct.FILE**> [#uses=0] + at sargc = external global i32 ; [#uses=0] + at sargv = external global i8** ; [#uses=0] + at .str1 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str12 = external constant [16 x i8], align 1 ; <[16 x i8]*> [#uses=0] + at .str2 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str3 = external constant [16 x i8], align 1 ; <[16 x i8]*> [#uses=0] + at .str4 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str5 = external constant [2 x i8], align 1 ; <[2 x i8]*> [#uses=0] + at .str6 = external constant [16 x i8], align 1 ; <[16 x i8]*> [#uses=0] + at __stdinp = external global %struct.FILE* ; <%struct.FILE**> [#uses=0] + at __stdoutp = external global %struct.FILE* ; <%struct.FILE**> [#uses=0] + at .str7 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str8 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at options = external global [21 x %struct.optstr] ; <[21 x %struct.optstr]*> [#uses=0] + at .str9 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str110 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str211 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str312 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str413 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str514 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str615 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str716 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str817 = external constant [10 x i8], align 1 ; <[10 x i8]*> [#uses=0] + at .str918 = external constant [10 x i8], align 1 ; <[10 x i8]*> [#uses=0] + at .str10 = external constant [6 x i8], align 1 ; <[6 x i8]*> [#uses=0] + at .str11 = external constant [6 x i8], align 1 ; <[6 x i8]*> [#uses=0] + at .str1219 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str13 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str14 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str15 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str16 = external constant [9 x i8], align 1 ; <[9 x i8]*> [#uses=0] + at .str17 = external constant [9 x i8], align 1 ; <[9 x i8]*> [#uses=0] + at .str18 = external constant [6 x i8], align 1 ; <[6 x i8]*> [#uses=0] + at .str19 = external constant [6 x i8], align 1 ; <[6 x i8]*> [#uses=0] + at .str20 = external constant [14 x i8], align 1 ; <[14 x i8]*> [#uses=0] + at .str21 = external constant [25 x i8], align 1 ; <[25 x i8]*> [#uses=0] + at .str22 = external constant [11 x i8], align 1 ; <[11 x i8]*> [#uses=0] + at .str23 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str24 = external constant [34 x i8], align 1 ; <[34 x i8]*> [#uses=0] + at .str125 = external constant [32 x i8], align 1 ; <[32 x i8]*> [#uses=0] + at .str226 = external constant [17 x i8], align 1 ; <[17 x i8]*> [#uses=0] + at .str327 = external constant [38 x i8], align 1 ; <[38 x i8]*> [#uses=0] + at oncol = external global i32 ; [#uses=0] + at .str428 = external constant [40 x i8], align 1 ; <[40 x i8]*> [#uses=0] + at .str529 = external constant [31 x i8], align 1 ; <[31 x i8]*> [#uses=0] + at .str630 = external constant [51 x i8], align 1 ; <[51 x i8]*> [#uses=0] + at .str731 = external constant [51 x i8], align 1 ; <[51 x i8]*> [#uses=0] + at .str832 = external constant [40 x i8], align 1 ; <[40 x i8]*> [#uses=0] + at .str933 = external constant [26 x i8], align 1 ; <[26 x i8]*> [#uses=0] + at .str1034 = external constant [24 x i8], align 1 ; <[24 x i8]*> [#uses=0] + at .str1135 = external constant [21 x i8], align 1 ; <[21 x i8]*> [#uses=0] + at .str1236 = external constant [24 x i8], align 1 ; <[24 x i8]*> [#uses=0] + at .str1337 = external constant [33 x i8], align 1 ; <[33 x i8]*> [#uses=0] + at .str1438 = external constant [22 x i8], align 1 ; <[22 x i8]*> [#uses=0] + at .str1539 = external constant [32 x i8], align 1 ; <[32 x i8]*> [#uses=0] + at .str1640 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str1741 = external constant [6 x i8], align 1 ; <[6 x i8]*> [#uses=0] + at _DefaultRuneLocale = external global %struct._RuneLocale ; <%struct._RuneLocale*> [#uses=0] + at .str43 = external constant [3 x i8], align 1 ; <[3 x i8]*> [#uses=0] + at .str144 = external constant [43 x i8], align 1 ; <[43 x i8]*> [#uses=0] + at .str245 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str346 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str447 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str548 = external constant [3 x i8], align 1 ; <[3 x i8]*> [#uses=0] + at .str649 = external constant [1 x i8], align 1 ; <[1 x i8]*> [#uses=0] + at .str51 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str152 = external constant [2 x i8], align 1 ; <[2 x i8]*> [#uses=0] + at .str253 = external constant [2 x i8], align 1 ; <[2 x i8]*> [#uses=0] + at .str354 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str455 = external constant [10 x i8], align 1 ; <[10 x i8]*> [#uses=0] + at .str556 = external constant [16 x i8], align 1 ; <[16 x i8]*> [#uses=0] + at .str657 = external constant [19 x i8], align 1 ; <[19 x i8]*> [#uses=0] + at .str758 = external constant [32 x i8], align 1 ; <[32 x i8]*> [#uses=0] + at .str859 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str960 = external constant [30 x i8], align 1 ; <[30 x i8]*> [#uses=0] + at .str1061 = external constant [17 x i8], align 1 ; <[17 x i8]*> [#uses=0] + at .str1162 = external constant [35 x i8], align 1 ; <[35 x i8]*> [#uses=0] + at .str1263 = external constant [14 x i8], align 1 ; <[14 x i8]*> [#uses=0] + at .str1364 = external constant [20 x i8], align 1 ; <[20 x i8]*> [#uses=0] + at .str1465 = external constant [30 x i8], align 1 ; <[30 x i8]*> [#uses=0] + at .str1566 = external constant [41 x i8], align 1 ; <[41 x i8]*> [#uses=0] + at .str1667 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str1768 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str1869 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str1970 = external constant [29 x i8], align 1 ; <[29 x i8]*> [#uses=0] + at .str2071 = external constant [22 x i8], align 1 ; <[22 x i8]*> [#uses=0] + at .str2172 = external constant [17 x i8], align 1 ; <[17 x i8]*> [#uses=0] + at .str2273 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str2374 = external constant [36 x i8], align 1 ; <[36 x i8]*> [#uses=0] + at .str2475 = external constant [9 x i8], align 1 ; <[9 x i8]*> [#uses=0] + at .str25 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str26 = external constant [20 x i8], align 1 ; <[20 x i8]*> [#uses=0] + at .str27 = external constant [17 x i8], align 1 ; <[17 x i8]*> [#uses=0] + at .str28 = external constant [11 x i8], align 1 ; <[11 x i8]*> [#uses=0] + at .str29 = external constant [25 x i8], align 1 ; <[25 x i8]*> [#uses=0] + at .str30 = external constant [24 x i8], align 1 ; <[24 x i8]*> [#uses=0] + at .str31 = external constant [14 x i8], align 1 ; <[14 x i8]*> [#uses=0] + at .str32 = external constant [18 x i8], align 1 ; <[18 x i8]*> [#uses=0] + at .str33 = external constant [79 x i8], align 1 ; <[79 x i8]*> [#uses=0] + at .str77 = external constant [13 x i8], align 1 ; <[13 x i8]*> [#uses=0] + at .str178 = external constant [13 x i8], align 1 ; <[13 x i8]*> [#uses=0] + at .str279 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str380 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str481 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str582 = external constant [11 x i8], align 1 ; <[11 x i8]*> [#uses=0] + at .str683 = external constant [33 x i8], align 1 ; <[33 x i8]*> [#uses=0] + at .str784 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str885 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str986 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str1087 = external constant [28 x i8], align 1 ; <[28 x i8]*> [#uses=0] + at .str1188 = external constant [29 x i8], align 1 ; <[29 x i8]*> [#uses=0] + at .str1289 = external constant [11 x i8], align 1 ; <[11 x i8]*> [#uses=0] + at .str1390 = external constant [16 x i8], align 1 ; <[16 x i8]*> [#uses=0] + at .str1491 = external constant [22 x i8], align 1 ; <[22 x i8]*> [#uses=0] + at .str1592 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str1693 = external constant [13 x i8], align 1 ; <[13 x i8]*> [#uses=0] + at .str1794 = external constant [21 x i8], align 1 ; <[21 x i8]*> [#uses=0] + at .str1895 = external constant [25 x i8], align 1 ; <[25 x i8]*> [#uses=0] + at .str1996 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str2097 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str2198 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str2299 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str23100 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str24101 = external constant [14 x i8], align 1 ; <[14 x i8]*> [#uses=0] + at .str25102 = external constant [32 x i8], align 1 ; <[32 x i8]*> [#uses=0] + at .str26103 = external constant [11 x i8], align 1 ; <[11 x i8]*> [#uses=0] + at .str27104 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str28105 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str29106 = external constant [10 x i8], align 1 ; <[10 x i8]*> [#uses=0] + at .str30107 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str31108 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str111 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str1112 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str2113 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str3114 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str4115 = external constant [14 x i8], align 1 ; <[14 x i8]*> [#uses=0] + at .str5116 = external constant [16 x i8], align 1 ; <[16 x i8]*> [#uses=0] + at .str6117 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str7118 = external constant [28 x i8], align 1 ; <[28 x i8]*> [#uses=0] + at .str8119 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str9120 = external constant [16 x i8], align 1 ; <[16 x i8]*> [#uses=0] + at .str10121 = external constant [13 x i8], align 1 ; <[13 x i8]*> [#uses=0] + at .str11122 = external constant [14 x i8], align 1 ; <[14 x i8]*> [#uses=0] + at .str12123 = external constant [32 x i8], align 1 ; <[32 x i8]*> [#uses=0] + at .str13124 = external constant [27 x i8], align 1 ; <[27 x i8]*> [#uses=0] + at .str14125 = external constant [6 x i8], align 1 ; <[6 x i8]*> [#uses=0] + at .str15126 = external constant [13 x i8], align 1 ; <[13 x i8]*> [#uses=0] + at .str16127 = external constant [2 x i8], align 1 ; <[2 x i8]*> [#uses=0] + at .str17128 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str18129 = external constant [30 x i8], align 1 ; <[30 x i8]*> [#uses=0] + at .str19130 = external constant [13 x i8], align 1 ; <[13 x i8]*> [#uses=0] + at .str20131 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str21132 = external constant [9 x i8], align 1 ; <[9 x i8]*> [#uses=0] + at .str22133 = external constant [2 x i8], align 1 ; <[2 x i8]*> [#uses=0] + at watchout = external global i32 ; [#uses=0] + at once = external global i32 ; [#uses=0] + at .str23134 = external constant [20 x i8], align 1 ; <[20 x i8]*> [#uses=0] + at .str24135 = external constant [9 x i8], align 1 ; <[9 x i8]*> [#uses=0] + at .str25136 = external constant [18 x i8], align 1 ; <[18 x i8]*> [#uses=0] + at .str26137 = external constant [14 x i8], align 1 ; <[14 x i8]*> [#uses=0] + at .str27138 = external constant [63 x i8], align 1 ; <[63 x i8]*> [#uses=0] + at .str28139 = external constant [61 x i8], align 1 ; <[61 x i8]*> [#uses=0] + at .str29140 = external constant [14 x i8], align 1 ; <[14 x i8]*> [#uses=0] + at .str30141 = external constant [19 x i8], align 1 ; <[19 x i8]*> [#uses=0] + at .str31142 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str32143 = external constant [11 x i8], align 1 ; <[11 x i8]*> [#uses=0] + at .str33144 = external constant [3 x i8], align 1 ; <[3 x i8]*> [#uses=0] + at .str34 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str35 = external constant [23 x i8], align 1 ; <[23 x i8]*> [#uses=0] + at .str36 = external constant [23 x i8], align 1 ; <[23 x i8]*> [#uses=0] + at .str37 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at __stderrp = external global %struct.FILE* ; <%struct.FILE**> [#uses=0] + at .str38 = external constant [44 x i8], align 1 ; <[44 x i8]*> [#uses=0] + at .str39 = external constant [16 x i8], align 1 ; <[16 x i8]*> [#uses=0] + at topat = external global [20 x i32] ; <[20 x i32]*> [#uses=0] + at .str40 = external constant [22 x i8], align 1 ; <[22 x i8]*> [#uses=0] + at .str41 = external constant [10 x i8], align 1 ; <[10 x i8]*> [#uses=0] + at .str42 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str43145 = external constant [16 x i8], align 1 ; <[16 x i8]*> [#uses=0] + at .str149 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at useln = external global i32 ; [#uses=0] + at .str1150 = external constant [1 x i8], align 1 ; <[1 x i8]*> [#uses=0] + at .str2151 = external constant [26 x i8], align 1 ; <[26 x i8]*> [#uses=0] + at .str3152 = external constant [32 x i8], align 1 ; <[32 x i8]*> [#uses=0] + at spcount = external global i32 ; [#uses=0] + at tpcount = external global i32 ; [#uses=0] + at thisvec = external global i8* ; [#uses=0] + at tpvecs = external global [50 x i8*] ; <[50 x i8*]*> [#uses=0] + at .str156 = external constant [21 x i8], align 1 ; <[21 x i8]*> [#uses=0] + at spvecs = external global [20 x i8*] ; <[20 x i8*]*> [#uses=0] + at .str1157 = external constant [29 x i8], align 1 ; <[29 x i8]*> [#uses=0] + at .str2158 = external constant [24 x i8], align 1 ; <[24 x i8]*> [#uses=0] + at .str164 = external constant [71 x i8], align 1 ; <[71 x i8]*> [#uses=0] + at .str1165 = external constant [71 x i8], align 1 ; <[71 x i8]*> [#uses=0] + at .str2166 = external constant [47 x i8], align 1 ; <[47 x i8]*> [#uses=0] + at .str169 = external constant [18 x i8], align 1 ; <[18 x i8]*> [#uses=0] + at backp = external global i8* ; [#uses=0] + at backup = external global [500 x i8] ; <[500 x i8]*> [#uses=0] + at .str1170 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str2171 = external constant [16 x i8], align 1 ; <[16 x i8]*> [#uses=0] + at .str176 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str1177 = external constant [35 x i8], align 1 ; <[35 x i8]*> [#uses=0] + at .str2178 = external constant [11 x i8], align 1 ; <[11 x i8]*> [#uses=0] + at .str3179 = external constant [33 x i8], align 1 ; <[33 x i8]*> [#uses=0] + at .str4180 = external constant [36 x i8], align 1 ; <[36 x i8]*> [#uses=0] + at .str5181 = external constant [11 x i8], align 1 ; <[11 x i8]*> [#uses=0] + at .str6182 = external constant [9 x i8], align 1 ; <[9 x i8]*> [#uses=0] + at .str7183 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str8184 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str9185 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str10186 = external constant [11 x i8], align 1 ; <[11 x i8]*> [#uses=0] + at .str11187 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str12188 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str13189 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str14190 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str15191 = external constant [17 x i8], align 1 ; <[17 x i8]*> [#uses=0] + at .str16192 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str17193 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str18194 = external constant [10 x i8], align 1 ; <[10 x i8]*> [#uses=0] + at .str19195 = external constant [19 x i8], align 1 ; <[19 x i8]*> [#uses=0] + at .str203 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str1204 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str2205 = external constant [31 x i8], align 1 ; <[31 x i8]*> [#uses=0] + at .str3206 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str4207 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str5208 = external constant [10 x i8], align 1 ; <[10 x i8]*> [#uses=0] + at .str6209 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str7210 = external constant [9 x i8], align 1 ; <[9 x i8]*> [#uses=0] + at .str8211 = external constant [21 x i8], align 1 ; <[21 x i8]*> [#uses=0] + at .str9212 = external constant [11 x i8], align 1 ; <[11 x i8]*> [#uses=0] + at .str10213 = external constant [14 x i8], align 1 ; <[14 x i8]*> [#uses=0] + at .str11214 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str12215 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str13216 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str14217 = external constant [37 x i8], align 1 ; <[37 x i8]*> [#uses=0] + at .str15218 = external constant [9 x i8], align 1 ; <[9 x i8]*> [#uses=0] + at .str16219 = external constant [20 x i8], align 1 ; <[20 x i8]*> [#uses=0] + at .str17220 = external constant [28 x i8], align 1 ; <[28 x i8]*> [#uses=0] + at .str18221 = external constant [9 x i8], align 1 ; <[9 x i8]*> [#uses=0] + at .str19222 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str20223 = external constant [3 x i8], align 1 ; <[3 x i8]*> [#uses=0] + at .str21224 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str22225 = external constant [11 x i8], align 1 ; <[11 x i8]*> [#uses=0] + at .str23226 = external constant [13 x i8], align 1 ; <[13 x i8]*> [#uses=0] + at .str24227 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str25228 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str26229 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str27230 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str28231 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str242 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str1243 = external constant [25 x i8], align 1 ; <[25 x i8]*> [#uses=0] + at .str252 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str1253 = external constant [1 x i8], align 1 ; <[1 x i8]*> [#uses=0] + at .str2254 = external constant [9 x i8], align 1 ; <[9 x i8]*> [#uses=0] + at .str3255 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str4256 = external constant [3 x i8], align 1 ; <[3 x i8]*> [#uses=0] + at .str5257 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str6258 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str7259 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str8260 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str9261 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str10262 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str11263 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str12264 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str13265 = external constant [2 x i8], align 1 ; <[2 x i8]*> [#uses=0] + at .str14266 = external constant [5 x i8], align 1 ; <[5 x i8]*> [#uses=0] + at .str15267 = external constant [16 x i8], align 1 ; <[16 x i8]*> [#uses=0] + at .str16268 = external constant [29 x i8], align 1 ; <[29 x i8]*> [#uses=0] + at .str17269 = external constant [14 x i8], align 1 ; <[14 x i8]*> [#uses=0] + at .str18270 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str19271 = external constant [9 x i8], align 1 ; <[9 x i8]*> [#uses=0] + at .str20272 = external constant [32 x i8], align 1 ; <[32 x i8]*> [#uses=0] + at .str21273 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str282 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str1283 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str2284 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str3285 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str4286 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str5287 = external constant [8 x i8], align 1 ; <[8 x i8]*> [#uses=0] + at .str6288 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str7289 = external constant [12 x i8], align 1 ; <[12 x i8]*> [#uses=0] + at .str8290 = external constant [3 x i8], align 1 ; <[3 x i8]*> [#uses=0] + at .str9291 = external constant [7 x i8], align 1 ; <[7 x i8]*> [#uses=0] + at .str10292 = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=0] + at .str11293 = external constant [6 x i8], align 1 ; <[6 x i8]*> [#uses=0] + at .str12294 = external constant [2 x i8], align 1 ; <[2 x i8]*> [#uses=0] + at .str13295 = external constant [1 x i8], align 1 ; <[1 x i8]*> [#uses=0] + at .str14296 = external constant [6 x i8], align 1 ; <[6 x i8]*> [#uses=0] + at .str15297 = external constant [28 x i8], align 1 ; <[28 x i8]*> [#uses=0] + at .str16298 = external constant [4 x i8], align 1 ; <[4 x i8]*> [#uses=0] + at .str17299 = external constant [14 x i8], align 1 ; <[14 x i8]*> [#uses=0] + +declare arm_apcscc void @main(i32, i8**) noreturn nounwind + +declare arm_apcscc i32 @swapin() nounwind + +declare arm_apcscc %struct.FILE* @"\01_fopen"(i8*, i8*) + +declare arm_apcscc void @setinp(i32, i8**) nounwind + +declare arm_apcscc i32 @tbl(i32, i8**) nounwind + +declare arm_apcscc i32 @fprintf(%struct.FILE* nocapture, i8* nocapture, ...) nounwind + +declare arm_apcscc i32 @fclose(%struct.FILE* nocapture) nounwind + +declare arm_apcscc void @exit(i32) noreturn nounwind + +declare arm_apcscc void @tableput() nounwind + +declare arm_apcscc void @init_options() nounwind + +declare arm_apcscc void @backrest(i8*) nounwind + +declare arm_apcscc void @getcomm() nounwind + +declare arm_apcscc i32 @printf(i8* nocapture, ...) nounwind + +declare arm_apcscc i8* @strchr(i8*, i32) nounwind readonly + +declare arm_apcscc i32 @strlen(i8* nocapture) nounwind readonly + +declare arm_apcscc void @getspec() nounwind + +declare arm_apcscc void @readspec() nounwind + +declare arm_apcscc i32 @"\01_fwrite"(i8*, i32, i32, i8*) + +declare arm_apcscc i32 @atoi(i8* nocapture) nounwind readonly + +declare arm_apcscc i32 @fputc(i32, i8* nocapture) nounwind + +declare arm_apcscc void @gettbl() nounwind + +declare arm_apcscc i32 @vspen(i8*) nounwind readonly + +declare arm_apcscc i32 @vspand(i32, i32, i32) nounwind readonly + +declare arm_apcscc i32 @oneh(i32) nounwind readonly + +declare arm_apcscc i32 @nodata(i32) nounwind readonly + +declare arm_apcscc i32 @permute() nounwind + +declare arm_apcscc void @maktab() nounwind + +declare arm_apcscc i32 @filler(i8*) nounwind readonly + +declare arm_apcscc void @wide(i8*, i8*, i8*) nounwind + +declare arm_apcscc i32 @"\01_fputs"(i8*, i8*) + +declare arm_apcscc void @runout() nounwind + +declare arm_apcscc void @need() nounwind + +declare arm_apcscc void @deftail() nounwind + +declare arm_apcscc i32 @ifline(i8*) nounwind readonly + +declare arm_apcscc void @runtabs(i32, i32) nounwind + +declare arm_apcscc void @putline(i32, i32) nounwind + +declare arm_apcscc void @putsize(i8*) nounwind + +declare arm_apcscc void @putfont(i8*) nounwind + +declare arm_apcscc i32 @__maskrune(i32, i32) + +declare arm_apcscc void @funnies(i32, i32) nounwind + +declare arm_apcscc void @puttext(i8*, i8*, i8*) nounwind + +declare arm_apcscc i32 @puts(i8* nocapture) nounwind + +declare arm_apcscc void @yetmore() nounwind + +declare arm_apcscc i32 @domore(i8*) nounwind + +declare arm_apcscc void @checkuse() nounwind + +declare arm_apcscc void @release() nounwind + +declare arm_apcscc i32* @alocv(i32) nounwind + +declare arm_apcscc i8* @calloc(...) + +declare arm_apcscc i8* @chspace() nounwind + +declare arm_apcscc i32 @real(i8*) nounwind readonly + +declare arm_apcscc void @choochar() nounwind + +declare arm_apcscc i32 @point(i32) nounwind readnone + +declare arm_apcscc void @error(i8*) nounwind + +declare arm_apcscc i8* @gets1(i8*) nounwind + +declare arm_apcscc i8* @fgets(i8*, i32, %struct.FILE* nocapture) nounwind + +declare arm_apcscc i32 @get1char() nounwind + +declare arm_apcscc i32 @getc(%struct.FILE* nocapture) nounwind + +declare arm_apcscc void @un1getc(i32) nounwind + +declare arm_apcscc void @savefill() nounwind + +declare arm_apcscc void @cleanfc() nounwind + +declare arm_apcscc void @saveline() nounwind + +declare arm_apcscc void @ifdivert() nounwind + +declare arm_apcscc void @restline() nounwind + +declare arm_apcscc void @endoff() nounwind + +declare arm_apcscc void @rstofill() nounwind + +declare arm_apcscc i32 @gettext(i8* nocapture, i32, i32, i8*, i8*) nounwind + +declare arm_apcscc void @untext() nounwind + +declare arm_apcscc i32 @interv(i32, i32) nounwind readonly + +declare arm_apcscc i32 @up1(i32) nounwind readonly + +declare arm_apcscc i32 @interh(i32, i32) nounwind readonly + +declare arm_apcscc i32 @maknew(i8*) nounwind + +define arm_apcscc i32 @ineqn(i8* %s, i8* %p) nounwind readonly { +entry: + %0 = load i32* @delim1, align 4 ; [#uses=1] + %1 = load i32* @delim2, align 4 ; [#uses=1] + br label %bb8.outer + +bb: ; preds = %bb8 + %2 = icmp eq i8* %p_addr.0, %s ; [#uses=1] + br i1 %2, label %bb10, label %bb2 + +bb2: ; preds = %bb + %3 = getelementptr inbounds i8* %p_addr.0, i32 1 ; [#uses=3] + switch i32 %ineq.0.ph, label %bb8.backedge [ + i32 0, label %bb3 + i32 1, label %bb6 + ] + +bb8.backedge: ; preds = %bb6, %bb5, %bb2 + br label %bb8 + +bb3: ; preds = %bb2 + %4 = icmp eq i32 %8, %0 ; [#uses=1] + br i1 %4, label %bb8.outer.loopexit, label %bb5 + +bb5: ; preds = %bb3 + br i1 %6, label %bb6, label %bb8.backedge + +bb6: ; preds = %bb5, %bb2 + %5 = icmp eq i32 %8, %1 ; [#uses=1] + br i1 %5, label %bb7, label %bb8.backedge + +bb7: ; preds = %bb6 + %.lcssa1 = phi i8* [ %3, %bb6 ] ; [#uses=1] + br label %bb8.outer.backedge + +bb8.outer.backedge: ; preds = %bb8.outer.loopexit, %bb7 + %.lcssa2 = phi i8* [ %.lcssa1, %bb7 ], [ %.lcssa, %bb8.outer.loopexit ] ; [#uses=1] + %ineq.0.ph.be = phi i32 [ 0, %bb7 ], [ 1, %bb8.outer.loopexit ] ; [#uses=1] + br label %bb8.outer + +bb8.outer.loopexit: ; preds = %bb3 + %.lcssa = phi i8* [ %3, %bb3 ] ; [#uses=1] + br label %bb8.outer.backedge + +bb8.outer: ; preds = %bb8.outer.backedge, %entry + %ineq.0.ph = phi i32 [ 0, %entry ], [ %ineq.0.ph.be, %bb8.outer.backedge ] ; [#uses=3] + %p_addr.0.ph = phi i8* [ %p, %entry ], [ %.lcssa2, %bb8.outer.backedge ] ; [#uses=1] + %6 = icmp eq i32 %ineq.0.ph, 1 ; [#uses=1] + br label %bb8 + +bb8: ; preds = %bb8.outer, %bb8.backedge + %p_addr.0 = phi i8* [ %p_addr.0.ph, %bb8.outer ], [ %3, %bb8.backedge ] ; [#uses=3] + %7 = load i8* %p_addr.0, align 1 ; [#uses=2] + %8 = sext i8 %7 to i32 ; [#uses=2] + %9 = icmp eq i8 %7, 0 ; [#uses=1] + br i1 %9, label %bb10, label %bb + +bb10: ; preds = %bb8, %bb + %.0 = phi i32 [ %ineq.0.ph, %bb ], [ 0, %bb8 ] ; [#uses=1] + ret i32 %.0 +} + +declare arm_apcscc i32 @match(i8* nocapture, i8* nocapture) nounwind readonly + +declare arm_apcscc i32 @prefix(i8* nocapture, i8* nocapture) nounwind readonly + +declare arm_apcscc i32 @letter(i32) nounwind readnone + +declare arm_apcscc i32 @numb(i8* nocapture) nounwind readonly + +declare arm_apcscc i32 @digit(i32) nounwind readnone + +declare arm_apcscc i32 @max(i32, i32) nounwind readnone + +declare arm_apcscc void @tcopy(i8* nocapture, i8* nocapture) nounwind + +declare arm_apcscc i32 @ctype(i32, i32) nounwind readonly + +declare arm_apcscc i32 @min(i32, i32) nounwind readnone + +declare arm_apcscc i32 @fspan(i32, i32) nounwind readonly + +declare arm_apcscc i32 @lspan(i32, i32) nounwind readonly + +declare arm_apcscc i32 @ctspan(i32, i32) nounwind readonly + +declare arm_apcscc i32 @thish(i32, i32) nounwind readonly + +declare arm_apcscc i32 @allh(i32) nounwind readonly + +declare arm_apcscc void @tohcol(i32) nounwind + +declare arm_apcscc void @makeline(i32, i32, i32) nounwind + +declare arm_apcscc i32 @next(i32) nounwind readonly + +declare arm_apcscc i32 @prev(i32) nounwind readonly + +declare arm_apcscc i32 @lefdata(i32, i32) nounwind readonly + +declare arm_apcscc i32 @left(i32, i32, i32* nocapture) nounwind + +declare arm_apcscc i32 @strcmp(i8* nocapture, i8* nocapture) nounwind readonly + +declare arm_apcscc void @getstop() nounwind + +declare arm_apcscc void @drawline(i32, i32, i32, i32, i32, i32) nounwind + +declare arm_apcscc void @fullwide(i32, i32) nounwind + +declare arm_apcscc void @drawvert(i32, i32, i32, i32) nounwind + +declare arm_apcscc i32 @barent(i8*) nounwind readonly + +declare arm_apcscc i32 @midbcol(i32, i32) nounwind readonly + +declare arm_apcscc i32 @midbar(i32, i32) nounwind readonly + + +; This is a simplified form of ineqn from above. It triggers some +; different cases in the loop-unswitch code. + +define void @simplified_ineqn() nounwind readonly { +entry: + br label %bb8.outer + +bb8.outer: ; preds = %bb6, %bb2, %entry + %x = phi i32 [ 0, %entry ], [ 0, %bb6 ], [ 1, %bb2 ] ; [#uses=1] + br i1 undef, label %return, label %bb2 + +bb2: ; preds = %bb + switch i32 %x, label %bb6 [ + i32 0, label %bb8.outer + ] + +bb6: ; preds = %bb2 + br i1 undef, label %bb8.outer, label %bb2 + +return: ; preds = %bb8, %bb + ret void +} From gohman at apple.com Tue Sep 8 10:52:56 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 08 Sep 2009 15:52:56 -0000 Subject: [llvm-commits] [llvm] r81222 - /llvm/trunk/Makefile.rules Message-ID: <200909081552.n88FquMQ028662@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 8 10:52:56 2009 New Revision: 81222 URL: http://llvm.org/viewvc/llvm-project?rev=81222&view=rev Log: llvm-as is no longer needed here, now that opt can read assembly files directly. Modified: llvm/trunk/Makefile.rules Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=81222&r1=81221&r2=81222&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Tue Sep 8 10:52:56 2009 @@ -1368,14 +1368,13 @@ # make the C and C++ compilers strip debug info out of bytecode libraries. ifdef DEBUG_RUNTIME -$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LLVMAS) $(LOPT) +$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT) $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)" - $(Verb) $(LLVMAS) $< -o - | $(LOPT) -std-compile-opts -o $@ + $(Verb) $(LOPT) $< -std-compile-opts -o $@ else -$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LLVMAS) $(LOPT) +$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT) $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)" - $(Verb) $(LLVMAS) $< -o - | \ - $(LOPT) -std-compile-opts -strip-debug -o $@ + $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@ endif From clattner at apple.com Tue Sep 8 10:53:44 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 8 Sep 2009 08:53:44 -0700 Subject: [llvm-commits] [llvm] r81221 - in /llvm/trunk: include/llvm/Analysis/LoopInfo.h include/llvm/Transforms/Utils/BasicBlockUtils.h lib/Analysis/LoopInfo.cpp lib/Transforms/Scalar/LICM.cpp lib/Transforms/Scalar/LoopStrengthReduce.cpp lib/Transforms/Scalar/LoopUnswitch.cpp lib/Transforms/Utils/BasicBlockUtils.cpp lib/Transforms/Utils/BreakCriticalEdges.cpp lib/Transforms/Utils/LCSSA.cpp lib/Transforms/Utils/LoopSimplify.cpp test/Transforms/LoopUnswitch/2009-09-05-DomAssert.ll test/Transforms/LoopUnswitch/preserve-analyses.ll In-Reply-To: <200909081545.n88Fj1Tu027659@zion.cs.uiuc.edu> References: <200909081545.n88Fj1Tu027659@zion.cs.uiuc.edu> Message-ID: On Sep 8, 2009, at 8:45 AM, Dan Gohman wrote: > Author: djg > Date: Tue Sep 8 10:45:00 2009 > New Revision: 81221 > > URL: http://llvm.org/viewvc/llvm-project?rev=81221&view=rev > Log: > Re-apply r80926, with fixes: keep the domtree informed of new blocks > that get created during loop unswitching, and fix > SplitBlockPredecessors' > LCSSA updating code to create new PHIs instead of trying to just move > existing ones. > > Also, optimize Loop::verifyLoop, since it gets called a lot. Use > searches on a sorted list of blocks instead of calling the "contains" > function, as is done in other places in the Loop class, since > "contains" > does a linear search. Also, don't call verifyLoop from LoopSimplify or > LCSSA, as the PassManager is already calling verifyLoop as part of > LoopInfo's verifyAnalysis. Ok, please trim the dead gunk out of preserve-analyses.ll though, -Chris From daniel at zuster.org Tue Sep 8 11:14:55 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 08 Sep 2009 16:14:55 -0000 Subject: [llvm-commits] [llvm] r81223 - /llvm/trunk/lib/Support/regcomp.c Message-ID: <200909081614.n88GEtg8031420@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 8 11:14:54 2009 New Revision: 81223 URL: http://llvm.org/viewvc/llvm-project?rev=81223&view=rev Log: Fix may-be-used-uninitialized warning. Modified: llvm/trunk/lib/Support/regcomp.c Modified: llvm/trunk/lib/Support/regcomp.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/regcomp.c?rev=81223&r1=81222&r2=81223&view=diff ============================================================================== --- llvm/trunk/lib/Support/regcomp.c (original) +++ llvm/trunk/lib/Support/regcomp.c Tue Sep 8 11:14:54 2009 @@ -257,8 +257,8 @@ p_ere(struct parse *p, int stop) /* character this ERE should end at */ { char c; - sopno prevback; - sopno prevfwd; + sopno prevback = 0; + sopno prevfwd = 0; sopno conc; int first = 1; /* is this the first alternative? */ From gohman at apple.com Tue Sep 8 11:50:14 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 08 Sep 2009 16:50:14 -0000 Subject: [llvm-commits] [llvm] r81226 [1/2] - in /llvm/trunk/test: Analysis/Andersens/ Analysis/BasicAA/ Analysis/CallGraph/ Analysis/Dominators/ Analysis/GlobalsModRef/ Analysis/LoopDependenceAnalysis/ Analysis/LoopInfo/ Analysis/PointerTracking/ Analysis/PostDominators/ Analysis/Profiling/ Analysis/ScalarEvolution/ Assembler/ Bitcode/ CodeGen/Generic/GC/ CodeGen/PowerPC/ CodeGen/X86/ DebugInfo/ Feature/ FrontendC/ Other/ Transforms/ADCE/ Transforms/ArgumentPromotion/ Transforms/BlockPlacement/ Transforms/BranchFolding/ Transf... Message-ID: <200909081650.n88GovKS005205@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 8 11:50:01 2009 New Revision: 81226 URL: http://llvm.org/viewvc/llvm-project?rev=81226&view=rev Log: Change these tests to feed the assembly files to opt directly, instead of using llvm-as, now that opt supports this. Modified: llvm/trunk/test/Analysis/Andersens/2007-11-19-InlineAsm.ll llvm/trunk/test/Analysis/Andersens/2008-03-19-External.ll llvm/trunk/test/Analysis/Andersens/2008-04-07-Memcpy.ll llvm/trunk/test/Analysis/Andersens/2008-12-27-BuiltinWrongType.ll llvm/trunk/test/Analysis/Andersens/basictest.ll llvm/trunk/test/Analysis/Andersens/external.ll llvm/trunk/test/Analysis/Andersens/modreftest.ll llvm/trunk/test/Analysis/Andersens/modreftest2.ll llvm/trunk/test/Analysis/Andersens/trivialtest.ll llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll llvm/trunk/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll llvm/trunk/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll llvm/trunk/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll llvm/trunk/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll llvm/trunk/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll llvm/trunk/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll llvm/trunk/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll llvm/trunk/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll llvm/trunk/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll llvm/trunk/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll llvm/trunk/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll llvm/trunk/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll llvm/trunk/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll llvm/trunk/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll llvm/trunk/test/Analysis/BasicAA/byval.ll llvm/trunk/test/Analysis/BasicAA/cas.ll llvm/trunk/test/Analysis/BasicAA/constant-over-index.ll llvm/trunk/test/Analysis/BasicAA/featuretest.ll llvm/trunk/test/Analysis/BasicAA/gcsetest.ll llvm/trunk/test/Analysis/BasicAA/global-size.ll llvm/trunk/test/Analysis/BasicAA/modref.ll llvm/trunk/test/Analysis/BasicAA/no-escape-call.ll llvm/trunk/test/Analysis/BasicAA/nocapture.ll llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll llvm/trunk/test/Analysis/BasicAA/store-promote.ll llvm/trunk/test/Analysis/BasicAA/tailcall-modref.ll llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll llvm/trunk/test/Analysis/Dominators/2006-10-02-BreakCritEdges.ll llvm/trunk/test/Analysis/Dominators/2007-01-14-BreakCritEdges.ll llvm/trunk/test/Analysis/GlobalsModRef/2008-09-03-ReadGlobals.ll llvm/trunk/test/Analysis/GlobalsModRef/aliastest.ll llvm/trunk/test/Analysis/GlobalsModRef/chaining-analysis.ll llvm/trunk/test/Analysis/GlobalsModRef/indirect-global.ll llvm/trunk/test/Analysis/GlobalsModRef/modreftest.ll llvm/trunk/test/Analysis/GlobalsModRef/purecse.ll llvm/trunk/test/Analysis/LoopDependenceAnalysis/alias.ll llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-strong.ll llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-crossing.ll llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-zero.ll llvm/trunk/test/Analysis/LoopDependenceAnalysis/ziv.ll llvm/trunk/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll llvm/trunk/test/Analysis/PointerTracking/sizes.ll llvm/trunk/test/Analysis/PostDominators/2006-09-26-PostDominanceFrontier.ll llvm/trunk/test/Analysis/PostDominators/2007-04-17-PostDominanceFrontier.ll llvm/trunk/test/Analysis/PostDominators/2007-04-20-PostDom-Reset.ll llvm/trunk/test/Analysis/PostDominators/pr1098.ll llvm/trunk/test/Analysis/Profiling/edge-profiling.ll llvm/trunk/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll llvm/trunk/test/Analysis/ScalarEvolution/2007-08-06-MisinterpretBranch.ll llvm/trunk/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll llvm/trunk/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll llvm/trunk/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-02-12-SMAXTripCount.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-06-12-BinomialInt64.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect1.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect2.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-InfiniteLoop.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-WrappingIV.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-11-02-QuadraticCrash.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-11-15-CubicOOM.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-LessThanOrEqual.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll llvm/trunk/test/Analysis/ScalarEvolution/2009-01-02-SignedNegativeStride.ll llvm/trunk/test/Analysis/ScalarEvolution/2009-04-22-TruncCast.ll llvm/trunk/test/Analysis/ScalarEvolution/2009-05-09-PointerEdgeCount.ll llvm/trunk/test/Analysis/ScalarEvolution/2009-07-04-GroupConstantsWidthMismatch.ll llvm/trunk/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll llvm/trunk/test/Analysis/ScalarEvolution/and-xor.ll llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-0.ll llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll llvm/trunk/test/Analysis/ScalarEvolution/avoid-smax-0.ll llvm/trunk/test/Analysis/ScalarEvolution/avoid-smax-1.ll llvm/trunk/test/Analysis/ScalarEvolution/div-overflow.ll llvm/trunk/test/Analysis/ScalarEvolution/do-loop.ll llvm/trunk/test/Analysis/ScalarEvolution/max-trip-count.ll llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll llvm/trunk/test/Analysis/ScalarEvolution/pointer-sign-bits.ll llvm/trunk/test/Analysis/ScalarEvolution/pr3909.ll llvm/trunk/test/Analysis/ScalarEvolution/scev-aa.ll llvm/trunk/test/Analysis/ScalarEvolution/sext-inreg.ll llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-0.ll llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-1.ll llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-2.ll llvm/trunk/test/Analysis/ScalarEvolution/smax.ll llvm/trunk/test/Analysis/ScalarEvolution/trip-count.ll llvm/trunk/test/Analysis/ScalarEvolution/trip-count2.ll llvm/trunk/test/Analysis/ScalarEvolution/trip-count3.ll llvm/trunk/test/Analysis/ScalarEvolution/trip-count4.ll llvm/trunk/test/Analysis/ScalarEvolution/trip-count5.ll llvm/trunk/test/Analysis/ScalarEvolution/trip-count6.ll llvm/trunk/test/Analysis/ScalarEvolution/trip-count7.ll llvm/trunk/test/Analysis/ScalarEvolution/trip-count8.ll llvm/trunk/test/Analysis/ScalarEvolution/xor-and.ll llvm/trunk/test/Analysis/ScalarEvolution/zext-wrap.ll llvm/trunk/test/Assembler/2002-04-07-HexFloatConstants.ll llvm/trunk/test/Assembler/2002-04-29-NameBinding.ll llvm/trunk/test/Assembler/2002-08-19-BytecodeReader.ll llvm/trunk/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll llvm/trunk/test/Assembler/2008-02-20-MultipleReturnValue.ll llvm/trunk/test/Assembler/2009-02-28-StripOpaqueName.ll llvm/trunk/test/Bitcode/extractelement.ll llvm/trunk/test/CodeGen/Generic/GC/argpromotion.ll llvm/trunk/test/CodeGen/Generic/GC/deadargelim.ll llvm/trunk/test/CodeGen/Generic/GC/inline.ll llvm/trunk/test/CodeGen/Generic/GC/inline2.ll llvm/trunk/test/CodeGen/PowerPC/ppcf128-1.ll llvm/trunk/test/CodeGen/PowerPC/vec_shuffle.ll llvm/trunk/test/CodeGen/X86/2009-03-23-i80-fp80.ll llvm/trunk/test/CodeGen/X86/asm-block-labels.ll llvm/trunk/test/CodeGen/X86/nancvt.ll llvm/trunk/test/CodeGen/X86/vec_ins_extract.ll llvm/trunk/test/DebugInfo/2008-11-05-InlinedFuncStart.ll llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll llvm/trunk/test/DebugInfo/2009-01-15-member.ll llvm/trunk/test/DebugInfo/2009-02-18-DefaultScope-Crash.ll llvm/trunk/test/DebugInfo/2009-03-03-cheapdse.ll llvm/trunk/test/DebugInfo/2009-03-03-deadstore.ll llvm/trunk/test/DebugInfo/2009-03-03-store-to-load-forward.ll llvm/trunk/test/DebugInfo/2009-06-12-Inline.ll llvm/trunk/test/DebugInfo/2009-06-12-InlineFuncStart.ll llvm/trunk/test/DebugInfo/2009-06-15-InlineFuncStart.ll llvm/trunk/test/DebugInfo/2009-06-15-abstract_origin.ll llvm/trunk/test/DebugInfo/deaddebuglabel.ll llvm/trunk/test/DebugInfo/printdbginfo2.ll llvm/trunk/test/Feature/load_module.ll llvm/trunk/test/Feature/weak_constant.ll llvm/trunk/test/FrontendC/2008-07-29-EHLabel.ll llvm/trunk/test/Other/2002-01-31-CallGraph.ll llvm/trunk/test/Other/2002-02-24-InlineBrokePHINodes.ll llvm/trunk/test/Other/2002-03-11-ConstPropCrash.ll llvm/trunk/test/Other/2003-02-19-LoopInfoNestingBug.ll llvm/trunk/test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll llvm/trunk/test/Other/2007-06-05-PassID.ll llvm/trunk/test/Other/2007-09-10-PassManager.ll llvm/trunk/test/Other/2008-03-19-PassManager.ll llvm/trunk/test/Other/2008-06-04-FieldSizeInPacked.ll llvm/trunk/test/Other/2008-10-06-RemoveDeadPass.ll llvm/trunk/test/Other/2009-03-31-CallGraph.ll llvm/trunk/test/Other/2009-06-05-no-implicit-float.ll llvm/trunk/test/Transforms/ADCE/2002-05-22-PHITest.ll llvm/trunk/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll llvm/trunk/test/Transforms/ADCE/2002-05-28-Crash-distilled.ll llvm/trunk/test/Transforms/ADCE/2002-05-28-Crash.ll llvm/trunk/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll llvm/trunk/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll llvm/trunk/test/Transforms/ADCE/2003-01-22-PredecessorProblem.ll llvm/trunk/test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll llvm/trunk/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll llvm/trunk/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll llvm/trunk/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll llvm/trunk/test/Transforms/ADCE/2003-09-10-UnwindInstFail.ll llvm/trunk/test/Transforms/ADCE/2003-09-15-InfLoopCrash.ll llvm/trunk/test/Transforms/ADCE/2003-11-16-MissingPostDominanceInfo.ll llvm/trunk/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll llvm/trunk/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll llvm/trunk/test/Transforms/ADCE/basictest.ll llvm/trunk/test/Transforms/ADCE/basictest1.ll llvm/trunk/test/Transforms/ADCE/basictest2.ll llvm/trunk/test/Transforms/ADCE/dce_pure_call.ll llvm/trunk/test/Transforms/ADCE/dce_pure_invoke.ll llvm/trunk/test/Transforms/ADCE/unreachable-function.ll llvm/trunk/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll llvm/trunk/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll llvm/trunk/test/Transforms/ArgumentPromotion/2008-09-07-CGUpdate.ll llvm/trunk/test/Transforms/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll llvm/trunk/test/Transforms/ArgumentPromotion/aggregate-promote.ll llvm/trunk/test/Transforms/ArgumentPromotion/attrs.ll llvm/trunk/test/Transforms/ArgumentPromotion/basictest.ll llvm/trunk/test/Transforms/ArgumentPromotion/byval-2.ll llvm/trunk/test/Transforms/ArgumentPromotion/byval.ll llvm/trunk/test/Transforms/ArgumentPromotion/callgraph-update.ll llvm/trunk/test/Transforms/ArgumentPromotion/chained.ll llvm/trunk/test/Transforms/ArgumentPromotion/control-flow.ll llvm/trunk/test/Transforms/ArgumentPromotion/control-flow2.ll llvm/trunk/test/Transforms/ArgumentPromotion/pr3085.ll llvm/trunk/test/Transforms/BlockPlacement/basictest.ll llvm/trunk/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll llvm/trunk/test/Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll llvm/trunk/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll llvm/trunk/test/Transforms/CodeExtractor/2004-03-14-NoSwitchSupport.ll llvm/trunk/test/Transforms/CodeExtractor/2004-03-17-MissedLiveIns.ll llvm/trunk/test/Transforms/CodeExtractor/2004-03-17-OutputMismatch.ll llvm/trunk/test/Transforms/CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll llvm/trunk/test/Transforms/CodeExtractor/2004-03-18-InvokeHandling.ll llvm/trunk/test/Transforms/CodeExtractor/2004-08-12-BlockExtractPHI.ll llvm/trunk/test/Transforms/CodeExtractor/2004-11-12-InvokeExtract.ll llvm/trunk/test/Transforms/CodeGenPrepare/2008-11-24-RAUW-Self.ll llvm/trunk/test/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll llvm/trunk/test/Transforms/CondProp/2006-11-01-PhiNodeCrash.ll llvm/trunk/test/Transforms/CondProp/2007-08-01-InvalidRead.ll llvm/trunk/test/Transforms/CondProp/2009-01-25-SingleEntryPHI.ll llvm/trunk/test/Transforms/CondProp/basictest-dbg.ll llvm/trunk/test/Transforms/CondProp/basictest.ll llvm/trunk/test/Transforms/CondProp/phisimplify.ll llvm/trunk/test/Transforms/CondProp/phisimplify2.ll llvm/trunk/test/Transforms/CondProp/phisimplify3.ll llvm/trunk/test/Transforms/ConstProp/2002-05-03-DivideByZeroException.ll llvm/trunk/test/Transforms/ConstProp/2002-05-03-NotOperator.ll llvm/trunk/test/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll llvm/trunk/test/Transforms/ConstProp/2003-05-12-DivideError.ll llvm/trunk/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll llvm/trunk/test/Transforms/ConstProp/2006-11-30-vector-cast.ll llvm/trunk/test/Transforms/ConstProp/2006-12-01-TruncBoolBug.ll llvm/trunk/test/Transforms/ConstProp/2006-12-01-bool-casts.ll llvm/trunk/test/Transforms/ConstProp/2007-02-05-BitCast.ll llvm/trunk/test/Transforms/ConstProp/2007-11-23-cttz.ll llvm/trunk/test/Transforms/ConstProp/2008-07-07-VectorCompare.ll llvm/trunk/test/Transforms/ConstProp/2009-09-01-GEP-Crash.ll llvm/trunk/test/Transforms/ConstProp/basictest.ll llvm/trunk/test/Transforms/ConstProp/bitcast2.ll llvm/trunk/test/Transforms/ConstProp/bswap.ll llvm/trunk/test/Transforms/ConstProp/calls.ll llvm/trunk/test/Transforms/ConstProp/div-zero.ll llvm/trunk/test/Transforms/ConstProp/float-to-ptr-cast.ll llvm/trunk/test/Transforms/ConstProp/logicaltest.ll llvm/trunk/test/Transforms/ConstProp/nottest.ll llvm/trunk/test/Transforms/ConstProp/phi.ll llvm/trunk/test/Transforms/ConstProp/remtest.ll llvm/trunk/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll llvm/trunk/test/Transforms/ConstantMerge/2006-03-07-DontMergeDiffSections.ll llvm/trunk/test/Transforms/DeadArgElim/2006-06-27-struct-ret.ll llvm/trunk/test/Transforms/DeadArgElim/2007-02-07-FuncRename.ll llvm/trunk/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll llvm/trunk/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll llvm/trunk/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll llvm/trunk/test/Transforms/DeadArgElim/2008-06-23-DeadAfterLive.ll llvm/trunk/test/Transforms/DeadArgElim/2009-03-17-MRE-Invoke.ll llvm/trunk/test/Transforms/DeadArgElim/basictest.ll llvm/trunk/test/Transforms/DeadArgElim/canon.ll llvm/trunk/test/Transforms/DeadArgElim/dead_vaargs.ll llvm/trunk/test/Transforms/DeadArgElim/deadretval.ll llvm/trunk/test/Transforms/DeadArgElim/deadretval2.ll llvm/trunk/test/Transforms/DeadArgElim/keepalive.ll llvm/trunk/test/Transforms/DeadArgElim/multdeadretval.ll llvm/trunk/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll llvm/trunk/test/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll llvm/trunk/test/Transforms/DeadStoreElimination/2005-11-30-vaarg.ll llvm/trunk/test/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll llvm/trunk/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll llvm/trunk/test/Transforms/DeadStoreElimination/2008-11-28-MemDepUpdate.ll llvm/trunk/test/Transforms/DeadStoreElimination/2008-11-29-OffEndOfBlock.ll llvm/trunk/test/Transforms/DeadStoreElimination/PartialStore.ll llvm/trunk/test/Transforms/DeadStoreElimination/alloca.ll llvm/trunk/test/Transforms/DeadStoreElimination/byval.ll llvm/trunk/test/Transforms/DeadStoreElimination/context-sensitive.ll llvm/trunk/test/Transforms/DeadStoreElimination/crash.ll llvm/trunk/test/Transforms/DeadStoreElimination/free.ll llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll llvm/trunk/test/Transforms/DeadStoreElimination/simple.ll llvm/trunk/test/Transforms/DeadStoreElimination/volatile-load.ll llvm/trunk/test/Transforms/FunctionAttrs/2008-09-03-Mutual.ll llvm/trunk/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll llvm/trunk/test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll llvm/trunk/test/Transforms/FunctionAttrs/2008-09-13-VolatileRead.ll llvm/trunk/test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll llvm/trunk/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll llvm/trunk/test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll llvm/trunk/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll llvm/trunk/test/Transforms/FunctionAttrs/2009-05-06-Malloc.ll llvm/trunk/test/Transforms/GVN/2007-07-25-DominatedLoop.ll llvm/trunk/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll llvm/trunk/test/Transforms/GVN/2007-07-25-Loop.ll llvm/trunk/test/Transforms/GVN/2007-07-25-NestedLoop.ll llvm/trunk/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll llvm/trunk/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll llvm/trunk/test/Transforms/GVN/2007-07-26-NonRedundant.ll llvm/trunk/test/Transforms/GVN/2007-07-26-PhiErasure.ll llvm/trunk/test/Transforms/GVN/2007-07-30-PredIDom.ll llvm/trunk/test/Transforms/GVN/2007-07-31-NoDomInherit.ll llvm/trunk/test/Transforms/GVN/2007-07-31-RedundantPhi.ll llvm/trunk/test/Transforms/GVN/2008-02-12-UndefLoad.ll llvm/trunk/test/Transforms/GVN/2008-02-13-NewPHI.ll llvm/trunk/test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll llvm/trunk/test/Transforms/GVN/2008-02-26-MemCpySize.ll llvm/trunk/test/Transforms/GVN/2008-07-02-Unreachable.ll llvm/trunk/test/Transforms/GVN/2008-12-09-SelfRemove.ll llvm/trunk/test/Transforms/GVN/2008-12-12-RLE-Crash.ll llvm/trunk/test/Transforms/GVN/2008-12-14-rle-reanalyze.ll llvm/trunk/test/Transforms/GVN/2008-12-15-CacheVisited.ll llvm/trunk/test/Transforms/GVN/2009-01-21-SortInvalidation.ll llvm/trunk/test/Transforms/GVN/2009-01-22-SortInvalidation.ll llvm/trunk/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll llvm/trunk/test/Transforms/GVN/2009-03-05-dbg.ll llvm/trunk/test/Transforms/GVN/2009-03-10-PREOnVoid.ll llvm/trunk/test/Transforms/GVN/2009-06-17-InvalidPRE.ll llvm/trunk/test/Transforms/GVN/2009-07-13-MemDepSortFail.ll llvm/trunk/test/Transforms/GVN/basic.ll llvm/trunk/test/Transforms/GVN/bitcast-of-call.ll llvm/trunk/test/Transforms/GVN/calls-nonlocal.ll llvm/trunk/test/Transforms/GVN/calls-readonly.ll llvm/trunk/test/Transforms/GVN/condprop.ll llvm/trunk/test/Transforms/GVN/load-constant-mem.ll llvm/trunk/test/Transforms/GVN/local-pre.ll llvm/trunk/test/Transforms/GVN/lpre-basic.ll llvm/trunk/test/Transforms/GVN/mixed.ll llvm/trunk/test/Transforms/GVN/pre-basic-add.ll llvm/trunk/test/Transforms/GVN/pre-single-pred.ll llvm/trunk/test/Transforms/GVN/rle-dominated.ll llvm/trunk/test/Transforms/GVN/rle-must-alias.ll llvm/trunk/test/Transforms/GVN/rle-no-phi-translate.ll llvm/trunk/test/Transforms/GVN/rle-nonlocal.ll llvm/trunk/test/Transforms/GVN/rle-phi-translate.ll llvm/trunk/test/Transforms/GVN/rle-semidominated.ll llvm/trunk/test/Transforms/GVNPRE/2007-06-12-NoExit.ll llvm/trunk/test/Transforms/GVNPRE/2007-06-12-PhiTranslate.ll llvm/trunk/test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll llvm/trunk/test/Transforms/GVNPRE/2007-06-15-Looping.ll llvm/trunk/test/Transforms/GVNPRE/2007-06-18-ConstantInPhi.ll llvm/trunk/test/Transforms/GVNPRE/2007-06-18-EraseNumbering.ll llvm/trunk/test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll llvm/trunk/test/Transforms/GVNPRE/2007-07-04-CleanSelect.ll llvm/trunk/test/Transforms/GVNPRE/2007-07-04-SelectInst.ll llvm/trunk/test/Transforms/GVNPRE/2007-07-05-AvailabilityUpdating.ll llvm/trunk/test/Transforms/GVNPRE/2007-07-07-AnticOutUnique.ll llvm/trunk/test/Transforms/GVNPRE/basic.ll llvm/trunk/test/Transforms/GVNPRE/cast.ll llvm/trunk/test/Transforms/GVNPRE/extractelement.ll llvm/trunk/test/Transforms/GVNPRE/gep.ll llvm/trunk/test/Transforms/GVNPRE/insertelement.ll llvm/trunk/test/Transforms/GVNPRE/select.ll llvm/trunk/test/Transforms/GVNPRE/shufflevector.ll llvm/trunk/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll llvm/trunk/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll llvm/trunk/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll llvm/trunk/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll llvm/trunk/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll llvm/trunk/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll llvm/trunk/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll llvm/trunk/test/Transforms/GlobalDCE/2009-01-05-DeadAliases.ll llvm/trunk/test/Transforms/GlobalDCE/2009-02-17-AliasUsesAliasee.ll llvm/trunk/test/Transforms/GlobalDCE/2009-09-03-MDNode.ll llvm/trunk/test/Transforms/GlobalDCE/basicvariabletest.ll llvm/trunk/test/Transforms/GlobalDCE/externally_available.ll llvm/trunk/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll llvm/trunk/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll llvm/trunk/test/Transforms/GlobalOpt/2005-09-27-Crash.ll llvm/trunk/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll llvm/trunk/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll llvm/trunk/test/Transforms/GlobalOpt/2007-04-05-Crash.ll llvm/trunk/test/Transforms/GlobalOpt/2007-05-13-Crash.ll llvm/trunk/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll llvm/trunk/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll llvm/trunk/test/Transforms/GlobalOpt/2008-01-03-Crash.ll llvm/trunk/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll llvm/trunk/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll llvm/trunk/test/Transforms/GlobalOpt/2008-02-16-NestAttr.ll llvm/trunk/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll llvm/trunk/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll llvm/trunk/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll llvm/trunk/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll llvm/trunk/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll llvm/trunk/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll llvm/trunk/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll llvm/trunk/test/Transforms/GlobalOpt/2009-03-03-dbg.ll llvm/trunk/test/Transforms/GlobalOpt/2009-03-05-dbg.ll llvm/trunk/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll llvm/trunk/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll llvm/trunk/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll llvm/trunk/test/Transforms/GlobalOpt/alias-resolve.ll llvm/trunk/test/Transforms/GlobalOpt/basictest.ll llvm/trunk/test/Transforms/GlobalOpt/constantexpr-dangle.ll llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll llvm/trunk/test/Transforms/GlobalOpt/ctor-list-opt.ll llvm/trunk/test/Transforms/GlobalOpt/deadglobal-2.ll llvm/trunk/test/Transforms/GlobalOpt/deadglobal.ll llvm/trunk/test/Transforms/GlobalOpt/globalsra-partial.ll llvm/trunk/test/Transforms/GlobalOpt/globalsra-unknown-index.ll llvm/trunk/test/Transforms/GlobalOpt/globalsra.ll llvm/trunk/test/Transforms/GlobalOpt/heap-sra-1.ll llvm/trunk/test/Transforms/GlobalOpt/heap-sra-2.ll llvm/trunk/test/Transforms/GlobalOpt/heap-sra-phi.ll llvm/trunk/test/Transforms/GlobalOpt/integer-bool.ll llvm/trunk/test/Transforms/GlobalOpt/iterate.ll llvm/trunk/test/Transforms/GlobalOpt/load-store-global.ll llvm/trunk/test/Transforms/GlobalOpt/malloc-promote-1.ll llvm/trunk/test/Transforms/GlobalOpt/malloc-promote-2.ll llvm/trunk/test/Transforms/GlobalOpt/malloc-promote-3.ll llvm/trunk/test/Transforms/GlobalOpt/memcpy.ll llvm/trunk/test/Transforms/GlobalOpt/memset.ll llvm/trunk/test/Transforms/GlobalOpt/phi-select.ll llvm/trunk/test/Transforms/GlobalOpt/storepointer-compare.ll llvm/trunk/test/Transforms/GlobalOpt/storepointer.ll llvm/trunk/test/Transforms/GlobalOpt/trivialstore.ll llvm/trunk/test/Transforms/GlobalOpt/undef-init.ll llvm/trunk/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll llvm/trunk/test/Transforms/IPConstantProp/deadarg.ll llvm/trunk/test/Transforms/IPConstantProp/recursion.ll llvm/trunk/test/Transforms/IPConstantProp/return-argument.ll llvm/trunk/test/Transforms/IPConstantProp/return-constant.ll llvm/trunk/test/Transforms/IPConstantProp/return-constants.ll llvm/trunk/test/Transforms/IndMemRem/2009-01-24-Noalias.ll llvm/trunk/test/Transforms/IndVarSimplify/2002-09-09-PointerIndVar.ll llvm/trunk/test/Transforms/IndVarSimplify/2003-04-16-ExprAnalysis.ll llvm/trunk/test/Transforms/IndVarSimplify/2003-09-12-MultiplePred.ll llvm/trunk/test/Transforms/IndVarSimplify/2003-12-10-IndVarDeadCode.ll llvm/trunk/test/Transforms/IndVarSimplify/2003-12-10-RemoveInstrCrash.ll llvm/trunk/test/Transforms/IndVarSimplify/2003-12-15-Crash.ll llvm/trunk/test/Transforms/IndVarSimplify/2003-12-21-IndVarSize.ll llvm/trunk/test/Transforms/IndVarSimplify/2004-03-10-PHIInsertionBug.ll llvm/trunk/test/Transforms/IndVarSimplify/2004-04-05-InvokeCastCrash.ll llvm/trunk/test/Transforms/IndVarSimplify/2004-04-07-ScalarEvolutionCrash.ll llvm/trunk/test/Transforms/IndVarSimplify/2005-02-11-InvokeCrash.ll llvm/trunk/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll llvm/trunk/test/Transforms/IndVarSimplify/2005-02-26-ExitValueCompute.ll llvm/trunk/test/Transforms/IndVarSimplify/2005-06-15-InstMoveCrash.ll llvm/trunk/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll llvm/trunk/test/Transforms/IndVarSimplify/2006-03-31-NegativeStride.ll llvm/trunk/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll llvm/trunk/test/Transforms/IndVarSimplify/2006-09-20-LFTR-Crash.ll llvm/trunk/test/Transforms/IndVarSimplify/2006-12-10-BitCast.ll llvm/trunk/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll llvm/trunk/test/Transforms/IndVarSimplify/2007-01-08-X86-64-Pointer.ll llvm/trunk/test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll llvm/trunk/test/Transforms/IndVarSimplify/2007-11-23-BitcastCrash.ll llvm/trunk/test/Transforms/IndVarSimplify/2008-06-15-SCEVExpanderBug.ll llvm/trunk/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll llvm/trunk/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll llvm/trunk/test/Transforms/IndVarSimplify/2008-11-03-Floating.ll llvm/trunk/test/Transforms/IndVarSimplify/2008-11-17-Floating.ll llvm/trunk/test/Transforms/IndVarSimplify/2008-11-25-APFloatAssert.ll llvm/trunk/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll llvm/trunk/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll llvm/trunk/test/Transforms/IndVarSimplify/2009-04-22-IndvarCrash.ll llvm/trunk/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll llvm/trunk/test/Transforms/IndVarSimplify/2009-05-24-useafterfree.ll llvm/trunk/test/Transforms/IndVarSimplify/ada-loops.ll llvm/trunk/test/Transforms/IndVarSimplify/addrec-gep.ll llvm/trunk/test/Transforms/IndVarSimplify/ashr-tripcount.ll llvm/trunk/test/Transforms/IndVarSimplify/avoid-i0.ll llvm/trunk/test/Transforms/IndVarSimplify/casted-argument.ll llvm/trunk/test/Transforms/IndVarSimplify/complex-scev.ll llvm/trunk/test/Transforms/IndVarSimplify/divide-pointer.ll llvm/trunk/test/Transforms/IndVarSimplify/exit_value_tests.ll llvm/trunk/test/Transforms/IndVarSimplify/gep-with-mul-base.ll llvm/trunk/test/Transforms/IndVarSimplify/interesting-invoke-use.ll llvm/trunk/test/Transforms/IndVarSimplify/iterationCount_zext_or_trunc.ll llvm/trunk/test/Transforms/IndVarSimplify/iv-sext.ll llvm/trunk/test/Transforms/IndVarSimplify/iv-zext.ll llvm/trunk/test/Transforms/IndVarSimplify/lftr-other-uses.ll llvm/trunk/test/Transforms/IndVarSimplify/lftr-promote.ll llvm/trunk/test/Transforms/IndVarSimplify/lftr_simple.ll llvm/trunk/test/Transforms/IndVarSimplify/loop-invariant-step.ll llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate10.ll llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate11.ll llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate7.ll llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate8.ll llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate9.ll llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate_1.ll llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate_2.ll llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate_3.ll llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate_4.ll llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate_5.ll llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate_6.ll llvm/trunk/test/Transforms/IndVarSimplify/masked-iv.ll llvm/trunk/test/Transforms/IndVarSimplify/max-pointer.ll llvm/trunk/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll llvm/trunk/test/Transforms/IndVarSimplify/pointer-indvars.ll llvm/trunk/test/Transforms/IndVarSimplify/pointer.ll llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-nested.ll llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep-remainder.ll llvm/trunk/test/Transforms/IndVarSimplify/preserve-gep.ll llvm/trunk/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll llvm/trunk/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll llvm/trunk/test/Transforms/IndVarSimplify/shrunk-constant.ll llvm/trunk/test/Transforms/IndVarSimplify/signed-trip-count.ll llvm/trunk/test/Transforms/IndVarSimplify/single-element-range.ll llvm/trunk/test/Transforms/IndVarSimplify/sink-alloca.ll llvm/trunk/test/Transforms/IndVarSimplify/sink-trapping.ll llvm/trunk/test/Transforms/IndVarSimplify/subtract.ll llvm/trunk/test/Transforms/IndVarSimplify/tripcount_compute.ll llvm/trunk/test/Transforms/IndVarSimplify/tripcount_infinite.ll llvm/trunk/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll llvm/trunk/test/Transforms/IndVarSimplify/variable-stride-ivs-1.ll llvm/trunk/test/Transforms/Inline/2003-09-14-InlineValue.ll llvm/trunk/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll llvm/trunk/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll llvm/trunk/test/Transforms/Inline/2003-09-22-PHINodesInNormalInvokeDest.ll llvm/trunk/test/Transforms/Inline/2003-10-13-AllocaDominanceProblem.ll llvm/trunk/test/Transforms/Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll llvm/trunk/test/Transforms/Inline/2004-04-15-InlineDeletesCall.ll llvm/trunk/test/Transforms/Inline/2004-04-20-InlineLinkOnce.ll llvm/trunk/test/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll llvm/trunk/test/Transforms/Inline/2006-01-14-CallGraphUpdate.ll llvm/trunk/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll llvm/trunk/test/Transforms/Inline/2006-11-09-InlineCGUpdate-2.ll llvm/trunk/test/Transforms/Inline/2006-11-09-InlineCGUpdate.ll llvm/trunk/test/Transforms/Inline/2007-04-15-InlineEH.ll llvm/trunk/test/Transforms/Inline/2007-06-06-NoInline.ll llvm/trunk/test/Transforms/Inline/2007-06-25-WeakInline.ll llvm/trunk/test/Transforms/Inline/2008-03-04-StructRet.ll llvm/trunk/test/Transforms/Inline/2008-03-07-Inline-2.ll llvm/trunk/test/Transforms/Inline/2008-03-07-Inline.ll llvm/trunk/test/Transforms/Inline/2008-09-02-AlwaysInline.ll llvm/trunk/test/Transforms/Inline/2008-09-02-NoInline.ll llvm/trunk/test/Transforms/Inline/2008-10-30-AlwaysInline.ll llvm/trunk/test/Transforms/Inline/2008-11-04-AlwaysInline.ll llvm/trunk/test/Transforms/Inline/2009-01-08-NoInlineDynamicAlloca.ll llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll llvm/trunk/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll llvm/trunk/test/Transforms/Inline/2009-05-07-CallUsingSelfCrash.ll llvm/trunk/test/Transforms/Inline/alloca-in-scc.ll llvm/trunk/test/Transforms/Inline/always_inline_dyn_alloca.ll llvm/trunk/test/Transforms/Inline/array_merge.ll llvm/trunk/test/Transforms/Inline/basictest.ll llvm/trunk/test/Transforms/Inline/byval.ll llvm/trunk/test/Transforms/Inline/byval2.ll llvm/trunk/test/Transforms/Inline/callgraph-update.ll llvm/trunk/test/Transforms/Inline/casts.ll llvm/trunk/test/Transforms/Inline/cfg_preserve_test.ll llvm/trunk/test/Transforms/Inline/crash.ll llvm/trunk/test/Transforms/Inline/dynamic_alloca_test.ll llvm/trunk/test/Transforms/Inline/externally_available.ll llvm/trunk/test/Transforms/Inline/indirect_resolve.ll llvm/trunk/test/Transforms/Inline/inline-invoke-tail.ll llvm/trunk/test/Transforms/Inline/inline-tail.ll llvm/trunk/test/Transforms/Inline/inline_cleanup.ll llvm/trunk/test/Transforms/Inline/inline_constprop.ll llvm/trunk/test/Transforms/Inline/inline_dce.ll llvm/trunk/test/Transforms/Inline/inline_prune.ll llvm/trunk/test/Transforms/Inline/invoke_test-1.ll llvm/trunk/test/Transforms/Inline/invoke_test-2.ll llvm/trunk/test/Transforms/Inline/invoke_test-3.ll llvm/trunk/test/Transforms/InstCombine/2002-03-11-InstCombineHang.ll llvm/trunk/test/Transforms/InstCombine/2002-05-14-SubFailure.ll llvm/trunk/test/Transforms/InstCombine/2002-08-02-CastTest.ll llvm/trunk/test/Transforms/InstCombine/2002-12-05-MissedConstProp.ll llvm/trunk/test/Transforms/InstCombine/2003-05-26-CastMiscompile.ll llvm/trunk/test/Transforms/InstCombine/2003-05-27-ConstExprCrash.ll llvm/trunk/test/Transforms/InstCombine/2003-06-05-BranchInvertInfLoop.ll llvm/trunk/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll llvm/trunk/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll llvm/trunk/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll llvm/trunk/test/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll llvm/trunk/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll llvm/trunk/test/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll llvm/trunk/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll llvm/trunk/test/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll llvm/trunk/test/Transforms/InstCombine/2004-03-13-InstCombineInfLoop.ll llvm/trunk/test/Transforms/InstCombine/2004-04-04-InstCombineReplaceAllUsesWith.ll llvm/trunk/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll llvm/trunk/test/Transforms/InstCombine/2004-07-27-ConstantExprMul.ll llvm/trunk/test/Transforms/InstCombine/2004-08-09-RemInfLoop.ll llvm/trunk/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll llvm/trunk/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll llvm/trunk/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll llvm/trunk/test/Transforms/InstCombine/2004-09-28-BadShiftAndSetCC.ll llvm/trunk/test/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll llvm/trunk/test/Transforms/InstCombine/2004-12-08-RemInfiniteLoop.ll llvm/trunk/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll llvm/trunk/test/Transforms/InstCombine/2005-04-07-UDivSelectCrash.ll llvm/trunk/test/Transforms/InstCombine/2005-06-15-DivSelectCrash.ll llvm/trunk/test/Transforms/InstCombine/2005-06-15-ShiftSetCCCrash.ll llvm/trunk/test/Transforms/InstCombine/2005-06-16-RangeCrash.ll llvm/trunk/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll llvm/trunk/test/Transforms/InstCombine/2005-07-07-DeadPHILoop.ll llvm/trunk/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll llvm/trunk/test/Transforms/InstCombine/2006-02-28-Crash.ll llvm/trunk/test/Transforms/InstCombine/2006-03-30-ExtractElement.ll llvm/trunk/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll llvm/trunk/test/Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll llvm/trunk/test/Transforms/InstCombine/2006-09-15-CastToBool.ll llvm/trunk/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll llvm/trunk/test/Transforms/InstCombine/2006-11-03-Memmove64.ll llvm/trunk/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll llvm/trunk/test/Transforms/InstCombine/2006-11-27-XorBug.ll llvm/trunk/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll llvm/trunk/test/Transforms/InstCombine/2006-12-05-fp-to-int-ext.ll llvm/trunk/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll llvm/trunk/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll llvm/trunk/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll llvm/trunk/test/Transforms/InstCombine/2006-12-15-Range-Test.ll llvm/trunk/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll llvm/trunk/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll llvm/trunk/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll llvm/trunk/test/Transforms/InstCombine/2007-01-18-VectorInfLoop.ll llvm/trunk/test/Transforms/InstCombine/2007-01-27-AndICmp.ll llvm/trunk/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll llvm/trunk/test/Transforms/InstCombine/2007-02-07-PointerCast.ll llvm/trunk/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll llvm/trunk/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll llvm/trunk/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll llvm/trunk/test/Transforms/InstCombine/2007-03-25-DoubleShift.ll llvm/trunk/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll llvm/trunk/test/Transforms/InstCombine/2007-03-27-PR1280.ll llvm/trunk/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll llvm/trunk/test/Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll llvm/trunk/test/Transforms/InstCombine/2007-05-04-Crash.ll llvm/trunk/test/Transforms/InstCombine/2007-05-10-icmp-or.ll llvm/trunk/test/Transforms/InstCombine/2007-05-14-Crash.ll llvm/trunk/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll llvm/trunk/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll llvm/trunk/test/Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll llvm/trunk/test/Transforms/InstCombine/2007-08-02-InfiniteLoop.ll llvm/trunk/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll llvm/trunk/test/Transforms/InstCombine/2007-09-11-Trampoline.ll llvm/trunk/test/Transforms/InstCombine/2007-09-17-AliasConstFold2.ll llvm/trunk/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll llvm/trunk/test/Transforms/InstCombine/2007-10-12-Crash.ll llvm/trunk/test/Transforms/InstCombine/2007-10-28-stacksave.ll llvm/trunk/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll llvm/trunk/test/Transforms/InstCombine/2007-10-31-StringCrash.ll llvm/trunk/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll llvm/trunk/test/Transforms/InstCombine/2007-11-15-CompareMiscomp.ll llvm/trunk/test/Transforms/InstCombine/2007-11-22-IcmpCrash.ll llvm/trunk/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll llvm/trunk/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll llvm/trunk/test/Transforms/InstCombine/2007-12-12-GEPScale.ll llvm/trunk/test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll llvm/trunk/test/Transforms/InstCombine/2007-12-18-AddSelCmpSub.ll llvm/trunk/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll llvm/trunk/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll llvm/trunk/test/Transforms/InstCombine/2008-01-06-CastCrash.ll llvm/trunk/test/Transforms/InstCombine/2008-01-06-VoidCast.ll llvm/trunk/test/Transforms/InstCombine/2008-01-13-AndCmpCmp.ll llvm/trunk/test/Transforms/InstCombine/2008-01-13-NoBitCastAttributes.ll llvm/trunk/test/Transforms/InstCombine/2008-01-14-DoubleNest.ll llvm/trunk/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll llvm/trunk/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll llvm/trunk/test/Transforms/InstCombine/2008-01-21-MulTrunc.ll llvm/trunk/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll llvm/trunk/test/Transforms/InstCombine/2008-01-29-AddICmp.ll llvm/trunk/test/Transforms/InstCombine/2008-02-13-MulURem.ll llvm/trunk/test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll llvm/trunk/test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll llvm/trunk/test/Transforms/InstCombine/2008-02-23-MulSub.ll llvm/trunk/test/Transforms/InstCombine/2008-02-28-OrFCmpCrash.ll llvm/trunk/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll llvm/trunk/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll llvm/trunk/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll llvm/trunk/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll llvm/trunk/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll llvm/trunk/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll llvm/trunk/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll llvm/trunk/test/Transforms/InstCombine/2008-05-17-InfLoop.ll llvm/trunk/test/Transforms/InstCombine/2008-05-18-FoldIntToPtr.ll llvm/trunk/test/Transforms/InstCombine/2008-05-22-IDivVector.ll llvm/trunk/test/Transforms/InstCombine/2008-05-22-NegValVector.ll llvm/trunk/test/Transforms/InstCombine/2008-05-23-CompareFold.ll llvm/trunk/test/Transforms/InstCombine/2008-05-31-AddBool.ll llvm/trunk/test/Transforms/InstCombine/2008-05-31-Bools.ll llvm/trunk/test/Transforms/InstCombine/2008-06-05-ashr-crash.ll llvm/trunk/test/Transforms/InstCombine/2008-06-08-ICmpPHI.ll llvm/trunk/test/Transforms/InstCombine/2008-06-13-InfiniteLoopStore.ll llvm/trunk/test/Transforms/InstCombine/2008-06-13-ReadOnlyCallStore.ll llvm/trunk/test/Transforms/InstCombine/2008-06-19-UncondLoad.ll llvm/trunk/test/Transforms/InstCombine/2008-06-21-CompareMiscomp.ll llvm/trunk/test/Transforms/InstCombine/2008-06-24-StackRestore.ll llvm/trunk/test/Transforms/InstCombine/2008-07-08-AndICmp.ll llvm/trunk/test/Transforms/InstCombine/2008-07-08-ShiftOneAndOne.ll llvm/trunk/test/Transforms/InstCombine/2008-07-08-SubAnd.ll llvm/trunk/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll llvm/trunk/test/Transforms/InstCombine/2008-07-09-SubAndError.ll llvm/trunk/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll llvm/trunk/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll llvm/trunk/test/Transforms/InstCombine/2008-07-11-RemAnd.ll llvm/trunk/test/Transforms/InstCombine/2008-07-13-DivZero.ll llvm/trunk/test/Transforms/InstCombine/2008-07-16-fsub.ll llvm/trunk/test/Transforms/InstCombine/2008-07-16-sse2_storel_dq.ll llvm/trunk/test/Transforms/InstCombine/2008-08-05-And.ll llvm/trunk/test/Transforms/InstCombine/2008-08-17-ICmpXorSignbit.ll llvm/trunk/test/Transforms/InstCombine/2008-09-02-VectorCrash.ll llvm/trunk/test/Transforms/InstCombine/2008-09-29-FoldingOr.ll llvm/trunk/test/Transforms/InstCombine/2008-10-11-DivCompareFold.ll llvm/trunk/test/Transforms/InstCombine/2008-10-23-ConstFoldWithoutMask.ll llvm/trunk/test/Transforms/InstCombine/2008-11-01-SRemDemandedBits.ll llvm/trunk/test/Transforms/InstCombine/2008-11-08-FCmp.ll llvm/trunk/test/Transforms/InstCombine/2008-11-20-DivMulRem.ll llvm/trunk/test/Transforms/InstCombine/2008-11-27-IDivVector.ll llvm/trunk/test/Transforms/InstCombine/2008-11-27-MultiplyIntVec.ll llvm/trunk/test/Transforms/InstCombine/2008-11-27-UDivNegative.ll llvm/trunk/test/Transforms/InstCombine/2008-12-17-SRemNegConstVec.ll llvm/trunk/test/Transforms/InstCombine/2009-01-05-i128-crash.ll llvm/trunk/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll llvm/trunk/test/Transforms/InstCombine/2009-01-16-PointerAddrSpace.ll llvm/trunk/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll llvm/trunk/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll llvm/trunk/test/Transforms/InstCombine/2009-01-24-EmptyStruct.ll llvm/trunk/test/Transforms/InstCombine/2009-01-31-InfIterate.ll llvm/trunk/test/Transforms/InstCombine/2009-01-31-Pressure.ll llvm/trunk/test/Transforms/InstCombine/2009-02-04-FPBitcast.ll llvm/trunk/test/Transforms/InstCombine/2009-02-20-InstCombine-SROA.ll llvm/trunk/test/Transforms/InstCombine/2009-02-21-LoadCST.ll llvm/trunk/test/Transforms/InstCombine/2009-02-25-CrashZeroSizeArray.ll llvm/trunk/test/Transforms/InstCombine/2009-03-18-vector-ashr-crash.ll llvm/trunk/test/Transforms/InstCombine/2009-03-20-AShrOverShift.ll llvm/trunk/test/Transforms/InstCombine/2009-03-24-InfLoop.ll llvm/trunk/test/Transforms/InstCombine/2009-04-07-MulPromoteToI96.ll llvm/trunk/test/Transforms/InstCombine/2009-05-23-FCmpToICmp.ll llvm/trunk/test/Transforms/InstCombine/2009-06-11-StoreAddrSpace.ll llvm/trunk/test/Transforms/InstCombine/2009-06-16-SRemDemandedBits.ll llvm/trunk/test/Transforms/InstCombine/2009-07-02-MaskedIntVector.ll llvm/trunk/test/Transforms/InstCombine/CPP_min_max.ll llvm/trunk/test/Transforms/InstCombine/IntPtrCast.ll llvm/trunk/test/Transforms/InstCombine/JavaCompare.ll llvm/trunk/test/Transforms/InstCombine/add-shrink.ll llvm/trunk/test/Transforms/InstCombine/add-sitofp.ll llvm/trunk/test/Transforms/InstCombine/add.ll llvm/trunk/test/Transforms/InstCombine/add2.ll llvm/trunk/test/Transforms/InstCombine/add3.ll llvm/trunk/test/Transforms/InstCombine/addnegneg.ll llvm/trunk/test/Transforms/InstCombine/adjust-for-sminmax.ll llvm/trunk/test/Transforms/InstCombine/align-2d-gep.ll llvm/trunk/test/Transforms/InstCombine/align-addr.ll llvm/trunk/test/Transforms/InstCombine/align-external.ll llvm/trunk/test/Transforms/InstCombine/align-inc.ll llvm/trunk/test/Transforms/InstCombine/alloca.ll llvm/trunk/test/Transforms/InstCombine/and-compare.ll llvm/trunk/test/Transforms/InstCombine/and-fcmp.ll llvm/trunk/test/Transforms/InstCombine/and-not-or.ll llvm/trunk/test/Transforms/InstCombine/and-or-and.ll llvm/trunk/test/Transforms/InstCombine/and-or-not.ll llvm/trunk/test/Transforms/InstCombine/and-or.ll llvm/trunk/test/Transforms/InstCombine/and-xor-merge.ll llvm/trunk/test/Transforms/InstCombine/and.ll llvm/trunk/test/Transforms/InstCombine/and2.ll llvm/trunk/test/Transforms/InstCombine/apint-add1.ll llvm/trunk/test/Transforms/InstCombine/apint-add2.ll llvm/trunk/test/Transforms/InstCombine/apint-and-compare.ll llvm/trunk/test/Transforms/InstCombine/apint-and-or-and.ll llvm/trunk/test/Transforms/InstCombine/apint-and-xor-merge.ll llvm/trunk/test/Transforms/InstCombine/apint-and1.ll llvm/trunk/test/Transforms/InstCombine/apint-and2.ll llvm/trunk/test/Transforms/InstCombine/apint-call-cast-target.ll llvm/trunk/test/Transforms/InstCombine/apint-cast-and-cast.ll llvm/trunk/test/Transforms/InstCombine/apint-cast-cast-to-and.ll llvm/trunk/test/Transforms/InstCombine/apint-cast.ll llvm/trunk/test/Transforms/InstCombine/apint-div1.ll llvm/trunk/test/Transforms/InstCombine/apint-div2.ll llvm/trunk/test/Transforms/InstCombine/apint-elim-logicalops.ll llvm/trunk/test/Transforms/InstCombine/apint-mul1.ll llvm/trunk/test/Transforms/InstCombine/apint-mul2.ll llvm/trunk/test/Transforms/InstCombine/apint-not.ll llvm/trunk/test/Transforms/InstCombine/apint-or1.ll llvm/trunk/test/Transforms/InstCombine/apint-or2.ll llvm/trunk/test/Transforms/InstCombine/apint-rem1.ll llvm/trunk/test/Transforms/InstCombine/apint-rem2.ll llvm/trunk/test/Transforms/InstCombine/apint-select.ll llvm/trunk/test/Transforms/InstCombine/apint-shift-simplify.ll llvm/trunk/test/Transforms/InstCombine/apint-shift.ll llvm/trunk/test/Transforms/InstCombine/apint-shl-trunc.ll llvm/trunk/test/Transforms/InstCombine/apint-sub.ll llvm/trunk/test/Transforms/InstCombine/apint-xor1.ll llvm/trunk/test/Transforms/InstCombine/apint-xor2.ll llvm/trunk/test/Transforms/InstCombine/apint-zext1.ll llvm/trunk/test/Transforms/InstCombine/apint-zext2.ll llvm/trunk/test/Transforms/InstCombine/ashr-nop.ll llvm/trunk/test/Transforms/InstCombine/binop-cast.ll llvm/trunk/test/Transforms/InstCombine/bit-tracking.ll llvm/trunk/test/Transforms/InstCombine/bitcast-scalar-to-vector.ll llvm/trunk/test/Transforms/InstCombine/bitcast-vec-canon.ll llvm/trunk/test/Transforms/InstCombine/bitcast-vector-fold.ll llvm/trunk/test/Transforms/InstCombine/bitcount.ll llvm/trunk/test/Transforms/InstCombine/bittest.ll llvm/trunk/test/Transforms/InstCombine/bswap-fold.ll llvm/trunk/test/Transforms/InstCombine/bswap.ll llvm/trunk/test/Transforms/InstCombine/call-cast-target.ll llvm/trunk/test/Transforms/InstCombine/call-intrinsics.ll llvm/trunk/test/Transforms/InstCombine/call.ll llvm/trunk/test/Transforms/InstCombine/call2.ll llvm/trunk/test/Transforms/InstCombine/canonicalize_branch.ll llvm/trunk/test/Transforms/InstCombine/cast-and-cast.ll llvm/trunk/test/Transforms/InstCombine/cast-cast-to-and.ll llvm/trunk/test/Transforms/InstCombine/cast-load-gep.ll llvm/trunk/test/Transforms/InstCombine/cast-malloc.ll llvm/trunk/test/Transforms/InstCombine/cast-mul-select.ll llvm/trunk/test/Transforms/InstCombine/cast-propagate.ll llvm/trunk/test/Transforms/InstCombine/cast-set.ll llvm/trunk/test/Transforms/InstCombine/cast-sext-zext.ll llvm/trunk/test/Transforms/InstCombine/cast.ll llvm/trunk/test/Transforms/InstCombine/cast2.ll llvm/trunk/test/Transforms/InstCombine/cast3.ll llvm/trunk/test/Transforms/InstCombine/cast_ld_addr_space.ll llvm/trunk/test/Transforms/InstCombine/cast_ptr.ll llvm/trunk/test/Transforms/InstCombine/constant-fold-gep.ll llvm/trunk/test/Transforms/InstCombine/constant-fold-ptr-casts.ll llvm/trunk/test/Transforms/InstCombine/dce-iterate.ll llvm/trunk/test/Transforms/InstCombine/deadcode.ll llvm/trunk/test/Transforms/InstCombine/div-cmp-overflow.ll llvm/trunk/test/Transforms/InstCombine/div.ll llvm/trunk/test/Transforms/InstCombine/enforce-known-alignment.ll llvm/trunk/test/Transforms/InstCombine/exact-sdiv.ll llvm/trunk/test/Transforms/InstCombine/extractvalue.ll llvm/trunk/test/Transforms/InstCombine/fold-bin-operand.ll llvm/trunk/test/Transforms/InstCombine/fold-vector-zero.ll llvm/trunk/test/Transforms/InstCombine/fp-ret-bitcast.ll llvm/trunk/test/Transforms/InstCombine/fpextend.ll llvm/trunk/test/Transforms/InstCombine/fsub-fsub.ll llvm/trunk/test/Transforms/InstCombine/getelementptr.ll llvm/trunk/test/Transforms/InstCombine/hoist_instr.ll llvm/trunk/test/Transforms/InstCombine/icmp.ll llvm/trunk/test/Transforms/InstCombine/known_align.ll llvm/trunk/test/Transforms/InstCombine/load.ll llvm/trunk/test/Transforms/InstCombine/load2.ll llvm/trunk/test/Transforms/InstCombine/load3.ll llvm/trunk/test/Transforms/InstCombine/loadstore-alignment.ll llvm/trunk/test/Transforms/InstCombine/logical-select.ll llvm/trunk/test/Transforms/InstCombine/lshr-phi.ll llvm/trunk/test/Transforms/InstCombine/malloc-free-delete.ll llvm/trunk/test/Transforms/InstCombine/malloc.ll llvm/trunk/test/Transforms/InstCombine/malloc2.ll llvm/trunk/test/Transforms/InstCombine/malloc3.ll llvm/trunk/test/Transforms/InstCombine/memcpy-to-load.ll llvm/trunk/test/Transforms/InstCombine/memmove.ll llvm/trunk/test/Transforms/InstCombine/memset.ll llvm/trunk/test/Transforms/InstCombine/mul-masked-bits.ll llvm/trunk/test/Transforms/InstCombine/mul.ll llvm/trunk/test/Transforms/InstCombine/multi-use-or.ll llvm/trunk/test/Transforms/InstCombine/narrow.ll llvm/trunk/test/Transforms/InstCombine/not-fcmp.ll llvm/trunk/test/Transforms/InstCombine/not.ll llvm/trunk/test/Transforms/InstCombine/nothrow.ll llvm/trunk/test/Transforms/InstCombine/nsw.ll llvm/trunk/test/Transforms/InstCombine/odr-linkage.ll llvm/trunk/test/Transforms/InstCombine/or-fcmp.ll llvm/trunk/test/Transforms/InstCombine/or-to-xor.ll llvm/trunk/test/Transforms/InstCombine/or.ll llvm/trunk/test/Transforms/InstCombine/or2.ll llvm/trunk/test/Transforms/InstCombine/phi-merge.ll llvm/trunk/test/Transforms/InstCombine/phi.ll llvm/trunk/test/Transforms/InstCombine/pr2645-0.ll llvm/trunk/test/Transforms/InstCombine/pr2645-1.ll llvm/trunk/test/Transforms/InstCombine/pr2996.ll llvm/trunk/test/Transforms/InstCombine/preserve-sminmax.ll llvm/trunk/test/Transforms/InstCombine/ptr-int-cast.ll llvm/trunk/test/Transforms/InstCombine/rem.ll llvm/trunk/test/Transforms/InstCombine/sdiv-1.ll llvm/trunk/test/Transforms/InstCombine/sdiv-2.ll llvm/trunk/test/Transforms/InstCombine/sdiv-shift.ll llvm/trunk/test/Transforms/InstCombine/select-2.ll llvm/trunk/test/Transforms/InstCombine/select-load-call.ll llvm/trunk/test/Transforms/InstCombine/select.ll llvm/trunk/test/Transforms/InstCombine/set.ll llvm/trunk/test/Transforms/InstCombine/setcc-cast-cast.ll llvm/trunk/test/Transforms/InstCombine/setcc-strength-reduce.ll llvm/trunk/test/Transforms/InstCombine/sext-misc.ll llvm/trunk/test/Transforms/InstCombine/shift-simplify.ll llvm/trunk/test/Transforms/InstCombine/shift-sra.ll llvm/trunk/test/Transforms/InstCombine/shift-trunc-shift.ll llvm/trunk/test/Transforms/InstCombine/shift.ll llvm/trunk/test/Transforms/InstCombine/shl-icmp.ll llvm/trunk/test/Transforms/InstCombine/shl-trunc.ll llvm/trunk/test/Transforms/InstCombine/shufflemask-undef.ll llvm/trunk/test/Transforms/InstCombine/shufflevec-constant.ll llvm/trunk/test/Transforms/InstCombine/signed-comparison.ll llvm/trunk/test/Transforms/InstCombine/signext.ll llvm/trunk/test/Transforms/InstCombine/simplify-demanded-bits-pointer.ll llvm/trunk/test/Transforms/InstCombine/sitofp.ll llvm/trunk/test/Transforms/InstCombine/srem-simplify-bug.ll llvm/trunk/test/Transforms/InstCombine/srem.ll llvm/trunk/test/Transforms/InstCombine/srem1.ll llvm/trunk/test/Transforms/InstCombine/stack-overalign.ll llvm/trunk/test/Transforms/InstCombine/stacksaverestore.ll llvm/trunk/test/Transforms/InstCombine/store-merge.ll llvm/trunk/test/Transforms/InstCombine/store.ll llvm/trunk/test/Transforms/InstCombine/sub.ll llvm/trunk/test/Transforms/InstCombine/trunc-mask-ext.ll llvm/trunk/test/Transforms/InstCombine/udiv-simplify-bug-0.ll llvm/trunk/test/Transforms/InstCombine/udiv-simplify-bug-1.ll llvm/trunk/test/Transforms/InstCombine/udiv_select_to_select_shift.ll llvm/trunk/test/Transforms/InstCombine/udivrem-change-width.ll llvm/trunk/test/Transforms/InstCombine/urem-simplify-bug.ll llvm/trunk/test/Transforms/InstCombine/urem.ll llvm/trunk/test/Transforms/InstCombine/vec_demanded_elts-2.ll llvm/trunk/test/Transforms/InstCombine/vec_demanded_elts-3.ll llvm/trunk/test/Transforms/InstCombine/vec_demanded_elts.ll llvm/trunk/test/Transforms/InstCombine/vec_extract_elt.ll llvm/trunk/test/Transforms/InstCombine/vec_extract_elt2.ll llvm/trunk/test/Transforms/InstCombine/vec_insert_to_shuffle.ll llvm/trunk/test/Transforms/InstCombine/vec_insertelt.ll llvm/trunk/test/Transforms/InstCombine/vec_narrow.ll llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll llvm/trunk/test/Transforms/InstCombine/vec_shuffle2.ll llvm/trunk/test/Transforms/InstCombine/vector-casts.ll llvm/trunk/test/Transforms/InstCombine/vector-srem.ll llvm/trunk/test/Transforms/InstCombine/volatile_store.ll llvm/trunk/test/Transforms/InstCombine/xor-demorgans.ll llvm/trunk/test/Transforms/InstCombine/xor-undef.ll llvm/trunk/test/Transforms/InstCombine/xor.ll llvm/trunk/test/Transforms/InstCombine/xor2.ll llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll llvm/trunk/test/Transforms/InstCombine/zeroext-and-reduce.ll llvm/trunk/test/Transforms/InstCombine/zext-bool-add-sub.ll llvm/trunk/test/Transforms/InstCombine/zext-fold.ll llvm/trunk/test/Transforms/InstCombine/zext-or-icmp.ll llvm/trunk/test/Transforms/InstCombine/zext.ll llvm/trunk/test/Transforms/Internalize/2008-05-09-AllButMain.ll llvm/trunk/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll llvm/trunk/test/Transforms/JumpThreading/2008-04-24-InfLoop.ll llvm/trunk/test/Transforms/JumpThreading/2008-05-05-MRV-Crash.ll llvm/trunk/test/Transforms/JumpThreading/2008-11-28-InfLoop.ll llvm/trunk/test/Transforms/JumpThreading/2009-01-08-DeadLoopRepl.ll llvm/trunk/test/Transforms/JumpThreading/2009-01-19-InfSwitchLoop.ll llvm/trunk/test/Transforms/JumpThreading/and-and-cond.ll llvm/trunk/test/Transforms/JumpThreading/and-cond.ll llvm/trunk/test/Transforms/JumpThreading/basic.ll llvm/trunk/test/Transforms/JumpThreading/branch-no-const.ll llvm/trunk/test/Transforms/JumpThreading/compare.ll llvm/trunk/test/Transforms/JumpThreading/dup-cond.ll llvm/trunk/test/Transforms/JumpThreading/no-irreducible-loops.ll llvm/trunk/test/Transforms/JumpThreading/thread-loads.ll llvm/trunk/test/Transforms/JumpThreading/undef.ll llvm/trunk/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll llvm/trunk/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll llvm/trunk/test/Transforms/LCSSA/2006-07-09-NoDominator.ll llvm/trunk/test/Transforms/LCSSA/2006-10-31-UnreachableBlock-2.ll llvm/trunk/test/Transforms/LCSSA/2006-10-31-UnreachableBlock.ll llvm/trunk/test/Transforms/LCSSA/2007-07-12-LICM-2.ll llvm/trunk/test/Transforms/LCSSA/2007-07-12-LICM-3.ll llvm/trunk/test/Transforms/LCSSA/2007-07-12-LICM.ll llvm/trunk/test/Transforms/LCSSA/basictest.ll llvm/trunk/test/Transforms/LCSSA/invoke-dest.ll llvm/trunk/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll llvm/trunk/test/Transforms/LICM/2003-02-27-NestedLoopExitBlocks.ll llvm/trunk/test/Transforms/LICM/2003-02-27-PreheaderExitNodeUpdate.ll llvm/trunk/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll llvm/trunk/test/Transforms/LICM/2003-02-27-StoreSinkPHIs.ll llvm/trunk/test/Transforms/LICM/2003-02-28-PromoteDifferentType.ll llvm/trunk/test/Transforms/LICM/2003-05-02-LoadHoist.ll llvm/trunk/test/Transforms/LICM/2003-12-11-SinkingToPHI.ll llvm/trunk/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll llvm/trunk/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll llvm/trunk/test/Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll llvm/trunk/test/Transforms/LICM/2006-09-12-DeadUserOfSunkInstr.ll llvm/trunk/test/Transforms/LICM/2007-05-22-VolatileSink.ll llvm/trunk/test/Transforms/LICM/2007-07-30-AliasSet.ll llvm/trunk/test/Transforms/LICM/2007-09-17-PromoteValue.ll llvm/trunk/test/Transforms/LICM/2007-09-24-PromoteNullValue.ll llvm/trunk/test/Transforms/LICM/2007-10-01-PromoteSafeValue.ll llvm/trunk/test/Transforms/LICM/2008-05-20-AliasSetVAArg.ll llvm/trunk/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll llvm/trunk/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll llvm/trunk/test/Transforms/LICM/Preserve-LCSSA.ll llvm/trunk/test/Transforms/LICM/basictest.ll llvm/trunk/test/Transforms/LICM/hoisting.ll llvm/trunk/test/Transforms/LICM/no-preheader-test.ll llvm/trunk/test/Transforms/LICM/scalar_promote.ll llvm/trunk/test/Transforms/LICM/sinking.ll llvm/trunk/test/Transforms/LoopDeletion/2007-07-23-InfiniteLoop.ll llvm/trunk/test/Transforms/LoopDeletion/2008-05-06-Phi.ll llvm/trunk/test/Transforms/LoopDeletion/dcetest.ll llvm/trunk/test/Transforms/LoopIndexSplit/2007-09-21-LoopBound.ll llvm/trunk/test/Transforms/LoopIndexSplit/2007-09-24-UpdateIterationSpace.ll llvm/trunk/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-02-08-Crash.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-02-13-ExitValueNum.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatch.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatchPHI.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-02-14-Crash.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-03-24-ExitPhi.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-06-03-DomFrontier.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-07-08-MisCompilation.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-09-17-IVUse.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-09-20-Crash.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll llvm/trunk/test/Transforms/LoopIndexSplit/2008-11-10-Sign.ll llvm/trunk/test/Transforms/LoopIndexSplit/2009-03-02-UpdateIterationSpace-crash.ll llvm/trunk/test/Transforms/LoopIndexSplit/2009-03-30-undef.ll llvm/trunk/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll llvm/trunk/test/Transforms/LoopIndexSplit/Crash-2007-12-03.ll llvm/trunk/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll llvm/trunk/test/Transforms/LoopIndexSplit/ExitCondition-2007-09-10.ll llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll llvm/trunk/test/Transforms/LoopIndexSplit/PR3913.ll llvm/trunk/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll llvm/trunk/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24-dbg.ll llvm/trunk/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24.ll llvm/trunk/test/Transforms/LoopIndexSplit/UpperBound-2007-08-24.ll llvm/trunk/test/Transforms/LoopIndexSplit/non-iv-cmp-operand.ll llvm/trunk/test/Transforms/LoopRotate/2009-01-25-SingleEntryPhi.ll llvm/trunk/test/Transforms/LoopRotate/LRCrash-1.ll llvm/trunk/test/Transforms/LoopRotate/LRCrash-2.ll llvm/trunk/test/Transforms/LoopRotate/LRCrash-3.ll llvm/trunk/test/Transforms/LoopRotate/LRCrash-4.ll llvm/trunk/test/Transforms/LoopRotate/LRCrash-5.ll llvm/trunk/test/Transforms/LoopRotate/PhiRename-1.ll llvm/trunk/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll llvm/trunk/test/Transforms/LoopRotate/pr2639.ll llvm/trunk/test/Transforms/LoopSimplify/2003-04-25-AssertFail.ll llvm/trunk/test/Transforms/LoopSimplify/2003-05-12-PreheaderExitOfChild.ll llvm/trunk/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll llvm/trunk/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll llvm/trunk/test/Transforms/LoopSimplify/2004-02-05-DominatorInfoCorruption.ll llvm/trunk/test/Transforms/LoopSimplify/2004-03-15-IncorrectDomUpdate.ll llvm/trunk/test/Transforms/LoopSimplify/2004-04-01-IncorrectDomUpdate.ll llvm/trunk/test/Transforms/LoopSimplify/2004-04-12-LoopSimplify-SwitchBackedges.ll llvm/trunk/test/Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll llvm/trunk/test/Transforms/LoopSimplify/2007-10-28-InvokeCrash.ll llvm/trunk/test/Transforms/LoopSimplify/basictest.ll llvm/trunk/test/Transforms/LoopSimplify/hardertest.ll llvm/trunk/test/Transforms/LoopSimplify/merge-exits.ll llvm/trunk/test/Transforms/LoopSimplify/phi-node-simplify.ll llvm/trunk/test/Transforms/LoopSimplify/single-backedge.ll llvm/trunk/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll llvm/trunk/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll llvm/trunk/test/Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll llvm/trunk/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll llvm/trunk/test/Transforms/LoopStrengthReduce/2008-08-06-CmpStride.ll llvm/trunk/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll llvm/trunk/test/Transforms/LoopStrengthReduce/2008-08-14-ShadowIV.ll llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll llvm/trunk/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll llvm/trunk/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-0.ll llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-1.ll llvm/trunk/test/Transforms/LoopStrengthReduce/dead-phi.ll llvm/trunk/test/Transforms/LoopStrengthReduce/different-type-ivs.ll llvm/trunk/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll llvm/trunk/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll llvm/trunk/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll llvm/trunk/test/Transforms/LoopStrengthReduce/dont_reverse.ll llvm/trunk/test/Transforms/LoopStrengthReduce/invariant_value_first.ll llvm/trunk/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll llvm/trunk/test/Transforms/LoopStrengthReduce/nested-reduce.ll llvm/trunk/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll llvm/trunk/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll llvm/trunk/test/Transforms/LoopStrengthReduce/pr2537.ll llvm/trunk/test/Transforms/LoopStrengthReduce/pr2570.ll llvm/trunk/test/Transforms/LoopStrengthReduce/pr3086.ll llvm/trunk/test/Transforms/LoopStrengthReduce/pr3399.ll llvm/trunk/test/Transforms/LoopStrengthReduce/pr3571.ll llvm/trunk/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll llvm/trunk/test/Transforms/LoopStrengthReduce/related_indvars.ll llvm/trunk/test/Transforms/LoopStrengthReduce/remove_indvar.ll llvm/trunk/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll llvm/trunk/test/Transforms/LoopStrengthReduce/share_ivs.ll llvm/trunk/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll llvm/trunk/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll llvm/trunk/test/Transforms/LoopStrengthReduce/variable_stride.ll llvm/trunk/test/Transforms/LoopUnroll/2004-05-13-DontUnrollTooMuch.ll llvm/trunk/test/Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll llvm/trunk/test/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll llvm/trunk/test/Transforms/LoopUnroll/2007-04-16-PhiUpdate.ll llvm/trunk/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll llvm/trunk/test/Transforms/LoopUnroll/2007-05-09-UnknownTripCount.ll llvm/trunk/test/Transforms/LoopUnroll/2007-11-05-Crash.ll llvm/trunk/test/Transforms/LoopUnswitch/2006-02-14-LoopSimplifyCrash.ll llvm/trunk/test/Transforms/LoopUnswitch/2006-02-22-UnswitchCrash.ll llvm/trunk/test/Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll llvm/trunk/test/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll llvm/trunk/test/Transforms/LoopUnswitch/2007-05-09-Unreachable.ll llvm/trunk/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll llvm/trunk/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll llvm/trunk/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll llvm/trunk/test/Transforms/LoopUnswitch/2007-08-01-Dom.ll llvm/trunk/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll llvm/trunk/test/Transforms/LoopUnswitch/2007-10-04-DomFrontier.ll llvm/trunk/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll llvm/trunk/test/Transforms/LoopUnswitch/2008-06-17-DomFrontier.ll llvm/trunk/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll llvm/trunk/test/Transforms/LoopUnswitch/basictest.ll llvm/trunk/test/Transforms/LowerInvoke/2003-12-10-Crash.ll llvm/trunk/test/Transforms/LowerInvoke/2004-02-29-PHICrash.ll llvm/trunk/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll llvm/trunk/test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll llvm/trunk/test/Transforms/LowerInvoke/2008-02-14-CritEdgePhiCrash.ll llvm/trunk/test/Transforms/LowerInvoke/basictest.ll llvm/trunk/test/Transforms/LowerSetJmp/2003-11-05-DominanceProperties.ll llvm/trunk/test/Transforms/LowerSetJmp/simpletest.ll llvm/trunk/test/Transforms/LowerSwitch/2003-05-01-PHIProblem.ll llvm/trunk/test/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll llvm/trunk/test/Transforms/LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll llvm/trunk/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll llvm/trunk/test/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll llvm/trunk/test/Transforms/Mem2Reg/2003-04-10-DFNotFound.ll llvm/trunk/test/Transforms/Mem2Reg/2003-04-18-DeadBlockProblem.ll llvm/trunk/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll llvm/trunk/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll llvm/trunk/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll llvm/trunk/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll llvm/trunk/test/Transforms/Mem2Reg/2005-11-28-Crash.ll llvm/trunk/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll llvm/trunk/test/Transforms/Mem2Reg/PromoteMemToRegister.ll llvm/trunk/test/Transforms/Mem2Reg/UndefValuesMerge.ll llvm/trunk/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll llvm/trunk/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll llvm/trunk/test/Transforms/MemCpyOpt/2008-04-29-SRetRemoval.ll llvm/trunk/test/Transforms/MemCpyOpt/form-memset.ll llvm/trunk/test/Transforms/MemCpyOpt/form-memset2.ll llvm/trunk/test/Transforms/MemCpyOpt/memcpy.ll llvm/trunk/test/Transforms/MemCpyOpt/memmove.ll llvm/trunk/test/Transforms/MemCpyOpt/sret.ll llvm/trunk/test/Transforms/MergeFunc/fold-weak.ll llvm/trunk/test/Transforms/MergeFunc/phi-speculation1.ll llvm/trunk/test/Transforms/MergeFunc/phi-speculation2.ll llvm/trunk/test/Transforms/PredicateSimplifier/2006-08-02-Switch.ll llvm/trunk/test/Transforms/PredicateSimplifier/2006-08-07-LeaderOffByOne.ll llvm/trunk/test/Transforms/PredicateSimplifier/2006-09-20-ResolveCycle.ll llvm/trunk/test/Transforms/PredicateSimplifier/2006-09-20-SetCC.ll llvm/trunk/test/Transforms/PredicateSimplifier/2006-11-04-ImpossibleGT.ll llvm/trunk/test/Transforms/PredicateSimplifier/2006-11-04-ReplacingZeros.ll llvm/trunk/test/Transforms/PredicateSimplifier/2006-11-05-CycleGTLT.ll llvm/trunk/test/Transforms/PredicateSimplifier/2006-11-11-Squeeze.ll llvm/trunk/test/Transforms/PredicateSimplifier/2006-11-12-MergeNodes.ll llvm/trunk/test/Transforms/PredicateSimplifier/2007-01-04-SelectSwitch.ll llvm/trunk/test/Transforms/PredicateSimplifier/2007-03-17-OpsToDefVRP.ll llvm/trunk/test/Transforms/PredicateSimplifier/2007-09-19-Subtract.ll llvm/trunk/test/Transforms/PredicateSimplifier/predsimplify.reg1.ll llvm/trunk/test/Transforms/PredicateSimplifier/predsimplify.reg2.ll llvm/trunk/test/Transforms/PredicateSimplifier/predsimplify.reg3.ll llvm/trunk/test/Transforms/PredicateSimplifier/predsimplify.reg4.ll llvm/trunk/test/Transforms/PruneEH/2003-09-14-ExternalCall.ll llvm/trunk/test/Transforms/PruneEH/2003-11-21-PHIUpdate.ll llvm/trunk/test/Transforms/PruneEH/2008-06-02-Weak.ll llvm/trunk/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll llvm/trunk/test/Transforms/PruneEH/recursivetest.ll llvm/trunk/test/Transforms/PruneEH/simplenoreturntest.ll llvm/trunk/test/Transforms/PruneEH/simpletest.ll llvm/trunk/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll llvm/trunk/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll llvm/trunk/test/Transforms/Reassociate/2002-05-15-AgressiveSubMove.ll llvm/trunk/test/Transforms/Reassociate/2002-05-15-MissedTree.ll llvm/trunk/test/Transforms/Reassociate/2002-05-15-SubReassociate.ll llvm/trunk/test/Transforms/Reassociate/2002-05-15-SubReassociate2.ll llvm/trunk/test/Transforms/Reassociate/2002-07-09-DominanceProblem.ll llvm/trunk/test/Transforms/Reassociate/2003-08-12-InfiniteLoop.ll llvm/trunk/test/Transforms/Reassociate/2005-08-24-Crash.ll llvm/trunk/test/Transforms/Reassociate/2005-09-01-ArrayOutOfBounds.ll llvm/trunk/test/Transforms/Reassociate/2006-04-27-ReassociateVector.ll llvm/trunk/test/Transforms/Reassociate/basictest.ll llvm/trunk/test/Transforms/Reassociate/basictest2.ll llvm/trunk/test/Transforms/Reassociate/basictest3.ll llvm/trunk/test/Transforms/Reassociate/basictest4.ll llvm/trunk/test/Transforms/Reassociate/inverses.ll llvm/trunk/test/Transforms/Reassociate/looptest.ll llvm/trunk/test/Transforms/Reassociate/mul-neg-add.ll llvm/trunk/test/Transforms/Reassociate/mulfactor.ll llvm/trunk/test/Transforms/Reassociate/negation.ll llvm/trunk/test/Transforms/Reassociate/otherops.ll llvm/trunk/test/Transforms/Reassociate/shifttest.ll llvm/trunk/test/Transforms/Reassociate/subtest.ll llvm/trunk/test/Transforms/Reassociate/subtest2.ll llvm/trunk/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll llvm/trunk/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll llvm/trunk/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll llvm/trunk/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll llvm/trunk/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll llvm/trunk/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll llvm/trunk/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll llvm/trunk/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll llvm/trunk/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll llvm/trunk/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll llvm/trunk/test/Transforms/SCCP/2006-12-04-PackedType.ll llvm/trunk/test/Transforms/SCCP/2006-12-19-UndefBug.ll llvm/trunk/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll llvm/trunk/test/Transforms/SCCP/2008-05-23-UndefCallFold.ll llvm/trunk/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll llvm/trunk/test/Transforms/SCCP/2009-05-27-VectorOperandZero.ll llvm/trunk/test/Transforms/SCCP/apint-array.ll llvm/trunk/test/Transforms/SCCP/apint-basictest.ll llvm/trunk/test/Transforms/SCCP/apint-basictest2.ll llvm/trunk/test/Transforms/SCCP/apint-basictest3.ll llvm/trunk/test/Transforms/SCCP/apint-basictest4.ll llvm/trunk/test/Transforms/SCCP/apint-bigarray.ll llvm/trunk/test/Transforms/SCCP/apint-ipsccp1.ll llvm/trunk/test/Transforms/SCCP/apint-ipsccp2.ll llvm/trunk/test/Transforms/SCCP/apint-ipsccp4.ll llvm/trunk/test/Transforms/SCCP/apint-load.ll llvm/trunk/test/Transforms/SCCP/apint-phi.ll llvm/trunk/test/Transforms/SCCP/basictest.ll llvm/trunk/test/Transforms/SCCP/calltest.ll llvm/trunk/test/Transforms/SCCP/ipsccp-basic.ll llvm/trunk/test/Transforms/SCCP/ipsccp-conditional.ll llvm/trunk/test/Transforms/SCCP/ipsccp-gvar.ll llvm/trunk/test/Transforms/SCCP/loadtest.ll llvm/trunk/test/Transforms/SCCP/logical-nuke.ll llvm/trunk/test/Transforms/SCCP/phitest.ll llvm/trunk/test/Transforms/SCCP/sccptest.ll llvm/trunk/test/Transforms/SCCP/select.ll llvm/trunk/test/Transforms/SRETPromotion/2008-03-11-attributes.ll llvm/trunk/test/Transforms/SRETPromotion/2008-06-04-function-pointer-passing.ll llvm/trunk/test/Transforms/SRETPromotion/2008-06-05-non-call-use.ll llvm/trunk/test/Transforms/SRETPromotion/basictest.ll llvm/trunk/test/Transforms/SSI/2009-07-09-Invoke.ll llvm/trunk/test/Transforms/SSI/2009-08-15-UnreachableBB.ll llvm/trunk/test/Transforms/SSI/2009-08-17-CritEdge.ll llvm/trunk/test/Transforms/SSI/2009-08-19-UnreachableBB2.ll llvm/trunk/test/Transforms/SSI/ssiphi.ll llvm/trunk/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll llvm/trunk/test/Transforms/ScalarRepl/2003-05-30-InvalidIndices.ll llvm/trunk/test/Transforms/ScalarRepl/2003-05-30-MultiLevel.ll llvm/trunk/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll llvm/trunk/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll llvm/trunk/test/Transforms/ScalarRepl/2005-12-14-UnionPromoteCrash.ll llvm/trunk/test/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.ll llvm/trunk/test/Transforms/ScalarRepl/2006-04-20-PromoteCrash.ll llvm/trunk/test/Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.ll llvm/trunk/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll llvm/trunk/test/Transforms/ScalarRepl/2006-12-11-SROA-Crash.ll llvm/trunk/test/Transforms/ScalarRepl/2007-03-19-CanonicalizeMemcpy.ll llvm/trunk/test/Transforms/ScalarRepl/2007-05-24-LargeAggregate.ll llvm/trunk/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll llvm/trunk/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll llvm/trunk/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll llvm/trunk/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll llvm/trunk/test/Transforms/ScalarRepl/2008-06-05-loadstore-agg.ll llvm/trunk/test/Transforms/ScalarRepl/2008-06-22-LargeArray.ll llvm/trunk/test/Transforms/ScalarRepl/2008-08-22-out-of-range-array-promote.ll llvm/trunk/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll llvm/trunk/test/Transforms/ScalarRepl/2009-01-09-scalarrepl-empty.ll llvm/trunk/test/Transforms/ScalarRepl/2009-02-02-ScalarPromoteOutOfRange.ll llvm/trunk/test/Transforms/ScalarRepl/2009-02-05-LoadFCA.ll llvm/trunk/test/Transforms/ScalarRepl/2009-03-04-MemCpyAlign.ll llvm/trunk/test/Transforms/ScalarRepl/2009-03-05-Aggre2Scalar-dbg.ll llvm/trunk/test/Transforms/ScalarRepl/2009-03-17-CleanUp.ll llvm/trunk/test/Transforms/ScalarRepl/2009-04-21-ZeroLengthMemSet.ll llvm/trunk/test/Transforms/ScalarRepl/2009-05-08-I1Crash.ll llvm/trunk/test/Transforms/ScalarRepl/2009-06-01-BitcastIntPadding.ll llvm/trunk/test/Transforms/ScalarRepl/2009-08-16-VLA.ll llvm/trunk/test/Transforms/ScalarRepl/AggregatePromote.ll llvm/trunk/test/Transforms/ScalarRepl/DifferingTypes.ll llvm/trunk/test/Transforms/ScalarRepl/arraytest.ll llvm/trunk/test/Transforms/ScalarRepl/badarray.ll llvm/trunk/test/Transforms/ScalarRepl/basictest.ll llvm/trunk/test/Transforms/ScalarRepl/bitfield-sroa.ll llvm/trunk/test/Transforms/ScalarRepl/copy-aggregate.ll llvm/trunk/test/Transforms/ScalarRepl/debuginfo.ll llvm/trunk/test/Transforms/ScalarRepl/load-store-aggregate.ll llvm/trunk/test/Transforms/ScalarRepl/memcpy-from-global.ll llvm/trunk/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll llvm/trunk/test/Transforms/ScalarRepl/memset-aggregate.ll llvm/trunk/test/Transforms/ScalarRepl/not-a-vector.ll llvm/trunk/test/Transforms/ScalarRepl/phinodepromote.ll llvm/trunk/test/Transforms/ScalarRepl/select_promote.ll llvm/trunk/test/Transforms/ScalarRepl/sroa-fca.ll llvm/trunk/test/Transforms/ScalarRepl/sroa_two.ll llvm/trunk/test/Transforms/ScalarRepl/union-fp-int.ll llvm/trunk/test/Transforms/ScalarRepl/union-packed.ll llvm/trunk/test/Transforms/ScalarRepl/union-pointer.ll llvm/trunk/test/Transforms/ScalarRepl/vector_memcpy.ll llvm/trunk/test/Transforms/ScalarRepl/vector_promote.ll llvm/trunk/test/Transforms/ScalarRepl/volatile.ll llvm/trunk/test/Transforms/SimplifyCFG/2002-05-05-EmptyBlockMerge.ll llvm/trunk/test/Transforms/SimplifyCFG/2002-05-21-PHIElimination.ll llvm/trunk/test/Transforms/SimplifyCFG/2002-06-24-PHINode.ll llvm/trunk/test/Transforms/SimplifyCFG/2002-09-24-PHIAssertion.ll llvm/trunk/test/Transforms/SimplifyCFG/2003-03-07-DominateProblem.ll llvm/trunk/test/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll llvm/trunk/test/Transforms/SimplifyCFG/2003-08-05-MishandleInvoke.ll llvm/trunk/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll llvm/trunk/test/Transforms/SimplifyCFG/2003-08-17-BranchFoldOrdering.ll llvm/trunk/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll llvm/trunk/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll llvm/trunk/test/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll llvm/trunk/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll llvm/trunk/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll llvm/trunk/test/Transforms/SimplifyCFG/2005-08-03-PHIFactorCrash.ll llvm/trunk/test/Transforms/SimplifyCFG/2005-10-02-InvokeSimplify.ll llvm/trunk/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll llvm/trunk/test/Transforms/SimplifyCFG/2006-02-17-InfiniteUnroll.ll llvm/trunk/test/Transforms/SimplifyCFG/2006-06-12-InfLoop.ll llvm/trunk/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll llvm/trunk/test/Transforms/SimplifyCFG/2006-10-19-UncondDiv.ll llvm/trunk/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll llvm/trunk/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll llvm/trunk/test/Transforms/SimplifyCFG/2007-11-22-InvokeNoUnwind.ll llvm/trunk/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll llvm/trunk/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll llvm/trunk/test/Transforms/SimplifyCFG/2008-04-23-MergeMultipleResultRet.ll llvm/trunk/test/Transforms/SimplifyCFG/2008-04-27-MultipleReturnCrash.ll llvm/trunk/test/Transforms/SimplifyCFG/2008-05-16-PHIBlockMerge.ll llvm/trunk/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll llvm/trunk/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll llvm/trunk/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll llvm/trunk/test/Transforms/SimplifyCFG/2008-10-03-SpeculativelyExecuteBeforePHI.ll llvm/trunk/test/Transforms/SimplifyCFG/2008-12-06-SingleEntryPhi.ll llvm/trunk/test/Transforms/SimplifyCFG/2008-12-16-DCECond.ll llvm/trunk/test/Transforms/SimplifyCFG/2009-01-18-PHIPropCrash.ll llvm/trunk/test/Transforms/SimplifyCFG/2009-01-19-UnconditionalTrappingConstantExpr.ll llvm/trunk/test/Transforms/SimplifyCFG/2009-03-05-Speculative-Hoist-Dbg.ll llvm/trunk/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll llvm/trunk/test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll llvm/trunk/test/Transforms/SimplifyCFG/BrUnwind.ll llvm/trunk/test/Transforms/SimplifyCFG/DeadSetCC.ll llvm/trunk/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll llvm/trunk/test/Transforms/SimplifyCFG/HoistCode.ll llvm/trunk/test/Transforms/SimplifyCFG/InvokeEliminate.ll llvm/trunk/test/Transforms/SimplifyCFG/PhiBlockMerge.ll llvm/trunk/test/Transforms/SimplifyCFG/PhiBlockMerge2.ll llvm/trunk/test/Transforms/SimplifyCFG/PhiEliminate.ll llvm/trunk/test/Transforms/SimplifyCFG/PhiEliminate2.ll llvm/trunk/test/Transforms/SimplifyCFG/PhiNoEliminate.ll llvm/trunk/test/Transforms/SimplifyCFG/SpeculativeExec.ll llvm/trunk/test/Transforms/SimplifyCFG/UncondBranchToReturn.ll llvm/trunk/test/Transforms/SimplifyCFG/UnreachableEliminate.ll llvm/trunk/test/Transforms/SimplifyCFG/basictest.ll llvm/trunk/test/Transforms/SimplifyCFG/branch-branch-dbginfo.ll llvm/trunk/test/Transforms/SimplifyCFG/branch-cond-merge.ll llvm/trunk/test/Transforms/SimplifyCFG/branch-cond-prop.ll llvm/trunk/test/Transforms/SimplifyCFG/branch-fold-test.ll llvm/trunk/test/Transforms/SimplifyCFG/branch-fold.ll llvm/trunk/test/Transforms/SimplifyCFG/branch-phi-thread.ll llvm/trunk/test/Transforms/SimplifyCFG/branch_fold_dbg.ll llvm/trunk/test/Transforms/SimplifyCFG/dbginfo.ll llvm/trunk/test/Transforms/SimplifyCFG/hoist-common-code.dbg.ll llvm/trunk/test/Transforms/SimplifyCFG/hoist-common-code.ll llvm/trunk/test/Transforms/SimplifyCFG/iterative-simplify.ll llvm/trunk/test/Transforms/SimplifyCFG/noreturn-call.ll llvm/trunk/test/Transforms/SimplifyCFG/return-merge.ll llvm/trunk/test/Transforms/SimplifyCFG/switch-simplify-crash.ll llvm/trunk/test/Transforms/SimplifyCFG/switch_create.ll llvm/trunk/test/Transforms/SimplifyCFG/switch_formation.dbg.ll llvm/trunk/test/Transforms/SimplifyCFG/switch_formation.ll llvm/trunk/test/Transforms/SimplifyCFG/switch_switch_fold.ll llvm/trunk/test/Transforms/SimplifyCFG/switch_switch_fold_dbginfo.ll llvm/trunk/test/Transforms/SimplifyCFG/switch_thread.ll llvm/trunk/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll llvm/trunk/test/Transforms/SimplifyCFG/two-entry-phi-return.dbg.ll llvm/trunk/test/Transforms/SimplifyCFG/two-entry-phi-return.ll llvm/trunk/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll llvm/trunk/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll llvm/trunk/test/Transforms/SimplifyLibCalls/2008-05-19-memcmp.ll llvm/trunk/test/Transforms/SimplifyLibCalls/2009-01-04-Annotate.ll llvm/trunk/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll llvm/trunk/test/Transforms/SimplifyLibCalls/2009-02-12-StrTo.ll llvm/trunk/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll llvm/trunk/test/Transforms/SimplifyLibCalls/2009-07-28-Exit.ll llvm/trunk/test/Transforms/SimplifyLibCalls/2009-07-29-Exit2.ll llvm/trunk/test/Transforms/SimplifyLibCalls/FFS.ll llvm/trunk/test/Transforms/SimplifyLibCalls/FPrintF.ll llvm/trunk/test/Transforms/SimplifyLibCalls/IsDigit.ll llvm/trunk/test/Transforms/SimplifyLibCalls/MemCpy.ll llvm/trunk/test/Transforms/SimplifyLibCalls/Printf.ll llvm/trunk/test/Transforms/SimplifyLibCalls/Puts.ll llvm/trunk/test/Transforms/SimplifyLibCalls/SPrintF.ll llvm/trunk/test/Transforms/SimplifyLibCalls/StrCat.ll llvm/trunk/test/Transforms/SimplifyLibCalls/StrChr.ll llvm/trunk/test/Transforms/SimplifyLibCalls/StrCmp.ll llvm/trunk/test/Transforms/SimplifyLibCalls/StrCpy.ll llvm/trunk/test/Transforms/SimplifyLibCalls/StrLen.ll llvm/trunk/test/Transforms/SimplifyLibCalls/StrNCat.ll llvm/trunk/test/Transforms/SimplifyLibCalls/StrNCmp.ll llvm/trunk/test/Transforms/SimplifyLibCalls/StrNCpy.ll llvm/trunk/test/Transforms/SimplifyLibCalls/ToAscii.ll llvm/trunk/test/Transforms/SimplifyLibCalls/abs.ll llvm/trunk/test/Transforms/SimplifyLibCalls/exp2.ll llvm/trunk/test/Transforms/SimplifyLibCalls/floor.ll llvm/trunk/test/Transforms/SimplifyLibCalls/memcmp.ll llvm/trunk/test/Transforms/SimplifyLibCalls/memmove.ll llvm/trunk/test/Transforms/SimplifyLibCalls/memset-64.ll llvm/trunk/test/Transforms/SimplifyLibCalls/memset.ll llvm/trunk/test/Transforms/SimplifyLibCalls/pow2.ll llvm/trunk/test/Transforms/SimplifyLibCalls/weak-symbols.ll llvm/trunk/test/Transforms/StripSymbols/2007-01-15-llvm.used.ll llvm/trunk/test/Transforms/TailCallElim/accum_recursion.ll llvm/trunk/test/Transforms/TailCallElim/accum_recursion_constant_arg.ll llvm/trunk/test/Transforms/TailCallElim/dont-tce-tail-marked-call.ll llvm/trunk/test/Transforms/TailCallElim/inf-recursion.ll llvm/trunk/test/Transforms/TailCallElim/intervening-inst.ll llvm/trunk/test/Transforms/TailCallElim/return_constant.ll llvm/trunk/test/Transforms/TailCallElim/trivial_codegen_tailcall.ll llvm/trunk/test/Transforms/TailDup/2003-06-24-Simpleloop.ll llvm/trunk/test/Transforms/TailDup/2003-07-22-InfiniteLoop.ll llvm/trunk/test/Transforms/TailDup/2003-08-23-InvalidatedPointers.ll llvm/trunk/test/Transforms/TailDup/2003-08-31-UnreachableBlocks.ll llvm/trunk/test/Transforms/TailDup/2004-04-01-DemoteRegToStack.ll llvm/trunk/test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll llvm/trunk/test/Transforms/TailDup/2008-06-11-AvoidDupLoopHeader.ll llvm/trunk/test/Transforms/TailDup/2009-07-31-phicrash.ll llvm/trunk/test/Transforms/TailDup/MergeTest.ll llvm/trunk/test/Transforms/TailDup/PHIUpdateTest.ll llvm/trunk/test/Transforms/TailDup/basictest.ll llvm/trunk/test/Transforms/TailDup/basictest2.ll llvm/trunk/test/Transforms/TailDup/if-tail-dup.ll Modified: llvm/trunk/test/Analysis/Andersens/2007-11-19-InlineAsm.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Andersens/2007-11-19-InlineAsm.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/Andersens/2007-11-19-InlineAsm.ll (original) +++ llvm/trunk/test/Analysis/Andersens/2007-11-19-InlineAsm.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -anders-aa -disable-output +; RUN: opt %s -anders-aa -disable-output define void @x(i16 %Y) { entry: Modified: llvm/trunk/test/Analysis/Andersens/2008-03-19-External.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Andersens/2008-03-19-External.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/Andersens/2008-03-19-External.ll (original) +++ llvm/trunk/test/Analysis/Andersens/2008-03-19-External.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -anders-aa -gvn | llvm-dis | not grep undef +; RUN: opt %s -anders-aa -gvn | llvm-dis | not grep undef ; PR2160 declare void @f(i32*) Modified: llvm/trunk/test/Analysis/Andersens/2008-04-07-Memcpy.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Andersens/2008-04-07-Memcpy.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/Andersens/2008-04-07-Memcpy.ll (original) +++ llvm/trunk/test/Analysis/Andersens/2008-04-07-Memcpy.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -anders-aa -gvn | llvm-dis | not grep undef +; RUN: opt %s -anders-aa -gvn | llvm-dis | not grep undef ; PR2169 declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind Modified: llvm/trunk/test/Analysis/Andersens/2008-12-27-BuiltinWrongType.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Andersens/2008-12-27-BuiltinWrongType.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/Andersens/2008-12-27-BuiltinWrongType.ll (original) +++ llvm/trunk/test/Analysis/Andersens/2008-12-27-BuiltinWrongType.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -anders-aa +; RUN: opt %s -anders-aa ; PR3262 @.str15 = external global [3 x i8] ; <[3 x i8]*> [#uses=1] Modified: llvm/trunk/test/Analysis/Andersens/basictest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Andersens/basictest.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/Andersens/basictest.ll (original) +++ llvm/trunk/test/Analysis/Andersens/basictest.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -anders-aa -aa-eval 2>/dev/null +; RUN: opt %s -anders-aa -aa-eval 2>/dev/null define void @test1() { %X = malloc i32* Modified: llvm/trunk/test/Analysis/Andersens/external.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Andersens/external.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/Andersens/external.ll (original) +++ llvm/trunk/test/Analysis/Andersens/external.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -anders-aa -gvn -deadargelim | llvm-dis | grep store | not grep null +; RUN: opt %s -anders-aa -gvn -deadargelim | llvm-dis | grep store | not grep null ; Because the 'internal' function is passed to an external function, we don't ; know what the incoming values will alias. As such, we cannot do the Modified: llvm/trunk/test/Analysis/Andersens/modreftest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Andersens/modreftest.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/Andersens/modreftest.ll (original) +++ llvm/trunk/test/Analysis/Andersens/modreftest.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -anders-aa -gvn -instcombine | llvm-dis \ +; RUN: opt %s -anders-aa -gvn -instcombine | llvm-dis \ ; RUN: | grep {ret i1 true} @G = internal global i32* null Modified: llvm/trunk/test/Analysis/Andersens/modreftest2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Andersens/modreftest2.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/Andersens/modreftest2.ll (original) +++ llvm/trunk/test/Analysis/Andersens/modreftest2.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -anders-aa -gvn | llvm-dis \ +; RUN: opt %s -anders-aa -gvn | llvm-dis \ ; RUN: | not grep {ret i32 undef} ;; From PR 2160 Modified: llvm/trunk/test/Analysis/Andersens/trivialtest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Andersens/trivialtest.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/Andersens/trivialtest.ll (original) +++ llvm/trunk/test/Analysis/Andersens/trivialtest.ll Tue Sep 8 11:50:01 2009 @@ -1,3 +1,3 @@ -; RUN: llvm-as < %s | opt -anders-aa -disable-output +; RUN: opt %s -anders-aa -disable-output define void @foo() { ret void } Modified: llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll Tue Sep 8 11:50:01 2009 @@ -2,7 +2,7 @@ ; is performed. It is not legal to delete the second load instruction because ; the value computed by the first load instruction is changed by the store. -; RUN: llvm-as < %s | opt -gvn -instcombine | llvm-dis | grep DONOTREMOVE +; RUN: opt %s -gvn -instcombine | llvm-dis | grep DONOTREMOVE define i32 @test() { %A = alloca i32 Modified: llvm/trunk/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output 2>/dev/null +; RUN: opt %s -basicaa -aa-eval -disable-output 2>/dev/null ; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2 define void @test({[2 x i32],[2 x i32]}* %A, i64 %X, i64 %Y) { %P1 = getelementptr {[2 x i32],[2 x i32]}* %A, i64 0, i32 0, i64 %X Modified: llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -instcombine | llvm-dis | grep sub +; RUN: opt %s -gvn -instcombine | llvm-dis | grep sub ; BasicAA was incorrectly concluding that P1 and P2 didn't conflict! Modified: llvm/trunk/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output 2>/dev/null +; RUN: opt %s -basicaa -aa-eval -disable-output 2>/dev/null ; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2 define void @test([17 x i16]* %mask_bits) { %P1 = getelementptr [17 x i16]* %mask_bits, i64 0, i64 0 Modified: llvm/trunk/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm -disable-output +; RUN: opt %s -licm -disable-output %struct..apr_array_header_t = type { i32*, i32, i32, i32, i8* } %struct..apr_table_t = type { %struct..apr_array_header_t, i32, [32 x i32], [32 x i32] } Modified: llvm/trunk/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output 2>/dev/null +; RUN: opt %s -basicaa -aa-eval -disable-output 2>/dev/null define i32 @MTConcat([3 x i32]* %a.1) { %tmp.961 = getelementptr [3 x i32]* %a.1, i64 0, i64 4 Modified: llvm/trunk/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output 2>/dev/null +; RUN: opt %s -basicaa -aa-eval -disable-output 2>/dev/null %struct..RefPoint = type { i32, { i32, i8, i8 } } %struct..RefRect = type { %struct..RefPoint, %struct..RefPoint } Modified: llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll Tue Sep 8 11:50:01 2009 @@ -1,6 +1,6 @@ ; In this test, a local alloca cannot alias an incoming argument. -; RUN: llvm-as < %s | opt -gvn -instcombine | llvm-dis | not grep sub +; RUN: opt %s -gvn -instcombine | llvm-dis | not grep sub define i32 @test(i32* %P) { %X = alloca i32 Modified: llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll Tue Sep 8 11:50:01 2009 @@ -1,7 +1,7 @@ ; This testcase consists of alias relations which should be completely ; resolvable by basicaa. -; RUN: llvm-as < %s | opt -aa-eval -print-may-aliases -disable-output \ +; RUN: opt %s -aa-eval -print-may-aliases -disable-output \ ; RUN: |& not grep May: %T = type { i32, [10 x i8] } Modified: llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll Tue Sep 8 11:50:01 2009 @@ -1,7 +1,7 @@ ; This testcase consists of alias relations which should be completely ; resolvable by basicaa, but require analysis of getelementptr constant exprs. -; RUN: llvm-as < %s | opt -aa-eval -print-may-aliases -disable-output \ +; RUN: opt %s -aa-eval -print-may-aliases -disable-output \ ; RUN: |& not grep May: %T = type { i32, [10 x i8] } Modified: llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | grep {store i32 0} +; RUN: opt %s -dse | llvm-dis | grep {store i32 0} define void @test({i32,i32 }* %P) { %Q = getelementptr {i32,i32}* %P, i32 1 Modified: llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -licm +; RUN: opt %s -licm %"java/lang/Object" = type { %struct.llvm_java_object_base } %"java/lang/StringBuffer" = type { "java/lang/Object", i32, { "java/lang/Object", i32, [0 x i8] }*, i1 } Modified: llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse +; RUN: opt %s -dse %"java/lang/Object" = type { %struct.llvm_java_object_base } %"java/lang/StringBuffer" = type { "java/lang/Object", i32, { "java/lang/Object", i32, [0 x i8] }*, i1 } Modified: llvm/trunk/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine |\ +; RUN: opt %s -basicaa -gvn -instcombine |\ ; RUN: llvm-dis | grep {load i32\\* %A} declare double* @useit(i32*) Modified: llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -aa-eval -disable-output |& grep {2 no alias respon} +; RUN: opt %s -aa-eval -disable-output |& grep {2 no alias respon} ; TEST that A[1][0] may alias A[0][i]. define void @test(i32 %N) { Modified: llvm/trunk/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll Tue Sep 8 11:50:01 2009 @@ -1,7 +1,7 @@ ; PR1109 -; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | \ +; RUN: opt %s -basicaa -gvn -instcombine | llvm-dis | \ ; RUN: grep {sub i32} -; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | \ +; RUN: opt %s -basicaa -gvn -instcombine | llvm-dis | \ ; RUN: not grep {ret i32 0} ; END. Modified: llvm/trunk/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2007-08-05-GetOverloadedModRef.ll Tue Sep 8 11:50:01 2009 @@ -1,5 +1,5 @@ ; PR1600 -; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | \ +; RUN: opt %s -basicaa -gvn -instcombine | llvm-dis | \ ; RUN: grep {ret i32 0} ; END. Modified: llvm/trunk/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -gvn -dce | llvm-dis | grep tmp7 +; RUN: opt %s -basicaa -gvn -dce | llvm-dis | grep tmp7 %struct.A = type { i32 } %struct.B = type { %struct.A } Modified: llvm/trunk/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -disable-output +; RUN: opt %s -gvn -disable-output ; PR1774 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" Modified: llvm/trunk/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -disable-output +; RUN: opt %s -gvn -disable-output ; PR1782 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" Modified: llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -std-compile-opts | llvm-dis | grep store +; RUN: opt %s -std-compile-opts | llvm-dis | grep store ; ModuleID = 'small2.c' 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 = "i386-apple-darwin8" Modified: llvm/trunk/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn -disable-output +; RUN: opt %s -gvn -disable-output ; PR2395 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" Modified: llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -aa-eval |& grep {1 no alias response} +; RUN: opt %s -aa-eval |& grep {1 no alias response} declare noalias i32* @_Znwj(i32 %x) nounwind Modified: llvm/trunk/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -aa-eval -print-all-alias-modref-info -disable-output |& grep {MustAlias:.*%R,.*%r} +; RUN: opt %s -aa-eval -print-all-alias-modref-info -disable-output |& grep {MustAlias:.*%R,.*%r} ; Make sure that basicaa thinks R and r are must aliases. define i32 @test(i8 * %P) { Modified: llvm/trunk/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep load +; RUN: opt %s -basicaa -gvn | llvm-dis | grep load declare noalias i32* @noalias() Modified: llvm/trunk/test/Analysis/BasicAA/byval.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/byval.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/byval.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/byval.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {ret i32 1} +; RUN: opt %s -gvn | llvm-dis | grep {ret i32 1} 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-darwin8" %struct.x = type { i32, i32, i32, i32 } Modified: llvm/trunk/test/Analysis/BasicAA/cas.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/cas.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/cas.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/cas.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep load | count 1 +; RUN: opt %s -basicaa -gvn | llvm-dis | grep load | count 1 @flag0 = internal global i32 zeroinitializer @turn = internal global i32 zeroinitializer Modified: llvm/trunk/test/Analysis/BasicAA/constant-over-index.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/constant-over-index.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/constant-over-index.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/constant-over-index.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -aa-eval -print-all-alias-modref-info \ +; RUN: opt %s -aa-eval -print-all-alias-modref-info \ ; RUN: |& grep {MayAlias: double\\* \[%\]p.0.i.0, double\\* \[%\]p3\$} ; PR4267 Modified: llvm/trunk/test/Analysis/BasicAA/featuretest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/featuretest.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/featuretest.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/featuretest.ll Tue Sep 8 11:50:01 2009 @@ -1,7 +1,7 @@ ; This testcase tests for various features the basicaa test should be able to ; determine, as noted in the comments. -; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine -dce | llvm-dis | not grep REMOVE +; RUN: opt %s -basicaa -gvn -instcombine -dce | llvm-dis | not grep REMOVE @Global = external global { i32 } Modified: llvm/trunk/test/Analysis/BasicAA/gcsetest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/gcsetest.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/gcsetest.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/gcsetest.ll Tue Sep 8 11:50:01 2009 @@ -2,7 +2,7 @@ ; disambiguating some obvious cases. All loads should be removable in ; this testcase. -; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine -dce \ +; RUN: opt %s -basicaa -gvn -instcombine -dce \ ; RUN: | llvm-dis | not grep load @A = global i32 7 Modified: llvm/trunk/test/Analysis/BasicAA/global-size.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/global-size.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/global-size.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/global-size.ll Tue Sep 8 11:50:01 2009 @@ -1,7 +1,7 @@ ; A store or load cannot alias a global if the accessed amount is larger then ; the global. -; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | not grep load +; RUN: opt %s -basicaa -gvn -instcombine | llvm-dis | not grep load @B = global i16 8 ; [#uses=2] Modified: llvm/trunk/test/Analysis/BasicAA/modref.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/modref.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/modref.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/modref.ll Tue Sep 8 11:50:01 2009 @@ -1,5 +1,5 @@ ; A very rudimentary test on AliasAnalysis::getModRefInfo. -; RUN: llvm-as < %s | opt -print-all-alias-modref-info -aa-eval -disable-output |& \ +; RUN: opt %s -print-all-alias-modref-info -aa-eval -disable-output |& \ ; RUN: not grep NoModRef define i32 @callee() { Modified: llvm/trunk/test/Analysis/BasicAA/no-escape-call.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/no-escape-call.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/no-escape-call.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/no-escape-call.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | grep {ret i1 true} +; RUN: opt %s -basicaa -gvn -instcombine | llvm-dis | grep {ret i1 true} ; PR2436 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 = "i386-apple-darwin8" Modified: llvm/trunk/test/Analysis/BasicAA/nocapture.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/nocapture.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/nocapture.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/nocapture.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | grep {ret i32 0} +; RUN: opt %s -basicaa -gvn -instcombine | llvm-dis | grep {ret i32 0} declare i32* @test(i32* nocapture) Modified: llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll Tue Sep 8 11:50:01 2009 @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestConst | count 2 -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestPure | count 3 -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestNone | count 4 +; RUN: opt %s -basicaa -gvn | llvm-dis | grep TestConst | count 2 +; RUN: opt %s -basicaa -gvn | llvm-dis | grep TestPure | count 3 +; RUN: opt %s -basicaa -gvn | llvm-dis | grep TestNone | count 4 @g = global i32 0 ; [#uses=1] define i32 @test() { Modified: llvm/trunk/test/Analysis/BasicAA/store-promote.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/store-promote.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/store-promote.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/store-promote.ll Tue Sep 8 11:50:01 2009 @@ -2,7 +2,7 @@ ; disambiguating some obvious cases. If LICM is able to disambiguate the ; two pointers, then the load should be hoisted, and the store sunk. -; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | FileCheck %s +; RUN: opt %s -basicaa -licm | llvm-dis | FileCheck %s @A = global i32 7 ; [#uses=3] @B = global i32 8 ; [#uses=2] Modified: llvm/trunk/test/Analysis/BasicAA/tailcall-modref.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/tailcall-modref.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/tailcall-modref.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/tailcall-modref.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine |\ +; RUN: opt %s -basicaa -gvn -instcombine |\ ; RUN: llvm-dis | grep {ret i32 0} declare void @foo(i32*) Modified: llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll (original) +++ llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -print-callgraph -disable-output |& \ +; RUN: opt %s -print-callgraph -disable-output |& \ ; RUN: grep {Calls function 'callee'} | count 2 define internal void @callee(...) { Modified: llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll (original) +++ llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -print-callgraph -disable-output |& \ +; RUN: opt %s -print-callgraph -disable-output |& \ ; RUN: grep {Calls function} @a = global void ()* @f ; [#uses=0] Modified: llvm/trunk/test/Analysis/Dominators/2006-10-02-BreakCritEdges.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Dominators/2006-10-02-BreakCritEdges.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/Dominators/2006-10-02-BreakCritEdges.ll (original) +++ llvm/trunk/test/Analysis/Dominators/2006-10-02-BreakCritEdges.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -domtree -break-crit-edges -analyze \ +; RUN: opt %s -domtree -break-crit-edges -analyze \ ; RUN: -domtree | grep {3.*%brtrue } ; PR932 Modified: llvm/trunk/test/Analysis/Dominators/2007-01-14-BreakCritEdges.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Dominators/2007-01-14-BreakCritEdges.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/Dominators/2007-01-14-BreakCritEdges.ll (original) +++ llvm/trunk/test/Analysis/Dominators/2007-01-14-BreakCritEdges.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -domtree -break-crit-edges -domtree -disable-output +; RUN: opt %s -domtree -break-crit-edges -domtree -disable-output ; PR1110 %struct.OggVorbis_File = type { i8*, i32, i64, i64, %struct.ogg_sync_state, i32, i64*, i64*, i32*, i64*, %struct.vorbis_info*, %struct.vorbis_comment*, i64, i32, i32, i32, double, double, %struct.ogg_stream_state, %struct.vorbis_dsp_state, %struct.vorbis_block, %struct.ov_callbacks } Modified: llvm/trunk/test/Analysis/GlobalsModRef/2008-09-03-ReadGlobals.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/GlobalsModRef/2008-09-03-ReadGlobals.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/GlobalsModRef/2008-09-03-ReadGlobals.ll (original) +++ llvm/trunk/test/Analysis/GlobalsModRef/2008-09-03-ReadGlobals.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalsmodref-aa -gvn | llvm-dis | grep call | count 2 +; RUN: opt %s -globalsmodref-aa -gvn | llvm-dis | grep call | count 2 @g = internal global i32 0 ; [#uses=2] Modified: llvm/trunk/test/Analysis/GlobalsModRef/aliastest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/GlobalsModRef/aliastest.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/GlobalsModRef/aliastest.ll (original) +++ llvm/trunk/test/Analysis/GlobalsModRef/aliastest.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalsmodref-aa -gvn | llvm-dis | not grep load +; RUN: opt %s -globalsmodref-aa -gvn | llvm-dis | not grep load @X = internal global i32 4 ; [#uses=1] define i32 @test(i32* %P) { Modified: llvm/trunk/test/Analysis/GlobalsModRef/chaining-analysis.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/GlobalsModRef/chaining-analysis.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/GlobalsModRef/chaining-analysis.ll (original) +++ llvm/trunk/test/Analysis/GlobalsModRef/chaining-analysis.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalsmodref-aa -gvn | llvm-dis | not grep load +; RUN: opt %s -globalsmodref-aa -gvn | llvm-dis | not grep load ; This test requires the use of previous analyses to determine that ; doesnotmodX does not modify X (because 'sin' doesn't). Modified: llvm/trunk/test/Analysis/GlobalsModRef/indirect-global.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/GlobalsModRef/indirect-global.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/GlobalsModRef/indirect-global.ll (original) +++ llvm/trunk/test/Analysis/GlobalsModRef/indirect-global.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalsmodref-aa -gvn -instcombine | llvm-dis | \ +; RUN: opt %s -globalsmodref-aa -gvn -instcombine | llvm-dis | \ ; RUN: grep {ret i32 0} @G = internal global i32* null ; [#uses=3] Modified: llvm/trunk/test/Analysis/GlobalsModRef/modreftest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/GlobalsModRef/modreftest.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/GlobalsModRef/modreftest.ll (original) +++ llvm/trunk/test/Analysis/GlobalsModRef/modreftest.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -globalsmodref-aa -gvn | llvm-dis | not grep load +; RUN: opt %s -globalsmodref-aa -gvn | llvm-dis | not grep load @X = internal global i32 4 ; [#uses=2] define i32 @test(i32* %P) { Modified: llvm/trunk/test/Analysis/GlobalsModRef/purecse.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/GlobalsModRef/purecse.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/GlobalsModRef/purecse.ll (original) +++ llvm/trunk/test/Analysis/GlobalsModRef/purecse.ll Tue Sep 8 11:50:01 2009 @@ -1,5 +1,5 @@ ; Test that pure functions are cse'd away -; RUN: llvm-as < %s | opt -globalsmodref-aa -gvn -instcombine | \ +; RUN: opt %s -globalsmodref-aa -gvn -instcombine | \ ; RUN: llvm-dis | not grep sub define i32 @pure(i32 %X) { Modified: llvm/trunk/test/Analysis/LoopDependenceAnalysis/alias.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/LoopDependenceAnalysis/alias.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/LoopDependenceAnalysis/alias.ll (original) +++ llvm/trunk/test/Analysis/LoopDependenceAnalysis/alias.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -disable-output -analyze -lda | FileCheck %s +; RUN: opt %s -disable-output -analyze -lda | FileCheck %s ;; x[5] = x[6] // with x being a pointer passed as argument Modified: llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-strong.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-strong.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-strong.ll (original) +++ llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-strong.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -disable-output -analyze -lda | FileCheck %s +; RUN: opt %s -disable-output -analyze -lda | FileCheck %s @x = common global [256 x i32] zeroinitializer, align 4 @y = common global [256 x i32] zeroinitializer, align 4 Modified: llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-crossing.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-crossing.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-crossing.ll (original) +++ llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-crossing.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -disable-output -analyze -lda | FileCheck %s +; RUN: opt %s -disable-output -analyze -lda | FileCheck %s @x = common global [256 x i32] zeroinitializer, align 4 @y = common global [256 x i32] zeroinitializer, align 4 Modified: llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-zero.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-zero.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-zero.ll (original) +++ llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-zero.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -disable-output -analyze -lda | FileCheck %s +; RUN: opt %s -disable-output -analyze -lda | FileCheck %s @x = common global [256 x i32] zeroinitializer, align 4 @y = common global [256 x i32] zeroinitializer, align 4 Modified: llvm/trunk/test/Analysis/LoopDependenceAnalysis/ziv.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/LoopDependenceAnalysis/ziv.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/LoopDependenceAnalysis/ziv.ll (original) +++ llvm/trunk/test/Analysis/LoopDependenceAnalysis/ziv.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -disable-output -analyze -lda | FileCheck %s +; RUN: opt %s -disable-output -analyze -lda | FileCheck %s @x = common global [256 x i32] zeroinitializer, align 4 Modified: llvm/trunk/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll (original) +++ llvm/trunk/test/Analysis/LoopInfo/2003-05-15-NestingProblem.ll Tue Sep 8 11:50:01 2009 @@ -1,7 +1,7 @@ ; This testcase was incorrectly computing that the loopentry.7 loop was ; not a child of the loopentry.6 loop. ; -; RUN: llvm-as < %s | opt -analyze -loops | \ +; RUN: opt %s -analyze -loops | \ ; RUN: grep {^ Loop at depth 4 containing: %loopentry.7
} define void @getAndMoveToFrontDecode() { Modified: llvm/trunk/test/Analysis/PointerTracking/sizes.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/PointerTracking/sizes.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/PointerTracking/sizes.ll (original) +++ llvm/trunk/test/Analysis/PointerTracking/sizes.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -pointertracking -analyze | FileCheck %s +; RUN: opt %s -pointertracking -analyze | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" target triple = "x86_64-unknown-linux-gnu" @.str = internal constant [5 x i8] c"1234\00" ; <[5 x i8]*> [#uses=1] Modified: llvm/trunk/test/Analysis/PostDominators/2006-09-26-PostDominanceFrontier.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/PostDominators/2006-09-26-PostDominanceFrontier.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/PostDominators/2006-09-26-PostDominanceFrontier.ll (original) +++ llvm/trunk/test/Analysis/PostDominators/2006-09-26-PostDominanceFrontier.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -postdomfrontier \ +; RUN: opt %s -analyze -postdomfrontier \ ; RUN: -disable-verify ; ModuleID = '2006-09-26-PostDominanceFrontier.bc' target datalayout = "e-p:64:64" Modified: llvm/trunk/test/Analysis/PostDominators/2007-04-17-PostDominanceFrontier.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/PostDominators/2007-04-17-PostDominanceFrontier.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/PostDominators/2007-04-17-PostDominanceFrontier.ll (original) +++ llvm/trunk/test/Analysis/PostDominators/2007-04-17-PostDominanceFrontier.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -postdomfrontier -disable-output +; RUN: opt %s -postdomfrontier -disable-output define void @SManager() { entry: Modified: llvm/trunk/test/Analysis/PostDominators/2007-04-20-PostDom-Reset.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/PostDominators/2007-04-20-PostDom-Reset.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/PostDominators/2007-04-20-PostDom-Reset.ll (original) +++ llvm/trunk/test/Analysis/PostDominators/2007-04-20-PostDom-Reset.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -postdomfrontier -disable-output +; RUN: opt %s -postdomfrontier -disable-output define void @args_out_of_range() { entry: Modified: llvm/trunk/test/Analysis/PostDominators/pr1098.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/PostDominators/pr1098.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/PostDominators/pr1098.ll (original) +++ llvm/trunk/test/Analysis/PostDominators/pr1098.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -postdomtree -analyze | grep entry +; RUN: opt %s -postdomtree -analyze | grep entry ; PR932 define void @foo(i1 %x) { Modified: llvm/trunk/test/Analysis/Profiling/edge-profiling.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Profiling/edge-profiling.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/Profiling/edge-profiling.ll (original) +++ llvm/trunk/test/Analysis/Profiling/edge-profiling.ll Tue Sep 8 11:50:01 2009 @@ -1,5 +1,5 @@ ; Test the edge profiling instrumentation. -; RUN: llvm-as < %s | opt -insert-edge-profiling | llvm-dis | FileCheck %s +; RUN: opt %s -insert-edge-profiling | llvm-dis | FileCheck %s ; ModuleID = '' 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=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2007-07-15-NegativeStride.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: -scalar-evolution-max-iterations=0 | grep {Loop bb: backedge-taken count is 100} ; PR1533 Modified: llvm/trunk/test/Analysis/ScalarEvolution/2007-08-06-MisinterpretBranch.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2007-08-06-MisinterpretBranch.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2007-08-06-MisinterpretBranch.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2007-08-06-MisinterpretBranch.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -adce -simplifycfg | llvm-dis | grep "icmp s" +; RUN: opt %s -indvars -adce -simplifycfg | llvm-dis | grep "icmp s" ; PR1598 define i32 @f(i32 %a, i32 %b, i32 %x, i32 %y) { Modified: llvm/trunk/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalar-evolution -analyze -disable-output | grep {Loop bb: backedge-taken count is (-1 + (-1 \\* %x) + %y)} +; RUN: opt %s -scalar-evolution -analyze -disable-output | grep {Loop bb: backedge-taken count is (-1 + (-1 \\* %x) + %y)} ; PR1597 define i32 @f(i32 %x, i32 %y) { 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=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2007-09-27-LargeStepping.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 13} ; PR1706 Modified: llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep printd | grep 1206807378 +; RUN: opt %s -indvars | llvm-dis | grep printd | grep 1206807378 ; PR1798 declare void @printd(i32) Modified: llvm/trunk/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2007-11-18-OrInstruction.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | grep -e {--> %b} +; RUN: opt %s -analyze -scalar-evolution -disable-output | grep -e {--> %b} ; PR1810 define void @fun() { Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalar-evolution -analyze -disable-output | grep {Loop header: backedge-taken count is (0 smax %n)} +; RUN: opt %s -scalar-evolution -analyze -disable-output | grep {Loop header: backedge-taken count is (0 smax %n)} define void @foo(i32 %n) { entry: Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-02-12-SMAXTripCount.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-02-12-SMAXTripCount.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-02-12-SMAXTripCount.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-02-12-SMAXTripCount.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalar-evolution -analyze -disable-output | grep {Loop loop: backedge-taken count is (100 + (-100 smax %n))} +; RUN: opt %s -scalar-evolution -analyze -disable-output | grep {Loop loop: backedge-taken count is (100 + (-100 smax %n))} ; PR2002 define void @foo(i8 %n) { Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | grep umax +; RUN: opt %s -analyze -scalar-evolution -disable-output | grep umax ; PR2003 define i32 @foo(i32 %n) { 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=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 61} ; PR2364 Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-06-12-BinomialInt64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-06-12-BinomialInt64.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-06-12-BinomialInt64.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-06-12-BinomialInt64.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution 2>/dev/null +; RUN: opt %s -analyze -scalar-evolution 2>/dev/null ; PR2433 define i32 @main1(i32 %argc, i8** %argv) nounwind { Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect1.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect1.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect1.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output |& not grep smax +; RUN: opt %s -analyze -scalar-evolution -disable-output |& not grep smax ; PR2261 @lut = common global [256 x i8] zeroinitializer, align 32 ; <[256 x i8]*> [#uses=1] Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect2.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect2.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-07-12-UnneededSelect2.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output |& not grep smax +; RUN: opt %s -analyze -scalar-evolution -disable-output |& not grep smax ; PR2070 define i32 @a(i32 %x) nounwind { Modified: 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=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-InfiniteLoop.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-InfiniteLoop.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: -scalar-evolution-max-iterations=0 | grep Unpredictable ; PR2088 Modified: 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=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-WrappingIV.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-07-19-WrappingIV.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 113} ; PR2088 Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SGTTripCount.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: -scalar-evolution-max-iterations=0 | \ ; RUN: grep -F "backedge-taken count is (-1 + (-1 * %j))" ; PR2607 Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-07-29-SMinExpr.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: -scalar-evolution-max-iterations=0 | \ ; RUN: grep -F "backedge-taken count is (-2147483632 + ((-1 + (-1 * %x)) smax (-1 + (-1 * %y))))" ; PR2607 Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: -scalar-evolution-max-iterations=0 | grep -F "Exits: 20028" ; PR2621 Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: -scalar-evolution-max-iterations=0 | grep -F "Exits: -19168" ; PR2621 Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-11-02-QuadraticCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-11-02-QuadraticCrash.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-11-02-QuadraticCrash.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-11-02-QuadraticCrash.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output +; RUN: opt %s -analyze -scalar-evolution -disable-output ; PR1827 declare void @use(i32) Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-11-15-CubicOOM.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-11-15-CubicOOM.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-11-15-CubicOOM.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-11-15-CubicOOM.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output +; RUN: opt %s -analyze -scalar-evolution -disable-output ; PR2602 define i32 @a() nounwind { Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-LessThanOrEqual.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-LessThanOrEqual.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-LessThanOrEqual.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-LessThanOrEqual.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output |& \ +; RUN: opt %s -analyze -scalar-evolution -disable-output |& \ ; RUN: grep {Loop bb: backedge-taken count is (7 + (-1 \\* %argc))} ; XFAIL: * Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: | grep {Loop bb: Unpredictable backedge-taken count\\.} ; ScalarEvolution can't compute a trip count because it doesn't know if Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output |& grep {/u 3} +; RUN: opt %s -analyze -scalar-evolution -disable-output |& grep {/u 3} ; XFAIL: * define i32 @f(i32 %x) nounwind readnone { Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | grep {backedge-taken count is 255} +; RUN: opt %s -analyze -scalar-evolution -disable-output | grep {backedge-taken count is 255} ; XFAIL: * define i32 @foo(i32 %x, i32 %y, i32* %lam, i32* %alp) nounwind { Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | grep {0 smax} +; RUN: opt %s -analyze -scalar-evolution -disable-output | grep {0 smax} ; XFAIL: * define i32 @f(i32 %c.idx.val) { Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output |& \ +; RUN: opt %s -analyze -scalar-evolution -disable-output |& \ ; RUN: grep {(((-1 \\* %i0) + (100005 smax %i0)) /u 5)} ; XFAIL: * Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output |& grep {/u 5} +; RUN: opt %s -analyze -scalar-evolution -disable-output |& grep {/u 5} ; XFAIL: * define i8 @foo0(i8 %i0) nounwind { Modified: llvm/trunk/test/Analysis/ScalarEvolution/2009-01-02-SignedNegativeStride.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2009-01-02-SignedNegativeStride.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2009-01-02-SignedNegativeStride.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2009-01-02-SignedNegativeStride.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | not grep {/u -1} +; RUN: opt %s -analyze -scalar-evolution -disable-output | not grep {/u -1} ; PR3275 @g_16 = external global i16 ; [#uses=3] Modified: llvm/trunk/test/Analysis/ScalarEvolution/2009-04-22-TruncCast.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2009-04-22-TruncCast.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2009-04-22-TruncCast.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2009-04-22-TruncCast.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | grep {(trunc i} | not grep ext +; RUN: opt %s -analyze -scalar-evolution -disable-output | grep {(trunc i} | not grep ext define i16 @test1(i8 %x) { %A = sext i8 %x to i32 Modified: llvm/trunk/test/Analysis/ScalarEvolution/2009-05-09-PointerEdgeCount.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2009-05-09-PointerEdgeCount.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2009-05-09-PointerEdgeCount.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2009-05-09-PointerEdgeCount.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | grep {count is 2} +; RUN: opt %s -analyze -scalar-evolution -disable-output | grep {count is 2} ; PR3171 %struct.Foo = type { i32 } Modified: llvm/trunk/test/Analysis/ScalarEvolution/2009-07-04-GroupConstantsWidthMismatch.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2009-07-04-GroupConstantsWidthMismatch.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2009-07-04-GroupConstantsWidthMismatch.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2009-07-04-GroupConstantsWidthMismatch.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution +; RUN: opt %s -analyze -scalar-evolution ; PR4501 define void @test() { Modified: llvm/trunk/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 100} ; PR1101 Modified: llvm/trunk/test/Analysis/ScalarEvolution/and-xor.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/and-xor.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/and-xor.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/and-xor.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalar-evolution -analyze -disable-output \ +; RUN: opt %s -scalar-evolution -analyze -disable-output \ ; RUN: | grep {\\--> (zext} | count 2 define i32 @foo(i32 %x) { Modified: llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-0.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-0.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-0.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-0.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output +; RUN: opt %s -analyze -scalar-evolution -disable-output ; PR4537 ; ModuleID = 'b.bc' Modified: llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/avoid-infinite-recursion-1.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -iv-users +; RUN: opt %s -iv-users ; PR4538 ; ModuleID = 'bugpoint-reduced-simplified.bc' Modified: llvm/trunk/test/Analysis/ScalarEvolution/avoid-smax-0.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/avoid-smax-0.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/avoid-smax-0.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/avoid-smax-0.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalar-evolution -analyze -disable-output | grep {Loop bb3: backedge-taken count is (-1 + %n)} +; RUN: opt %s -scalar-evolution -analyze -disable-output | grep {Loop bb3: backedge-taken count is (-1 + %n)} ; We don't want to use a max in the trip count expression in ; this testcase. Modified: llvm/trunk/test/Analysis/ScalarEvolution/avoid-smax-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/avoid-smax-1.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/avoid-smax-1.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/avoid-smax-1.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t +; RUN: opt %s -indvars | llvm-dis > %t ; RUN: grep select %t | count 2 ; RUN: grep {icmp ne i32.\* %w } %t Modified: llvm/trunk/test/Analysis/ScalarEvolution/div-overflow.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/div-overflow.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/div-overflow.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/div-overflow.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalar-evolution -analyze -disable-output \ +; RUN: opt %s -scalar-evolution -analyze -disable-output \ ; RUN: | grep {\\--> ((-128 \\* %a) /u -128)} ; Don't let ScalarEvolution fold this div away. Modified: llvm/trunk/test/Analysis/ScalarEvolution/do-loop.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/do-loop.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/do-loop.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/do-loop.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | grep smax +; RUN: opt %s -analyze -scalar-evolution -disable-output | grep smax ; PR1614 define i32 @f(i32 %x, i32 %y) { Modified: llvm/trunk/test/Analysis/ScalarEvolution/max-trip-count.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/max-trip-count.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/max-trip-count.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/max-trip-count.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: | grep {\{%d,+,\[^\{\}\]\*\}} ; ScalarEvolution should be able to understand the loop and eliminate the casts. Modified: llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/nsw.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | grep { --> {.*,+,.*}} | count 8 +; RUN: opt %s -analyze -scalar-evolution -disable-output | grep { --> {.*,+,.*}} | count 8 ; The addrecs in this loop are analyzable only by using nsw information. Modified: llvm/trunk/test/Analysis/ScalarEvolution/pointer-sign-bits.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/pointer-sign-bits.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/pointer-sign-bits.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/pointer-sign-bits.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output +; RUN: opt %s -analyze -scalar-evolution -disable-output 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" %JavaObject = type { [0 x i32 (...)*]*, i8* } Modified: llvm/trunk/test/Analysis/ScalarEvolution/pr3909.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/pr3909.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/pr3909.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/pr3909.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -indvars -disable-output +; RUN: opt %s -indvars -disable-output ; PR 3909 Modified: llvm/trunk/test/Analysis/ScalarEvolution/scev-aa.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/scev-aa.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/scev-aa.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/scev-aa.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scev-aa -aa-eval -print-all-alias-modref-info \ +; RUN: opt %s -scev-aa -aa-eval -print-all-alias-modref-info \ ; RUN: |& FileCheck %s ; At the time of this writing, all of these CHECK lines are cases that Modified: llvm/trunk/test/Analysis/ScalarEvolution/sext-inreg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/sext-inreg.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/sext-inreg.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/sext-inreg.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output > %t +; RUN: opt %s -analyze -scalar-evolution -disable-output > %t ; RUN: grep {sext i57 \{0,+,199\} to i64} %t | count 1 ; RUN: grep {sext i59 \{0,+,199\} to i64} %t | count 1 Modified: llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-0.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-0.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-0.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-0.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -disable-output -scalar-evolution -analyze \ +; RUN: opt %s -disable-output -scalar-evolution -analyze \ ; RUN: | grep { --> \{-128,+,1\} Exits: 127} | count 5 ; Convert (sext {-128,+,1}) to {sext(-128),+,sext(1)}, since the Modified: llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-1.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-1.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-1.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -disable-output -scalar-evolution -analyze \ +; RUN: opt %s -disable-output -scalar-evolution -analyze \ ; RUN: | grep { --> (sext i. \{.\*,+,.\*\} to i64)} | count 5 ; Don't convert (sext {...,+,...}) to {sext(...),+,sext(...)} in cases Modified: llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-2.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-2.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/sext-iv-2.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | FileCheck %s +; RUN: opt %s -analyze -scalar-evolution -disable-output | FileCheck %s ; CHECK: %tmp3 = sext i8 %tmp2 to i32 ; CHECK: --> (sext i8 {0,+,1} to i32) Exits: -1 Modified: llvm/trunk/test/Analysis/ScalarEvolution/smax.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/smax.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/smax.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/smax.ll Tue Sep 8 11:50:01 2009 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | grep smax | count 2 -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | grep \ +; RUN: opt %s -analyze -scalar-evolution -disable-output | grep smax | count 2 +; RUN: opt %s -analyze -scalar-evolution -disable-output | grep \ ; RUN: {%. smax %. smax %.} ; PR1614 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=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/trip-count.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/trip-count.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 10000} ; PR1101 Modified: llvm/trunk/test/Analysis/ScalarEvolution/trip-count2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/trip-count2.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/trip-count2.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/trip-count2.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output | \ +; RUN: opt %s -analyze -scalar-evolution -disable-output | \ ; RUN: grep {backedge-taken count is 4} ; PR1101 Modified: llvm/trunk/test/Analysis/ScalarEvolution/trip-count3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/trip-count3.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/trip-count3.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/trip-count3.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalar-evolution -analyze -disable-output \ +; RUN: opt %s -scalar-evolution -analyze -disable-output \ ; RUN: | grep {Loop bb3\\.i: Unpredictable backedge-taken count\\.} ; ScalarEvolution can't compute a trip count because it doesn't know if Modified: llvm/trunk/test/Analysis/ScalarEvolution/trip-count4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/trip-count4.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/trip-count4.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/trip-count4.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: | grep {sext.*trunc.*Exits: 11} ; ScalarEvolution should be able to compute a loop exit value for %indvar.i8. Modified: llvm/trunk/test/Analysis/ScalarEvolution/trip-count5.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/trip-count5.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/trip-count5.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/trip-count5.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output > %t +; RUN: opt %s -analyze -scalar-evolution -disable-output > %t ; RUN: grep sext %t | count 2 ; RUN: not grep {(sext} %t Modified: llvm/trunk/test/Analysis/ScalarEvolution/trip-count6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/trip-count6.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/trip-count6.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/trip-count6.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -disable-output -scalar-evolution \ +; RUN: opt %s -analyze -disable-output -scalar-evolution \ ; RUN: | grep {max backedge-taken count is 1\$} @mode_table = global [4 x i32] zeroinitializer ; <[4 x i32]*> [#uses=1] Modified: llvm/trunk/test/Analysis/ScalarEvolution/trip-count7.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/trip-count7.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/trip-count7.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/trip-count7.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: | grep {Loop bb7.i: Unpredictable backedge-taken count\\.} target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" Modified: llvm/trunk/test/Analysis/ScalarEvolution/trip-count8.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/trip-count8.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/trip-count8.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/trip-count8.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: | grep {Loop for\\.body: backedge-taken count is (-1 + \[%\]ecx)} ; PR4599 Modified: llvm/trunk/test/Analysis/ScalarEvolution/xor-and.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/xor-and.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/xor-and.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/xor-and.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalar-evolution -disable-output -analyze \ +; RUN: opt %s -scalar-evolution -disable-output -analyze \ ; RUN: | grep {\\--> (zext i4 (-8 + (trunc i64 (8 \\* %x) to i4)) to i64)} ; ScalarEvolution shouldn't try to analyze %z into something like Modified: llvm/trunk/test/Analysis/ScalarEvolution/zext-wrap.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/zext-wrap.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/zext-wrap.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/zext-wrap.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: opt %s -analyze -scalar-evolution -disable-output \ ; RUN: | FileCheck %s ; PR4569 Modified: llvm/trunk/test/Assembler/2002-04-07-HexFloatConstants.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-04-07-HexFloatConstants.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-04-07-HexFloatConstants.ll (original) +++ llvm/trunk/test/Assembler/2002-04-07-HexFloatConstants.ll Tue Sep 8 11:50:01 2009 @@ -5,7 +5,7 @@ ; of the bug that was causing the Olden Health benchmark to output incorrect ; results! ; -; RUN: llvm-as < %s | opt -constprop | llvm-dis > %t.1 +; RUN: opt %s -constprop | llvm-dis > %t.1 ; RUN: llvm-as < %s | llvm-dis | llvm-as | opt -constprop | \ ; RUN: llvm-dis > %t.2 ; RUN: diff %t.1 %t.2 Modified: llvm/trunk/test/Assembler/2002-04-29-NameBinding.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-04-29-NameBinding.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-04-29-NameBinding.ll (original) +++ llvm/trunk/test/Assembler/2002-04-29-NameBinding.ll Tue Sep 8 11:50:01 2009 @@ -4,7 +4,7 @@ ; Check by running globaldce, which will remove the constant if there are ; no references to it! ; -; RUN: llvm-as < %s | opt -globaldce | llvm-dis | \ +; RUN: opt %s -globaldce | llvm-dis | \ ; RUN: not grep constant ; Modified: llvm/trunk/test/Assembler/2002-08-19-BytecodeReader.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-08-19-BytecodeReader.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2002-08-19-BytecodeReader.ll (original) +++ llvm/trunk/test/Assembler/2002-08-19-BytecodeReader.ll Tue Sep 8 11:50:01 2009 @@ -1,7 +1,7 @@ ; Testcase that seems to break the bytecode reader. This comes from the ; "crafty" spec benchmark. ; -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | llvm-as +; RUN: opt %s -instcombine | llvm-dis | llvm-as %CHESS_POSITION = type { i32, i32 } @pawn_probes = external global i32 ; [#uses=0] Modified: llvm/trunk/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll (original) +++ llvm/trunk/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine -simplifycfg | llvm-dis | not grep br +; RUN: opt %s -instcombine -simplifycfg | llvm-dis | not grep br @.str_1 = internal constant [6 x i8] c"_Bool\00" ; <[6 x i8]*> [#uses=2] Modified: llvm/trunk/test/Assembler/2008-02-20-MultipleReturnValue.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2008-02-20-MultipleReturnValue.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2008-02-20-MultipleReturnValue.ll (original) +++ llvm/trunk/test/Assembler/2008-02-20-MultipleReturnValue.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -verify | llvm-dis | llvm-as -disable-output +; RUN: opt %s -verify | llvm-dis | llvm-as -disable-output define {i32, i8} @foo(i32 %p) { ret i32 1, i8 2 Modified: llvm/trunk/test/Assembler/2009-02-28-StripOpaqueName.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2009-02-28-StripOpaqueName.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2009-02-28-StripOpaqueName.ll (original) +++ llvm/trunk/test/Assembler/2009-02-28-StripOpaqueName.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -strip | llvm-dis | llvm-as | llvm-dis +; RUN: opt %s -strip | llvm-dis | llvm-as | llvm-dis ; Stripping the name from A should not break references to it. %A = type opaque Modified: llvm/trunk/test/Bitcode/extractelement.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/extractelement.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Bitcode/extractelement.ll (original) +++ llvm/trunk/test/Bitcode/extractelement.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -constprop | llvm-dis +; RUN: opt %s -constprop | llvm-dis ; PR3465 define double @test() { Modified: llvm/trunk/test/CodeGen/Generic/GC/argpromotion.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/GC/argpromotion.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/GC/argpromotion.ll (original) +++ llvm/trunk/test/CodeGen/Generic/GC/argpromotion.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -anders-aa -argpromotion +; RUN: opt %s -anders-aa -argpromotion declare void @llvm.gcroot(i8**, i8*) Modified: llvm/trunk/test/CodeGen/Generic/GC/deadargelim.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/GC/deadargelim.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/GC/deadargelim.ll (original) +++ llvm/trunk/test/CodeGen/Generic/GC/deadargelim.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -deadargelim +; RUN: opt %s -deadargelim declare void @llvm.gcroot(i8**, i8*) Modified: llvm/trunk/test/CodeGen/Generic/GC/inline.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/GC/inline.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/GC/inline.ll (original) +++ llvm/trunk/test/CodeGen/Generic/GC/inline.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | grep example +; RUN: opt %s -inline | llvm-dis | grep example %IntArray = type { i32, [0 x i32*] } Modified: llvm/trunk/test/CodeGen/Generic/GC/inline2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/GC/inline2.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/GC/inline2.ll (original) +++ llvm/trunk/test/CodeGen/Generic/GC/inline2.ll Tue Sep 8 11:50:01 2009 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | grep sample -; RUN: llvm-as < %s | opt -inline | llvm-dis | grep example +; RUN: opt %s -inline | llvm-dis | grep sample +; RUN: opt %s -inline | llvm-dis | grep example %IntArray = type { i32, [0 x i32*] } Modified: llvm/trunk/test/CodeGen/PowerPC/ppcf128-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/ppcf128-1.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/ppcf128-1.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/ppcf128-1.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -std-compile-opts | llc > %t +; RUN: opt %s -std-compile-opts | llc > %t ; ModuleID = 'ld3.c' 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-darwin8" Modified: llvm/trunk/test/CodeGen/PowerPC/vec_shuffle.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/vec_shuffle.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/vec_shuffle.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/vec_shuffle.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | \ +; RUN: opt %s -instcombine | \ ; RUN: llc -march=ppc32 -mcpu=g5 | not grep vperm ; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 > %t ; RUN: grep vsldoi %t | count 2 Modified: llvm/trunk/test/CodeGen/X86/2009-03-23-i80-fp80.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-23-i80-fp80.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-03-23-i80-fp80.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-03-23-i80-fp80.ll Tue Sep 8 11:50:01 2009 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 302245289961712575840256 -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep K40018000000000000000 +; RUN: opt %s -instcombine | llvm-dis | grep 302245289961712575840256 +; RUN: opt %s -instcombine | llvm-dis | grep K40018000000000000000 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" Modified: llvm/trunk/test/CodeGen/X86/asm-block-labels.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/asm-block-labels.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/asm-block-labels.ll (original) +++ llvm/trunk/test/CodeGen/X86/asm-block-labels.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -std-compile-opts | llc +; RUN: opt %s -std-compile-opts | llc ; ModuleID = 'block12.c' 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-darwin8" Modified: llvm/trunk/test/CodeGen/X86/nancvt.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/nancvt.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/nancvt.ll (original) +++ llvm/trunk/test/CodeGen/X86/nancvt.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -std-compile-opts | llc > %t +; RUN: opt %s -std-compile-opts | llc > %t ; RUN: grep 2147027116 %t | count 3 ; RUN: grep 2147228864 %t | count 3 ; RUN: grep 2146502828 %t | count 3 Modified: llvm/trunk/test/CodeGen/X86/vec_ins_extract.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_ins_extract.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_ins_extract.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_ins_extract.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -scalarrepl -instcombine | \ +; RUN: opt %s -scalarrepl -instcombine | \ ; RUN: llc -march=x86 -mcpu=yonah | not grep sub.*esp ; This checks that various insert/extract idiom work without going to the Modified: llvm/trunk/test/DebugInfo/2008-11-05-InlinedFuncStart.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2008-11-05-InlinedFuncStart.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2008-11-05-InlinedFuncStart.ll (original) +++ llvm/trunk/test/DebugInfo/2008-11-05-InlinedFuncStart.ll Tue Sep 8 11:50:01 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -; RUN: llvm-as < %s | llc -O0 +; RUN: llc %s -o - -O0 %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } Modified: llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll (original) +++ llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o /dev/null -verify-dom-info +; RUN: llc %s -o /dev/null -verify-dom-info %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32, i8*, i8* } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } Modified: llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll (original) +++ llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o /dev/null +; RUN: llc %s -o /dev/null %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }*, i8*, i8* } @llvm.dbg.variable24 = external constant %llvm.dbg.variable.type ; <%llvm.dbg.variable.type*> [#uses=1] Modified: llvm/trunk/test/DebugInfo/2009-01-15-member.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-15-member.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-15-member.ll (original) +++ llvm/trunk/test/DebugInfo/2009-01-15-member.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o /dev/null +; RUN: llc %s -o /dev/null %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32, i8*, i8* } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } Modified: llvm/trunk/test/DebugInfo/2009-02-18-DefaultScope-Crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-02-18-DefaultScope-Crash.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-02-18-DefaultScope-Crash.ll (original) +++ llvm/trunk/test/DebugInfo/2009-02-18-DefaultScope-Crash.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o /dev/null +; RUN: llc %s -o /dev/null %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8* } Modified: llvm/trunk/test/DebugInfo/2009-03-03-cheapdse.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-03-03-cheapdse.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-03-03-cheapdse.ll (original) +++ llvm/trunk/test/DebugInfo/2009-03-03-cheapdse.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep store | count 5 +; RUN: opt %s -instcombine | llvm-dis | grep store | count 5 ; ModuleID = '' 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 = "i386-apple-darwin9.6" Modified: llvm/trunk/test/DebugInfo/2009-03-03-deadstore.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-03-03-deadstore.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-03-03-deadstore.ll (original) +++ llvm/trunk/test/DebugInfo/2009-03-03-deadstore.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep alloca +; RUN: opt %s -instcombine | llvm-dis | not grep alloca ; ModuleID = '' 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 = "i386-apple-darwin9.6" Modified: llvm/trunk/test/DebugInfo/2009-03-03-store-to-load-forward.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-03-03-store-to-load-forward.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-03-03-store-to-load-forward.ll (original) +++ llvm/trunk/test/DebugInfo/2009-03-03-store-to-load-forward.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep alloca +; RUN: opt %s -instcombine | llvm-dis | not grep alloca ; ModuleID = '' 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 = "i386-apple-darwin9.6" Modified: llvm/trunk/test/DebugInfo/2009-06-12-Inline.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-06-12-Inline.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-06-12-Inline.ll (original) +++ llvm/trunk/test/DebugInfo/2009-06-12-Inline.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o /dev/null +; RUN: llc %s -o /dev/null %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 } Modified: llvm/trunk/test/DebugInfo/2009-06-12-InlineFuncStart.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-06-12-InlineFuncStart.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-06-12-InlineFuncStart.ll (original) +++ llvm/trunk/test/DebugInfo/2009-06-12-InlineFuncStart.ll Tue Sep 8 11:50:01 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -; RUN: llvm-as < %s | llc -O0 +; RUN: llc %s -o - -O0 %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } Modified: llvm/trunk/test/DebugInfo/2009-06-15-InlineFuncStart.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-06-15-InlineFuncStart.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-06-15-InlineFuncStart.ll (original) +++ llvm/trunk/test/DebugInfo/2009-06-15-InlineFuncStart.ll Tue Sep 8 11:50:01 2009 @@ -2,7 +2,7 @@ ; 2009-06-12-InlineFunctStart.ll with one change. In function main, the bb1 ; does not have llvm.dbg.stoppiont intrinsic before llvm.dbg.func.start. ; RUN: llvm-as < %s | llc -; RUN: llvm-as < %s | llc -O0 +; RUN: llc %s -o - -O0 %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } Modified: llvm/trunk/test/DebugInfo/2009-06-15-abstract_origin.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-06-15-abstract_origin.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2009-06-15-abstract_origin.ll (original) +++ llvm/trunk/test/DebugInfo/2009-06-15-abstract_origin.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -asm-verbose -O0 | not grep ".long 0x0 ## DW_AT_abstract_origin" +; RUN: llc %s -o - -asm-verbose -O0 | not grep ".long 0x0 ## DW_AT_abstract_origin" %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } Modified: llvm/trunk/test/DebugInfo/deaddebuglabel.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/deaddebuglabel.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/deaddebuglabel.ll (original) +++ llvm/trunk/test/DebugInfo/deaddebuglabel.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -O0 | grep "label" | count 8 +; RUN: llc %s -o - -O0 | grep "label" | count 8 ; PR2614 ; XFAIL: * Modified: llvm/trunk/test/DebugInfo/printdbginfo2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/printdbginfo2.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/printdbginfo2.ll (original) +++ llvm/trunk/test/DebugInfo/printdbginfo2.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -print-dbginfo -disable-output | FileCheck %s +; RUN: opt %s -print-dbginfo -disable-output | FileCheck %s ; grep {%b is variable b of type x declared at x.c:7} %t1 ; grep {%2 is variable b of type x declared at x.c:7} %t1 ; grep {@c.1442 is variable c of type int declared at x.c:4} %t1 Modified: llvm/trunk/test/Feature/load_module.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/load_module.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Feature/load_module.ll (original) +++ llvm/trunk/test/Feature/load_module.ll Tue Sep 8 11:50:01 2009 @@ -1,6 +1,6 @@ ; PR1318 -; RUN: llvm-as < %s | opt -load=%llvmlibsdir/LLVMHello%shlibext -hello \ -; RUN: -disable-output - |& grep Hello +; RUN: opt %s -load=%llvmlibsdir/LLVMHello%shlibext -hello \ +; RUN: -disable-output |& grep Hello @junk = global i32 0 Modified: llvm/trunk/test/Feature/weak_constant.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/weak_constant.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Feature/weak_constant.ll (original) +++ llvm/trunk/test/Feature/weak_constant.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -std-compile-opts | llvm-dis > %t +; RUN: opt %s -std-compile-opts | llvm-dis > %t ; RUN: grep undef %t | count 1 ; RUN: grep 5 %t | count 1 ; RUN: grep 7 %t | count 1 Modified: llvm/trunk/test/FrontendC/2008-07-29-EHLabel.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2008-07-29-EHLabel.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2008-07-29-EHLabel.ll (original) +++ llvm/trunk/test/FrontendC/2008-07-29-EHLabel.ll Tue Sep 8 11:50:01 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o - | %llvmgcc -xassembler -c -o /dev/null - +; RUN: llc %s -o - | %llvmgcc -xassembler -c -o /dev/null - ; PR2609 %struct..0._11 = type { i32 } %struct..1__pthread_mutex_s = type { i32, i32, i32, i32, i32, %struct..0._11 } Modified: llvm/trunk/test/Other/2002-01-31-CallGraph.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/2002-01-31-CallGraph.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Other/2002-01-31-CallGraph.ll (original) +++ llvm/trunk/test/Other/2002-01-31-CallGraph.ll Tue Sep 8 11:50:01 2009 @@ -1,6 +1,6 @@ ; Call graph construction crash: Not handling indirect calls right ; -; RUN: llvm-as < %s | opt -analyze -print-callgraph >& /dev/null +; RUN: opt %s -analyze -print-callgraph >& /dev/null ; %FunTy = type i32 (i32) Modified: llvm/trunk/test/Other/2002-02-24-InlineBrokePHINodes.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/2002-02-24-InlineBrokePHINodes.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Other/2002-02-24-InlineBrokePHINodes.ll (original) +++ llvm/trunk/test/Other/2002-02-24-InlineBrokePHINodes.ll Tue Sep 8 11:50:01 2009 @@ -1,7 +1,7 @@ ; Inlining used to break PHI nodes. This tests that they are correctly updated ; when a node is split around the call instruction. The verifier caught the error. ; -; RUN: llvm-as < %s | opt -inline +; RUN: opt %s -inline ; define i64 @test(i64 %X) { Modified: llvm/trunk/test/Other/2002-03-11-ConstPropCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/2002-03-11-ConstPropCrash.ll?rev=81226&r1=81225&r2=81226&view=diff ============================================================================== --- llvm/trunk/test/Other/2002-03-11-ConstPropCrash.ll (original) +++ llvm/trunk/test/Other/2002-03-11-ConstPropCrash.ll Tue Sep 8 11:50:01 2009 @@ -5,7 +5,7 @@ ; ; Fixed by adding new arguments to ConstantFoldTerminator ; -; RUN: llvm-as < %s | opt -constprop +; RUN: opt %s -constprop define void @build_tree(i32 %ml) { ;