[llvm-commits] [llvm] r40623 - in /llvm/trunk/test/C++Frontend: 2007-07-29-RestrictPtrArg.cpp 2007-07-29-RestrictRefArg.cpp
Author: clamb Date: Tue Jul 31 02:03:24 2007 New Revision: 40623 URL: http://llvm.org/viewvc/llvm-project?rev=40623&view=rev Log: Un-XFAIL these tests after r40622 fixed them. Modified: llvm/trunk/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp llvm/trunk/test/C++Frontend/2007-07-29-RestrictRefArg.cpp Modified: llvm/trunk/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/C%2B%2BFrontend/2007-07-29-RestrictPtrArg.cpp?rev=40623&r1=40622&r2=40623&view=diff == --- llvm/trunk/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp (original) +++ llvm/trunk/test/C++Frontend/2007-07-29-RestrictPtrArg.cpp Tue Jul 31 02:03:24 2007 @@ -1,5 +1,4 @@ // RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep noalias -// XFAIL: i[1-9]86|alpha|ia64|arm|x86_64|amd64 // NOTE: This should be un-XFAILed when the C++ type qualifiers are fixed void foo(int * __restrict myptr1, int * myptr2) { Modified: llvm/trunk/test/C++Frontend/2007-07-29-RestrictRefArg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/C%2B%2BFrontend/2007-07-29-RestrictRefArg.cpp?rev=40623&r1=40622&r2=40623&view=diff == --- llvm/trunk/test/C++Frontend/2007-07-29-RestrictRefArg.cpp (original) +++ llvm/trunk/test/C++Frontend/2007-07-29-RestrictRefArg.cpp Tue Jul 31 02:03:24 2007 @@ -1,5 +1,4 @@ // RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep noalias -// XFAIL: i[1-9]86|alpha|ia64|arm|x86_64|amd64 // NOTE: This should be un-XFAILed when the C++ type qualifiers are fixed void foo(int & __restrict myptr1, int & myptr2) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40624 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll
Author: clamb Date: Tue Jul 31 02:04:51 2007 New Revision: 40624 URL: http://llvm.org/viewvc/llvm-project?rev=40624&view=rev Log: Teach BasicAA about noalias function parameters. Passes all of DejaGNU and test-suite. Added: llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=40624&r1=40623&r2=40624&view=diff == --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Jul 31 02:04:51 2007 @@ -18,6 +18,7 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" +#include "llvm/ParameterAttributes.h" #include "llvm/GlobalVariable.h" #include "llvm/Instructions.h" #include "llvm/Pass.h" @@ -294,6 +295,21 @@ // Pointing at a discernible object? if (O1) { +// Check for noalias attribute +if (isa(O1)) { + const Argument *Arg = cast(O1); + const Function *Func = Arg->getParent(); + const ParamAttrsList *Attr = Func->getFunctionType()->getParamAttrs(); + if (Attr) { +unsigned Idx = 1; +for (Function::const_arg_iterator I = Func->arg_begin(), + E = Func->arg_end(); I != E; ++I, ++Idx) { + if (&(*I) == Arg && + Attr->paramHasAttr(Idx, ParamAttr::NoAlias)) +return NoAlias; +} + } +} if (O2) { if (isa(O1)) { // Incoming argument cannot alias locally allocated object! @@ -307,7 +323,22 @@ // If they are two different objects, we know that we have no alias... return NoAlias; } - + + // Check for noalias atrribute independently from above logic + if (isa(O2)) { +const Argument *Arg = cast(O2); +const Function *Func = Arg->getParent(); +const ParamAttrsList *Attr = Func->getFunctionType()->getParamAttrs(); +if (Attr) { + unsigned Idx = 1; + for (Function::const_arg_iterator I = Func->arg_begin(), +E = Func->arg_end(); I != E; ++I, ++Idx) { +if (&(*I) == Arg && + Attr->paramHasAttr(Idx, ParamAttr::NoAlias)) + return NoAlias; + } +} + } // If they are the same object, they we can look at the indexes. If they // index off of the object is the same for both pointers, they must alias. // If they are provably different, they must not alias. Otherwise, we Added: llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll?rev=40624&view=auto == --- llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll (added) +++ llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll Tue Jul 31 02:04:51 2007 @@ -0,0 +1,12 @@ +; RUN: llvm-as %s -o - | opt -aa-eval -print-may-aliases -disable-output |& grep '1 may alias' +; RUN: llvm-as %s -o - | opt -aa-eval -print-may-aliases -disable-output |& grep '5 no alias' +; RUN: llvm-as %s -o - | opt -aa-eval -print-may-aliases -disable-output |& grep 'MayAlias: i32* %ptr4, i32* %ptr2' + +define void @_Z3fooPiS_RiS_(i32* noalias %ptr1, i32* %ptr2, i32* noalias %ptr3, i32* %ptr4) { +entry: +store i32 0, i32* %ptr1 +store i32 0, i32* %ptr2 +store i32 0, i32* %ptr3 +store i32 0, i32* %ptr4 +ret void +} \ No newline at end of file ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40625 - in /llvm/trunk: include/llvm/Analysis/LoopPass.h lib/Analysis/LoopPass.cpp
Author: dpatel Date: Tue Jul 31 03:00:57 2007 New Revision: 40625 URL: http://llvm.org/viewvc/llvm-project?rev=40625&view=rev Log: Introduce Simple Analysis interface for loop passes. Right now, this interface provides hooks for only to operations, 1) clone basic block 2) delete value. Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h llvm/trunk/lib/Analysis/LoopPass.cpp Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPass.h?rev=40625&r1=40624&r2=40625&view=diff == --- llvm/trunk/include/llvm/Analysis/LoopPass.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopPass.h Tue Jul 31 03:00:57 2007 @@ -63,6 +63,21 @@ virtual PassManagerType getPotentialPassManagerType() const { return PMT_LoopPassManager; } + + //======// + /// SimpleAnalysis - Provides simple interface to update analysis info + /// maintained by various passes. Note, if required this interface can + /// be extracted into a separate abstract class but it would require + /// additional use of multiple inheritance in Pass class hierarcy, someting + /// we are trying to avoid. + + /// Each loop pass can override these simple analysis hookss to update + /// desired analysis information. + /// cloneBasicBlockAnalysis - Clone analysis info associated with basic block. + virtual void cloneBasicBlockAnalysis(BasicBlock *F, BasicBlock *T, Loop *L) {} + + /// deletekAnalysisValue - Delete analysis info associated with value V. + virtual void deleteAnalysisValue(Value *V, Loop *L) {} }; class LPPassManager : public FunctionPass, public PMDataManager { @@ -115,6 +130,20 @@ // utility may send LPPassManager into infinite loops so use caution. void redoLoop(Loop *L); + //======// + /// SimpleAnalysis - Provides simple interface to update analysis info + /// maintained by various passes. Note, if required this interface can + /// be extracted into a separate abstract class but it would require + /// additional use of multiple inheritance in Pass class hierarcy, someting + /// we are trying to avoid. + + /// cloneBasicBlockSimpleAnalysis - Invoke cloneBasicBlockAnalysis hook for + /// all passes that implement simple analysis interface. + void cloneBasicBlockSimpleAnalysis(BasicBlock *From, BasicBlock *To, Loop *L); + + /// deleteSimpleAnalysisValue - Invoke deleteAnalysisValue hook for all passes + /// that implement simple analysis interface. + void deleteSimpleAnalysisValue(Value *V, Loop *L); private: std::deque LQ; bool skipThisLoop; Modified: llvm/trunk/lib/Analysis/LoopPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPass.cpp?rev=40625&r1=40624&r2=40625&view=diff == --- llvm/trunk/lib/Analysis/LoopPass.cpp (original) +++ llvm/trunk/lib/Analysis/LoopPass.cpp Tue Jul 31 03:00:57 2007 @@ -140,6 +140,27 @@ redoThisLoop = true; } +/// cloneBasicBlockSimpleAnalysis - Invoke cloneBasicBlockAnalysis hook for +/// all loop passes. +void LPPassManager::cloneBasicBlockSimpleAnalysis(BasicBlock *From, + BasicBlock *To, Loop *L) { + for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { +Pass *P = getContainedPass(Index); +LoopPass *LP = dynamic_cast(P); +LP->cloneBasicBlockAnalysis(From, To, L); + } +} + +/// deleteSimpleAnalysisValue - Invoke deleteAnalysisValue hook for all passes. +void LPPassManager::deleteSimpleAnalysisValue(Value *V, Loop *L) { + for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { +Pass *P = getContainedPass(Index); +LoopPass *LP = dynamic_cast(P); +LP->deleteAnalysisValue(V, L); + } +} + + // Recurse through all subloops and all loops into LQ. static void addLoopIntoQueue(Loop *L, std::deque &LQ) { LQ.push_back(L); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40626 - /llvm/trunk/lib/Transforms/Scalar/LICM.cpp
Author: dpatel Date: Tue Jul 31 03:01:41 2007 New Revision: 40626 URL: http://llvm.org/viewvc/llvm-project?rev=40626&view=rev Log: Implement Simple Analysis interfaces - cloneBasicBlockAnalysis and deleteAnalysisValue. Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=40626&r1=40625&r2=40626&view=diff == --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Tue Jul 31 03:01:41 2007 @@ -102,6 +102,13 @@ AliasSetTracker *CurAST; // AliasSet information for the current loop... std::map LoopToAliasMap; +/// cloneBasicBlockAnalysis - Simple Analysis hook. Clone alias set info. +void cloneBasicBlockAnalysis(BasicBlock *From, BasicBlock *To, Loop *L); + +/// deleteAnalysisValue - Simple Analysis hook. Delete value V from alias +/// set. +void deleteAnalysisValue(Value *V, Loop *L); + /// SinkRegion - Walk the specified region of the CFG (defined by all blocks /// dominated by the specified block, and that are in the current loop) in /// reverse depth first order w.r.t the DominatorTree. This allows us to @@ -798,3 +805,22 @@ } } } + +/// cloneBasicBlockAnalysis - Simple Analysis hook. Clone alias set info. +void LICM::cloneBasicBlockAnalysis(BasicBlock *From, BasicBlock *To, Loop *L) { + AliasSetTracker *AST = LoopToAliasMap[L]; + if (!AST) +return; + + AST->copyValue(From, To); +} + +/// deleteAnalysisValue - Simple Analysis hook. Delete value V from alias +/// set. +void LICM::deleteAnalysisValue(Value *V, Loop *L) { + AliasSetTracker *AST = LoopToAliasMap[L]; + if (!AST) +return; + + AST->deleteValue(V); +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40627 - /llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
Author: dpatel Date: Tue Jul 31 03:03:26 2007 New Revision: 40627 URL: http://llvm.org/viewvc/llvm-project?rev=40627&view=rev Log: Loop unswitch preserves dom info. Use simple analysis interface to preserve analysis info maintained by other loop passes. Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=40627&r1=40626&r2=40627&view=diff == --- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Tue Jul 31 03:03:26 2007 @@ -88,9 +88,13 @@ AU.addRequired(); AU.addPreserved(); AU.addRequiredID(LCSSAID); + AU.addPreservedID(LCSSAID); + AU.addPreserved(); + AU.addPreserved(); } private: + /// RemoveLoopFromWorklist - If the specified loop is on the loop worklist, /// remove it. void RemoveLoopFromWorklist(Loop *L) { @@ -114,9 +118,9 @@ BasicBlock *FalseDest, Instruction *InsertPt); -void SimplifyCode(std::vector &Worklist); +void SimplifyCode(std::vector &Worklist, Loop *L); void RemoveBlockIfDead(BasicBlock *BB, - std::vector &Worklist); + std::vector &Worklist, Loop *l); void RemoveLoopFromHierarchy(Loop *L); }; char LoopUnswitch::ID = 0; @@ -588,6 +592,7 @@ EmitPreheaderBranchOnCondition(Cond, Val, NewExit, NewPH, OrigPH->getTerminator()); OrigPH->getTerminator()->eraseFromParent(); + LPM->deleteSimpleAnalysisValue(OrigPH->getTerminator(), L); // We need to reprocess this loop, it could be unswitched again. redoLoop = true; @@ -690,6 +695,7 @@ BasicBlock *New = CloneBasicBlock(LoopBlocks[i], ValueMap, ".us", F); NewBlocks.push_back(New); ValueMap[LoopBlocks[i]] = New; // Keep the BB mapping. +LPM->cloneBasicBlockSimpleAnalysis(LoopBlocks[i], New, L); } // Update dominator info @@ -752,6 +758,7 @@ // Emit the new branch that selects between the two versions of this loop. EmitPreheaderBranchOnCondition(LIC, Val, NewBlocks[0], LoopBlocks[0], OldBR); OldBR->eraseFromParent(); + LPM->deleteSimpleAnalysisValue(OldBR, L); LoopProcessWorklist.push_back(NewLoop); redoLoop = true; @@ -782,7 +789,8 @@ /// ReplaceUsesOfWith - When we find that I really equals V, remove I from the /// program, replacing all uses with V and update the worklist. static void ReplaceUsesOfWith(Instruction *I, Value *V, - std::vector &Worklist) { + std::vector &Worklist, + Loop *L, LPPassManager *LPM) { DOUT << "Replace with '" << *V << "': " << *I; // Add uses to the worklist, which may be dead now. @@ -796,6 +804,7 @@ Worklist.push_back(cast(*UI)); I->replaceAllUsesWith(V); I->eraseFromParent(); + LPM->deleteSimpleAnalysisValue(I, L); RemoveFromWorklist(I, Worklist); ++NumSimplify; } @@ -804,7 +813,8 @@ /// information, and remove any dead successors it has. /// void LoopUnswitch::RemoveBlockIfDead(BasicBlock *BB, - std::vector &Worklist) { + std::vector &Worklist, + Loop *L) { if (pred_begin(BB) != pred_end(BB)) { // This block isn't dead, since an edge to BB was just removed, see if there // are any easy simplifications we can do now. @@ -813,7 +823,7 @@ while (isa(BB->begin())) ReplaceUsesOfWith(BB->begin(), cast(BB->begin())->getIncomingValue(0), - Worklist); + Worklist, L, LPM); // If this is the header of a loop and the only pred is the latch, we now // have an unreachable loop. @@ -823,13 +833,14 @@ // the header dead, which will make the latch dead (because the header // dominates the latch). Pred->getTerminator()->eraseFromParent(); + LPM->deleteSimpleAnalysisValue(Pred->getTerminator(), L); new UnreachableInst(Pred); // The loop is now broken, remove it from LI. RemoveLoopFromHierarchy(L); // Reprocess the header, which now IS dead. - RemoveBlockIfDead(BB, Worklist); + RemoveBlockIfDead(BB, Worklist, L); return; } @@ -880,7 +891,7 @@ // Remove the basic block, including all of the instructions contained in it. BB->eraseFromParent(); - + LPM->deleteSimpleAnalysisValue(BB, L); // Remove successor blocks here that are not dead, so that we know we only // have dead blocks in this list.
[llvm-commits] [llvm] r40628 - in /llvm/trunk: lib/Target/X86/X86InstrFPStack.td lib/Target/X86/X86InstrFormats.td lib/Target/X86/X86InstrInfo.td lib/Target/X86/X86InstrMMX.td lib/Target/X86/X86InstrS
Author: evancheng Date: Tue Jul 31 03:04:03 2007 New Revision: 40628 URL: http://llvm.org/viewvc/llvm-project?rev=40628&view=rev Log: Redo and generalize previously removed opt for pinsrw: (vextract (v4i32 bc (v4f32 s2v (f32 load ))), 0) -> (i32 load ) Added: llvm/trunk/lib/Target/X86/X86InstrFormats.td llvm/trunk/test/CodeGen/X86/2007-07-31-VInsertBug.ll Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td llvm/trunk/lib/Target/X86/X86InstrInfo.td llvm/trunk/lib/Target/X86/X86InstrMMX.td llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/lib/Target/X86/X86InstrX86-64.td Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFPStack.td?rev=40628&r1=40627&r2=40628&view=diff == --- llvm/trunk/lib/Target/X86/X86InstrFPStack.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFPStack.td Tue Jul 31 03:04:03 2007 @@ -119,17 +119,6 @@ // a pattern) and the FPI instruction should have emission info (e.g. opcode // encoding and asm printing info). -// FPI - Floating Point Instruction template. -class FPI o, Format F, dag outs, dag ins, string asm> - : I {} - -// FpI_ - Floating Point Psuedo Instruction template. Not Predicated. -class FpI_ pattern> - : X86Inst<0, Pseudo, NoImm, outs, ins, ""> { - let FPForm = fp; let FPFormBits = FPForm.Value; - let Pattern = pattern; -} - // Random Pseudo Instructions. def FpGETRESULT32 : FpI_<(outs RFP32:$dst), (ins), SpecialFP, [(set RFP32:$dst, X86fpget)]>; // FPR = ST(0) Added: llvm/trunk/lib/Target/X86/X86InstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFormats.td?rev=40628&view=auto == --- llvm/trunk/lib/Target/X86/X86InstrFormats.td (added) +++ llvm/trunk/lib/Target/X86/X86InstrFormats.td Tue Jul 31 03:04:03 2007 @@ -0,0 +1,232 @@ +//===- X86InstrFormats.td - X86 Instruction Formats *- tablegen -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by the LLVM research group and is distributed under +// the University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===--===// + +//===--===// +// X86 Instruction Format Definitions. +// + +// Format specifies the encoding used by the instruction. This is part of the +// ad-hoc solution used to emit machine instruction encodings by our machine +// code emitter. +class Format val> { + bits<6> Value = val; +} + +def Pseudo : Format<0>; def RawFrm : Format<1>; +def AddRegFrm : Format<2>; def MRMDestReg : Format<3>; +def MRMDestMem : Format<4>; def MRMSrcReg : Format<5>; +def MRMSrcMem : Format<6>; +def MRM0r : Format<16>; def MRM1r : Format<17>; def MRM2r : Format<18>; +def MRM3r : Format<19>; def MRM4r : Format<20>; def MRM5r : Format<21>; +def MRM6r : Format<22>; def MRM7r : Format<23>; +def MRM0m : Format<24>; def MRM1m : Format<25>; def MRM2m : Format<26>; +def MRM3m : Format<27>; def MRM4m : Format<28>; def MRM5m : Format<29>; +def MRM6m : Format<30>; def MRM7m : Format<31>; +def MRMInitReg : Format<32>; + + +// ImmType - This specifies the immediate type used by an instruction. This is +// part of the ad-hoc solution used to emit machine instruction encodings by our +// machine code emitter. +class ImmType val> { + bits<3> Value = val; +} +def NoImm : ImmType<0>; +def Imm8 : ImmType<1>; +def Imm16 : ImmType<2>; +def Imm32 : ImmType<3>; +def Imm64 : ImmType<4>; + +// FPFormat - This specifies what form this FP instruction has. This is used by +// the Floating-Point stackifier pass. +class FPFormat val> { + bits<3> Value = val; +} +def NotFP : FPFormat<0>; +def ZeroArgFP : FPFormat<1>; +def OneArgFP : FPFormat<2>; +def OneArgFPRW : FPFormat<3>; +def TwoArgFP : FPFormat<4>; +def CompareFP : FPFormat<5>; +def CondMovFP : FPFormat<6>; +def SpecialFP : FPFormat<7>; + +// Prefix byte classes which are used to indicate to the ad-hoc machine code +// emitter that various prefix bytes are required. +class OpSize { bit hasOpSizePrefix = 1; } +class AdSize { bit hasAdSizePrefix = 1; } +class REX_W { bit hasREX_WPrefix = 1; } +class TB { bits<4> Prefix = 1; } +class REP{ bits<4> Prefix = 2; } +class D8 { bits<4> Prefix = 3; } +class D9 { bits<4> Prefix = 4; } +class DA { bits<4> Prefix = 5; } +class DB { bits<4> Prefix = 6; } +class DC { bits<4> Prefix = 7; } +class DD { bits<4> Prefix = 8; } +class DE { bits<4> Prefix = 9; } +class DF { bits<4> Prefix = 10; } +class XD { bits<4> Prefix = 11; } +class XS { bits<4> Prefix = 12; } +class T8 { bits<4> Prefix = 13; } +class TA
[llvm-commits] [llvm] r40629 - in /llvm/trunk/test: Analysis/Dominators/2007-07-11-SplitBlock.ll Analysis/Dominators/2007-07-12-SplitBlock.ll Transforms/LCSSA/2007-07-12-LICM-2.ll Transforms/LCSSA/200
Author: dpatel Date: Tue Jul 31 03:04:17 2007 New Revision: 40629 URL: http://llvm.org/viewvc/llvm-project?rev=40629&view=rev Log: Bunch of tests to check loop passes. Added: llvm/trunk/test/Analysis/Dominators/2007-07-11-SplitBlock.ll llvm/trunk/test/Analysis/Dominators/2007-07-12-SplitBlock.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/LICM/2007-07-30-AliasSet.ll llvm/trunk/test/Transforms/LICM/Preserve-LCSSA.ll llvm/trunk/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll llvm/trunk/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll Removed: llvm/trunk/test/Transforms/LoopRotate/LRAnalysis.ll Added: llvm/trunk/test/Analysis/Dominators/2007-07-11-SplitBlock.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Dominators/2007-07-11-SplitBlock.ll?rev=40629&view=auto == --- llvm/trunk/test/Analysis/Dominators/2007-07-11-SplitBlock.ll (added) +++ llvm/trunk/test/Analysis/Dominators/2007-07-11-SplitBlock.ll Tue Jul 31 03:04:17 2007 @@ -0,0 +1,21 @@ +; RUN: llvm-as < %s | opt -loop-rotate -loop-unswitch -disable-output + +define i32 @stringSearch_Clib(i32 %count) { +entry: + br i1 false, label %bb36, label %bb44 + +cond_true20: ; preds = %bb36 + %tmp33 = add i32 0, 0 ; [#uses=1] + br label %bb36 + +bb36: ; preds = %cond_true20, %entry + %c.2 = phi i32 [ %tmp33, %cond_true20 ], [ 0, %entry ] ; [#uses=1] + br i1 false, label %cond_true20, label %bb41 + +bb41: ; preds = %bb36 + %c.2.lcssa = phi i32 [ %c.2, %bb36 ]; [#uses=0] + ret i32 0 + +bb44: ; preds = %entry + ret i32 0 +} Added: llvm/trunk/test/Analysis/Dominators/2007-07-12-SplitBlock.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/Dominators/2007-07-12-SplitBlock.ll?rev=40629&view=auto == --- llvm/trunk/test/Analysis/Dominators/2007-07-12-SplitBlock.ll (added) +++ llvm/trunk/test/Analysis/Dominators/2007-07-12-SplitBlock.ll Tue Jul 31 03:04:17 2007 @@ -0,0 +1,13 @@ +; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output + +define i32 @main(i32 %argc, i8** %argv) { +entry: + br label %bb7 + +bb7: ; preds = %bb7, %entry + %tmp54 = icmp slt i32 0, 200; [#uses=1] + br i1 %tmp54, label %bb7, label %bb56 + +bb56: ; preds = %bb7 + ret i32 0 +} Added: llvm/trunk/test/Transforms/LCSSA/2007-07-12-LICM-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LCSSA/2007-07-12-LICM-2.ll?rev=40629&view=auto == --- llvm/trunk/test/Transforms/LCSSA/2007-07-12-LICM-2.ll (added) +++ llvm/trunk/test/Transforms/LCSSA/2007-07-12-LICM-2.ll Tue Jul 31 03:04:17 2007 @@ -0,0 +1,17 @@ +; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output +define i32 @main(i32 %argc, i8** %argv) { +entry: + br label %bb7 + +bb7: ; preds = %bb7, %entry + %tmp39 = load <4 x float>* null ; <<4 x float>> [#uses=1] + %tmp40 = add <4 x float> %tmp39, < float 2.00e+00, float 3.00e+00, float 1.00e+00, float 0.00e+00 > ; <<4 x float>> [#uses=1] + %tmp43 = add <4 x float> %tmp40, < float 1.00e+00, float 1.00e+00, float 0.00e+00, float 2.00e+00 > ; <<4 x float>> [#uses=1] + %tmp46 = add <4 x float> %tmp43, < float 3.00e+00, float 0.00e+00, float 2.00e+00, float 4.00e+00 > ; <<4 x float>> [#uses=1] + %tmp49 = add <4 x float> %tmp46, < float 0.00e+00, float 4.00e+00, float 6.00e+00, float 1.00e+00 > ; <<4 x float>> [#uses=1] + store <4 x float> %tmp49, <4 x float>* null + br i1 false, label %bb7, label %bb56 + +bb56: ; preds = %bb7 + ret i32 0 +} Added: llvm/trunk/test/Transforms/LCSSA/2007-07-12-LICM-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LCSSA/2007-07-12-LICM-3.ll?rev=40629&view=auto == --- llvm/trunk/test/Transforms/LCSSA/2007-07-12-LICM-3.ll (added) +++ llvm/trunk/test/Transforms/LCSSA/2007-07-12-LICM-3.ll Tue Jul 31 03:04:17 2007 @@ -0,0 +1,24 @@ +; RUN: llvm-as < %s | opt -loop-rotate -licm -loop-unswitch -disable-output + +define i32 @main(i32 %argc, i8** %argv) { +entry: +br label %bb + +bb: ; preds = %bb56, %entry +br label %bb7 + +bb7:; preds = %bb7, %bb +%tmp39 = load <4 x float>* null ; <<4 x float>> [#uses=1] +%tmp40 = add <4 x
[llvm-commits] [llvm-gcc-4.2] r40630 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Author: asl Date: Tue Jul 31 03:12:35 2007 New Revision: 40630 URL: http://llvm.org/viewvc/llvm-project?rev=40630&view=rev Log: Propagate r40582 from llvm-gcc-4.0: Add support to emit noalias attribute on function parameters when the __restrict qualifier is used. Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=40630&r1=40629&r2=40630&view=diff == --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Tue Jul 31 03:12:35 2007 @@ -1031,6 +1031,11 @@ else Attributes |= ParamAttr::SExt; } + +// Compute noalias attributes. +if (TREE_CODE(ArgTy) == POINTER_TYPE || TREE_CODE(ArgTy) == REFERENCE_TYPE) + if (TYPE_RESTRICT(ArgTy)) +Attributes |= ParamAttr::NoAlias; #ifdef LLVM_TARGET_ENABLE_REGPARM // Allow the target to mark this as inreg. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.0] r40622 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-types.cpp
Hello, Christopher. > +tree RestrictArgTy = (DeclArgs) ? DeclArgs->type.common.type : ArgTy; This looks very dangerous. Why can't standard TREE_ macro be used here? Also, please add a comment describing what's going here (why you need such thing) :) -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.0] r40622 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-types.cpp
On Jul 31, 2007, at 1:30 AM, Anton Korobeynikov wrote: Hello, Christopher. +tree RestrictArgTy = (DeclArgs) ? DeclArgs- >type.common.type : ArgTy; This looks very dangerous. Why can't standard TREE_ macro be used here? Also, please add a comment describing what's going here (why you need such thing) :) What specifically is dangerous about this? I'm no GCC expert, but the DECL_ARGUMENTS() seems to be the only place where the restrict qualifier is preserved under C++. While debugging I could inspect the data structure to see that the information I needed was there, but looking in tree.h I found no TREE_... macro that got me there. The ?: came about because while bootstrapping GCC there were cases when DelArgs was NULL. It seems a bit of a hack, I know, but it's the best I could figure and it seems to work properly in my tests. If you have a suggestion on a more proper way to consistently get the restrict qualifier I'm all ears. =) -- Christopher Lamb ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r40624 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll
> Log: > Teach BasicAA about noalias function parameters. Passes all of DejaGNU and > test-suite. I just grepped through LLVM's test-suite and didn't find any uses of the restrict keyword though... >// Pointing at a discernible object? >if (O1) { > +// Check for noalias attribute > +if (isa(O1)) { > + const Argument *Arg = cast(O1); > + const Function *Func = Arg->getParent(); > + const ParamAttrsList *Attr = Func->getFunctionType()->getParamAttrs(); > + if (Attr) { > +unsigned Idx = 1; > +for (Function::const_arg_iterator I = Func->arg_begin(), > + E = Func->arg_end(); I != E; ++I, ++Idx) { > + if (&(*I) == Arg && > + Attr->paramHasAttr(Idx, ParamAttr::NoAlias)) > +return NoAlias; > +} > + } > +} This logic is more aggressive than what C's restrict qualifier allows in two ways. For this testcase: define void @foo(i32* noalias %p, i32* noalias %q, i32 %i, i32 %j) { %pi = getelementptr i32* %p, i32 %i %qi = getelementptr i32* %q, i32 %i %pj = getelementptr i32* %p, i32 %j %qj = getelementptr i32* %q, i32 %j store i32 0, i32* %p store i32 0, i32* %pi store i32 0, i32* %pj store i32 0, i32* %q store i32 0, i32* %qi store i32 0, i32* %qj ret void } basicaa is now saying this: 15 no alias responses (100.0%) 0 may alias responses (0.0%) 0 must alias responses (0.0%) The noalias logic should consider that a noalias pointer still aliases itself. In this example, %p, %pi, and %pj should all MayAlias each other, and %q, %qi, and %qj should all MayAlias each other. Second, since you're mapping C's restrict qualifier on parameters to this noalias attribute, it's necessary to consider cases like this: declare i32* @unclear(i32* %a) define void @foo(i32* noalias %x) { %y = call i32* @unclear(i32* %x) store i32 0, i32* %x store i32 0, i32* %y ret void } Right now basicaa is saying NoAlias for %x and %y. The answer should be MayAlias, because %y may legally be "based on" %x. There's nothing in the definition of restrict that says that "based on" relationships must be obvious to a compiler. So for an alias query where one of the two pointers is noalias and the other is not, and the non-noalias one doesn't have a base object that basicaa can find, the answer should be MayAlias. A more advanced pass could try to prove that the non-noalias pointer couldn't possibly be "based on" the noalias one by examining all its uses, though the specific example here would defy such analysis. > + // Check for noalias atrribute independently from above logic > + if (isa(O2)) { > +const Argument *Arg = cast(O2); > +const Function *Func = Arg->getParent(); > +const ParamAttrsList *Attr = > Func->getFunctionType()->getParamAttrs(); > +if (Attr) { > + unsigned Idx = 1; > + for (Function::const_arg_iterator I = Func->arg_begin(), > +E = Func->arg_end(); I != E; ++I, ++Idx) { > +if (&(*I) == Arg && > + Attr->paramHasAttr(Idx, ParamAttr::NoAlias)) > + return NoAlias; > + } > +} > + } Same as above. Dan -- Dan Gohman, Cray Inc. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40632 - in /llvm/trunk/lib: AsmParser/llvmAsmParser.y VMCore/Verifier.cpp
Author: reid Date: Tue Jul 31 09:39:10 2007 New Revision: 40632 URL: http://llvm.org/viewvc/llvm-project?rev=40632&view=rev Log: After a discussion with Anton, it turns out that the InReg attribute is not permitted on function results. So, revert the last patch to make it illegal. Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=40632&r1=40631&r2=40632&view=diff == --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Tue Jul 31 09:39:10 2007 @@ -1245,7 +1245,6 @@ | NOUNWIND { $$ = ParamAttr::NoUnwind; } | ZEROEXT { $$ = ParamAttr::ZExt; } | SIGNEXT { $$ = ParamAttr::SExt; } - | INREG{ $$ = ParamAttr::InReg;} ; OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; } Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=40632&r1=40631&r2=40632&view=diff == --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Jul 31 09:39:10 2007 @@ -358,7 +358,8 @@ "Invalid struct-return function!", &F); const uint16_t ReturnIncompatible = -ParamAttr::ByVal | ParamAttr::Nest | ParamAttr::StructRet; +ParamAttr::ByVal | ParamAttr::InReg | +ParamAttr::Nest | ParamAttr::StructRet; const uint16_t ParameterIncompatible = ParamAttr::NoReturn | ParamAttr::NoUnwind; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40633 - /llvm/trunk/docs/LangRef.html
Author: reid Date: Tue Jul 31 09:40:14 2007 New Revision: 40633 URL: http://llvm.org/viewvc/llvm-project?rev=40633&view=rev Log: fp2uint -> fptoui 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=40633&r1=40632&r2=40633&view=diff == --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Jul 31 09:40:14 2007 @@ -1501,7 +1501,7 @@ Floating point extend a constant to another type. The size of CST must be smaller or equal to the size of TYPE. Both types must be floating point. - fp2uint ( CST to TYPE ) + fptoui ( CST to TYPE ) Convert a floating point constant to the corresponding unsigned integer constant. TYPE must be an integer type. CST must be floating point. If the value won't fit in the integer type, the results are undefined. @@ -3098,21 +3098,21 @@ Syntax: -= fp2uint to ; yields ty2 + = fptoui to ; yields ty2 Overview: -The 'fp2uint' converts a floating point value to its +The 'fptoui' converts a floating point value to its unsigned integer equivalent of type ty2. Arguments: -The 'fp2uint' instruction takes a value to cast, which must be a +The 'fptoui' instruction takes a value to cast, which must be a floating point value, and a type to cast it to, which must be an integer type. Semantics: - The 'fp2uint' instruction converts its + The 'fptoui' instruction converts its floating point operand into the nearest (rounding towards zero) unsigned integer value. If the value cannot fit in ty2, the results are undefined. @@ -3123,9 +3123,9 @@ Example: - %X = fp2uint double 123.0 to i32 ; yields i32:123 - %Y = fp2uint float 1.0E+300 to i1 ; yields i1:true - %X = fp2uint float 1.04E+17 to i8 ; yields undefined:1 + %X = fptoui double 123.0 to i32 ; yields i32:123 + %Y = fptoui float 1.0E+300 to i1 ; yields i1:true + %X = fptoui float 1.04E+17 to i8 ; yields undefined:1 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r40624 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll
On 7/31/07, Dan Gohman <[EMAIL PROTECTED]> wrote: > > Log: > > Teach BasicAA about noalias function parameters. Passes all of DejaGNU and > > test-suite. > > I just grepped through LLVM's test-suite and didn't find any uses of the > restrict keyword though... > There are a few you could snag from GCC's testsuite, because we started with an implementation that had the exact same problems you've noted below. > So for an alias query where one of the two pointers is noalias and the > other is not, and the non-noalias one doesn't have a base object that > basicaa can find, the answer should be MayAlias. A more advanced pass > could try to prove that the non-noalias pointer couldn't possibly be > "based on" the noalias one by examining all its uses, though the specific > example here would defy such analysis. This is also what we eventually did with GCC. Note that your function call example is not just "not disallowed", it is explicitly allowed. It is the one case you are allowed to carry restricted pointers outside the block they are in. See C99 6.7.3.1 #12 There is a weird issue in restrict where gcc doesn't "check for correctness of input code", and i doubt LLVM can either (at least, not easily). This is that block nesting can introduce valid restricted pointers in the nested block that would have otherwise been invalid. IIRC, anyway :) We of course, eliminate lexical scoping. For safety sake, we just assume that if they have come up with assignments between restricted pointers, that they are legal. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40635 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll
Author: clamb Date: Tue Jul 31 11:18:07 2007 New Revision: 40635 URL: http://llvm.org/viewvc/llvm-project?rev=40635&view=rev Log: Revert overly aggressive interpretation of noalias Removed: llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=40635&r1=40634&r2=40635&view=diff == --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Jul 31 11:18:07 2007 @@ -18,7 +18,6 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" -#include "llvm/ParameterAttributes.h" #include "llvm/GlobalVariable.h" #include "llvm/Instructions.h" #include "llvm/Pass.h" @@ -295,21 +294,6 @@ // Pointing at a discernible object? if (O1) { -// Check for noalias attribute -if (isa(O1)) { - const Argument *Arg = cast(O1); - const Function *Func = Arg->getParent(); - const ParamAttrsList *Attr = Func->getFunctionType()->getParamAttrs(); - if (Attr) { -unsigned Idx = 1; -for (Function::const_arg_iterator I = Func->arg_begin(), - E = Func->arg_end(); I != E; ++I, ++Idx) { - if (&(*I) == Arg && - Attr->paramHasAttr(Idx, ParamAttr::NoAlias)) -return NoAlias; -} - } -} if (O2) { if (isa(O1)) { // Incoming argument cannot alias locally allocated object! @@ -323,22 +307,7 @@ // If they are two different objects, we know that we have no alias... return NoAlias; } - - // Check for noalias atrribute independently from above logic - if (isa(O2)) { -const Argument *Arg = cast(O2); -const Function *Func = Arg->getParent(); -const ParamAttrsList *Attr = Func->getFunctionType()->getParamAttrs(); -if (Attr) { - unsigned Idx = 1; - for (Function::const_arg_iterator I = Func->arg_begin(), -E = Func->arg_end(); I != E; ++I, ++Idx) { -if (&(*I) == Arg && - Attr->paramHasAttr(Idx, ParamAttr::NoAlias)) - return NoAlias; - } -} - } + // If they are the same object, they we can look at the indexes. If they // index off of the object is the same for both pointers, they must alias. // If they are provably different, they must not alias. Otherwise, we Removed: llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll?rev=40634&view=auto == --- llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll (removed) @@ -1,12 +0,0 @@ -; RUN: llvm-as %s -o - | opt -aa-eval -print-may-aliases -disable-output |& grep '1 may alias' -; RUN: llvm-as %s -o - | opt -aa-eval -print-may-aliases -disable-output |& grep '5 no alias' -; RUN: llvm-as %s -o - | opt -aa-eval -print-may-aliases -disable-output |& grep 'MayAlias: i32* %ptr4, i32* %ptr2' - -define void @_Z3fooPiS_RiS_(i32* noalias %ptr1, i32* %ptr2, i32* noalias %ptr3, i32* %ptr4) { -entry: -store i32 0, i32* %ptr1 -store i32 0, i32* %ptr2 -store i32 0, i32* %ptr3 -store i32 0, i32* %ptr4 -ret void -} \ No newline at end of file ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40636 - /llvm/trunk/test/CodeGen/PowerPC/no-dead-strip.ll
Author: lattner Date: Tue Jul 31 11:18:25 2007 New Revision: 40636 URL: http://llvm.org/viewvc/llvm-project?rev=40636&view=rev Log: new testcase Added: llvm/trunk/test/CodeGen/PowerPC/no-dead-strip.ll Added: llvm/trunk/test/CodeGen/PowerPC/no-dead-strip.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/no-dead-strip.ll?rev=40636&view=auto == --- llvm/trunk/test/CodeGen/PowerPC/no-dead-strip.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/no-dead-strip.ll Tue Jul 31 11:18:25 2007 @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | llc | grep {no_dead_strip.*_X} + +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" +target triple = "powerpc-apple-darwin8.8.0" [EMAIL PROTECTED] = weak global i32 0 ; [#uses=1] [EMAIL PROTECTED] = internal constant [4 x i8] c"t.c\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] [EMAIL PROTECTED] = appending global [1 x i8*] [ i8* bitcast (i32* @X to i8*) ] ; <[1 x i8*]*> [#uses=0] + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40638 - /llvm/trunk/lib/Transforms/Scalar/LICM.cpp
Author: dpatel Date: Tue Jul 31 11:52:25 2007 New Revision: 40638 URL: http://llvm.org/viewvc/llvm-project?rev=40638&view=rev Log: Add note. Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=40638&r1=40637&r2=40638&view=diff == --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Tue Jul 31 11:52:25 2007 @@ -218,7 +218,9 @@ LoopPass *llvm::createLICMPass() { return new LICM(); } -/// Hoist expressions out of the specified loop... +/// Hoist expressions out of the specified loop. Note, alias info for inner +/// loop is not preserved so it is not a good idea to run LICM multiple +/// times on one loop. /// bool LICM::runOnLoop(Loop *L, LPPassManager &LPM) { Changed = false; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40641 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Author: djg Date: Tue Jul 31 12:22:27 2007 New Revision: 40641 URL: http://llvm.org/viewvc/llvm-project?rev=40641&view=rev Log: Use SCEVExpander::InsertCastOfTo instead of calling new IntToPtrInst directly, because the insert point used by the SCEVExpander may vary from what LSR originally computes. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=40641&r1=40640&r2=40641&view=diff == --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Jul 31 12:22:27 2007 @@ -596,10 +596,13 @@ } } Value *NewVal = InsertCodeForBaseAtPosition(NewBase, Rewriter, InsertPt, L); -// Adjust the type back to match the Inst. +// Adjust the type back to match the Inst. Note that we can't use InsertPt +// here because the SCEVExpander may have inserted the instructions after +// that point, in its efforts to avoid inserting redundant expressions. if (isa(OperandValToReplace->getType())) { - NewVal = new IntToPtrInst(NewVal, OperandValToReplace->getType(), "cast", -InsertPt); + NewVal = SCEVExpander::InsertCastOfTo(Instruction::IntToPtr, +NewVal, +OperandValToReplace->getType()); } // Replace the use of the operand Value with the new Phi we just created. Inst->replaceUsesOfWith(OperandValToReplace, NewVal); @@ -648,9 +651,13 @@ Instruction *InsertPt = PN->getIncomingBlock(i)->getTerminator(); Code = InsertCodeForBaseAtPosition(NewBase, Rewriter, InsertPt, L); -// Adjust the type back to match the PHI. +// Adjust the type back to match the PHI. Note that we can't use InsertPt +// here because the SCEVExpander may have inserted its instructions after +// that point, in its efforts to avoid inserting redundant expressions. if (isa(PN->getType())) { - Code = new IntToPtrInst(Code, PN->getType(), "cast", InsertPt); + Code = SCEVExpander::InsertCastOfTo(Instruction::IntToPtr, + Code, + PN->getType()); } } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.0] r40622 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-types.cpp
Hello, Christopher. > What specifically is dangerous about this? Well, because you're accessing internals of tree_node structure directly. Please use macroses. > I'm no GCC expert, but the DECL_ARGUMENTS() seems to be the only place > where the restrict qualifier is preserved under C++. While debugging I > could inspect the data structure to see that the information I needed > was there, but looking in tree.h I found no TREE_... macro that got me > there. This sometimes mean, that such data shouldn't be used at all ;) What's wrong with TREE_TYPE(decl) ? > The ?: came about because while bootstrapping GCC there were cases > when DelArgs was NULL. It seems a bit of a hack, I know, but it's the > best I could figure and it seems to work properly in my tests. If you > have a suggestion on a more proper way to consistently get the > restrict qualifier I'm all ears. =) What was the function decl in that case? -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40642 - in /llvm/trunk: lib/Transforms/Scalar/GVN.cpp test/Transforms/GVN/2007-07-31-NoDomInherit.ll
Author: resistor Date: Tue Jul 31 12:43:14 2007 New Revision: 40642 URL: http://llvm.org/viewvc/llvm-project?rev=40642&view=rev Log: Fix a misoptimization in aha. Added: llvm/trunk/test/Transforms/GVN/2007-07-31-NoDomInherit.ll Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=40642&r1=40641&r2=40642&view=diff == --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue Jul 31 12:43:14 2007 @@ -710,21 +710,14 @@ /// GetValueForBlock - Get the value to use within the specified basic block. /// available values are in Phis. Value *GVN::GetValueForBlock(BasicBlock *BB, LoadInst* orig, - DenseMap &Phis) { - DominatorTree &DT = getAnalysis(); + DenseMap &Phis) { // If we have already computed this value, return the previously computed val. Value *&V = Phis[BB]; if (V) return V; - - DomTreeNode *IDom = DT.getNode(BB)->getIDom(); - - if (IDom && Phis.count(IDom->getBlock())) { -return V = GetValueForBlock(IDom->getBlock(), orig, Phis); - } if (std::distance(pred_begin(BB), pred_end(BB)) == 1) -return V = GetValueForBlock(IDom->getBlock(), orig, Phis); +return V = GetValueForBlock(*pred_begin(BB), orig, Phis); // Otherwise, the idom is the loop, so we need to insert a PHI node. Do so // now, then get values to fill in the incoming values for the PHI. @@ -733,9 +726,30 @@ PN->reserveOperandSpace(std::distance(pred_begin(BB), pred_end(BB))); V = PN; + bool all_same = true; + Value* first = 0; + // Fill in the incoming values for the block. - for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) -PN->addIncoming(GetValueForBlock(*PI, orig, Phis), *PI); + for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) { +Value* val = GetValueForBlock(*PI, orig, Phis); +if (first == 0) + first = val; +else if (all_same && first != val) + all_same = false; + +PN->addIncoming(val, *PI); + } + + if (all_same) { +MemoryDependenceAnalysis& MD = getAnalysis(); + +MD.removeInstruction(PN); +PN->replaceAllUsesWith(first); +PN->eraseFromParent(); + +return first; + } + return PN; } Added: llvm/trunk/test/Transforms/GVN/2007-07-31-NoDomInherit.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/2007-07-31-NoDomInherit.ll?rev=40642&view=auto == --- llvm/trunk/test/Transforms/GVN/2007-07-31-NoDomInherit.ll (added) +++ llvm/trunk/test/Transforms/GVN/2007-07-31-NoDomInherit.ll Tue Jul 31 12:43:14 2007 @@ -0,0 +1,313 @@ +; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep tmp51.rle + + %struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* } [EMAIL PROTECTED] = external constant i32 ; [#uses=0] [EMAIL PROTECTED] = external constant i32 ; [#uses=1] [EMAIL PROTECTED] = external global [17 x i32] ; <[17 x i32]*> [#uses=1] [EMAIL PROTECTED] = external global [7 x i32] ; <[7 x i32]*> [#uses=0] [EMAIL PROTECTED] = external global [4 x i32] ; <[4 x i32]*> [#uses=0] [EMAIL PROTECTED] = external global i32 ; [#uses=0] [EMAIL PROTECTED] = external global [13 x %struct.anon] ; <[13 x %struct.anon]*> [#uses=3] [EMAIL PROTECTED] = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [3 x i8] ; <[3 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [1 x i8] ; <[1 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [3 x i8] ; <[3 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [2 x i8] ; <[2 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [2 x i8] ; <[2 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [2 x i8] ; <[2 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [5 x i8] ; <[5 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [5 x i8] ; <[5 x i8]*> [#uses=0] [EMAIL PROTECTED] = external constant [4 x i8]
[llvm-commits] CVS: llvm-www/www-index.html
Changes in directory llvm-www: www-index.html updated: 1.144 -> 1.145 --- Log message: Adding release schedule. --- Diffs of the changes: (+10 -5) www-index.html | 15 ++- 1 files changed, 10 insertions(+), 5 deletions(-) Index: llvm-www/www-index.html diff -u llvm-www/www-index.html:1.144 llvm-www/www-index.html:1.145 --- llvm-www/www-index.html:1.144 Fri Jun 29 18:07:24 2007 +++ llvm-www/www-index.html Tue Jul 31 12:47:12 2007 @@ -113,13 +113,18 @@ -Developers MeetingMay 25, 2007 +Upcoming Releases - The - May 2007 Developer Meeting meeting was - a great success. Videos and slides are now - available. + LLVM 2.1 will be released on September 27, 2007. Here is the release schedule: + +9/12/2007 - Code freeze and branch creation. +9/14/2007 - Prerelease-1 out for testing. +9/19/2007 - Prerelease-1 testing complete. +9/20/2007 - Prerelease-2 out for testing. +9/25/2007 - Prerelease-2 testing complete. +9/27/2007 - Release. + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.0] r40622 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-types.cpp
On Jul 31, 2007, at 10:36 AM, Anton Korobeynikov wrote: Hello, Christopher. What specifically is dangerous about this? Well, because you're accessing internals of tree_node structure directly. Please use macroses. It may be language specific to C++, but there doesn't appear to be a macro there... I'm no GCC expert, but the DECL_ARGUMENTS() seems to be the only place where the restrict qualifier is preserved under C++. While debugging I could inspect the data structure to see that the information I needed was there, but looking in tree.h I found no TREE_... macro that got me there. This sometimes mean, that such data shouldn't be used at all ;) What's wrong with TREE_TYPE(decl) ? See PR1582. Using TREE_TYPE(decl) as was the case before, the tree doesn't contain restrict qualifiers on C++ arguments (but it does on C) arguments. The qualifiers are there in the DECL_ARGUMENTS(decl), but not in the TREE_TYPE(decl). The ?: came about because while bootstrapping GCC there were cases when DelArgs was NULL. It seems a bit of a hack, I know, but it's the best I could figure and it seems to work properly in my tests. If you have a suggestion on a more proper way to consistently get the restrict qualifier I'm all ears. =) What was the function decl in that case? How can I find/dump that? My GCC fu is weak. -- Christopher Lamb ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40647 - in /llvm/trunk: include/llvm/Analysis/MemoryDependenceAnalysis.h lib/Analysis/MemoryDependenceAnalysis.cpp
Author: greened Date: Tue Jul 31 15:01:27 2007 New Revision: 40647 URL: http://llvm.org/viewvc/llvm-project?rev=40647&view=rev Log: Fix GLIBCXX_DEBUG error owing to dereference of end iterator. There's no guarantee that an instruction returned by getDependency exists in the maps. Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h?rev=40647&r1=40646&r2=40647&view=diff == --- llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h Tue Jul 31 15:01:27 2007 @@ -32,9 +32,14 @@ class MemoryDependenceAnalysis : public FunctionPass { private: - -DenseMap > depGraphLocal; -std::multimap reverseDep; + +typedef DenseMap > +depMapType; + +depMapType depGraphLocal; + +typedef std::multimap reverseDepMapType; +reverseDepMapType reverseDep; Instruction* getCallSiteDependency(CallSite C, Instruction* start, bool local = true); Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=40647&r1=40646&r2=40647&view=diff == --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jul 31 15:01:27 2007 @@ -308,33 +308,40 @@ void MemoryDependenceAnalysis::removeInstruction(Instruction* rem) { // Figure out the new dep for things that currently depend on rem Instruction* newDep = NonLocal; - if (depGraphLocal[rem].first != NonLocal && - depGraphLocal[rem].second) { -// If we have dep info for rem, set them to it -BasicBlock::iterator RI = depGraphLocal[rem].first; -RI++; -newDep = RI; - } else if (depGraphLocal[rem].first == NonLocal && - depGraphLocal[rem].second ) { -// If we have a confirmed non-local flag, use it -newDep = NonLocal; - } else { -// Otherwise, use the immediate successor of rem -// NOTE: This is because, when getDependence is called, it will first check -// the immediate predecessor of what is in the cache. -BasicBlock::iterator RI = rem; -RI++; -newDep = RI; - } - std::multimap::iterator I = reverseDep.find(rem); - while (I->first == rem) { -// Insert the new dependencies -// Mark it as unconfirmed as long as it is not the non-local flag -depGraphLocal[I->second] = std::make_pair(newDep, !newDep); -reverseDep.erase(I); -I = reverseDep.find(rem); + depMapType::iterator depGraphEntry = depGraphLocal.find(rem); + // We assume here that it's not in the reverse map if it's not in + // the dep map. Checking it could be expensive, so don't do it. + + if (depGraphEntry != depGraphLocal.end()) { +if (depGraphEntry->second.first != NonLocal && +depGraphEntry->second.second) { + // If we have dep info for rem, set them to it + BasicBlock::iterator RI = depGraphEntry->second.first; + RI++; + newDep = RI; +} else if (depGraphEntry->second.first == NonLocal && + depGraphEntry->second.second ) { + // If we have a confirmed non-local flag, use it + newDep = NonLocal; +} else { + // Otherwise, use the immediate successor of rem + // NOTE: This is because, when getDependence is called, it will first check + // the immediate predecessor of what is in the cache. + BasicBlock::iterator RI = rem; + RI++; + newDep = RI; +} + +std::multimap::iterator I = reverseDep.find(rem); +while (I != reverseDep.end() && I->first == rem) { + // Insert the new dependencies + // Mark it as unconfirmed as long as it is not the non-local flag + depGraphLocal[I->second] = std::make_pair(newDep, !newDep); + reverseDep.erase(I); + I = reverseDep.find(rem); +} } - + getAnalysis().deleteValue(rem); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40649 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/known_align.ll
Author: laurov Date: Tue Jul 31 15:13:21 2007 New Revision: 40649 URL: http://llvm.org/viewvc/llvm-project?rev=40649&view=rev Log: Fix a bug in GetKnownAlignment of packed structs. Added: llvm/trunk/test/Transforms/InstCombine/known_align.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=40649&r1=40648&r2=40649&view=diff == --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jul 31 15:13:21 2007 @@ -7533,11 +7533,13 @@ const Type *BasePtrTy = GEPI->getOperand(0)->getType(); const PointerType *PtrTy = cast(BasePtrTy); -if (TD->getABITypeAlignment(PtrTy->getElementType()) -<= BaseAlignment) { +unsigned Align = TD->getABITypeAlignment(PtrTy->getElementType()); +if (Align <= BaseAlignment) { const Type *GEPTy = GEPI->getType(); const PointerType *GEPPtrTy = cast(GEPTy); - return TD->getABITypeAlignment(GEPPtrTy->getElementType()); + Align = std::min(Align, (unsigned) + TD->getABITypeAlignment(GEPPtrTy->getElementType())); + return Align; } return 0; } Added: llvm/trunk/test/Transforms/InstCombine/known_align.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/known_align.ll?rev=40649&view=auto == --- llvm/trunk/test/Transforms/InstCombine/known_align.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/known_align.ll Tue Jul 31 15:13:21 2007 @@ -0,0 +1,27 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {align 1} +; END. + + %struct.p = type <{ i8, i32 }> [EMAIL PROTECTED] = global %struct.p <{ i8 1, i32 10 }> ; <%struct.p*> [#uses=1] [EMAIL PROTECTED] = weak global %struct.p zeroinitializer ; <%struct.p*> [#uses=1] + +define i32 @main() { +entry: + %retval = alloca i32, align 4 ; [#uses=2] + %tmp = alloca i32, align 4 ; [#uses=2] + %tmp1 = alloca i32, align 4 ; [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %tmp3 = load i32* getelementptr (%struct.p* @t, i32 0, i32 1), align 1 ; [#uses=1] + store i32 %tmp3, i32* %tmp1, align 4 + %tmp5 = load i32* %tmp1, align 4; [#uses=1] + store i32 %tmp5, i32* getelementptr (%struct.p* @u, i32 0, i32 1), align 1 + %tmp6 = load i32* %tmp1, align 4; [#uses=1] + store i32 %tmp6, i32* %tmp, align 4 + %tmp7 = load i32* %tmp, align 4 ; [#uses=1] + store i32 %tmp7, i32* %retval, align 4 + br label %return + +return:; preds = %entry + %retval8 = load i32* %retval; [#uses=1] + ret i32 %retval8 +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40650 - in /llvm/trunk: lib/Transforms/Scalar/GVN.cpp test/Transforms/GVN/2007-07-31-RedundantPhi.ll
Author: resistor Date: Tue Jul 31 15:18:28 2007 New Revision: 40650 URL: http://llvm.org/viewvc/llvm-project?rev=40650&view=rev Log: Fix a failure I accidentally caused in my last commit by mishandling the removal of redundant phis. Added: llvm/trunk/test/Transforms/GVN/2007-07-31-RedundantPhi.ll Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=40650&r1=40649&r2=40650&view=diff == --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue Jul 31 15:18:28 2007 @@ -747,6 +747,8 @@ PN->replaceAllUsesWith(first); PN->eraseFromParent(); +Phis[BB] = first; + return first; } Added: llvm/trunk/test/Transforms/GVN/2007-07-31-RedundantPhi.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/2007-07-31-RedundantPhi.ll?rev=40650&view=auto == --- llvm/trunk/test/Transforms/GVN/2007-07-31-RedundantPhi.ll (added) +++ llvm/trunk/test/Transforms/GVN/2007-07-31-RedundantPhi.ll Tue Jul 31 15:18:28 2007 @@ -0,0 +1,22 @@ +; RUN: llvm-as < %s | opt -gvn | llvm-dis | not grep {tmp701 =} + [EMAIL PROTECTED] = external global i16 ; [#uses=2] + +define i32 @smpUMHEXBipredIntegerPelBlockMotionSearch(i16* %cur_pic, i16 signext %ref, i32 %list, i32 %pic_pix_x, i32 %pic_pix_y, i32 %blocktype, i16 signext %pred_mv_x1, i16 signext %pred_mv_y1, i16 signext %pred_mv_x2, i16 signext %pred_mv_y2, i16* %mv_x, i16* %mv_y, i16* %s_mv_x, i16* %s_mv_y, i32 %search_range, i32 %min_mcost, i32 %lambda_factor) { +cond_next143: ; preds = %entry + store i16 0, i16* @img_width, align 2 + br i1 false, label %cond_next449, label %cond_false434 + +cond_false434: ; preds = %cond_true415 + br label %cond_next449 + +cond_next449: ; preds = %cond_false434, %cond_true415 + br i1 false, label %cond_next698, label %cond_false470 + +cond_false470: ; preds = %cond_next449 + br label %cond_next698 + +cond_next698: ; preds = %cond_true492 + %tmp701 = load i16* @img_width, align 2 ; [#uses=0] + ret i32 0 +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.0] r40622 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-types.cpp
Hello, Christopher. > -return TypeDB.setType(type, ConvertFunctionType(type, NULL, > CallingConv)); > +return TypeDB.setType(type, ConvertFunctionType(type, orig_type, NULL, > CallingConv)); and another one: second argument should be "declaration" tree, not "type" tree. This was caused build error on darwin (reported by Tanya): ./../src/gcc/config/darwin-crt3.c: In function 'cxa_atexit_check_2': ../../src/gcc/config/darwin-crt3.c:160: internal compiler error: tree check: expected class 'declaration', have 'type' (function_type) in ConvertFunctionType, at llvm-types.cpp:983 -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.0] r40622 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-types.cpp
On Jul 31, 2007, at 1:59 PM, Anton Korobeynikov wrote: Hello, Christopher. -return TypeDB.setType(type, ConvertFunctionType(type, NULL, CallingConv)); +return TypeDB.setType(type, ConvertFunctionType(type, orig_type, NULL, CallingConv)); and another one: second argument should be "declaration" tree, not "type" tree. This was caused build error on darwin (reported by Tanya): Right. It seems that getting the declaration tree at that point is rather difficult. Any suggestions? -- Christopher Lamb ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] Trampoline support (pointers nested funtions)
On Jul 27, 2007, at 3:38 AM, Duncan Sands wrote: > Hi Evan, > >> Some nit picks. >> >> 1. Please don't use "Chain" for stand for function static chain. It >> confuses backend guys like me. :-) "Chain" stands for control flow >> dependency in the backend. > > I've replaced Chain with Nest everywhere, eg the attribute is now > 'nest'. Thanks. > > >> 2. Purely a stylistic thing: >> >> +SDOperand X86TargetLowering::LowerTRAMPOLINE(SDOperand Op, >> + SelectionDAG &DAG) { >> + SDOperand Root = Op.getOperand(0); >> + SDOperand Trmp = Op.getOperand(1); // trampoline >> + SDOperand FPtr = Op.getOperand(2); // nested function >> + SDOperand SChn = Op.getOperand(3); // static chain >> + >> + SrcValueSDNode *TrmpSV = cast(Op.getOperand(4)); >> + >> + if (Subtarget->is64Bit()) { >> +return SDOperand(); // not yet supported >> + } else { >> >> If you move the check is64Bit() to the beginning of function, there >> is no need to nest the part that actually do the work in the "else" >> clause. > > I'd prefer to leave it as it is: this is where the code for 64 bit > support will go, once added. And since right now codegen will abort > on trampoline lowering on x86-64, I don't think it matters if a few > cycles are wasted before the abort :) By the way, I think aborting > is the right thing to do: if someone is creating a trampoline, most > likely they are going to use it, i.e. jump to the code it contains. > If we lower trampoline initialization to nothing on architectures that > don't yet support it, then the code will appear to compile fine but > will > die very horribly at runtime, by jumping to a bunch of random bytes... > Ok. It's just a nit pick. >> 3. In X86TargetLowering::LowerTRAMPOLINE(): >> +case CallingConv::X86_StdCall: { >> + Move = 0xb9; // Pass chain in ECX >> >> I assume this is the ModR/M byte? > > Well, it's MOV32ri. Then it should be 0xb8? > > >> Can you refactor ModRMByte() from X86CodeEmitter.cpp (probably also >> getX86RegNum) >> and use that to calculate this instead? > > For the reasons explained in the next paragraph, I've taken a > minimal approach. > (1) I've introduced X86CodeEmitter.h, which contains native X86 > Register numbers > factored out of X86CodeEmitter.cpp. Please factor out getX86RegNum() as well. Perhaps put them in X86RegisterInfo.cpp (since lowering really shouldn't depend on codeemitter...) Do getX86RegNum(X86::EAX) rather than make use N86::EAX directly. > > (2) In LowerTRAMPOLINE, names like N86::ECX are used to name the > register used. > (3) Rather than using 0xb8 and 0xE9, I've introduced symbolic names > MOV32ri > and JMP. I could also get these by doing something like this: > const X86InstrInfo *TII = > ((X86TargetMachine&)getTargetMachine()).getInstrInfo(); > unsigned char MOV32ri = TII->getBaseOpcodeFor(&TII- > >get(X86::MOV32ri)); > But it didn't seem worth it (is there a way to extract the machine > opcode > statically?). Please go through X86InstrInfo to get the opcode numbers instead of hard coding it. > > >> Also, isn't the static chain register described in X86CallingConv.td? > > It is, but it's hard to use here. The problem is that when lowering > the > init.trampoline intrinsic you only have a pointer to the target > function. > From this pointer you would like to find out which register a certain > parameter will be passed in for that function. Not so easy! It's > like > having a call instruction without having the arguments. In order to > exploit X86CallingConv.td, you have to use all the lowering machinery, > which isn't adapted to this case. For example, you could try to > synthesize > a fake call. Or you could pretend to be lowering the target > function. I > tried it, and it can be done with a lot of horrible hacking. But > it's not > worth it. It's much simpler to simply grab the calling convention > and use > that, which unfortunately means keeping LowerTRAMPOLINE and > X86CallingConv.td in sync. Personally I can live with that, > especially since > I've seen the alternative and it still wakes me up screaming at > night :) > But maybe you can see a reasonable way of doing it? Seems like a deficiency in CCState class. Chris, your thoughts? Evan > > > Since I need to map the calling convention to a native X86 register > number, > I chose to bypass X86::ECX etc and directly use N86::ECX. This > would be > different if the register number was being extracted from lowering + > CCInfo. > >> Magic number is confusing. :-) > > Hopefully it's more readable now. The amount of code factorization is > minimal which is a pity but seems the best choice. > >> Looks great otherwise. Thanks! > > Thanks for reviewing! > > Duncan. > ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.0] r40622 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-types.cpp
On Jul 31, 2007, at 10:49 AM, Christopher Lamb wrote: What was the function decl in that case? How can I find/dump that? My GCC fu is weak. On gdb prompt, debug_tree(t) or debug_generic_expr(t) etc.. There are gdb macros in gdbinit.in in source tree that provides short hands for these routines. - Devang ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40654 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
Author: evancheng Date: Tue Jul 31 17:37:44 2007 New Revision: 40654 URL: http://llvm.org/viewvc/llvm-project?rev=40654&view=rev Log: simpleregistercoalescing -> regcoalescing. It's too long for me to handle. 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=40654&r1=40653&r2=40654&view=diff == --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Jul 31 17:37:44 2007 @@ -12,7 +12,7 @@ // //===--===// -#define DEBUG_TYPE "simpleregistercoalescing" +#define DEBUG_TYPE "regcoalescing" #include "llvm/CodeGen/SimpleRegisterCoalescing.h" #include "llvm/CodeGen/LiveIntervalAnalysis.h" #include "VirtRegMap.h" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.0] r40622 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-types.cpp
On Jul 31, 2007, at 3:02 PM, Christopher Lamb wrote: > > > On Jul 31, 2007, at 1:59 PM, Anton Korobeynikov wrote: > >> Hello, Christopher. >> >>> -return TypeDB.setType(type, ConvertFunctionType(type, NULL, >>> CallingConv)); >>> +return TypeDB.setType(type, ConvertFunctionType(type, >>> orig_type, NULL, CallingConv)); >> and another one: second argument should be "declaration" tree, not >> "type" tree. This was caused build error on darwin (reported by >> Tanya): > > Right. It seems that getting the declaration tree at that point is > rather difficult. Any suggestions? Turns out that this type conversion is being requested on a struct which contains a function pointer, and the conversion is happening on that function pointer. Am I correct in assuming that if we've followed this code path to ConvertFunctionType then we have no declaration to pass through? from darwin-crt3.c: typedef int (*cxa_atexit_p)(void (*func) (void*), void* arg, const void* dso); struct atexit_data { int result; cxa_atexit_p cxa_atexit; }; static void cxa_atexit_check_2 (void *arg) { ((struct atexit_data *)arg)->result = 1; } -- Christopher Lamb ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r40624 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll
Daniel, I'm not a GCC guru, so I had some problems picking up the restrict qualifiers for argument types in llvm-gcc's type conversion routines. It seems that for C the qualifier is kept with the argument type, but in C++ it's only available in the declaration and is not kept with the types. Is there a better/proper way to get access to these qualifiers? -- Chris On Jul 31, 2007, at 8:27 AM, Daniel Berlin wrote: On 7/31/07, Dan Gohman <[EMAIL PROTECTED]> wrote: Log: Teach BasicAA about noalias function parameters. Passes all of DejaGNU and test-suite. I just grepped through LLVM's test-suite and didn't find any uses of the restrict keyword though... There are a few you could snag from GCC's testsuite, because we started with an implementation that had the exact same problems you've noted below. So for an alias query where one of the two pointers is noalias and the other is not, and the non-noalias one doesn't have a base object that basicaa can find, the answer should be MayAlias. A more advanced pass could try to prove that the non-noalias pointer couldn't possibly be "based on" the noalias one by examining all its uses, though the specific example here would defy such analysis. This is also what we eventually did with GCC. Note that your function call example is not just "not disallowed", it is explicitly allowed. It is the one case you are allowed to carry restricted pointers outside the block they are in. See C99 6.7.3.1 #12 There is a weird issue in restrict where gcc doesn't "check for correctness of input code", and i doubt LLVM can either (at least, not easily). This is that block nesting can introduce valid restricted pointers in the nested block that would have otherwise been invalid. IIRC, anyway :) We of course, eliminate lexical scoping. For safety sake, we just assume that if they have come up with assignments between restricted pointers, that they are legal. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -- Christopher Lamb ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40655 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Author: resistor Date: Tue Jul 31 18:27:13 2007 New Revision: 40655 URL: http://llvm.org/viewvc/llvm-project?rev=40655&view=rev Log: Don't let the memory allocator outsmart GVN. ;-) Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=40655&r1=40654&r2=40655&view=diff == --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue Jul 31 18:27:13 2007 @@ -558,6 +558,11 @@ nextValueNumber = 1; } +/// erase - Remove a value from the value numbering +void ValueTable::erase(Value* V) { + valueNumbering.erase(V); +} + //===--===// // ValueNumberedSet Class //===--===// @@ -871,6 +876,7 @@ if (currAvail.test(num)) { Value* repl = find_leader(currAvail, num); +VN.erase(I); I->replaceAllUsesWith(repl); toErase.push_back(I); return true; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/pubs/2007-07-25-LLVM-2.0-and-Beyond.html
Changes in directory llvm-www/pubs: 2007-07-25-LLVM-2.0-and-Beyond.html updated: 1.1 -> 1.2 --- Log message: add link to google video --- Diffs of the changes: (+1 -0) 2007-07-25-LLVM-2.0-and-Beyond.html |1 + 1 files changed, 1 insertion(+) Index: llvm-www/pubs/2007-07-25-LLVM-2.0-and-Beyond.html diff -u llvm-www/pubs/2007-07-25-LLVM-2.0-and-Beyond.html:1.1 llvm-www/pubs/2007-07-25-LLVM-2.0-and-Beyond.html:1.2 --- llvm-www/pubs/2007-07-25-LLVM-2.0-and-Beyond.html:1.1 Thu Jul 26 01:07:48 2007 +++ llvm-www/pubs/2007-07-25-LLVM-2.0-and-Beyond.html Tue Jul 31 18:29:24 2007 @@ -35,6 +35,7 @@ Download Presentation: LLVM 2.0 and Beyond! (PDF) + http://video.google.com/videoplay?docid=1921156852099786640";>View Google Tech Talk Video ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/releases/download.html
Changes in directory llvm-www/releases: download.html updated: 1.41 -> 1.42 --- Log message: Change text to reference SVN and not CVS. --- Diffs of the changes: (+3 -3) download.html |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-www/releases/download.html diff -u llvm-www/releases/download.html:1.41 llvm-www/releases/download.html:1.42 --- llvm-www/releases/download.html:1.41Wed May 23 13:29:22 2007 +++ llvm-www/releases/download.html Tue Jul 31 18:53:04 2007 @@ -12,14 +12,14 @@ -CVS Access +SVN Access If you'd like access to the "latest and greatest" in LLVM development, please see the instructions for accessing the LLVM CVS Repository. The major -changes and improvements that CVS contains relative to the previous release are +href="/docs/GettingStarted.html#checkout ">LLVM SVN Repository. The major +changes and improvements that SVN contains relative to the previous release are listed in the Release Notes for the next release. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/releases/index.html
Changes in directory llvm-www/releases: index.html updated: 1.37 -> 1.38 --- Log message: Change to SVN not CVS. --- Diffs of the changes: (+1 -1) index.html |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-www/releases/index.html diff -u llvm-www/releases/index.html:1.37 llvm-www/releases/index.html:1.38 --- llvm-www/releases/index.html:1.37 Mon Jul 23 09:53:24 2007 +++ llvm-www/releases/index.htmlTue Jul 31 18:53:42 2007 @@ -37,7 +37,7 @@ -Always - Anonymous CVS access; Always - Anonymous SVN access; release notes. 23 May 2007 - 2.0 release download; release notes. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/OpenProjects.html Oversight.html www-index.html
Changes in directory llvm-www: OpenProjects.html updated: 1.26 -> 1.27 Oversight.html updated: 1.5 -> 1.6 www-index.html updated: 1.145 -> 1.146 --- Log message: Remove CVS and now reference SVN. --- Diffs of the changes: (+7 -7) OpenProjects.html |4 ++-- Oversight.html|6 +++--- www-index.html|4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) Index: llvm-www/OpenProjects.html diff -u llvm-www/OpenProjects.html:1.26 llvm-www/OpenProjects.html:1.27 --- llvm-www/OpenProjects.html:1.26 Tue Apr 10 16:16:08 2007 +++ llvm-www/OpenProjects.html Tue Jul 31 18:59:07 2007 @@ -136,7 +136,7 @@ href="http://lists.cs.uiuc.edu/pipermail/llvmbugs/";>llvm-bugs list. If you get the program to compile, it would be extremely useful to convert the build system to be compatible with the LLVM Programs testsuite so that we can check it -into CVS and the automated tester can use it to track progress of the +into SVN and the automated tester can use it to track progress of the compiler. When testing a code, try running it with a variety of optimizations, and with @@ -411,7 +411,7 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2007/04/10 21:16:08 $ + Last modified: $Date: 2007/07/31 23:59:07 $ Index: llvm-www/Oversight.html diff -u llvm-www/Oversight.html:1.5 llvm-www/Oversight.html:1.6 --- llvm-www/Oversight.html:1.5 Thu Mar 16 13:02:22 2006 +++ llvm-www/Oversight.html Tue Jul 31 18:59:07 2007 @@ -43,10 +43,10 @@ Identify and prioritize improvements to the core. -Guidelines for who gets write-access to CVS: +Guidelines for who gets write-access to SVN: The goal here is to encourage the most active contributors by - giving them direct CVS write access. + giving them direct SVN write access. Our primary guiding principle here is that write access should be limited to persons who have a track record of responsible contributions, and are likely to remain active contributors @@ -104,6 +104,6 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> mailto:[EMAIL PROTECTED]">LLVM Oversight Group - Last modified: $Date: 2006/03/16 19:02:22 $ + Last modified: $Date: 2007/07/31 23:59:07 $ Index: llvm-www/www-index.html diff -u llvm-www/www-index.html:1.145 llvm-www/www-index.html:1.146 --- llvm-www/www-index.html:1.145 Tue Jul 31 12:47:12 2007 +++ llvm-www/www-index.html Tue Jul 31 18:59:07 2007 @@ -106,9 +106,9 @@ for download! LLVM is publicly available under an open source License. Also, you might want to check out the new - features in CVS that will appear in the next LLVM release. If + features in SVN that will appear in the next LLVM release. If you want them early, download LLVM through - anonymous CVS. + anonymous SVN. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/ProjectsWithLLVM/index.html
Changes in directory llvm-www/ProjectsWithLLVM: index.html updated: 1.38 -> 1.39 --- Log message: Reference SVN. --- Diffs of the changes: (+1 -1) index.html |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-www/ProjectsWithLLVM/index.html diff -u llvm-www/ProjectsWithLLVM/index.html:1.38 llvm-www/ProjectsWithLLVM/index.html:1.39 --- llvm-www/ProjectsWithLLVM/index.html:1.38 Thu Jul 5 11:00:58 2007 +++ llvm-www/ProjectsWithLLVM/index.htmlTue Jul 31 19:03:33 2007 @@ -410,7 +410,7 @@ http://wiki.cs.uiuc.edu/cs497rej/LLVM+Visualization+Tool";>Wiki page with overview; design doc, and user manual. You can download -llvm-tv from LLVM CVS (the llvm-tv module). +llvm-tv from LLVM SVN (http://llvm.org/svn/llvm-project/television/trunk). ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40657 - /llvm/trunk/test/CodeGen/X86/2007-07-31-VInsertBug.ll
Author: evancheng Date: Tue Jul 31 19:10:12 2007 New Revision: 40657 URL: http://llvm.org/viewvc/llvm-project?rev=40657&view=rev Log: Requires SSE2. Modified: llvm/trunk/test/CodeGen/X86/2007-07-31-VInsertBug.ll Modified: llvm/trunk/test/CodeGen/X86/2007-07-31-VInsertBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-07-31-VInsertBug.ll?rev=40657&r1=40656&r2=40657&view=diff == --- llvm/trunk/test/CodeGen/X86/2007-07-31-VInsertBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-07-31-VInsertBug.ll Tue Jul 31 19:10:12 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | %prcontext {pinsrw \$2} 1 | grep "movl \$1" -; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | not grep movss +; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -mattr=+sse2 | %prcontext {pinsrw \$2} 1 | grep "movl \$1" +; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -mattr=+sse2 | not grep movss @G = global <4 x float> zeroinitializer ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40658 - /llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
Author: evancheng Date: Tue Jul 31 19:12:08 2007 New Revision: 40658 URL: http://llvm.org/viewvc/llvm-project?rev=40658&view=rev Log: Indexed loads each has 2 outputs. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=40658&r1=40657&r2=40658&view=diff == --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Jul 31 19:12:08 2007 @@ -745,34 +745,34 @@ []>, Requires<[IsARM, HasV5T]>; // Indexed loads -def LDR_PRE : AI2pr<(outs GPR:$dst), (ins GPR:$base_wb, addrmode2:$addr), +def LDR_PRE : AI2pr<(outs GPR:$dst, GPR:$base_wb), (ins addrmode2:$addr), "ldr", " $dst, $addr!", "$addr.base = $base_wb", []>; -def LDR_POST : AI2po<(outs GPR:$dst), (ins GPR:$base_wb, GPR:$base, am2offset:$offset), +def LDR_POST : AI2po<(outs GPR:$dst, GPR:$base_wb), (ins GPR:$base, am2offset:$offset), "ldr", " $dst, [$base], $offset", "$base = $base_wb", []>; -def LDRH_PRE : AI3pr<(outs GPR:$dst), (ins GPR:$base_wb, addrmode3:$addr), +def LDRH_PRE : AI3pr<(outs GPR:$dst, GPR:$base_wb), (ins addrmode3:$addr), "ldr", "h $dst, $addr!", "$addr.base = $base_wb", []>; -def LDRH_POST : AI3po<(outs GPR:$dst), (ins GPR:$base_wb, GPR:$base,am3offset:$offset), +def LDRH_POST : AI3po<(outs GPR:$dst, GPR:$base_wb), (ins GPR:$base,am3offset:$offset), "ldr", "h $dst, [$base], $offset", "$base = $base_wb", []>; -def LDRB_PRE : AI2pr<(outs GPR:$dst), (ins GPR:$base_wb, addrmode2:$addr), +def LDRB_PRE : AI2pr<(outs GPR:$dst, GPR:$base_wb), (ins addrmode2:$addr), "ldr", "b $dst, $addr!", "$addr.base = $base_wb", []>; -def LDRB_POST : AI2po<(outs GPR:$dst), (ins GPR:$base_wb, GPR:$base,am2offset:$offset), +def LDRB_POST : AI2po<(outs GPR:$dst, GPR:$base_wb), (ins GPR:$base,am2offset:$offset), "ldr", "b $dst, [$base], $offset", "$base = $base_wb", []>; -def LDRSH_PRE : AI3pr<(outs GPR:$dst), (ins GPR:$base_wb, addrmode3:$addr), +def LDRSH_PRE : AI3pr<(outs GPR:$dst, GPR:$base_wb), (ins addrmode3:$addr), "ldr", "sh $dst, $addr!", "$addr.base = $base_wb", []>; -def LDRSH_POST: AI3po<(outs GPR:$dst), (ins GPR:$base_wb, GPR:$base,am3offset:$offset), +def LDRSH_POST: AI3po<(outs GPR:$dst, GPR:$base_wb), (ins GPR:$base,am3offset:$offset), "ldr", "sh $dst, [$base], $offset", "$base = $base_wb", []>; -def LDRSB_PRE : AI3pr<(outs GPR:$dst), (ins GPR:$base_wb, addrmode3:$addr), +def LDRSB_PRE : AI3pr<(outs GPR:$dst, GPR:$base_wb), (ins addrmode3:$addr), "ldr", "sb $dst, $addr!", "$addr.base = $base_wb", []>; -def LDRSB_POST: AI3po<(outs GPR:$dst), (ins GPR:$base_wb, GPR:$base,am3offset:$offset), +def LDRSB_POST: AI3po<(outs GPR:$dst, GPR:$base_wb), (ins GPR:$base,am3offset:$offset), "ldr", "sb $dst, [$base], $offset", "$base = $base_wb", []>; } // isLoad ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40660 - in /llvm/trunk: include/llvm/ include/llvm/Support/ lib/AsmParser/ lib/Bitcode/Reader/ lib/CodeGen/ lib/ExecutionEngine/JIT/ lib/Transforms/IPO/ lib/Transforms/Instrumen
Author: greened Date: Tue Jul 31 22:43:44 2007 New Revision: 40660 URL: http://llvm.org/viewvc/llvm-project?rev=40660&view=rev Log: New CallInst interface to address GLIBCXX_DEBUG errors caused by indexing an empty std::vector. Updates to all clients. Modified: llvm/trunk/include/llvm/Instructions.h llvm/trunk/include/llvm/Support/LLVMBuilder.h llvm/trunk/lib/AsmParser/llvmAsmParser.y llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp llvm/trunk/lib/Transforms/IPO/PruneEH.cpp llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp llvm/trunk/lib/Transforms/Instrumentation/ProfilingUtils.cpp llvm/trunk/lib/Transforms/Scalar/ADCE.cpp llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/lib/Transforms/Scalar/LowerGC.cpp llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp llvm/trunk/lib/VMCore/Instructions.cpp llvm/trunk/tools/bugpoint/Miscompilation.cpp llvm/trunk/tools/llvm-upgrade/UpgradeParser.y Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=40660&r1=40659&r2=40660&view=diff == --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Tue Jul 31 22:43:44 2007 @@ -16,7 +16,10 @@ #ifndef LLVM_INSTRUCTIONS_H #define LLVM_INSTRUCTIONS_H +#include + #include "llvm/InstrTypes.h" +#include "llvm/DerivedTypes.h" namespace llvm { @@ -735,12 +738,12 @@ //===--===// // CallInst Class //===--===// - /// CallInst - This class represents a function call, abstracting a target /// machine's calling convention. This class uses low bit of the SubClassData /// field to indicate whether or not this is a tail call. The rest of the bits /// hold the calling convention of the call. /// + class CallInst : public Instruction { ParamAttrsList *ParamAttrs; ///< parameter attributes for call CallInst(const CallInst &CI); @@ -749,18 +752,73 @@ void init(Value *Func, Value *Actual); void init(Value *Func); + template + void init(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, +const std::string &Name, +// This argument ensures that we have an iterator we can +// do arithmetic on in constant time +std::random_access_iterator_tag) { +typename std::iterator_traits::difference_type NumArgs = + std::distance(ArgBegin, ArgEnd); + +if (NumArgs > 0) { + // This requires that the iterator points to contiguous memory. + init(Func, &*ArgBegin, NumArgs); +} +else { + init(Func, 0, NumArgs); +} + +setName(Name); + } + public: + /// Construct a CallInst given a range of arguments. InputIterator + /// must be a random-access iterator pointing to contiguous storage + /// (e.g. a std::vector<>::iterator). Checks are made for + /// random-accessness but not for contiguous storage as that would + /// incur runtime overhead. + /// @brief Construct a CallInst from a range of arguments + template + CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, + const std::string &Name = "", Instruction *InsertBefore = 0) + : Instruction(cast(cast(Func->getType()) + ->getElementType())->getReturnType(), +Instruction::Call, 0, 0, InsertBefore) { +init(Func, ArgBegin, ArgEnd, Name, + typename std::iterator_traits::iterator_category()); + } + + /// Construct a CallInst given a range of arguments. InputIterator + /// must be a random-access iterator pointing to contiguous storage + /// (e.g. a std::vector<>::iterator). Checks are made for + /// random-accessness but not for contiguous storage as that would + /// incur runtime overhead. + /// @brief Construct a CallInst from a range of arguments + template + CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, + const std::string &Name, BasicBlock *InsertAtEnd) + : Instruction(cast(cast(Func->getType()) + ->getElementType())->getReturnType(), +Instruction::Call, 0, 0, InsertAtEnd) { +init(Func, ArgBegin, ArgEnd, Name, + typename std::iterator_traits::iterator_category()); + } + +#if 0 + // Leave thes
[llvm-commits] [llvm-gcc-4.0] r40661 - in /llvm-gcc-4.0/trunk/gcc: config/i386/llvm-i386.cpp llvm-convert.cpp llvm-debug.cpp
Author: greened Date: Tue Jul 31 22:44:20 2007 New Revision: 40661 URL: http://llvm.org/viewvc/llvm-project?rev=40661&view=rev Log: Updates to CallInst constructor clients to address GLIBCXX_DEBUG errors. Modified: llvm-gcc-4.0/trunk/gcc/config/i386/llvm-i386.cpp llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp llvm-gcc-4.0/trunk/gcc/llvm-debug.cpp Modified: llvm-gcc-4.0/trunk/gcc/config/i386/llvm-i386.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/config/i386/llvm-i386.cpp?rev=40661&r1=40660&r2=40661&view=diff == --- llvm-gcc-4.0/trunk/gcc/config/i386/llvm-i386.cpp (original) +++ llvm-gcc-4.0/trunk/gcc/config/i386/llvm-i386.cpp Tue Jul 31 22:44:20 2007 @@ -79,7 +79,7 @@ Function *psllw = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psll_w); Ops[1] = BuildVector(Ops[1], UndefValue::get(Type::Int32Ty), NULL); -Result = Builder.CreateCall(psllw, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psllw, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -88,7 +88,7 @@ Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psll_w); Value *Undef = UndefValue::get(Type::Int32Ty); Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL); -Result = Builder.CreateCall(psllw, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psllw, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -96,7 +96,7 @@ Function *pslld = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psll_d); Ops[1] = BuildVector(Ops[1], UndefValue::get(Type::Int32Ty), NULL); -Result = Builder.CreateCall(pslld, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(pslld, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -105,7 +105,7 @@ = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psll_d); Value *Undef = UndefValue::get(Type::Int32Ty); Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL); -Result = Builder.CreateCall(pslld, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(pslld, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -113,7 +113,7 @@ Function *psllq = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psll_q); Ops[1] = BuildVector(Ops[1], UndefValue::get(Type::Int32Ty), NULL); -Result = Builder.CreateCall(psllq, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psllq, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -122,7 +122,7 @@ Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psll_q); Value *Undef = UndefValue::get(Type::Int32Ty); Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL); -Result = Builder.CreateCall(psllq, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psllq, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -130,7 +130,7 @@ Function *psrlw = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psrl_w); Ops[1] = BuildVector(Ops[1], UndefValue::get(Type::Int32Ty), NULL); -Result = Builder.CreateCall(psrlw, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psrlw, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -139,7 +139,7 @@ Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psrl_w); Value *Undef = UndefValue::get(Type::Int32Ty); Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL); -Result = Builder.CreateCall(psrlw, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psrlw, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -147,7 +147,7 @@ Function *psrld = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psrl_d); Ops[1] = BuildVector(Ops[1], UndefValue::get(Type::Int32Ty), NULL); -Result = Builder.CreateCall(psrld, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psrld, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -156,7 +156,7 @@ Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psrl_d); Value *Undef = UndefValue::get(Type::Int32Ty); Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL); -Result = Builder.CreateCall(psrld, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psrld, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return t
[llvm-commits] [llvm-gcc-4.2] r40662 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386.cpp llvm-convert.cpp llvm-debug.cpp
Author: greened Date: Tue Jul 31 22:46:49 2007 New Revision: 40662 URL: http://llvm.org/viewvc/llvm-project?rev=40662&view=rev Log: Update CallInst constructor clients to address GLIBCXX_DEBUG errors. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=40662&r1=40661&r2=40662&view=diff == --- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Tue Jul 31 22:46:49 2007 @@ -79,7 +79,7 @@ Function *psllw = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psll_w); Ops[1] = BuildVector(Ops[1], UndefValue::get(Type::Int32Ty), NULL); -Result = Builder.CreateCall(psllw, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psllw, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -88,7 +88,7 @@ Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psll_w); Value *Undef = UndefValue::get(Type::Int32Ty); Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL); -Result = Builder.CreateCall(psllw, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psllw, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -96,7 +96,7 @@ Function *pslld = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psll_d); Ops[1] = BuildVector(Ops[1], UndefValue::get(Type::Int32Ty), NULL); -Result = Builder.CreateCall(pslld, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(pslld, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -105,7 +105,7 @@ = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psll_d); Value *Undef = UndefValue::get(Type::Int32Ty); Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL); -Result = Builder.CreateCall(pslld, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(pslld, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -113,7 +113,7 @@ Function *psllq = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psll_q); Ops[1] = BuildVector(Ops[1], UndefValue::get(Type::Int32Ty), NULL); -Result = Builder.CreateCall(psllq, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psllq, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -122,7 +122,7 @@ Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psll_q); Value *Undef = UndefValue::get(Type::Int32Ty); Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL); -Result = Builder.CreateCall(psllq, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psllq, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -130,7 +130,7 @@ Function *psrlw = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psrl_w); Ops[1] = BuildVector(Ops[1], UndefValue::get(Type::Int32Ty), NULL); -Result = Builder.CreateCall(psrlw, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psrlw, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -139,7 +139,7 @@ Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psrl_w); Value *Undef = UndefValue::get(Type::Int32Ty); Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL); -Result = Builder.CreateCall(psrlw, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psrlw, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -147,7 +147,7 @@ Function *psrld = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psrl_d); Ops[1] = BuildVector(Ops[1], UndefValue::get(Type::Int32Ty), NULL); -Result = Builder.CreateCall(psrld, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psrld, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true; } @@ -156,7 +156,7 @@ Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psrl_d); Value *Undef = UndefValue::get(Type::Int32Ty); Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL); -Result = Builder.CreateCall(psrld, Ops[0], Ops[1], "tmp"); +Result = Builder.CreateCall(psrld, Ops.begin(), Ops.begin()+2, "tmp"); Result = Builder.CreateBitCast(Result, ResultType, "tmp"); return true;
[llvm-commits] [llvm-gcc-4.0] r40664 - /llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
Author: clamb Date: Tue Jul 31 23:17:42 2007 New Revision: 40664 URL: http://llvm.org/viewvc/llvm-project?rev=40664&view=rev Log: Clean up restrict handling per feedback. Modified: llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.0/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-types.cpp?rev=40664&r1=40663&r2=40664&view=diff == --- llvm-gcc-4.0/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Tue Jul 31 23:17:42 2007 @@ -784,8 +784,9 @@ if (const Type *Ty = GET_TYPE_LLVM(type)) return Ty; +// No declaration to pass through, passing NULL unsigned CallingConv; -return TypeDB.setType(type, ConvertFunctionType(type, orig_type, NULL, CallingConv)); +return TypeDB.setType(type, ConvertFunctionType(type, NULL, NULL, CallingConv)); } case ARRAY_TYPE: { if (const Type *Ty = GET_TYPE_LLVM(type)) @@ -978,9 +979,10 @@ LLVM_TARGET_INIT_REGPARM(local_regparam, type); #endif // LLVM_TARGET_ENABLE_REGPARM + // Check if we have a corresponding decl to inspect + tree DeclArgs = (decl) ? DECL_ARGUMENTS(decl) : NULL; // Loop over all of the arguments, adding them as we go. tree Args = TYPE_ARG_TYPES(type); - tree DeclArgs = DECL_ARGUMENTS(decl); for (; Args && TREE_VALUE(Args) != void_type_node; Args = TREE_CHAIN(Args)){ tree ArgTy = TREE_VALUE(Args); if (!isPassedByInvisibleReference(ArgTy) && @@ -1013,13 +1015,15 @@ Attributes |= ParamAttr::SExt; } -// Compute noalias attributes. -tree RestrictArgTy = (DeclArgs) ? DeclArgs->type.common.type : ArgTy; -RestrictArgTy = (RestrictArgTy) ? RestrictArgTy : ArgTy; +// Compute noalias attributes. If we have a decl for the function +// inspect it for restrict qualifiers, otherwise try the argument +// types +tree RestrictArgTy = (DeclArgs) ? TREE_TYPE(DeclArgs) : ArgTy; if (TREE_CODE(RestrictArgTy) == POINTER_TYPE || -TREE_CODE(RestrictArgTy) == REFERENCE_TYPE) +TREE_CODE(RestrictArgTy) == REFERENCE_TYPE) { if (TYPE_RESTRICT(RestrictArgTy)) Attributes |= ParamAttr::NoAlias; +} #ifdef LLVM_TARGET_ENABLE_REGPARM // Allow the target to mark this as inreg. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] Patch for X86 to use subregs
On Jul 30, 2007, at 3:10 PM, Christopher Lamb wrote: > > On Jul 30, 2007, at 2:40 PM, Evan Cheng wrote: > >> >> I appreciate you're trying to think of ways to expand the use of >> subreg work. But x86-64 implicit zero-extension is not the same >> problem. Trying to solve the x86-64 optimization issue this way is >> a unacceptable hack. Your subreg pass is a general pass. Please >> keep it that way. > > Settled. > > There are other cases where I think it would be interesting to model > implicit operations or more complex register constrains in a way that > the register allocator an coalescing has a way to deal with them. Certainly! > For instance, the kind of constraints that cause MOV16to16_ to be > necessary. Here I'd think that coalescing could be taught how to > coalesce moves between register classes and sub classes of that class. Right. > Currently the following MOV16to16_ wouldn't be coalesced, though it > could be, because CX is in class GR32_ and AX is in class GR32. > > CX = mov AX > > Coalescing would see this as > > GR32_:reg1025 = mov GR32:reg1024 > > So it isn't as simple as it may seem at first because you'd > potentially have to tighten the register class constraint on the def > of reg1024, but I think it's doable... It isn't particularly difficult to teach the coalescer to coalesce across different register classes. The difficult part is figuring out when it is profitable. We have tried to enable coalescing of instructions like MOV16to16_. But in some cases it end up hurting performance because the resultant live interval is longer and have fewer candidate registers for the allocator to target. I think the answer is we must have a way to undo harmful coalescing decision. That is, live range splitting. Without the ability to undo, we shouldn't be any more aggressive about coalescing as we already are. > > There is an internal architecture here that it would be interesting > to target with LLVM, but it happens to have a highly constrained > register file, requiring many of these currently un-coalesced moves > between register sub classes and their parent. Do you think I should > open a PR on that? Yes, please open an enhancement request and add your ideas. Thanks! Evan > > -- > Christopher Lamb > > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r40667 - in /llvm/trunk/lib/Transforms/Scalar: DeadStoreElimination.cpp FastDSE.cpp
Author: resistor Date: Wed Aug 1 01:30:51 2007 New Revision: 40667 URL: http://llvm.org/viewvc/llvm-project?rev=40667&view=rev Log: Move FastDSE in to DeadStoreElimination. Added: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp - copied unchanged from r40665, llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Removed: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Removed: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=40666&view=auto == --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (removed) @@ -1,387 +0,0 @@ -//===- FastDSE.cpp - Fast Dead Store Elimination --===// -// -// The LLVM Compiler Infrastructure -// -// This file was developed by Owen Anderson and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. -// -//===--===// -// -// This file implements a trivial dead store elimination that only considers -// basic-block local redundant stores. -// -// FIXME: This should eventually be extended to be a post-dominator tree -// traversal. Doing so would be pretty trivial. -// -//===--===// - -#define DEBUG_TYPE "fdse" -#include "llvm/Transforms/Scalar.h" -#include "llvm/Constants.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/Pass.h" -#include "llvm/ADT/SetVector.h" -#include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/Statistic.h" -#include "llvm/Analysis/AliasAnalysis.h" -#include "llvm/Analysis/MemoryDependenceAnalysis.h" -#include "llvm/Target/TargetData.h" -#include "llvm/Transforms/Utils/Local.h" -#include "llvm/Support/Compiler.h" -using namespace llvm; - -STATISTIC(NumFastStores, "Number of stores deleted"); -STATISTIC(NumFastOther , "Number of other instrs removed"); - -namespace { - struct VISIBILITY_HIDDEN FDSE : public FunctionPass { -static char ID; // Pass identification, replacement for typeid -FDSE() : FunctionPass((intptr_t)&ID) {} - -virtual bool runOnFunction(Function &F) { - bool Changed = false; - for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) -Changed |= runOnBasicBlock(*I); - return Changed; -} - -bool runOnBasicBlock(BasicBlock &BB); -bool handleFreeWithNonTrivialDependency(FreeInst* F, Instruction* dependency, -SetVector& possiblyDead); -bool handleEndBlock(BasicBlock& BB, SetVector& possiblyDead); -bool RemoveUndeadPointers(Value* pointer, unsigned pointerSize, - BasicBlock::iterator& BBI, - SmallPtrSet& deadPointers, - SetVector& possiblyDead); -void DeleteDeadInstructionChains(Instruction *I, - SetVector &DeadInsts); -void TranslatePointerBitCasts(Value*& v) { - assert(isa(v->getType()) && "Translating a non-pointer type?"); - - // See through pointer-to-pointer bitcasts - while (isa(v) || isa(v)) -if (BitCastInst* C = dyn_cast(v)) - v = C->getOperand(0); -else if (GetElementPtrInst* G = dyn_cast(v)) - v = G->getOperand(0); -} - -// getAnalysisUsage - We require post dominance frontiers (aka Control -// Dependence Graph) -virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesCFG(); - AU.addRequired(); - AU.addRequired(); - AU.addRequired(); - AU.addPreserved(); - AU.addPreserved(); -} - }; - char FDSE::ID = 0; - RegisterPass X("fdse", "Fast Dead Store Elimination"); -} - -FunctionPass *llvm::createFastDeadStoreEliminationPass() { return new FDSE(); } - -bool FDSE::runOnBasicBlock(BasicBlock &BB) { - MemoryDependenceAnalysis& MD = getAnalysis(); - - // Record the last-seen store to this pointer - DenseMap lastStore; - // Record instructions possibly made dead by deleting a store - SetVector possiblyDead; - - bool MadeChange = false; - - // Do a top-down walk on the BB - for (BasicBlock::iterator BBI = BB.begin(), BBE = BB.end(); BBI != BBE; ++BBI) { -// If we find a store or a free... -if (isa(BBI) || isa(BBI)) { - Value* pointer = 0; - if (StoreInst* S = dyn_cast(BBI)) -pointer = S->getPointerOperand(); - else if (FreeInst* F = dyn_cast(BBI)) -pointer = F->getPointerOperand(); - - assert(pointer && "Not a free or a store?"); - - StoreInst*& last = lastStore[pointer]; - bool deletedStore = false; - - // ... to a pointer that has been stored to before... - if (last) { - -Instruction* dep = M
[llvm-commits] [llvm] r40668 - in /llvm/trunk: include/llvm/LinkAllPasses.h include/llvm/Transforms/Scalar.h lib/Transforms/Scalar/DeadStoreElimination.cpp test/Transforms/DeadStoreElimination/2004-11
Author: resistor Date: Wed Aug 1 01:36:51 2007 New Revision: 40668 URL: http://llvm.org/viewvc/llvm-project?rev=40668&view=rev Log: Rename FastDSE to just DSE. Modified: llvm/trunk/include/llvm/LinkAllPasses.h llvm/trunk/include/llvm/Transforms/Scalar.h llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp 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/PartialStore.ll llvm/trunk/tools/llvm-ld/Optimize.cpp llvm/trunk/tools/opt/opt.cpp Modified: llvm/trunk/include/llvm/LinkAllPasses.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllPasses.h?rev=40668&r1=40667&r2=40668&view=diff == --- llvm/trunk/include/llvm/LinkAllPasses.h (original) +++ llvm/trunk/include/llvm/LinkAllPasses.h Wed Aug 1 01:36:51 2007 @@ -62,7 +62,6 @@ (void) llvm::createDeadTypeEliminationPass(); (void) llvm::createEdgeProfilerPass(); (void) llvm::createRedundantLoadEliminationPass(); - (void) llvm::createFastDeadStoreEliminationPass(); (void) llvm::createFunctionInliningPass(); (void) llvm::createFunctionProfilerPass(); (void) llvm::createGCSEPass(); Modified: llvm/trunk/include/llvm/Transforms/Scalar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=40668&r1=40667&r2=40668&view=diff == --- llvm/trunk/include/llvm/Transforms/Scalar.h (original) +++ llvm/trunk/include/llvm/Transforms/Scalar.h Wed Aug 1 01:36:51 2007 @@ -325,13 +325,6 @@ //===--===// // -// FastDeadStoreElimination - This pass deletes stores that are post-dominated by -// must-aliased stores and are not loaded used between the stores. -// -FunctionPass *createFastDeadStoreEliminationPass(); - -//===--===// -// // RedundantLoadElimination - This pass deletes loads that are dominated by // must-aliased loads and are not stored to between the loads. // Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=40668&r1=40667&r2=40668&view=diff == --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Wed Aug 1 01:36:51 2007 @@ -1,4 +1,4 @@ -//===- FastDSE.cpp - Fast Dead Store Elimination --===// +//===- DeadStoreElimination.cpp - Fast Dead Store Elimination --===// // // The LLVM Compiler Infrastructure // @@ -15,7 +15,7 @@ // //===--===// -#define DEBUG_TYPE "fdse" +#define DEBUG_TYPE "dse" #include "llvm/Transforms/Scalar.h" #include "llvm/Constants.h" #include "llvm/Function.h" @@ -35,9 +35,9 @@ STATISTIC(NumFastOther , "Number of other instrs removed"); namespace { - struct VISIBILITY_HIDDEN FDSE : public FunctionPass { + struct VISIBILITY_HIDDEN DSE : public FunctionPass { static char ID; // Pass identification, replacement for typeid -FDSE() : FunctionPass((intptr_t)&ID) {} +DSE() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { bool Changed = false; @@ -78,13 +78,13 @@ AU.addPreserved(); } }; - char FDSE::ID = 0; - RegisterPass X("fdse", "Fast Dead Store Elimination"); + char DSE::ID = 0; + RegisterPass X("dse", "Dead Store Elimination"); } -FunctionPass *llvm::createFastDeadStoreEliminationPass() { return new FDSE(); } +FunctionPass *llvm::createDeadStoreEliminationPass() { return new DSE(); } -bool FDSE::runOnBasicBlock(BasicBlock &BB) { +bool DSE::runOnBasicBlock(BasicBlock &BB) { MemoryDependenceAnalysis& MD = getAnalysis(); // Record the last-seen store to this pointer @@ -172,7 +172,7 @@ /// handleFreeWithNonTrivialDependency - Handle frees of entire structures whose /// dependency is a store to a field of that structure -bool FDSE::handleFreeWithNonTrivialDependency(FreeInst* F, Instruction* dep, +bool DSE::handleFreeWithNonTrivialDependency(FreeInst* F, Instruction* dep, SetVector& possiblyDead) { TargetData &TD = getAnalysis(); AliasAnalysis &AA = getAnalysis(); @@ -213,7 +213,7 @@ /// handleEndBlock - Remove dead stores to stack-allocated locations in the fun
[llvm-commits] [llvm] r40666 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
Author: resistor Date: Wed Aug 1 01:30:10 2007 New Revision: 40666 URL: http://llvm.org/viewvc/llvm-project?rev=40666&view=rev Log: Remove old DSE. Removed: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Removed: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=40665&view=auto == --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (removed) @@ -1,179 +0,0 @@ -//===- DeadStoreElimination.cpp - Dead Store Elimination --===// -// -// The LLVM Compiler Infrastructure -// -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. -// -//===--===// -// -// This file implements a trivial dead store elimination that only considers -// basic-block local redundant stores. -// -// FIXME: This should eventually be extended to be a post-dominator tree -// traversal. Doing so would be pretty trivial. -// -//===--===// - -#define DEBUG_TYPE "dse" -#include "llvm/Transforms/Scalar.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/Analysis/AliasAnalysis.h" -#include "llvm/Analysis/AliasSetTracker.h" -#include "llvm/Target/TargetData.h" -#include "llvm/Transforms/Utils/Local.h" -#include "llvm/ADT/SetVector.h" -#include "llvm/ADT/Statistic.h" -#include "llvm/Support/Compiler.h" -using namespace llvm; - -STATISTIC(NumStores, "Number of stores deleted"); -STATISTIC(NumOther , "Number of other instrs removed"); - -namespace { - struct VISIBILITY_HIDDEN DSE : public FunctionPass { -static char ID; // Pass identification, replacement for typeid -DSE() : FunctionPass((intptr_t)&ID) {} - -virtual bool runOnFunction(Function &F) { - bool Changed = false; - for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) -Changed |= runOnBasicBlock(*I); - return Changed; -} - -bool runOnBasicBlock(BasicBlock &BB); - -void DeleteDeadInstructionChains(Instruction *I, - SetVector &DeadInsts); - -// getAnalysisUsage - We require post dominance frontiers (aka Control -// Dependence Graph) -virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesCFG(); - AU.addRequired(); - AU.addRequired(); - AU.addPreserved(); -} - }; - char DSE::ID = 0; - RegisterPass X("dse", "Dead Store Elimination"); -} - -FunctionPass *llvm::createDeadStoreEliminationPass() { return new DSE(); } - -bool DSE::runOnBasicBlock(BasicBlock &BB) { - TargetData &TD = getAnalysis(); - AliasAnalysis &AA = getAnalysis(); - AliasSetTracker KillLocs(AA); - - // If this block ends in a return, unwind, unreachable, and eventually - // tailcall, then all allocas are dead at its end. - if (BB.getTerminator()->getNumSuccessors() == 0) { -BasicBlock *Entry = BB.getParent()->begin(); -for (BasicBlock::iterator I = Entry->begin(), E = Entry->end(); I != E; ++I) - if (AllocaInst *AI = dyn_cast(I)) { -unsigned Size = ~0U; -if (!AI->isArrayAllocation() && -AI->getType()->getElementType()->isSized()) - Size = (unsigned)TD.getTypeSize(AI->getType()->getElementType()); -KillLocs.add(AI, Size); - } - } - - // PotentiallyDeadInsts - Deleting dead stores from the program can make other - // instructions die if they were only used as operands to stores. Keep track - // of the operands to stores so that we can try deleting them at the end of - // the traversal. - SetVector PotentiallyDeadInsts; - - bool MadeChange = false; - for (BasicBlock::iterator BBI = BB.end(); BBI != BB.begin(); ) { -Instruction *I = --BBI; // Keep moving iterator backwards - -// If this is a free instruction, it makes the free'd location dead! -if (FreeInst *FI = dyn_cast(I)) { - // Free instructions make any stores to the free'd location dead. - KillLocs.add(FI); - continue; -} - -if (!isa(I) || cast(I)->isVolatile()) { - // If this is a vaarg instruction, it reads its operand. We don't model - // it correctly, so just conservatively remove all entries. - if (isa(I)) { -KillLocs.clear(); -continue; - } - - // If this is a non-store instruction, it makes everything referenced no - // longer killed. Remove anything aliased from the alias set tracker. - KillLocs.remove(I); - continue; -} - -// If this is a non-volatile store instruction, and if it is already in -// the stor
[llvm-commits] [llvm-gcc-4.0] r40669 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-linker-hack.cpp
Author: resistor Date: Wed Aug 1 01:52:09 2007 New Revision: 40669 URL: http://llvm.org/viewvc/llvm-project?rev=40669&view=rev Log: FastDSE has been remained to just DSE. Modified: llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp llvm-gcc-4.0/trunk/gcc/llvm-linker-hack.cpp Modified: llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp?rev=40669&r1=40668&r2=40669&view=diff == --- llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp Wed Aug 1 01:52:09 2007 @@ -350,7 +350,7 @@ // opened up by them. PM->add(createInstructionCombiningPass()); PM->add(createCondPropagationPass()); // Propagate conditionals -PM->add(createFastDeadStoreEliminationPass()); // Delete dead stores +PM->add(createDeadStoreEliminationPass()); // Delete dead stores PM->add(createAggressiveDCEPass()); // SSA based 'Aggressive DCE' PM->add(createCFGSimplificationPass()); // Merge & remove BBs Modified: llvm-gcc-4.0/trunk/gcc/llvm-linker-hack.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-linker-hack.cpp?rev=40669&r1=40668&r2=40669&view=diff == --- llvm-gcc-4.0/trunk/gcc/llvm-linker-hack.cpp (original) +++ llvm-gcc-4.0/trunk/gcc/llvm-linker-hack.cpp Wed Aug 1 01:52:09 2007 @@ -78,7 +78,6 @@ llvm::createLoadValueNumberingPass(); llvm::createTailCallEliminationPass(); llvm::createDeadStoreEliminationPass(); - llvm::createFastDeadStoreEliminationPass(); llvm::createIPConstantPropagationPass(); llvm::createStripDeadPrototypesPass(); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits