From bruno.cardoso at gmail.com Mon Aug 4 01:17:02 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 4 Aug 2008 03:17:02 -0300 Subject: [llvm-commits] SoftenFloatOp support for fp_round In-Reply-To: <200807162143.44860.baldrick@free.fr> References: <275e64e40807161139x699f650cx816bf9947e5b0ae9@mail.gmail.com> <200807162143.44860.baldrick@free.fr> Message-ID: <275e64e40808032317r1b1fd3c2mcc70584e5a8aa10c@mail.gmail.com> > Thanks Bruno. How about handling all other possible > types while there? This patch adds the remaining fp_round libcalls: FPROUND_F80_F32, FPROUND_PPCF128_F32, FPROUND_F80_F64, FPROUND_PPCF128_F64 Support for soften float fp_round operands is added because mips need this to round f64->f32. It also adds support to soften float fabs result for single and double, (Mips doesn't support double fabs within 'single float only' mode). Duncan, could you plz take a look? Thanks, -- Bruno Cardoso Lopes http://www.brunocardoso.cc "When faced with untenable alternatives, you should consider your imperative." -------------- next part -------------- A non-text attachment was scrubbed... Name: legalize-types-fabs-fpround.patch Type: application/octet-stream Size: 5422 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080804/e1c2678f/attachment.obj From sabre at nondot.org Mon Aug 4 01:29:40 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 4 Aug 2008 01:29:40 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/index.html Message-ID: <200808040629.m746TeRx015106@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: index.html updated: 1.12 -> 1.13 --- Log message: fix some typos, add some videos --- Diffs of the changes: (+41 -38) index.html | 79 +++++++++++++++++++++++++++++++------------------------------ 1 files changed, 41 insertions(+), 38 deletions(-) Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.12 llvm-www/devmtg/2008-08/index.html:1.13 --- llvm-www/devmtg/2008-08/index.html:1.12 Sun Aug 3 17:58:54 2008 +++ llvm-www/devmtg/2008-08/index.html Mon Aug 4 01:28:53 2008 @@ -35,22 +35,23 @@ - + - + - + - + - + - - + + - + @@ -152,7 +155,7 @@ enables almost arbitrary C and C++ code to be executed safely and efficiently within a Flash container on web pages. This talk describes the implementation of the system and shows several compelling examples - that use it to run other lanugage and CPU interpreters within Flash as + that use it to run other language and CPU interpreters within Flash as well as run existing large programs within C. The demos are also extremely impressive :). @@ -171,18 +174,18 @@ - + - + - + - + @@ -193,35 +196,35 @@ - + - + - + - + - + - + - - + + - + - - - + + + @@ -230,24 +233,24 @@ - + - + - + - + - + @@ -261,23 +264,23 @@ - - + + - + - + - - + + - + @@ -297,7 +300,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
Last modified: $Date: 2008/08/03 22:58:54 $ +
Last modified: $Date: 2008/08/04 06:28:53 $ From sabre at nondot.org Mon Aug 4 01:32:46 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 4 Aug 2008 01:32:46 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/index.html Message-ID: <200808040632.m746WkbI015278@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: index.html updated: 1.13 -> 1.14 --- Log message: nbsp-ify --- Diffs of the changes: (+5 -5) index.html | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.13 llvm-www/devmtg/2008-08/index.html:1.14 --- llvm-www/devmtg/2008-08/index.html:1.13 Mon Aug 4 01:28:53 2008 +++ llvm-www/devmtg/2008-08/index.html Mon Aug 4 01:32:28 2008 @@ -35,8 +35,8 @@
MediaWhoDescription
[Video]
[Video Hi] + [Video Lo]Chris Lattner
Apple Inc.
Chris Lattner
Apple, Inc.
Welcome and Thanks - A brief welcome, thanks and some logistics for the day.
[Slides] [Video]Steve Naroff
Apple Inc.
Steve Naroff
Apple, Inc.
Clang Internals - Clang status, design and architecture.
[Slides] [Video]Dan Gohman
Apple Inc.
Dan Gohman
Apple, Inc.
CodeGen Overview and Focus on SelectionDAGs - A high-level overview of the LLVM Code Generator, with specific depth and overview in the area of the SelectionDAG phases. @@ -58,7 +59,7 @@
[Slides] [Video]Evan Cheng
Apple Inc.
Evan Cheng
Apple, Inc.
LLVM Register Allocation - Description of the current design and architecture of the LLVM register allocator. The talk discusses some optimizations that are currently performed as well as describing future @@ -66,8 +67,10 @@
[Slides] [Video]Nate Begeman
Apple Inc.
[Slides] + [Video Hi] + [Video Lo]Nate Begeman
Apple, Inc.
Building an Efficient JIT - LLVM provides many of the facilities that you need to assemble a JIT for various purposes. This talk walks you through construction of a simple JIT for C code (based on Clang) and @@ -90,7 +93,7 @@
[Slides] [Video]Ted Kremenek
Apple Inc.
Ted Kremenek
Apple, Inc.
Finding Bugs with Source Code Analysis - .
Talin -Google
Vikram AdveUniversity of Illinois at Urbana-Champaign
Nathan AllanAlphora / Database Consulting Group
Owen AndersonApple
Owen AndersonApple, Inc.
Chris AokiSun Microsystems, Inc.
Michael AuYeungThe Aerospace Corporation
Joseph BattelleLogitech
Nate BegemanApple, Inc.
Kris BellApple
Kris BellApple, Inc.
Jay BharadwajIntel Corporation
Robert BowdidgeSelf
Max BurkeElectronic Arts
Anders CarlssonApple Inc.
Anders CarlssonApple, Inc.
Chandler CarruthGoogle, Inc
Evan ChengApple
Evan ChengApple, Inc.
Andy ChouCoverity, Inc.
Eric ChristopherApple, Inc
Jan CivlinAMD
Stefanus Du ToitRapidMind
Daniel DunbarStanford University / Apple Inc.
Bernardo ElaydaWind River
Ken FerryApple
Ken FerryApple, Inc.
Tim FoleySelf
Chandrashekhar GarudSun Microsystems
Nicolas GeoffrayUniversit?? Pierre et Marie Curie
Dan GohmanApple
Dan GohmanApple, Inc.
John GolenbieskiSelf
Eric GouriouApple
Eric GouriouApple, Inc.
Ryan GovostesAlacatia Labs, Inc.
David GreeneCray, Inc.
Jim GrosbachApple
Jim GrosbachApple, Inc.
Vinod GroverNVIDIA
Alfonso GuerraApokalypse Software Corp.
Mohammad Reza HaghighatIntel Corporation
Chris HansonApple Inc.
Chris HansonApple, Inc.
Kurt HarrimanGreenplum
Stuart HastingsApple
Stuart HastingsApple, Inc.
John HixsonUniversity of the Pacific
Robert HundtGoogle
Oliver HuntApple, Inc.
Changhao JiangFacebook Inc.
dale johannesenApple
Francois JouauxApple Inc.
dale johannesenApple, Inc.
Francois JouauxApple, Inc.
Benjamin KingDemandEO.com
George Kingarboreality.net
Nick KledzikApple Inc
Nick KledzikApple, Inc.
Anton KorobeynikovSaint Petersburg State University
Ted KremenekApple Inc.
Chris LattnerApple Inc
Tanya LattnerApple
Ted KremenekApple, Inc.
Chris LattnerApple, Inc.
Tanya LattnerApple, Inc.
Andrew LenharthUniversity of Illinois
Mark LeoneSelf
Julien LerougeApple, Inc.
olivier magginumeriz
Dmitri MakarovAMD
Ali MashtizadehVMware, Inc.
Henry MasonApple
Henry MasonApple, Inc.
Scott MichelAerospace
Keir MierleGoogle
Daniel MonizUnified Research
Marcel MoolenaarThe FreeBSD Project
Alireza MoshtaghiMicrochip Technology
Ginger MylesApple Inc.
Ginger MylesApple, Inc.
Prashanth NarayanaswamySun Microsystems
Steve NaroffApple Inc.
Steve NaroffApple, Inc.
Ted NewardNeward & Associates
Jay O'ConorSelf
Maksim PanchenkoSun Microsystems
Ji Young ParkAMD Inc.
Terence ParrUniversity of San Francisco
Devang PatelApple
Devang PatelApple, Inc.
Scott PetersenAdobe Systems, Inc.
Richard PhillipsWolfram Research
Ernest PrabhakarApple
Ernest PrabhakarApple, Inc.
Gregor PurdyApple, Inc.
Paul RamseyDreamworks Animation
Joseph RanieriAlacatia Labs, Inc.
Mitesh ShahARC International
Craig SmithNational Instruments
Evan SmythDreamWorks Animation
Pratik SolankiApple
Mike StumpApple
Pratik SolankiApple, Inc.
Mike StumpApple, Inc.
Andre SubletteSelf
Richard SweetAdobe Systems
Yan TangVMware
Caroline TiceApple Inc.
Caroline TiceApple, Inc.
Ross TowleSun
Andrew TrickHewlett-Packard
Hemant TrivediSilicon Informatics, Inc
Erick Tryzelaarself
Mon Ping WangApple
Mon Ping WangApple, Inc.
Douglas WattXMOS Semiconductor
Patrick WebsterSelf
Marcel WeiherApple
Sam WeinigApple Inc.
Marcel WeiherApple, Inc.
Sam WeinigApple, Inc.
Steve WeissingerWind River
Bill WendlingApple Inc.
Bill WendlingApple, Inc.
Hans-Martin WillVincent 3D Rendering Library (OSS project)
Pen-Chung YewUniversity of Minnesota
Anna ZaksNew York University
- + @@ -68,8 +68,8 @@ + [Video Hi] + [Video Lo] - +
MediaWhoDescription
[Video Hi] - [Video Lo]
[Video Hi] + [Video Lo] Chris Lattner
Apple, Inc.
[Slides] - [Video Hi] - [Video Lo] Nate Begeman
Apple, Inc.
Building an Efficient JIT - LLVM provides many of the facilities that you need to assemble a JIT for various purposes. This talk walks @@ -300,7 +300,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2008/08/04 06:28:53 $ +
Last modified: $Date: 2008/08/04 06:32:28 $ From sabre at nondot.org Mon Aug 4 01:41:45 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 4 Aug 2008 01:41:45 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/index.html Message-ID: <200808040641.m746firf015621@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: index.html updated: 1.14 -> 1.15 --- Log message: add nuno's talk video --- Diffs of the changes: (+4 -2) index.html | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.14 llvm-www/devmtg/2008-08/index.html:1.15 --- llvm-www/devmtg/2008-08/index.html:1.14 Mon Aug 4 01:32:28 2008 +++ llvm-www/devmtg/2008-08/index.html Mon Aug 4 01:41:26 2008 @@ -98,7 +98,9 @@
[Slides] [Video]
[Slides] + [Video Hi] + [Video Lo] Nuno Lopes
Instituto Superior Tecnico
Building a JIT compiler for PHP in 2 days - This talk describes the implementation of the PHP interpreter and how it was easily changed into @@ -300,7 +302,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2008/08/04 06:32:28 $ +
Last modified: $Date: 2008/08/04 06:41:26 $ From bruno.cardoso at gmail.com Mon Aug 4 01:44:33 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 04 Aug 2008 06:44:33 -0000 Subject: [llvm-commits] [llvm] r54315 - in /llvm/trunk/lib/Target/Mips: MipsISelLowering.cpp MipsInstrFPU.td Message-ID: <200808040644.m746iXTA015705@zion.cs.uiuc.edu> Author: bruno Date: Mon Aug 4 01:44:31 2008 New Revision: 54315 URL: http://llvm.org/viewvc/llvm-project?rev=54315&view=rev Log: Handle i32->f32 bitconvert results. Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsInstrFPU.td Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=54315&r1=54314&r2=54315&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Mon Aug 4 01:44:31 2008 @@ -138,7 +138,7 @@ setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand); setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand); - if (Subtarget->isSingleFloat()) + if (Subtarget->isSingleFloat()) setOperationAction(ISD::SELECT_CC, MVT::f64, Expand); if (!Subtarget->hasSEInReg()) { Modified: llvm/trunk/lib/Target/Mips/MipsInstrFPU.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrFPU.td?rev=54315&r1=54314&r2=54315&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrFPU.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrFPU.td Mon Aug 4 01:44:31 2008 @@ -339,3 +339,8 @@ def : Pat<(i32 (bitconvert FGR32:$src)), (MFC1 FGR32:$src)>; def : Pat<(i32 (bitconvert AFGR32:$src)), (MFC1A AFGR32:$src)>; + +def : Pat<(f32 (bitconvert CPURegs:$src)), (MTC1 CPURegs:$src)>, + Requires<[IsSingleFloat]>; +def : Pat<(f32 (bitconvert CPURegs:$src)), (MTC1A CPURegs:$src)>, + Requires<[In32BitMode]>; From bruno.cardoso at gmail.com Mon Aug 4 02:12:53 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 04 Aug 2008 07:12:53 -0000 Subject: [llvm-commits] [llvm] r54316 - in /llvm/trunk/lib/Target/Mips: MipsISelLowering.cpp MipsISelLowering.h Message-ID: <200808040712.m747Crgd016513@zion.cs.uiuc.edu> Author: bruno Date: Mon Aug 4 02:12:52 2008 New Revision: 54316 URL: http://llvm.org/viewvc/llvm-project?rev=54316&view=rev Log: Mips ISelLowering cleanup : Removed old LowerCALL and FORMAL_ARGS helpers, they aren't used anyway, they also used to broke compiling when fastcc was specified for a function, but not anymore. Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.h Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=54316&r1=54315&r2=54316&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Mon Aug 4 02:12:52 2008 @@ -556,34 +556,19 @@ // CALL Calling Convention Implementation //===----------------------------------------------------------------------===// -/// Mips custom CALL implementation -SDValue MipsTargetLowering:: -LowerCALL(SDValue Op, SelectionDAG &DAG) -{ - unsigned CallingConv = cast(Op.getOperand(1))->getValue(); - - // By now, only CallingConv::C implemented - switch (CallingConv) { - default: - assert(0 && "Unsupported calling convention"); - case CallingConv::Fast: - case CallingConv::C: - return LowerCCCCallTo(Op, DAG, CallingConv); - } -} - /// LowerCCCCallTo - functions arguments are copied from virtual /// regs to (physical regs)/(stack frame), CALLSEQ_START and /// CALLSEQ_END are emitted. /// TODO: isVarArg, isTailCall. SDValue MipsTargetLowering:: -LowerCCCCallTo(SDValue Op, SelectionDAG &DAG, unsigned CC) +LowerCALL(SDValue Op, SelectionDAG &DAG) { MachineFunction &MF = DAG.getMachineFunction(); - SDValue Chain = Op.getOperand(0); + SDValue Chain = Op.getOperand(0); SDValue Callee = Op.getOperand(4); - bool isVarArg = cast(Op.getOperand(2))->getValue() != 0; + bool isVarArg = cast(Op.getOperand(2))->getValue() != 0; + unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv(); MachineFrameInfo *MFI = MF.getFrameInfo(); @@ -786,34 +771,20 @@ // FORMAL_ARGUMENTS Calling Convention Implementation //===----------------------------------------------------------------------===// -/// Mips custom FORMAL_ARGUMENTS implementation -SDValue MipsTargetLowering:: -LowerFORMAL_ARGUMENTS(SDValue Op, SelectionDAG &DAG) -{ - unsigned CC = cast(Op.getOperand(1))->getValue(); - switch(CC) - { - default: - assert(0 && "Unsupported calling convention"); - case CallingConv::C: - return LowerCCCArguments(Op, DAG); - } -} - -/// LowerCCCArguments - transform physical registers into +/// LowerFORMAL_ARGUMENTS - transform physical registers into /// virtual registers and generate load operations for /// arguments places on the stack. /// TODO: isVarArg SDValue MipsTargetLowering:: -LowerCCCArguments(SDValue Op, SelectionDAG &DAG) +LowerFORMAL_ARGUMENTS(SDValue Op, SelectionDAG &DAG) { - SDValue Root = Op.getOperand(0); - MachineFunction &MF = DAG.getMachineFunction(); + SDValue Root = Op.getOperand(0); + MachineFunction &MF = DAG.getMachineFunction(); MachineFrameInfo *MFI = MF.getFrameInfo(); MipsFunctionInfo *MipsFI = MF.getInfo(); bool isVarArg = cast(Op.getOperand(2))->getValue() != 0; - unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv(); + unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv(); unsigned StackReg = MF.getTarget().getRegisterInfo()->getFrameRegister(MF); Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.h?rev=54316&r1=54315&r2=54316&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.h (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.h Mon Aug 4 02:12:52 2008 @@ -83,8 +83,6 @@ const MipsSubtarget *Subtarget; // Lower Operand helpers - SDValue LowerCCCArguments(SDValue Op, SelectionDAG &DAG); - SDValue LowerCCCCallTo(SDValue Op, SelectionDAG &DAG, unsigned CC); SDNode *LowerCallResult(SDValue Chain, SDValue InFlag, SDNode*TheCall, unsigned CallingConv, SelectionDAG &DAG); bool IsGlobalInSmallSection(GlobalValue *GV); From baldrick at free.fr Mon Aug 4 02:24:30 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 4 Aug 2008 09:24:30 +0200 Subject: [llvm-commits] SoftenFloatOp support for fp_round In-Reply-To: <275e64e40808032317r1b1fd3c2mcc70584e5a8aa10c@mail.gmail.com> References: <275e64e40807161139x699f650cx816bf9947e5b0ae9@mail.gmail.com> <200807162143.44860.baldrick@free.fr> <275e64e40808032317r1b1fd3c2mcc70584e5a8aa10c@mail.gmail.com> Message-ID: <200808040924.31674.baldrick@free.fr> Hi Bruno, +SDValue DAGTypeLegalizer::SoftenFloatRes_FABS(SDNode *N) { + MVT VT = N->getValueType(0); + assert((VT == MVT::f64 || VT == MVT::f32) && + "Don't know how to soften other FABS result types"); it is easy to support any width, so best to do so (see below). + + MVT NVT = TLI.getTypeToTransformTo(VT); + SDValue Lo = GetSoftenedFloat(N->getOperand(0)); + SDValue Mask = (VT == MVT::f64) + ? DAG.getConstantFP(BitsToDouble(~(1ULL << 63)), VT) + : DAG.getConstantFP(BitsToFloat(~(1U << 31)), VT); + Mask = DAG.getNode(ISD::BIT_CONVERT, NVT, Mask); What you are doing here is bitcasting 1 << 63 to a double, then bitcasting that double back again to an integer. Why don't you directly generate the integer? That way it also works for any floating point type. What you need to do is create an APInt with bitwidth NVT->getSizeInBits(), and use some APInt method to set the top bit. Then Mask is simply DAG.getConstant(MyAPInt, NVT). + return DAG.getNode(ISD::AND, NVT, Lo, Mask); +} +SDValue DAGTypeLegalizer::SoftenFloatOp_FP_ROUND(SDNode *N) { + MVT SVT = N->getOperand(0).getValueType(); + MVT RVT = TLI.getTypeToTransformTo(N->getValueType(0)); This should be: MVT RVT = N->getValueType(0); This type is necessarily legal (because LegalizeTypes always legalizes return types before operands; the result is that if you are in operand legalization then you can be sure that the return types are all legal). So TLI.getTypeToTransformTo is a no-op. + RTLIB::Libcall LC = RTLIB::getFPROUND(SVT, RVT); + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_ROUND libcall"); + + SDValue Op = GetSoftenedFloat(N->getOperand(0)); + return MakeLibCall(LC, RVT, &Op, 1, false); +} Otherwise it's ok. Thanks! Duncan. From criswell at cs.uiuc.edu Mon Aug 4 11:11:06 2008 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 4 Aug 2008 11:11:06 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/index.html Message-ID: <200808041611.m74GB6Fp032652@maute.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: index.html updated: 1.15 -> 1.16 --- Log message: Adhere to the UIUC web standards which require us to use University of Illinois instead of UIUC. --- Diffs of the changes: (+2 -2) index.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.15 llvm-www/devmtg/2008-08/index.html:1.16 --- llvm-www/devmtg/2008-08/index.html:1.15 Mon Aug 4 01:41:26 2008 +++ llvm-www/devmtg/2008-08/index.html Mon Aug 4 11:10:12 2008 @@ -18,7 +18,7 @@
-

Sponsored By: Apple, Google, Adobe, UIUC

+

Sponsored By: Apple, Google, Adobe, University of Illinois

The meeting served as a forum for LLVM developers and users to get acquainted, learn how LLVM is used, and @@ -302,7 +302,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2008/08/04 06:41:26 $ +
Last modified: $Date: 2008/08/04 16:10:12 $ From bruno.cardoso at gmail.com Mon Aug 4 11:38:37 2008 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 4 Aug 2008 13:38:37 -0300 Subject: [llvm-commits] SoftenFloatOp support for fp_round In-Reply-To: <200808040924.31674.baldrick@free.fr> References: <275e64e40807161139x699f650cx816bf9947e5b0ae9@mail.gmail.com> <200807162143.44860.baldrick@free.fr> <275e64e40808032317r1b1fd3c2mcc70584e5a8aa10c@mail.gmail.com> <200808040924.31674.baldrick@free.fr> Message-ID: <275e64e40808040938g29a4b1b6j87c85abaaf557e96@mail.gmail.com> > Otherwise it's ok. Done. The new patch contain the changes. Ok to commit? -- Bruno Cardoso Lopes http://www.brunocardoso.cc "When faced with untenable alternatives, you should consider your imperative." -------------- next part -------------- A non-text attachment was scrubbed... Name: Legalize.patch Type: application/octet-stream Size: 5215 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080804/07dd20f0/attachment.obj From sabre at nondot.org Mon Aug 4 11:54:28 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 4 Aug 2008 11:54:28 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/index.html Message-ID: <200808041654.m74GsS02018583@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: index.html updated: 1.16 -> 1.17 --- Log message: add video for Steve and Dan, fix nuno's large video --- Diffs of the changes: (+11 -3) index.html | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.16 llvm-www/devmtg/2008-08/index.html:1.17 --- llvm-www/devmtg/2008-08/index.html:1.16 Mon Aug 4 11:10:12 2008 +++ llvm-www/devmtg/2008-08/index.html Mon Aug 4 11:52:07 2008 @@ -44,13 +44,21 @@ for the day. - [Slides] [Video] + [Slides] + [Video Hi] + [Video Lo] + Steve Naroff
Apple, Inc. Clang Internals - Clang status, design and architecture. - [Slides] [Video] + + + [Slides] + [Video Hi] + [Video Lo] + Dan Gohman
Apple, Inc. CodeGen Overview and Focus on SelectionDAGs - A high-level overview of the LLVM Code Generator, with specific depth and overview in the @@ -302,7 +310,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2008/08/04 16:10:12 $ +
Last modified: $Date: 2008/08/04 16:52:07 $ From kremenek at apple.com Mon Aug 4 12:14:26 2008 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 04 Aug 2008 17:14:26 -0000 Subject: [llvm-commits] [llvm] r54320 - /llvm/tags/checker/checker-72/ Message-ID: <200808041714.m74HEQTC019365@zion.cs.uiuc.edu> Author: kremenek Date: Mon Aug 4 12:14:25 2008 New Revision: 54320 URL: http://llvm.org/viewvc/llvm-project?rev=54320&view=rev Log: Tagging checker-72. Added: llvm/tags/checker/checker-72/ - copied from r54319, llvm/trunk/ From isanbard at gmail.com Mon Aug 4 15:05:31 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 04 Aug 2008 20:05:31 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54327 - in /llvm-gcc-4.2/trunk/libcpp: ChangeLog.apple charset.c Message-ID: <200808042005.m74K5VhN025172@zion.cs.uiuc.edu> Author: void Date: Mon Aug 4 15:05:30 2008 New Revision: 54327 URL: http://llvm.org/viewvc/llvm-project?rev=54327&view=rev Log: Make sure we don't read before the buffer. PR2628 Modified: llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple llvm-gcc-4.2/trunk/libcpp/charset.c Modified: llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple?rev=54327&r1=54326&r2=54327&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple Mon Aug 4 15:05:30 2008 @@ -1,3 +1,8 @@ +2008-08-04 Bill Wendling + + Radar 6121572 + * charset.c (_cpp_convert_input): Don't read to.text[-1]. + 2008-05-01 Mike Stump Radar 5774975 Modified: llvm-gcc-4.2/trunk/libcpp/charset.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/charset.c?rev=54327&r1=54326&r2=54327&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libcpp/charset.c (original) +++ llvm-gcc-4.2/trunk/libcpp/charset.c Mon Aug 4 15:05:30 2008 @@ -1692,7 +1692,8 @@ terminate with another \r, not an \n, so that we do not mistake the \r\n sequence for a single DOS line ending and erroneously issue the "No newline at end of file" diagnostic. */ - if (to.text[to.len - 1] == '\r') + /* APPLE LOCAL don't read to.text[-1] radar 6121572 */ + if (to.len > 0 && to.text[to.len - 1] == '\r') to.text[to.len] = '\r'; else to.text[to.len] = '\n'; From sabre at nondot.org Mon Aug 4 16:34:57 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 4 Aug 2008 16:34:57 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/Kremenek_StaticAnalyzer.pdf Naroff_Clang.pdf index.html Message-ID: <200808042134.m74LYvNP028389@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: Kremenek_StaticAnalyzer.pdf added (r1.1) Naroff_Clang.pdf added (r1.1) index.html updated: 1.17 -> 1.18 --- Log message: Add ted and steve's slides. --- Diffs of the changes: (+8 -4) Kremenek_StaticAnalyzer.pdf | 0 Naroff_Clang.pdf | 0 index.html | 12 ++++++++---- 3 files changed, 8 insertions(+), 4 deletions(-) Index: llvm-www/devmtg/2008-08/Kremenek_StaticAnalyzer.pdf Index: llvm-www/devmtg/2008-08/Naroff_Clang.pdf Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.17 llvm-www/devmtg/2008-08/index.html:1.18 --- llvm-www/devmtg/2008-08/index.html:1.17 Mon Aug 4 11:52:07 2008 +++ llvm-www/devmtg/2008-08/index.html Mon Aug 4 16:33:51 2008 @@ -44,7 +44,7 @@ for the day. - [Slides] + [Slides] [Video Hi] [Video Lo] @@ -100,9 +100,13 @@ - [Slides] [Video] + + + [Slides] + [Video] + Ted Kremenek
Apple, Inc. - Finding Bugs with Source Code Analysis - . + Finding Bugs with the Clang Static Analyzer - . @@ -310,7 +314,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2008/08/04 16:52:07 $ +
Last modified: $Date: 2008/08/04 21:33:51 $ From sabre at nondot.org Mon Aug 4 16:40:50 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 4 Aug 2008 16:40:50 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/index.html Message-ID: <200808042140.m74LeohS028589@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: index.html updated: 1.18 -> 1.19 --- Log message: add several new videos. --- Diffs of the changes: (+34 -12) index.html | 46 ++++++++++++++++++++++++++++++++++------------ 1 files changed, 34 insertions(+), 12 deletions(-) Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.18 llvm-www/devmtg/2008-08/index.html:1.19 --- llvm-www/devmtg/2008-08/index.html:1.18 Mon Aug 4 16:33:51 2008 +++ llvm-www/devmtg/2008-08/index.html Mon Aug 4 16:40:32 2008 @@ -75,9 +75,11 @@ - [Slides] - [Video Hi] - [Video Lo] + + [Slides] + [Video Hi] + [Video Lo] + Nate Begeman
Apple, Inc. Building an Efficient JIT - LLVM provides many of the facilities that you need to assemble a JIT for various purposes. This talk walks @@ -103,6 +105,9 @@ [Slides] + [Video Hi] + [Video Lo] + [Video] Ted Kremenek
Apple, Inc. @@ -110,9 +115,12 @@ - [Slides] - [Video Hi] - [Video Lo] + + + [Slides] + [Video Hi] + [Video Lo] + Nuno Lopes
Instituto Superior Tecnico Building a JIT compiler for PHP in 2 days - This talk describes the implementation of the PHP interpreter and how it was easily changed into @@ -133,13 +141,18 @@ - [Slides] [Video] + [Slides] [No video] John Criswell
University of Illinois SVA: Using LLVM to Provide Memory Safety - . - [Slides] [Video] + + + [Slides] + [Video Hi] + [Video Lo] + Nicolas Geoffray
Universite Pierre et Marie Curie The VMKit Project - VMKit is an implementation of the Java and .NET Virtual Machines that use LLVM to optimize and JIT compile the code. @@ -149,8 +162,12 @@ - [Slides] - [Video] + + + [Slides] + [Video Hi] + [Video Lo] + Tim Sander
Technischen Universitat Darmstadt Designflow: using LLVM to compile to Hardware - This project uses LLVM to compile code to a mixed hardware and software implementation. This @@ -161,7 +178,12 @@ - [Slides] [Video] + + + [Slides] + [Video Hi] + [Video Lo] + Scott Petersen
Adobe Inc. Flash C Compiler: Compiling C code to the Adobe Flash Virtual Machine - FlaCC is a research project that compiles C code to @@ -314,7 +336,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2008/08/04 21:33:51 $ +
Last modified: $Date: 2008/08/04 21:40:32 $ From sabre at nondot.org Mon Aug 4 16:47:57 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 4 Aug 2008 16:47:57 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/.htaccess Message-ID: <200808042147.m74Llv4o028906@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: .htaccess added (r1.1) --- Log message: set the right mime type --- Diffs of the changes: (+4 -0) .htaccess | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-www/devmtg/2008-08/.htaccess diff -c /dev/null llvm-www/devmtg/2008-08/.htaccess:1.1 *** /dev/null Mon Aug 4 16:47:48 2008 --- llvm-www/devmtg/2008-08/.htaccess Mon Aug 4 16:47:38 2008 *************** *** 0 **** --- 1,4 ---- + AddType audio/mpeg mp3 + AddType audio/x-m4a m4a + AddType video/x-m4v m4v + AddType video/mp4 mp4 From gohman at apple.com Mon Aug 4 18:09:15 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 04 Aug 2008 23:09:15 -0000 Subject: [llvm-commits] [llvm] r54329 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200808042309.m74N9G6v031667@zion.cs.uiuc.edu> Author: djg Date: Mon Aug 4 18:09:15 2008 New Revision: 54329 URL: http://llvm.org/viewvc/llvm-project?rev=54329&view=rev Log: Add an assert to catch invalid VECTOR_SHUFFLE mask indices. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=54329&r1=54328&r2=54329&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Aug 4 18:09:15 2008 @@ -3665,6 +3665,7 @@ Locs[i] = std::make_pair(-1, -1); } else { unsigned Val = cast(Elt)->getValue(); + assert(Val < 8 && "Invalid VECTOR_SHUFFLE index!"); if (Val < 4) { Locs[i] = std::make_pair(0, NumLo); Mask1[NumLo] = Elt; From gohman at apple.com Mon Aug 4 18:30:42 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 04 Aug 2008 23:30:42 -0000 Subject: [llvm-commits] [llvm] r54330 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp test/CodeGen/Generic/pr2625.ll Message-ID: <200808042330.m74NUgQY032345@zion.cs.uiuc.edu> Author: djg Date: Mon Aug 4 18:30:41 2008 New Revision: 54330 URL: http://llvm.org/viewvc/llvm-project?rev=54330&view=rev Log: Fix SDISel lowering of zeroinitializer and undef to use ComputeValueVTs. This allows it to work correctly on nested aggregate values. This fixes PR2625. Added: llvm/trunk/test/CodeGen/Generic/pr2625.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=54330&r1=54329&r2=54330&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Aug 4 18:30:41 2008 @@ -1184,34 +1184,18 @@ return DAG.getMergeValues(&Constants[0], Constants.size()); } - if (const ArrayType *ATy = dyn_cast(C->getType())) { + if (isa(C->getType()) || isa(C->getType())) { assert((isa(C) || isa(C)) && - "Unknown array constant!"); - unsigned NumElts = ATy->getNumElements(); - if (NumElts == 0) - return SDValue(); // empty array - MVT EltVT = TLI.getValueType(ATy->getElementType()); - SmallVector Constants(NumElts); - for (unsigned i = 0, e = NumElts; i != e; ++i) { - if (isa(C)) - Constants[i] = DAG.getNode(ISD::UNDEF, EltVT); - else if (EltVT.isFloatingPoint()) - Constants[i] = DAG.getConstantFP(0, EltVT); - else - Constants[i] = DAG.getConstant(0, EltVT); - } - return DAG.getMergeValues(&Constants[0], Constants.size()); - } + "Unknown struct or array constant!"); - if (const StructType *STy = dyn_cast(C->getType())) { - assert((isa(C) || isa(C)) && - "Unknown struct constant!"); - unsigned NumElts = STy->getNumElements(); + SmallVector ValueVTs; + ComputeValueVTs(TLI, C->getType(), ValueVTs); + unsigned NumElts = ValueVTs.size(); if (NumElts == 0) return SDValue(); // empty struct SmallVector Constants(NumElts); - for (unsigned i = 0, e = NumElts; i != e; ++i) { - MVT EltVT = TLI.getValueType(STy->getElementType(i)); + for (unsigned i = 0; i != NumElts; ++i) { + MVT EltVT = ValueVTs[i]; if (isa(C)) Constants[i] = DAG.getNode(ISD::UNDEF, EltVT); else if (EltVT.isFloatingPoint()) @@ -1219,7 +1203,7 @@ else Constants[i] = DAG.getConstant(0, EltVT); } - return DAG.getMergeValues(&Constants[0], Constants.size()); + return DAG.getMergeValues(&Constants[0], NumElts); } const VectorType *VecTy = cast(V->getType()); Added: llvm/trunk/test/CodeGen/Generic/pr2625.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/pr2625.ll?rev=54330&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/pr2625.ll (added) +++ llvm/trunk/test/CodeGen/Generic/pr2625.ll Mon Aug 4 18:30:41 2008 @@ -0,0 +1,17 @@ +; RUN: llvm-as < %s | llc +; PR2625 + +define i32 @main({ i32, { i32 } }*) { +entry: + %state = alloca { i32, { i32 } }* ; <{ i32, { i32 } }**> [#uses=2] + store { i32, { i32 } }* %0, { i32, { i32 } }** %state + %retval = alloca i32 ; [#uses=2] + store i32 0, i32* %retval + load { i32, { i32 } }** %state ; <{ i32, { i32 } }*>:1 [#uses=1] + store { i32, { i32 } } zeroinitializer, { i32, { i32 } }* %1 + br label %return + +return: ; preds = %entry + load i32* %retval ; :2 [#uses=1] + ret i32 %2 +} From gohman at apple.com Mon Aug 4 18:42:47 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 04 Aug 2008 23:42:47 -0000 Subject: [llvm-commits] [llvm] r54331 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp test/CodeGen/X86/pr2623.ll Message-ID: <200808042342.m74NglID032704@zion.cs.uiuc.edu> Author: djg Date: Mon Aug 4 18:42:46 2008 New Revision: 54331 URL: http://llvm.org/viewvc/llvm-project?rev=54331&view=rev Log: Fix SDISel lowering of PHI nodes to use ComputeValueVTs. This allows it to work correctly on aggregate values. This fixes PR2623. Added: llvm/trunk/test/CodeGen/X86/pr2623.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=54331&r1=54330&r2=54331&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Aug 4 18:42:46 2008 @@ -444,13 +444,19 @@ for (BasicBlock::iterator I = BB->begin();(PN = dyn_cast(I)); ++I){ if (PN->use_empty()) continue; - MVT VT = TLI.getValueType(PN->getType()); - unsigned NumRegisters = TLI.getNumRegisters(VT); unsigned PHIReg = ValueMap[PN]; assert(PHIReg && "PHI node does not have an assigned virtual register!"); - const TargetInstrInfo *TII = TLI.getTargetMachine().getInstrInfo(); - for (unsigned i = 0; i != NumRegisters; ++i) - BuildMI(MBB, TII->get(TargetInstrInfo::PHI), PHIReg+i); + + SmallVector ValueVTs; + ComputeValueVTs(TLI, PN->getType(), ValueVTs); + for (unsigned vti = 0, vte = ValueVTs.size(); vti != vte; ++vti) { + MVT VT = ValueVTs[vti]; + unsigned NumRegisters = TLI.getNumRegisters(VT); + const TargetInstrInfo *TII = TLI.getTargetMachine().getInstrInfo(); + for (unsigned i = 0; i != NumRegisters; ++i) + BuildMI(MBB, TII->get(TargetInstrInfo::PHI), PHIReg+i); + PHIReg += NumRegisters; + } } } } @@ -5199,10 +5205,15 @@ // Remember that this register needs to added to the machine PHI node as // the input for this MBB. - MVT VT = TLI.getValueType(PN->getType()); - unsigned NumRegisters = TLI.getNumRegisters(VT); - for (unsigned i = 0, e = NumRegisters; i != e; ++i) - PHINodesToUpdate.push_back(std::make_pair(MBBI++, Reg+i)); + SmallVector ValueVTs; + ComputeValueVTs(TLI, PN->getType(), ValueVTs); + for (unsigned vti = 0, vte = ValueVTs.size(); vti != vte; ++vti) { + MVT VT = ValueVTs[vti]; + unsigned NumRegisters = TLI.getNumRegisters(VT); + for (unsigned i = 0, e = NumRegisters; i != e; ++i) + PHINodesToUpdate.push_back(std::make_pair(MBBI++, Reg+i)); + Reg += NumRegisters; + } } } ConstantsOut.clear(); Added: llvm/trunk/test/CodeGen/X86/pr2623.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr2623.ll?rev=54331&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/pr2623.ll (added) +++ llvm/trunk/test/CodeGen/X86/pr2623.ll Mon Aug 4 18:42:46 2008 @@ -0,0 +1,44 @@ +; RUN: llvm-as < %s | llc +; PR2623 + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-unknown-freebsd7.0" + %.objc_id = type { %.objc_id }* + %.objc_selector = type { i8*, i8* }* + at .objc_sel_ptr = external constant %.objc_selector ; <%.objc_selector*> [#uses=1] + at .objc_sel_ptr13 = external constant %.objc_selector ; <%.objc_selector*> [#uses=1] + at .objc_sel_ptr14 = external constant %.objc_selector ; <%.objc_selector*> [#uses=1] + at .objc_sel_ptr15 = external constant %.objc_selector ; <%.objc_selector*> [#uses=1] + at .objc_sel_ptr16 = external constant %.objc_selector ; <%.objc_selector*> [#uses=1] + at .objc_sel_ptr17 = external constant %.objc_selector ; <%.objc_selector*> [#uses=1] + at .objc_sel_ptr18 = external constant %.objc_selector ; <%.objc_selector*> [#uses=1] + at .objc_sel_ptr19 = external constant %.objc_selector ; <%.objc_selector*> [#uses=1] + at .objc_sel_ptr20 = external constant %.objc_selector ; <%.objc_selector*> [#uses=1] + at .objc_sel_ptr21 = external constant %.objc_selector ; <%.objc_selector*> [#uses=1] + + at .objc_untyped_selector_alias = alias internal %.objc_selector* @.objc_sel_ptr15 ; <%.objc_selector*> [#uses=0] + at .objc_untyped_selector_alias1 = alias internal %.objc_selector* @.objc_sel_ptr ; <%.objc_selector*> [#uses=0] + at .objc_untyped_selector_alias2 = alias internal %.objc_selector* @.objc_sel_ptr17 ; <%.objc_selector*> [#uses=0] + at .objc_untyped_selector_alias3 = alias internal %.objc_selector* @.objc_sel_ptr16 ; <%.objc_selector*> [#uses=0] + at .objc_untyped_selector_alias4 = alias internal %.objc_selector* @.objc_sel_ptr13 ; <%.objc_selector*> [#uses=0] + at .objc_untyped_selector_alias7 = alias internal %.objc_selector* @.objc_sel_ptr14 ; <%.objc_selector*> [#uses=0] + at getRange = alias internal %.objc_selector* @.objc_sel_ptr18 ; <%.objc_selector*> [#uses=0] +@"valueWithRange:" = alias internal %.objc_selector* @.objc_sel_ptr21 ; <%.objc_selector*> [#uses=0] + at rangeValue = alias internal %.objc_selector* @.objc_sel_ptr20 ; <%.objc_selector*> [#uses=0] +@"printRange:" = alias internal %.objc_selector* @.objc_sel_ptr19 ; <%.objc_selector*> [#uses=0] + +define void @"._objc_method_SmalltalkTool()-run"(i8* %self, %.objc_selector %_cmd) { +entry: + br i1 false, label %small_int_messagerangeValue, label %real_object_messagerangeValue + +small_int_messagerangeValue: ; preds = %entry + br label %Continue + +real_object_messagerangeValue: ; preds = %entry + br label %Continue + +Continue: ; preds = %real_object_messagerangeValue, %small_int_messagerangeValue + %rangeValue = phi { i32, i32 } [ undef, %small_int_messagerangeValue ], [ undef, %real_object_messagerangeValue ] ; <{ i32, i32 }> [#uses=1] + call void (%.objc_id, %.objc_selector, ...)* null( %.objc_id null, %.objc_selector null, { i32, i32 } %rangeValue ) + ret void +} From eli.friedman at gmail.com Mon Aug 4 18:49:07 2008 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 04 Aug 2008 23:49:07 -0000 Subject: [llvm-commits] [llvm] r54332 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll Message-ID: <200808042349.m74Nn7wM000437@zion.cs.uiuc.edu> Author: efriedma Date: Mon Aug 4 18:49:06 2008 New Revision: 54332 URL: http://llvm.org/viewvc/llvm-project?rev=54332&view=rev Log: PR2621: Improvements to the SCEV AddRec binomial expansion. This version uses a new algorithm for evaluating the binomial coefficients which is significantly more efficient for AddRecs of more than 2 terms (see the comments in the code for details on how the algorithm works). It also fixes some bugs: it removes the arbitrary length restriction for AddRecs, it fixes the silent generation of incorrect code for AddRecs which require a wide calculation width, and it fixes an issue where we were incorrectly truncating the iteration count too far when evaluating an AddRec expression narrower than the induction variable. There are still a few related issues I know of: I think there's still an issue with the SCEVExpander expansion of AddRec in terms of the width of the induction variable used. The hack to avoid generating too-wide integers shouldn't be necessary; instead, the callers should be considering the cost of the expansion before expanding it (in addition to not expanding too-wide integers, we might not want to expand expressions that are really expensive, especially when optimizing for size; calculating an length-17 32-bit AddRec currently generates about 250 instructions of straight-line code on X86). Also, for long 32-bit AddRecs on X86, CodeGen really sucks at scheduling the code. I'm planning on filing follow-up PRs for these issues. Added: llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=54332&r1=54331&r2=54332&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 4 18:49:06 2008 @@ -507,91 +507,125 @@ } -/// BinomialCoefficient - Compute BC(It, K). The result is of the same type as -/// It. Assume, K > 0. +/// BinomialCoefficient - Compute BC(It, K). The result has width W. +// Assume, K > 0. static SCEVHandle BinomialCoefficient(SCEVHandle It, unsigned K, - ScalarEvolution &SE) { + ScalarEvolution &SE, + const IntegerType* ResultTy) { + // Handle the simplest case efficiently. + if (K == 1) + return SE.getTruncateOrZeroExtend(It, ResultTy); + // We are using the following formula for BC(It, K): // // BC(It, K) = (It * (It - 1) * ... * (It - K + 1)) / K! // - // Suppose, W is the bitwidth of It (and of the return value as well). We - // must be prepared for overflow. Hence, we must assure that the result of - // our computation is equal to the accurate one modulo 2^W. Unfortunately, - // division isn't safe in modular arithmetic. This means we must perform the - // whole computation accurately and then truncate the result to W bits. + // Suppose, W is the bitwidth of the return value. We must be prepared for + // overflow. Hence, we must assure that the result of our computation is + // equal to the accurate one modulo 2^W. Unfortunately, division isn't + // safe in modular arithmetic. // - // The dividend of the formula is a multiplication of K integers of bitwidth - // W. K*W bits suffice to compute it accurately. + // However, this code doesn't use exactly that formula; the formula it uses + // is something like the following, where T is the number of factors of 2 in + // K! (i.e. trailing zeros in the binary representation of K!), and ^ is + // exponentiation: // - // FIXME: We assume the divisor can be accurately computed using 16-bit - // unsigned integer type. It is true up to K = 8 (AddRecs of length 9). In - // future we may use APInt to use the minimum number of bits necessary to - // compute it accurately. + // BC(It, K) = (It * (It - 1) * ... * (It - K + 1)) / 2^T / (K! / 2^T) // - // It is safe to use unsigned division here: the dividend is nonnegative and - // the divisor is positive. - - // Handle the simplest case efficiently. - if (K == 1) - return It; + // This formula is trivially equivalent to the previous formula. However, + // this formula can be implemented much more efficiently. The trick is that + // K! / 2^T is odd, and exact division by an odd number *is* safe in modular + // arithmetic. To do exact division in modular arithmetic, all we have + // to do is multiply by the inverse. Therefore, this step can be done at + // width W. + // + // The next issue is how to safely do the division by 2^T. The way this + // is done is by doing the multiplication step at a width of at least W + T + // bits. This way, the bottom W+T bits of the product are accurate. Then, + // when we perform the division by 2^T (which is equivalent to a right shift + // by T), the bottom W bits are accurate. Extra bits are okay; they'll get + // truncated out after the division by 2^T. + // + // In comparison to just directly using the first formula, this technique + // is much more efficient; using the first formula requires W * K bits, + // but this formula less than W + K bits. Also, the first formula requires + // a division step, whereas this formula only requires multiplies and shifts. + // + // It doesn't matter whether the subtraction step is done in the calculation + // width or the input iteration count's width; if the subtraction overflows, + // the result must be zero anyway. We prefer here to do it in the width of + // the induction variable because it helps a lot for certain cases; CodeGen + // isn't smart enough to ignore the overflow, which leads to much less + // efficient code if the width of the subtraction is wider than the native + // register width. + // + // (It's possible to not widen at all by pulling out factors of 2 before + // the multiplication; for example, K=2 can be calculated as + // It/2*(It+(It*INT_MIN/INT_MIN)+-1). However, it requires + // extra arithmetic, so it's not an obvious win, and it gets + // much more complicated for K > 3.) + + // Protection from insane SCEVs; this bound is conservative, + // but it probably doesn't matter. + if (K > 1000) + return new SCEVCouldNotCompute(); - assert(K < 9 && "We cannot handle such long AddRecs yet."); - - // FIXME: A temporary hack to remove in future. Arbitrary precision integers - // aren't supported by the code generator yet. For the dividend, the bitwidth - // we use is the smallest power of 2 greater or equal to K*W and less or equal - // to 64. Note that setting the upper bound for bitwidth may still lead to - // miscompilation in some cases. - unsigned DividendBits = 1U << Log2_32_Ceil(K * It->getBitWidth()); - if (DividendBits > 64) - DividendBits = 64; -#if 0 // Waiting for the APInt support in the code generator... - unsigned DividendBits = K * It->getBitWidth(); -#endif + unsigned W = ResultTy->getBitWidth(); - const IntegerType *DividendTy = IntegerType::get(DividendBits); - const SCEVHandle ExIt = SE.getTruncateOrZeroExtend(It, DividendTy); + // Calculate K! / 2^T and T; we divide out the factors of two before + // multiplying for calculating K! / 2^T to avoid overflow. + // Other overflow doesn't matter because we only care about the bottom + // W bits of the result. + APInt OddFactorial(W, 1); + unsigned T = 1; + for (unsigned i = 3; i <= K; ++i) { + APInt Mult(W, i); + unsigned TwoFactors = Mult.countTrailingZeros(); + T += TwoFactors; + Mult = Mult.lshr(TwoFactors); + OddFactorial *= Mult; + } + + // We need at least W + T bits for the multiplication step + // FIXME: A temporary hack; we round up the bitwidths + // to the nearest power of 2 to be nice to the code generator. + unsigned CalculationBits = 1U << Log2_32_Ceil(W + T); + // FIXME: Temporary hack to avoid generating integers that are too wide. + // Although, it's not completely clear how to determine how much + // widening is safe; for example, on X86, we can't really widen + // beyond 64 because we need to be able to do multiplication + // that's CalculationBits wide, but on X86-64, we can safely widen up to + // 128 bits. + if (CalculationBits > 64) + return new SCEVCouldNotCompute(); - // The final number of bits we need to perform the division is the maximum of - // dividend and divisor bitwidths. - const IntegerType *DivisionTy = - IntegerType::get(std::max(DividendBits, 16U)); - - // Compute K! We know K >= 2 here. - unsigned F = 2; - for (unsigned i = 3; i <= K; ++i) - F *= i; - APInt Divisor(DivisionTy->getBitWidth(), F); - - // Handle this case efficiently, it is common to have constant iteration - // counts while computing loop exit values. - if (SCEVConstant *SC = dyn_cast(ExIt)) { - const APInt& N = SC->getValue()->getValue(); - APInt Dividend(N.getBitWidth(), 1); - for (; K; --K) - Dividend *= N-(K-1); - if (DividendTy != DivisionTy) - Dividend = Dividend.zext(DivisionTy->getBitWidth()); - - APInt Result = Dividend.udiv(Divisor); - if (Result.getBitWidth() != It->getBitWidth()) - Result = Result.trunc(It->getBitWidth()); + // Calcuate 2^T, at width T+W. + APInt DivFactor = APInt(CalculationBits, 1).shl(T); - return SE.getConstant(Result); + // Calculate the multiplicative inverse of K! / 2^T; + // this multiplication factor will perform the exact division by + // K! / 2^T. + APInt Mod = APInt::getSignedMinValue(W+1); + APInt MultiplyFactor = OddFactorial.zext(W+1); + MultiplyFactor = MultiplyFactor.multiplicativeInverse(Mod); + MultiplyFactor = MultiplyFactor.trunc(W); + + // Calculate the product, at width T+W + const IntegerType *CalculationTy = IntegerType::get(CalculationBits); + SCEVHandle Dividend = SE.getTruncateOrZeroExtend(It, CalculationTy); + for (unsigned i = 1; i != K; ++i) { + SCEVHandle S = SE.getMinusSCEV(It, SE.getIntegerSCEV(i, It->getType())); + Dividend = SE.getMulExpr(Dividend, + SE.getTruncateOrZeroExtend(S, CalculationTy)); } - - SCEVHandle Dividend = ExIt; - for (unsigned i = 1; i != K; ++i) - Dividend = - SE.getMulExpr(Dividend, - SE.getMinusSCEV(ExIt, SE.getIntegerSCEV(i, DividendTy))); - - return SE.getTruncateOrZeroExtend( - SE.getUDivExpr( - SE.getTruncateOrZeroExtend(Dividend, DivisionTy), - SE.getConstant(Divisor) - ), It->getType()); + + // Divide by 2^T + SCEVHandle DivResult = SE.getUDivExpr(Dividend, SE.getConstant(DivFactor)); + + // Truncate the result, and divide by K! / 2^T. + + return SE.getMulExpr(SE.getConstant(MultiplyFactor), + SE.getTruncateOrZeroExtend(DivResult, ResultTy)); } /// evaluateAtIteration - Return the value of this chain of recurrences at @@ -610,8 +644,10 @@ // The computation is correct in the face of overflow provided that the // multiplication is performed _after_ the evaluation of the binomial // coefficient. - SCEVHandle Val = SE.getMulExpr(getOperand(i), - BinomialCoefficient(It, i, SE)); + SCEVHandle Val = + SE.getMulExpr(getOperand(i), + BinomialCoefficient(It, i, SE, + cast(getType()))); Result = SE.getAddExpr(Result, Val); } return Result; @@ -2441,17 +2477,8 @@ // loop iterates. Compute this now. SCEVHandle IterationCount = getIterationCount(AddRec->getLoop()); if (IterationCount == UnknownValue) return UnknownValue; - IterationCount = SE.getTruncateOrZeroExtend(IterationCount, - AddRec->getType()); - - // If the value is affine, simplify the expression evaluation to just - // Start + Step*IterationCount. - if (AddRec->isAffine()) - return SE.getAddExpr(AddRec->getStart(), - SE.getMulExpr(IterationCount, - AddRec->getOperand(1))); - // Otherwise, evaluate it the hard way. + // Then, evaluate the AddRec. return AddRec->evaluateAtIteration(IterationCount, SE); } return UnknownValue; Added: llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll?rev=54332&view=auto ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll (added) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-IVOverflow.ll Mon Aug 4 18:49:06 2008 @@ -0,0 +1,25 @@ +; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: -scalar-evolution-max-iterations=0 | grep -F "Exits: 20028" +; PR2621 + +define i32 @a() nounwind { +entry: + br label %bb1 + +bb: + trunc i32 %i.0 to i16 + add i16 %0, %x16.0 + add i32 %i.0, 1 + br label %bb1 + +bb1: + %i.0 = phi i32 [ 0, %entry ], [ %2, %bb ] + %x16.0 = phi i16 [ 0, %entry ], [ %1, %bb ] + icmp ult i32 %i.0, 888888 + br i1 %3, label %bb, label %bb2 + +bb2: + zext i16 %x16.0 to i32 + ret i32 %4 +} + Added: llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll?rev=54332&view=auto ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll (added) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-08-04-LongAddRec.ll Mon Aug 4 18:49:06 2008 @@ -0,0 +1,56 @@ +; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: -scalar-evolution-max-iterations=0 | grep -F "Exits: -19168" +; PR2621 + +define i32 @a() nounwind { +entry: + br label %bb1 + +bb: ; preds = %bb1 + add i16 %x17.0, 1 ; :0 [#uses=2] + add i16 %0, %x16.0 ; :1 [#uses=2] + add i16 %1, %x15.0 ; :2 [#uses=2] + add i16 %2, %x14.0 ; :3 [#uses=2] + add i16 %3, %x13.0 ; :4 [#uses=2] + add i16 %4, %x12.0 ; :5 [#uses=2] + add i16 %5, %x11.0 ; :6 [#uses=2] + add i16 %6, %x10.0 ; :7 [#uses=2] + add i16 %7, %x9.0 ; :8 [#uses=2] + add i16 %8, %x8.0 ; :9 [#uses=2] + add i16 %9, %x7.0 ; :10 [#uses=2] + add i16 %10, %x6.0 ; :11 [#uses=2] + add i16 %11, %x5.0 ; :12 [#uses=2] + add i16 %12, %x4.0 ; :13 [#uses=2] + add i16 %13, %x3.0 ; :14 [#uses=2] + add i16 %14, %x2.0 ; :15 [#uses=2] + add i16 %15, %x1.0 ; :16 [#uses=1] + add i32 %i.0, 1 ; :17 [#uses=1] + br label %bb1 + +bb1: ; preds = %bb, %entry + %x2.0 = phi i16 [ 0, %entry ], [ %15, %bb ] ; [#uses=1] + %x3.0 = phi i16 [ 0, %entry ], [ %14, %bb ] ; [#uses=1] + %x4.0 = phi i16 [ 0, %entry ], [ %13, %bb ] ; [#uses=1] + %x5.0 = phi i16 [ 0, %entry ], [ %12, %bb ] ; [#uses=1] + %x6.0 = phi i16 [ 0, %entry ], [ %11, %bb ] ; [#uses=1] + %x7.0 = phi i16 [ 0, %entry ], [ %10, %bb ] ; [#uses=1] + %x8.0 = phi i16 [ 0, %entry ], [ %9, %bb ] ; [#uses=1] + %x9.0 = phi i16 [ 0, %entry ], [ %8, %bb ] ; [#uses=1] + %x10.0 = phi i16 [ 0, %entry ], [ %7, %bb ] ; [#uses=1] + %x11.0 = phi i16 [ 0, %entry ], [ %6, %bb ] ; [#uses=1] + %x12.0 = phi i16 [ 0, %entry ], [ %5, %bb ] ; [#uses=1] + %x13.0 = phi i16 [ 0, %entry ], [ %4, %bb ] ; [#uses=1] + %x14.0 = phi i16 [ 0, %entry ], [ %3, %bb ] ; [#uses=1] + %x15.0 = phi i16 [ 0, %entry ], [ %2, %bb ] ; [#uses=1] + %x16.0 = phi i16 [ 0, %entry ], [ %1, %bb ] ; [#uses=1] + %x17.0 = phi i16 [ 0, %entry ], [ %0, %bb ] ; [#uses=1] + %i.0 = phi i32 [ 0, %entry ], [ %17, %bb ] ; [#uses=2] + %x1.0 = phi i16 [ 0, %entry ], [ %16, %bb ] ; [#uses=2] + icmp ult i32 %i.0, 8888 ; :18 [#uses=1] + br i1 %18, label %bb, label %bb2 + +bb2: ; preds = %bb1 + zext i16 %x1.0 to i32 ; :19 [#uses=1] + ret i32 %19 +} + From resistor at mac.com Mon Aug 4 18:54:44 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 04 Aug 2008 23:54:44 -0000 Subject: [llvm-commits] [llvm] r54333 - in /llvm/trunk: include/llvm/CodeGen/LiveVariables.h include/llvm/CodeGen/Passes.h include/llvm/Target/TargetOptions.h lib/CodeGen/LiveVariables.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/CodeGen/UnreachableBlockElim.cpp lib/Target/TargetMachine.cpp Message-ID: <200808042354.m74NsiQ7000604@zion.cs.uiuc.edu> Author: resistor Date: Mon Aug 4 18:54:43 2008 New Revision: 54333 URL: http://llvm.org/viewvc/llvm-project?rev=54333&view=rev Log: - Fix SelectionDAG to generate correct CFGs. - Add a basic machine-level dead block eliminator. These two have to go together, since many other parts of the code generator are unable to handle the unreachable blocks otherwise created. Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h llvm/trunk/include/llvm/CodeGen/Passes.h llvm/trunk/include/llvm/Target/TargetOptions.h llvm/trunk/lib/CodeGen/LiveVariables.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp llvm/trunk/lib/Target/TargetMachine.cpp Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveVariables.h?rev=54333&r1=54332&r2=54333&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Mon Aug 4 18:54:43 2008 @@ -247,10 +247,8 @@ assert(Removed && "Register is not defined by this instruction!"); return true; } - - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); - } + + void getAnalysisUsage(AnalysisUsage &AU) const; virtual void releaseMemory() { VirtRegInfo.clear(); Modified: llvm/trunk/include/llvm/CodeGen/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=54333&r1=54332&r2=54333&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) +++ llvm/trunk/include/llvm/CodeGen/Passes.h Mon Aug 4 18:54:43 2008 @@ -71,6 +71,10 @@ /// register allocators. extern const PassInfo *const TwoAddressInstructionPassID; + /// UnreachableMachineBlockElimination pass - This pass removes unreachable + /// machine basic blocks. + extern const PassInfo *const UnreachableMachineBlockElimID; + /// Creates a register allocator as the user specified on the command line. /// FunctionPass *createRegisterAllocator(); Modified: llvm/trunk/include/llvm/Target/TargetOptions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=54333&r1=54332&r2=54333&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetOptions.h (original) +++ llvm/trunk/include/llvm/Target/TargetOptions.h Mon Aug 4 18:54:43 2008 @@ -101,6 +101,11 @@ /// DisableJumpTables - This flag indicates jump tables should not be /// generated. extern bool DisableJumpTables; + + /// DisableCorrectBranchFolding - This flag indicates whether the instruction + /// selector should take care to update the CFG properly when + /// folding branches. + extern bool DisableCorrectBranchFolding; } // End llvm namespace #endif Modified: llvm/trunk/lib/CodeGen/LiveVariables.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveVariables.cpp?rev=54333&r1=54332&r2=54333&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveVariables.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveVariables.cpp Mon Aug 4 18:54:43 2008 @@ -29,6 +29,7 @@ #include "llvm/CodeGen/LiveVariables.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/Passes.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" @@ -43,6 +44,12 @@ char LiveVariables::ID = 0; static RegisterPass X("livevars", "Live Variable Analysis"); + +void LiveVariables::getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequiredID(UnreachableMachineBlockElimID); + AU.setPreservesAll(); +} + void LiveVariables::VarInfo::dump() const { cerr << " Alive in blocks: "; for (unsigned i = 0, e = AliveBlocks.size(); i != e; ++i) Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=54333&r1=54332&r2=54333&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Aug 4 18:54:43 2008 @@ -1632,11 +1632,24 @@ } SDValue BrCond = DAG.getNode(ISD::BRCOND, MVT::Other, getControlRoot(), Cond, DAG.getBasicBlock(CB.TrueBB)); - if (CB.FalseBB == NextBlock) + + // If the branch was constant folded, fix up the CFG. + if (BrCond.getOpcode() == ISD::BR) { + if (!DisableCorrectBranchFolding) + CurMBB->removeSuccessor(CB.FalseBB); DAG.setRoot(BrCond); - else - DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, BrCond, - DAG.getBasicBlock(CB.FalseBB))); + } else { + // Otherwise, go ahead and insert the false branch. + if (BrCond == getControlRoot()) + if (!DisableCorrectBranchFolding) + CurMBB->removeSuccessor(CB.TrueBB); + + if (CB.FalseBB == NextBlock) + DAG.setRoot(BrCond); + else + DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, BrCond, + DAG.getBasicBlock(CB.FalseBB))); + } } /// visitJumpTable - Emit JumpTable node in the current MBB Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp?rev=54333&r1=54332&r2=54333&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp (original) +++ llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Mon Aug 4 18:54:43 2008 @@ -26,8 +26,10 @@ #include "llvm/Function.h" #include "llvm/Pass.h" #include "llvm/Type.h" +#include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/Support/CFG.h" #include "llvm/Support/Compiler.h" +#include "llvm/Target/TargetInstrInfo.h" #include "llvm/ADT/DepthFirstIterator.h" using namespace llvm; @@ -71,11 +73,93 @@ BB->dropAllReferences(); } - if (DeadBlocks.empty()) return false; + // Actually remove the blocks now. + for (unsigned i = 0, e = DeadBlocks.size(); i != e; ++i) + DeadBlocks[i]->eraseFromParent(); + + return DeadBlocks.size(); +} + + +namespace { + class VISIBILITY_HIDDEN UnreachableMachineBlockElim : + public MachineFunctionPass { + virtual bool runOnMachineFunction(MachineFunction &F); + bool iterateOnFunction(MachineFunction& F); + + public: + static char ID; // Pass identification, replacement for typeid + UnreachableMachineBlockElim() : MachineFunctionPass((intptr_t)&ID) {} + }; +} +char UnreachableMachineBlockElim::ID = 0; + +static RegisterPass +Y("unreachable-mbb-elimination", + "Remove unreachable machine basic blocks"); + +const PassInfo *const llvm::UnreachableMachineBlockElimID = &Y; + +bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) { + bool changed = true; + bool result = false; + + while (changed) { + changed = iterateOnFunction(F); + result |= changed; + } + + if (result) + F.RenumberBlocks(); + + return result; +} + +bool UnreachableMachineBlockElim::iterateOnFunction(MachineFunction &F) { + std::set Reachable; + + // Mark all reachable blocks. + for (df_ext_iterator I = df_ext_begin(&F, Reachable), + E = df_ext_end(&F, Reachable); I != E; ++I) + /* Mark all reachable blocks */; + + // Loop over all dead blocks, remembering them and deleting all instructions + // in them. + std::vector DeadBlocks; + for (MachineFunction::iterator I = F.begin(), E = F.end(); I != E; ++I) + if (!Reachable.count(I)) { + MachineBasicBlock *BB = I; + DeadBlocks.push_back(BB); + + while (BB->succ_begin() != BB->succ_end()) { + MachineBasicBlock* succ = *BB->succ_begin(); + + MachineBasicBlock::iterator start = succ->begin(); + while (start != succ->end() && + start->getOpcode() == TargetInstrInfo::PHI) { + for (unsigned i = start->getNumOperands() - 1; i >= 2; i-=2) + if (start->getOperand(i).isMBB() && + start->getOperand(i).getMBB() == BB) { + start->RemoveOperand(i); + start->RemoveOperand(i-1); + } + + if (start->getNumOperands() == 1) { + MachineInstr* phi = start; + start++; + phi->eraseFromParent(); + } else + start++; + } + + BB->removeSuccessor(BB->succ_begin()); + } + } // Actually remove the blocks now. for (unsigned i = 0, e = DeadBlocks.size(); i != e; ++i) - F.getBasicBlockList().erase(DeadBlocks[i]); + DeadBlocks[i]->eraseFromParent(); - return true; + return DeadBlocks.size(); } + Modified: llvm/trunk/lib/Target/TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=54333&r1=54332&r2=54333&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/TargetMachine.cpp Mon Aug 4 18:54:43 2008 @@ -40,6 +40,7 @@ bool RealignStack; bool VerboseAsm; bool DisableJumpTables; + bool DisableCorrectBranchFolding; } static cl::opt PrintCode("print-machineinstrs", @@ -163,6 +164,11 @@ cl::location(DisableJumpTables), cl::init(false)); +static cl::opt +DisableCorrectISelFolding(cl::Hidden, "disable-correct-folding", +cl::desc("Do not perform correct branch folding in the instruction selector."), +cl::location(DisableCorrectBranchFolding), cl::init(false)); + //--------------------------------------------------------------------------- // TargetMachine Class // From resistor at mac.com Mon Aug 4 18:55:30 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 04 Aug 2008 23:55:30 -0000 Subject: [llvm-commits] [llvm] r54334 - in /llvm/trunk/test/CodeGen: ARM/2007-08-15-ReuseBug.ll ARM/remat.ll X86/2007-07-25-EpilogueBug.ll X86/2007-11-14-Coalescer-Bug.ll X86/2007-11-30-LoadFolding-Bug.ll X86/2007-11-30-TestLoadFolding.ll X86/2008-04-17-CoalescerBug.ll X86/2008-05-06-SpillerBug.ll X86/2008-05-21-CoalescerBug.ll X86/2008-06-13-SpillerCommuting.ll X86/ins_subreg_coalesce-3.ll Message-ID: <200808042355.m74NtUQ8000644@zion.cs.uiuc.edu> Author: resistor Date: Mon Aug 4 18:55:29 2008 New Revision: 54334 URL: http://llvm.org/viewvc/llvm-project?rev=54334&view=rev Log: Update these tests to work by disabling the new correct CFG generation. This flag should ONLY be used to for tests like these. Modified: llvm/trunk/test/CodeGen/ARM/2007-08-15-ReuseBug.ll llvm/trunk/test/CodeGen/ARM/remat.ll llvm/trunk/test/CodeGen/X86/2007-07-25-EpilogueBug.ll llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll llvm/trunk/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll llvm/trunk/test/CodeGen/X86/2008-05-06-SpillerBug.ll llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll llvm/trunk/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-3.ll Modified: llvm/trunk/test/CodeGen/ARM/2007-08-15-ReuseBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2007-08-15-ReuseBug.ll?rev=54334&r1=54333&r2=54334&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2007-08-15-ReuseBug.ll (original) +++ llvm/trunk/test/CodeGen/ARM/2007-08-15-ReuseBug.ll Mon Aug 4 18:55:29 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic -mattr=+v6 | %prcontext {ldr.*\\!} 1 | grep mov +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic -mattr=+v6 -disable-correct-folding | %prcontext {ldr.*\\!} 1 | grep mov ; PR1609 %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } Modified: llvm/trunk/test/CodeGen/ARM/remat.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/remat.ll?rev=54334&r1=54333&r2=54334&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/remat.ll (original) +++ llvm/trunk/test/CodeGen/ARM/remat.ll Mon Aug 4 18:55:29 2008 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -stats -info-output-file - | grep "Number of re-materialization" | grep 3 +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -disable-correct-folding -stats -info-output-file - | grep "Number of re-materialization" | grep 3 %struct.CONTENTBOX = type { i32, i32, i32, i32, i32 } %struct.LOCBOX = type { i32, i32, i32, i32 } Modified: llvm/trunk/test/CodeGen/X86/2007-07-25-EpilogueBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-07-25-EpilogueBug.ll?rev=54334&r1=54333&r2=54334&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-07-25-EpilogueBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-07-25-EpilogueBug.ll Mon Aug 4 18:55:29 2008 @@ -1,6 +1,6 @@ ; Verify that the addl comes before any popl. -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -mcpu=i386 | \ +; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -disable-correct-folding -mcpu=i386 | \ ; RUN: %prcontext ret 1 | grep popl ; PR1573 Modified: llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll?rev=54334&r1=54333&r2=54334&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll Mon Aug 4 18:55:29 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep movl | count 2 +; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep movl | count 1 %struct.double_int = type { i64, i64 } %struct.tree_common = type <{ i8, [3 x i8] }> Modified: llvm/trunk/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll?rev=54334&r1=54333&r2=54334&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll Mon Aug 4 18:55:29 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats |& \ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -disable-correct-folding -stats |& \ ; RUN: grep {1 .*folded into instructions} declare fastcc void @rdft(i32, i32, double*, i32*, double*) Modified: llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll?rev=54334&r1=54333&r2=54334&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll Mon Aug 4 18:55:29 2008 @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | llc -march=x86 -stats |& \ +; RUN: llvm-as < %s | llc -march=x86 -disable-correct-folding -stats |& \ ; RUN: grep {1 .*folded into instructions} -; RUN: llvm-as < %s | llc -march=x86 | grep cmp | count 3 +; RUN: llvm-as < %s | llc -march=x86 -disable-correct-folding | grep cmp | count 3 %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* } Modified: llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll?rev=54334&r1=54333&r2=54334&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll Mon Aug 4 18:55:29 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep xorl | grep {%e} +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -disable-correct-folding | grep xorl | grep {%e} ; Make sure xorl operands are 32-bit registers. %struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8* } Modified: llvm/trunk/test/CodeGen/X86/2008-05-06-SpillerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-05-06-SpillerBug.ll?rev=54334&r1=54333&r2=54334&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-05-06-SpillerBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-05-06-SpillerBug.ll Mon Aug 4 18:55:29 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic -disable-fp-elim | grep addb | grep ebp +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic -disable-fp-elim -disable-correct-folding | grep addb | grep ebp %struct.rc4_state = type { i32, i32, [256 x i32] } @.str1 = internal constant [65 x i8] c"m[%d] = 0x%02x, m[%d] = 0x%02x, 0x%02x, k = %d, key[k] = 0x%02x\0A\00" ; <[65 x i8]*> [#uses=1] Modified: llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll?rev=54334&r1=54333&r2=54334&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll Mon Aug 4 18:55:29 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -fast | grep mov | count 4 +; RUN: llvm-as < %s | llc -march=x86 -fast -disable-correct-folding | grep mov | count 4 ; PR2343 %llvm.dbg.anchor.type = type { i32, i32 } Modified: llvm/trunk/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll?rev=54334&r1=54333&r2=54334&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll Mon Aug 4 18:55:29 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic -stats |& grep {spiller - Number of instructions commuted} +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic -disable-correct-folding -stats |& grep {spiller - Number of instructions commuted} %struct.CABAC_context_element = type { i8, i8 } %struct.MB_Info_CABAC = type { i8, i8, [2 x i8], i8, i8, i8, i16, i16, [4 x i8], [8 x %struct.MotionVector] } Modified: llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-3.ll?rev=54334&r1=54333&r2=54334&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-3.ll (original) +++ llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-3.ll Mon Aug 4 18:55:29 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86-64 | grep mov | count 9 +; RUN: llvm-as < %s | llc -march=x86-64 -disable-correct-folding | grep mov | count 9 %struct.COMPOSITE = type { i8, i16, i16 } %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } From gohman at apple.com Mon Aug 4 19:18:11 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 4 Aug 2008 17:18:11 -0700 Subject: [llvm-commits] [llvm] r54333 - in /llvm/trunk: include/llvm/CodeGen/LiveVariables.h include/llvm/CodeGen/Passes.h include/llvm/Target/TargetOptions.h lib/CodeGen/LiveVariables.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/CodeGen/UnreachableBlockElim.cpp lib/Target/TargetMachine.cpp In-Reply-To: <200808042354.m74NsiQ7000604@zion.cs.uiuc.edu> References: <200808042354.m74NsiQ7000604@zion.cs.uiuc.edu> Message-ID: <8667DA03-EAAC-47AD-9606-B9F9F5FEB97A@apple.com> On Aug 4, 2008, at 4:54 PM, Owen Anderson wrote: > --- llvm/trunk/include/llvm/Target/TargetOptions.h (original) > +++ llvm/trunk/include/llvm/Target/TargetOptions.h Mon Aug 4 > 18:54:43 2008 > @@ -101,6 +101,11 @@ > /// DisableJumpTables - This flag indicates jump tables should not > be > /// generated. > extern bool DisableJumpTables; > + > + /// DisableCorrectBranchFolding - This flag indicates whether the > instruction > + /// selector should take care to update the CFG properly when > + /// folding branches. > + extern bool DisableCorrectBranchFolding; Does this need to be in TargetOptions.h, or can it be a private option in SelectionDAGISel.cpp? > > +char UnreachableMachineBlockElim::ID = 0; > + > +static RegisterPass > +Y("unreachable-mbb-elimination", > + "Remove unreachable machine basic blocks"); > + > +const PassInfo *const llvm::UnreachableMachineBlockElimID = &Y; > + > +bool > UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction > &F) { > + bool changed = true; > + bool result = false; > + > + while (changed) { > + changed = iterateOnFunction(F); > + result |= changed; > + } Is iteration necessary here? It looks like the code should get everything done in one iteration. > > > // Actually remove the blocks now. > for (unsigned i = 0, e = DeadBlocks.size(); i != e; ++i) > - F.getBasicBlockList().erase(DeadBlocks[i]); > + DeadBlocks[i]->eraseFromParent(); > > - return true; > + return DeadBlocks.size(); How about return !DeadBlocks.empty(); ? Dan From resistor at mac.com Mon Aug 4 19:27:29 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 05 Aug 2008 00:27:29 -0000 Subject: [llvm-commits] [llvm] r54336 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/TargetMachine.cpp Message-ID: <200808050027.m750RU1X001864@zion.cs.uiuc.edu> Author: resistor Date: Mon Aug 4 19:27:28 2008 New Revision: 54336 URL: http://llvm.org/viewvc/llvm-project?rev=54336&view=rev Log: This option doesn't need to be a target option. It can be in SDISel instead. Modified: llvm/trunk/include/llvm/Target/TargetOptions.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/TargetMachine.cpp Modified: llvm/trunk/include/llvm/Target/TargetOptions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=54336&r1=54335&r2=54336&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetOptions.h (original) +++ llvm/trunk/include/llvm/Target/TargetOptions.h Mon Aug 4 19:27:28 2008 @@ -101,11 +101,6 @@ /// DisableJumpTables - This flag indicates jump tables should not be /// generated. extern bool DisableJumpTables; - - /// DisableCorrectBranchFolding - This flag indicates whether the instruction - /// selector should take care to update the CFG properly when - /// folding branches. - extern bool DisableCorrectBranchFolding; } // End llvm namespace #endif Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=54336&r1=54335&r2=54336&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Aug 4 19:27:28 2008 @@ -53,6 +53,9 @@ EnableValueProp("enable-value-prop", cl::Hidden); static cl::opt EnableLegalizeTypes("enable-legalize-types", cl::Hidden); +static cl::opt +DisableCorrectBranchFolding("disable-correct-folding", cl::init(false), + cl::Hidden); #ifndef NDEBUG Modified: llvm/trunk/lib/Target/TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=54336&r1=54335&r2=54336&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/TargetMachine.cpp Mon Aug 4 19:27:28 2008 @@ -40,7 +40,6 @@ bool RealignStack; bool VerboseAsm; bool DisableJumpTables; - bool DisableCorrectBranchFolding; } static cl::opt PrintCode("print-machineinstrs", @@ -164,11 +163,6 @@ cl::location(DisableJumpTables), cl::init(false)); -static cl::opt -DisableCorrectISelFolding(cl::Hidden, "disable-correct-folding", -cl::desc("Do not perform correct branch folding in the instruction selector."), -cl::location(DisableCorrectBranchFolding), cl::init(false)); - //--------------------------------------------------------------------------- // TargetMachine Class // From resistor at mac.com Mon Aug 4 19:30:10 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 05 Aug 2008 00:30:10 -0000 Subject: [llvm-commits] [llvm] r54337 - /llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Message-ID: <200808050030.m750UAu8001945@zion.cs.uiuc.edu> Author: resistor Date: Mon Aug 4 19:30:10 2008 New Revision: 54337 URL: http://llvm.org/viewvc/llvm-project?rev=54337&view=rev Log: Remove unneeded iteration. Thanks to Dan for the feedback. Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp?rev=54337&r1=54336&r2=54337&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp (original) +++ llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Mon Aug 4 19:30:10 2008 @@ -85,7 +85,6 @@ class VISIBILITY_HIDDEN UnreachableMachineBlockElim : public MachineFunctionPass { virtual bool runOnMachineFunction(MachineFunction &F); - bool iterateOnFunction(MachineFunction& F); public: static char ID; // Pass identification, replacement for typeid @@ -101,21 +100,6 @@ const PassInfo *const llvm::UnreachableMachineBlockElimID = &Y; bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) { - bool changed = true; - bool result = false; - - while (changed) { - changed = iterateOnFunction(F); - result |= changed; - } - - if (result) - F.RenumberBlocks(); - - return result; -} - -bool UnreachableMachineBlockElim::iterateOnFunction(MachineFunction &F) { std::set Reachable; // Mark all reachable blocks. @@ -160,6 +144,8 @@ for (unsigned i = 0, e = DeadBlocks.size(); i != e; ++i) DeadBlocks[i]->eraseFromParent(); + F.RenumberBlocks(); + return DeadBlocks.size(); } From sabre at nondot.org Mon Aug 4 19:52:09 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 4 Aug 2008 19:52:09 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/index.html Message-ID: <200808050052.m750q9vR002667@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: index.html updated: 1.19 -> 1.20 --- Log message: add ted's abstract --- Diffs of the changes: (+9 -2) index.html | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.19 llvm-www/devmtg/2008-08/index.html:1.20 --- llvm-www/devmtg/2008-08/index.html:1.19 Mon Aug 4 16:40:32 2008 +++ llvm-www/devmtg/2008-08/index.html Mon Aug 4 19:50:42 2008 @@ -111,7 +111,14 @@ [Video] Ted Kremenek
Apple, Inc. - Finding Bugs with the Clang Static Analyzer - . + Finding Bugs with the Clang Static Analyzer - The Clang Static + Analyzer is a standalone tool that find bugs in C and Objective-C + programs. The analyzer is 100% open source and part of the Clang + project (a new C/Objective-C/C++ frontend for LLVM). Although still + very early in its development, the tool has been effective at finding + thousands of bugs in real-world C and Objective-C programs. This talk + presents a high-level overview of the goals, implementation, and + current status of the tool. @@ -336,7 +343,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2008/08/04 21:40:32 $ +
Last modified: $Date: 2008/08/05 00:50:42 $ From evan.cheng at apple.com Mon Aug 4 20:25:25 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 4 Aug 2008 18:25:25 -0700 Subject: [llvm-commits] [llvm] r54337 - /llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp In-Reply-To: <200808050030.m750UAu8001945@zion.cs.uiuc.edu> References: <200808050030.m750UAu8001945@zion.cs.uiuc.edu> Message-ID: Can you take a look at BranchFolding and see if it's possible to fold this pass into BranchFolding? (I think it is.) Perhaps we can run it twice, the first time just clean up the function without doing any tail duplication? Evan On Aug 4, 2008, at 5:30 PM, Owen Anderson wrote: > Author: resistor > Date: Mon Aug 4 19:30:10 2008 > New Revision: 54337 > > URL: http://llvm.org/viewvc/llvm-project?rev=54337&view=rev > Log: > Remove unneeded iteration. Thanks to Dan for the feedback. > > Modified: > llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp > > Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp?rev=54337&r1=54336&r2=54337&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp (original) > +++ llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Mon Aug 4 > 19:30:10 2008 > @@ -85,7 +85,6 @@ > class VISIBILITY_HIDDEN UnreachableMachineBlockElim : > public MachineFunctionPass { > virtual bool runOnMachineFunction(MachineFunction &F); > - bool iterateOnFunction(MachineFunction& F); > > public: > static char ID; // Pass identification, replacement for typeid > @@ -101,21 +100,6 @@ > const PassInfo *const llvm::UnreachableMachineBlockElimID = &Y; > > bool > UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction > &F) { > - bool changed = true; > - bool result = false; > - > - while (changed) { > - changed = iterateOnFunction(F); > - result |= changed; > - } > - > - if (result) > - F.RenumberBlocks(); > - > - return result; > -} > - > -bool UnreachableMachineBlockElim::iterateOnFunction(MachineFunction > &F) { > std::set Reachable; > > // Mark all reachable blocks. > @@ -160,6 +144,8 @@ > for (unsigned i = 0, e = DeadBlocks.size(); i != e; ++i) > DeadBlocks[i]->eraseFromParent(); > > + F.RenumberBlocks(); > + > return DeadBlocks.size(); > } > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Mon Aug 4 20:25:46 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 4 Aug 2008 18:25:46 -0700 Subject: [llvm-commits] [llvm] r54334 - in /llvm/trunk/test/CodeGen: ARM/2007-08-15-ReuseBug.ll ARM/remat.ll X86/2007-07-25-EpilogueBug.ll X86/2007-11-14-Coalescer-Bug.ll X86/2007-11-30-LoadFolding-Bug.ll X86/2007-11-30-TestLoadFolding.ll X86/2008-04-17-CoalescerBug.ll X86/2008-05-06-SpillerBug.ll X86/2008-05-21-CoalescerBug.ll X86/2008-06-13-SpillerCommuting.ll X86/ins_subreg_coalesce-3.ll In-Reply-To: <200808042355.m74NtUQ8000644@zion.cs.uiuc.edu> References: <200808042355.m74NtUQ8000644@zion.cs.uiuc.edu> Message-ID: On Aug 4, 2008, at 4:55 PM, Owen Anderson wrote: > Author: resistor > Date: Mon Aug 4 18:55:29 2008 > New Revision: 54334 > > URL: http://llvm.org/viewvc/llvm-project?rev=54334&view=rev > Log: > Update these tests to work by disabling the new correct CFG > generation. This flag should ONLY be used to for tests like these. Why not modify the tests so that they don't have dead blocks? -Chris From sabre at nondot.org Mon Aug 4 22:59:24 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 4 Aug 2008 22:59:24 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/index.html Message-ID: <200808050359.m753xOrQ008606@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: index.html updated: 1.20 -> 1.21 --- Log message: add anton and hirez ted --- Diffs of the changes: (+8 -6) index.html | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.20 llvm-www/devmtg/2008-08/index.html:1.21 --- llvm-www/devmtg/2008-08/index.html:1.20 Mon Aug 4 19:50:42 2008 +++ llvm-www/devmtg/2008-08/index.html Mon Aug 4 22:58:18 2008 @@ -105,11 +105,9 @@ [Slides] - [Video Hi] + [Video Hi] [Video Lo] - [Video] - Ted Kremenek
Apple, Inc. Finding Bugs with the Clang Static Analyzer - The Clang Static Analyzer is a standalone tool that find bugs in C and Objective-C @@ -136,8 +134,12 @@ - [Slides] - [Video] + + + [Slides] + [Video Hi] + [Video Lo] + Anton Korobeynikov
Saint Petersburg State University llvmc2 Compiler Driver - 'llvmc2' is the LLVM Compiler Driver, which is useful to people building new languages and tools from the LLVM @@ -343,7 +345,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2008/08/05 00:50:42 $ +
Last modified: $Date: 2008/08/05 03:58:18 $ From evan.cheng at apple.com Tue Aug 5 00:26:41 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 04 Aug 2008 22:26:41 -0700 Subject: [llvm-commits] [llvm] r54334 - in /llvm/trunk/test/CodeGen: ARM/2007-08-15-ReuseBug.ll ARM/remat.ll X86/2007-07-25-EpilogueBug.ll X86/2007-11-14-Coalescer-Bug.ll X86/2007-11-30-LoadFolding-Bug.ll X86/2007-11-30-TestLoadFolding.ll X86/2008-04-17-CoalescerBug.ll X86/2008-05-06-SpillerBug.ll X86/2008-05-21-CoalescerBug.ll X86/2008-06-13-SpillerCommuting.ll X86/ins_subreg_coalesce-3.ll In-Reply-To: References: <200808042355.m74NtUQ8000644@zion.cs.uiuc.edu> Message-ID: <33F024A1-126D-4B5A-ADAC-02126683C5C8@apple.com> My understanding is Owen made an effort to fix the tests but he wasn't successful in most cases. I suggested an option instead. Evan On Aug 4, 2008, at 6:25 PM, Chris Lattner wrote: > > On Aug 4, 2008, at 4:55 PM, Owen Anderson wrote: > >> Author: resistor >> Date: Mon Aug 4 18:55:29 2008 >> New Revision: 54334 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=54334&view=rev >> Log: >> Update these tests to work by disabling the new correct CFG >> generation. This flag should ONLY be used to for tests like these. > > Why not modify the tests so that they don't have dead blocks? > > -Chris > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Tue Aug 5 00:47:59 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 4 Aug 2008 22:47:59 -0700 Subject: [llvm-commits] [llvm] r54334 - in /llvm/trunk/test/CodeGen: ARM/2007-08-15-ReuseBug.ll ARM/remat.ll X86/2007-07-25-EpilogueBug.ll X86/2007-11-14-Coalescer-Bug.ll X86/2007-11-30-LoadFolding-Bug.ll X86/2007-11-30-TestLoadFolding.ll X86/2008-04-17-CoalescerBug.ll X86/2008-05-06-SpillerBug.ll X86/2008-05-21-CoalescerBug.ll X86/2008-06-13-SpillerCommuting.ll X86/ins_subreg_coalesce-3.ll In-Reply-To: <33F024A1-126D-4B5A-ADAC-02126683C5C8@apple.com> References: <200808042355.m74NtUQ8000644@zion.cs.uiuc.edu> <33F024A1-126D-4B5A-ADAC-02126683C5C8@apple.com> Message-ID: On Aug 4, 2008, at 10:26 PM, Evan Cheng wrote: > My understanding is Owen made an effort to fix the tests but he wasn't > successful in most cases. I suggested an option instead. I'd strongly prefer to avoid options that are only useful for testcases. The testcases should be fixed, this just indicates that they were "overreduced" when created. -Chris > > > Evan > > On Aug 4, 2008, at 6:25 PM, Chris Lattner wrote: > >> >> On Aug 4, 2008, at 4:55 PM, Owen Anderson wrote: >> >>> Author: resistor >>> Date: Mon Aug 4 18:55:29 2008 >>> New Revision: 54334 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=54334&view=rev >>> Log: >>> Update these tests to work by disabling the new correct CFG >>> generation. This flag should ONLY be used to for tests like these. >> >> Why not modify the tests so that they don't have dead blocks? >> >> -Chris >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Tue Aug 5 01:41:56 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 4 Aug 2008 23:41:56 -0700 Subject: [llvm-commits] [llvm] r54248 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/PowerPC/PPCTargetMachine.cpp lib/Target/TargetMachine.cpp In-Reply-To: <200807311813.m6VIDDrq000839@zion.cs.uiuc.edu> References: <200807311813.m6VIDDrq000839@zion.cs.uiuc.edu> Message-ID: <0A042EDE-0156-4F24-92C9-6B2DDD4787AD@apple.com> On Jul 31, 2008, at 11:13 AM, Dale Johannesen wrote: > Author: johannes > Date: Thu Jul 31 13:13:12 2008 > New Revision: 54248 > > URL: http://llvm.org/viewvc/llvm-project?rev=54248&view=rev > Log: > Add a flag to disable jump table generation (all > switches use the binary search algorithm) for > environments that don't support it. PPC64 JIT > is such an environment; turn the flag on for that. Thanks Dale, one tweak: > +++ llvm/trunk/include/llvm/Target/TargetOptions.h Thu Jul 31 > 13:13:12 2008 > @@ -97,6 +97,10 @@ > /// VerboseAsm - When this flag is set, the asm printer prints > additional > /// comments to asm directives. > extern bool VerboseAsm; > + > + /// DisableJumpTables - This flag indicates jump tables should > not be > + /// generated. > + extern bool DisableJumpTables; TargetOptions is for things that clients of the code generator set when they want to affect the behavior of codegen. In this case, jump tables are never valid in ppc64 JIT mode. Why not just have the PPC backend mark BR_JT and BRIND as illegal when in 64- bit jit mode? That way no target-indep code changes. -Chris > +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jul > 31 13:13:12 2008 > @@ -1916,8 +1916,9 @@ > } > > static inline bool areJTsAllowed(const TargetLowering &TLI) { > - return (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) || > - TLI.isOperationLegal(ISD::BRIND, MVT::Other)); > + return !DisableJumpTables && > + (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) || > + TLI.isOperationLegal(ISD::BRIND, MVT::Other)); > } > > /// handleJTSwitchCase - Emit jumptable for current switch case range > > Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=54248&r1=54247&r2=54248&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Thu Jul 31 > 13:13:12 2008 > @@ -43,7 +43,7 @@ > : TargetLowering(TM), PPCSubTarget(*TM.getSubtargetImpl()) { > > setPow2DivIsCheap(); > - > + > // Use _setjmp/_longjmp instead of setjmp/longjmp. > setUseUnderscoreSetJmp(true); > setUseUnderscoreLongJmp(true); > > Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=54248&r1=54247&r2=54248&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original) > +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Thu Jul 31 > 13:13:12 2008 > @@ -17,6 +17,7 @@ > #include "llvm/Module.h" > #include "llvm/PassManager.h" > #include "llvm/Target/TargetMachineRegistry.h" > +#include "llvm/Target/TargetOptions.h" > using namespace llvm; > > // Register the targets > @@ -144,6 +145,9 @@ > // instructions to materialize arbitrary global variable + > function + > // constant pool addresses. > setRelocationModel(Reloc::PIC_); > + // Temporary workaround for the inability of PPC64 JIT to > handle jump > + // tables. > + DisableJumpTables = true; > } else { > setRelocationModel(Reloc::Static); > } > > Modified: llvm/trunk/lib/Target/TargetMachine.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=54248&r1=54247&r2=54248&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/TargetMachine.cpp (original) > +++ llvm/trunk/lib/Target/TargetMachine.cpp Thu Jul 31 13:13:12 2008 > @@ -39,6 +39,7 @@ > unsigned StackAlignment; > bool RealignStack; > bool VerboseAsm; > + bool DisableJumpTables; > } > > static cl::opt PrintCode("print-machineinstrs", > @@ -156,6 +157,11 @@ > cl::location(VerboseAsm), > cl::init(false)); > > +static cl::opt > +DisableSwitchTables(cl::Hidden, "disable-jump-tables", > + cl::desc("Do not generate jump tables."), > + cl::location(DisableJumpTables), > + cl::init(false)); > > //--------------------------------------------------------------------------- > // TargetMachine Class > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Tue Aug 5 02:10:38 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 05 Aug 2008 07:10:38 -0000 Subject: [llvm-commits] [llvm] r54346 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/X86/2008-08-05-SpillerBug.ll Message-ID: <200808050710.m757AcfY014493@zion.cs.uiuc.edu> Author: evancheng Date: Tue Aug 5 02:10:38 2008 New Revision: 54346 URL: http://llvm.org/viewvc/llvm-project?rev=54346&view=rev Log: Fix PR2568: Fix bug that cause redudant kill marker after its live interval has been extended due to coalescing. Added: llvm/trunk/test/CodeGen/X86/2008-08-05-SpillerBug.ll Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=54346&r1=54345&r2=54346&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Aug 5 02:10:38 2008 @@ -533,14 +533,16 @@ MachineOperand &UseMO = UI.getOperand(); if (UseMO.isKill()) { MachineInstr *UseMI = UseMO.getParent(); +#if 0 unsigned SReg, DReg; if (!tii_->isMoveInstr(*UseMI, SReg, DReg)) continue; +#endif unsigned UseIdx = li_->getUseIndex(li_->getInstructionIndex(UseMI)); if (JoinedCopies.count(UseMI)) continue; const LiveRange *UI = LI.getLiveRangeContaining(UseIdx); - if (!LI.isKill(UI->valno, UseIdx+1)) + if (!UI || !LI.isKill(UI->valno, UseIdx+1)) UseMO.setIsKill(false); } } Added: llvm/trunk/test/CodeGen/X86/2008-08-05-SpillerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-08-05-SpillerBug.ll?rev=54346&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-08-05-SpillerBug.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-08-05-SpillerBug.ll Tue Aug 5 02:10:38 2008 @@ -0,0 +1,44 @@ +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -disable-fp-elim -stats -info-output-file - | not grep {Number of dead stores elided} +; PR2568 + + at g_3 = external global i16 ; [#uses=1] + at g_5 = external global i32 ; [#uses=3] + +declare i32 @func_15(i16 signext , i16 signext , i32) nounwind + +define void @func_9_entry_2E_ce(i8 %p_11) nounwind { +newFuncRoot: + br label %entry.ce + +entry.ce.ret.exitStub: ; preds = %entry.ce + ret void + +entry.ce: ; preds = %newFuncRoot + load i16* @g_3, align 2 ; :0 [#uses=1] + icmp sgt i16 %0, 0 ; :1 [#uses=1] + zext i1 %1 to i32 ; :2 [#uses=1] + load i32* @g_5, align 4 ; :3 [#uses=4] + icmp ugt i32 %2, %3 ; :4 [#uses=1] + zext i1 %4 to i32 ; :5 [#uses=1] + icmp eq i32 %3, 0 ; :6 [#uses=1] + %.0 = select i1 %6, i32 1, i32 %3 ; [#uses=1] + urem i32 1, %.0 ; :7 [#uses=2] + sext i8 %p_11 to i16 ; :8 [#uses=1] + trunc i32 %3 to i16 ; :9 [#uses=1] + tail call i32 @func_15( i16 signext %8, i16 signext %9, i32 1 ) nounwind ; :10 [#uses=0] + load i32* @g_5, align 4 ; :11 [#uses=1] + trunc i32 %11 to i16 ; :12 [#uses=1] + tail call i32 @func_15( i16 signext %12, i16 signext 1, i32 %7 ) nounwind ; :13 [#uses=0] + sext i8 %p_11 to i32 ; :14 [#uses=1] + %p_11.lobit = lshr i8 %p_11, 7 ; [#uses=1] + %tmp = zext i8 %p_11.lobit to i32 ; [#uses=1] + %tmp.not = xor i32 %tmp, 1 ; [#uses=1] + %.015 = ashr i32 %14, %tmp.not ; [#uses=2] + icmp eq i32 %.015, 0 ; :15 [#uses=1] + %.016 = select i1 %15, i32 1, i32 %.015 ; [#uses=1] + udiv i32 %7, %.016 ; :16 [#uses=1] + icmp ult i32 %5, %16 ; :17 [#uses=1] + zext i1 %17 to i32 ; :18 [#uses=1] + store i32 %18, i32* @g_5, align 4 + br label %entry.ce.ret.exitStub +} From evan.cheng at apple.com Tue Aug 5 02:19:01 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 5 Aug 2008 00:19:01 -0700 Subject: [llvm-commits] [llvm] r54248 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/PowerPC/PPCTargetMachine.cpp lib/Target/TargetMachine.cpp In-Reply-To: <0A042EDE-0156-4F24-92C9-6B2DDD4787AD@apple.com> References: <200807311813.m6VIDDrq000839@zion.cs.uiuc.edu> <0A042EDE-0156-4F24-92C9-6B2DDD4787AD@apple.com> Message-ID: On Aug 4, 2008, at 11:41 PM, Chris Lattner wrote: > > On Jul 31, 2008, at 11:13 AM, Dale Johannesen wrote: > >> Author: johannes >> Date: Thu Jul 31 13:13:12 2008 >> New Revision: 54248 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=54248&view=rev >> Log: >> Add a flag to disable jump table generation (all >> switches use the binary search algorithm) for >> environments that don't support it. PPC64 JIT >> is such an environment; turn the flag on for that. > > Thanks Dale, one tweak: > >> +++ llvm/trunk/include/llvm/Target/TargetOptions.h Thu Jul 31 >> 13:13:12 2008 >> @@ -97,6 +97,10 @@ >> /// VerboseAsm - When this flag is set, the asm printer prints >> additional >> /// comments to asm directives. >> extern bool VerboseAsm; >> + >> + /// DisableJumpTables - This flag indicates jump tables should >> not be >> + /// generated. >> + extern bool DisableJumpTables; > > TargetOptions is for things that clients of the code generator set > when they want to affect the behavior of codegen. > > In this case, jump tables are never valid in ppc64 JIT mode. Why not > just have the PPC backend mark BR_JT and BRIND as illegal when in 64- > bit jit mode? That way no target-indep code changes. The issue is PPCTargetLowering doesn't know it's in JIT mode. PPCTargetMachine::addCodeEmitter would have to toggle something to let it know. It's not exactly clean either. This is a short term workaround. I suspect teaching PPCJITInfo about PIC jumptable is pretty trivial. Once that's done, this whole thing can be reverted. Evan > > > -Chris > > >> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jul >> 31 13:13:12 2008 >> @@ -1916,8 +1916,9 @@ >> } >> >> static inline bool areJTsAllowed(const TargetLowering &TLI) { >> - return (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) || >> - TLI.isOperationLegal(ISD::BRIND, MVT::Other)); >> + return !DisableJumpTables && >> + (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) || >> + TLI.isOperationLegal(ISD::BRIND, MVT::Other)); >> } >> >> /// handleJTSwitchCase - Emit jumptable for current switch case range >> >> Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=54248&r1=54247&r2=54248&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) >> +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Thu Jul 31 >> 13:13:12 2008 >> @@ -43,7 +43,7 @@ >> : TargetLowering(TM), PPCSubTarget(*TM.getSubtargetImpl()) { >> >> setPow2DivIsCheap(); >> - >> + >> // Use _setjmp/_longjmp instead of setjmp/longjmp. >> setUseUnderscoreSetJmp(true); >> setUseUnderscoreLongJmp(true); >> >> Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=54248&r1=54247&r2=54248&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original) >> +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Thu Jul 31 >> 13:13:12 2008 >> @@ -17,6 +17,7 @@ >> #include "llvm/Module.h" >> #include "llvm/PassManager.h" >> #include "llvm/Target/TargetMachineRegistry.h" >> +#include "llvm/Target/TargetOptions.h" >> using namespace llvm; >> >> // Register the targets >> @@ -144,6 +145,9 @@ >> // instructions to materialize arbitrary global variable + >> function + >> // constant pool addresses. >> setRelocationModel(Reloc::PIC_); >> + // Temporary workaround for the inability of PPC64 JIT to >> handle jump >> + // tables. >> + DisableJumpTables = true; >> } else { >> setRelocationModel(Reloc::Static); >> } >> >> Modified: llvm/trunk/lib/Target/TargetMachine.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=54248&r1=54247&r2=54248&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/TargetMachine.cpp (original) >> +++ llvm/trunk/lib/Target/TargetMachine.cpp Thu Jul 31 13:13:12 2008 >> @@ -39,6 +39,7 @@ >> unsigned StackAlignment; >> bool RealignStack; >> bool VerboseAsm; >> + bool DisableJumpTables; >> } >> >> static cl::opt PrintCode("print-machineinstrs", >> @@ -156,6 +157,11 @@ >> cl::location(VerboseAsm), >> cl::init(false)); >> >> +static cl::opt >> +DisableSwitchTables(cl::Hidden, "disable-jump-tables", >> + cl::desc("Do not generate jump tables."), >> + cl::location(DisableJumpTables), >> + cl::init(false)); >> >> //--------------------------------------------------------------------------- >> // TargetMachine Class >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Tue Aug 5 02:20:58 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 05 Aug 2008 07:20:58 -0000 Subject: [llvm-commits] [llvm] r54347 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <200808050720.m757KwYw014971@zion.cs.uiuc.edu> Author: evancheng Date: Tue Aug 5 02:20:57 2008 New Revision: 54347 URL: http://llvm.org/viewvc/llvm-project?rev=54347&view=rev Log: Remove #if 0. 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=54347&r1=54346&r2=54347&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Aug 5 02:20:57 2008 @@ -533,11 +533,6 @@ MachineOperand &UseMO = UI.getOperand(); if (UseMO.isKill()) { MachineInstr *UseMI = UseMO.getParent(); -#if 0 - unsigned SReg, DReg; - if (!tii_->isMoveInstr(*UseMI, SReg, DReg)) - continue; -#endif unsigned UseIdx = li_->getUseIndex(li_->getInstructionIndex(UseMI)); if (JoinedCopies.count(UseMI)) continue; From evan.cheng at apple.com Tue Aug 5 02:27:38 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 5 Aug 2008 00:27:38 -0700 Subject: [llvm-commits] [llvm] r54334 - in /llvm/trunk/test/CodeGen: ARM/2007-08-15-ReuseBug.ll ARM/remat.ll X86/2007-07-25-EpilogueBug.ll X86/2007-11-14-Coalescer-Bug.ll X86/2007-11-30-LoadFolding-Bug.ll X86/2007-11-30-TestLoadFolding.ll X86/2008-04-17-CoalescerBug.ll X86/2008-05-06-SpillerBug.ll X86/2008-05-21-CoalescerBug.ll X86/2008-06-13-SpillerCommuting.ll X86/ins_subreg_coalesce-3.ll In-Reply-To: References: <200808042355.m74NtUQ8000644@zion.cs.uiuc.edu> <33F024A1-126D-4B5A-ADAC-02126683C5C8@apple.com> Message-ID: <3BAE6DC5-F79A-4E79-9412-6C122152A641@apple.com> I believe there are 11 test cases that cannot be trivially fixed. I am not sure how easy it is to go back and re-reduce these tests? That can take a lot of time. The issue is sdisel was constant folding branch conditions but not updating CFG. That's why we end up reducing tests with dead blocks. It's up to Owen to investigate whether it's possible to update the branch conditions to eliminate dead blocks. And whether it is possible to re-generate some the other tests. It's likely some of the tests will require more effort to fix up / regen than it's worth. If you are totally against the option, we can simply remove those tests that are now invalid. Evan On Aug 4, 2008, at 10:47 PM, Chris Lattner wrote: > > On Aug 4, 2008, at 10:26 PM, Evan Cheng wrote: > >> My understanding is Owen made an effort to fix the tests but he >> wasn't >> successful in most cases. I suggested an option instead. > > I'd strongly prefer to avoid options that are only useful for > testcases. The testcases should be fixed, this just indicates that > they were "overreduced" when created. > > -Chris > >> >> >> Evan >> >> On Aug 4, 2008, at 6:25 PM, Chris Lattner wrote: >> >>> >>> On Aug 4, 2008, at 4:55 PM, Owen Anderson wrote: >>> >>>> Author: resistor >>>> Date: Mon Aug 4 18:55:29 2008 >>>> New Revision: 54334 >>>> >>>> URL: http://llvm.org/viewvc/llvm-project?rev=54334&view=rev >>>> Log: >>>> Update these tests to work by disabling the new correct CFG >>>> generation. This flag should ONLY be used to for tests like these. >>> >>> Why not modify the tests so that they don't have dead blocks? >>> >>> -Chris >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Tue Aug 5 09:42:30 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 05 Aug 2008 14:42:30 -0000 Subject: [llvm-commits] [llvm] r54348 - /llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Message-ID: <200808051442.m75EgUMw010818@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 5 09:42:28 2008 New Revision: 54348 URL: http://llvm.org/viewvc/llvm-project?rev=54348&view=rev Log: Correct an assertion string. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=54348&r1=54347&r2=54348&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Aug 5 09:42:28 2008 @@ -1097,7 +1097,7 @@ /// true. It returns the MachineInstr opcode value that the node's opcode /// corresponds to. unsigned getMachineOpcode() const { - assert(isMachineOpcode() && "Not a target opcode!"); + assert(isMachineOpcode() && "Not a MachineInstr opcode!"); return ~NodeType; } From gohman at apple.com Tue Aug 5 09:45:15 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 05 Aug 2008 14:45:15 -0000 Subject: [llvm-commits] [llvm] r54349 - in /llvm/trunk/lib: CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Support/SmallPtrSet.cpp VMCore/Constants.cpp VMCore/Type.cpp Message-ID: <200808051445.m75EjGpH010927@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 5 09:45:15 2008 New Revision: 54349 URL: http://llvm.org/viewvc/llvm-project?rev=54349&view=rev Log: Fix several const-correctness issues, resolving some -Wcast-qual warnings. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/trunk/lib/Support/SmallPtrSet.cpp llvm/trunk/lib/VMCore/Constants.cpp llvm/trunk/lib/VMCore/Type.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=54349&r1=54348&r2=54349&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Tue Aug 5 09:45:15 2008 @@ -88,7 +88,7 @@ void Schedule(); /// IsReachable - Checks if SU is reachable from TargetSU. - bool IsReachable(SUnit *SU, SUnit *TargetSU); + bool IsReachable(const SUnit *SU, const SUnit *TargetSU); /// willCreateCycle - Returns true if adding an edge from SU to TargetSU will /// create a cycle. @@ -155,7 +155,7 @@ /// DFS - make a DFS traversal and mark all nodes affected by the /// edge insertion. These nodes will later get new topological indexes /// by means of the Shift method. - void DFS(SUnit *SU, int UpperBound, bool& HasLoop); + void DFS(const SUnit *SU, int UpperBound, bool& HasLoop); /// Shift - reassign topological indexes for the nodes in the DAG /// to preserve the topological ordering. @@ -395,7 +395,7 @@ } /// IsReachable - Checks if SU is reachable from TargetSU. -bool ScheduleDAGRRList::IsReachable(SUnit *SU, SUnit *TargetSU) { +bool ScheduleDAGRRList::IsReachable(const SUnit *SU, const SUnit *TargetSU) { // If insertion of the edge SU->TargetSU would create a cycle // then there is a path from TargetSU to SU. int UpperBound, LowerBound; @@ -543,8 +543,8 @@ /// DFS - Make a DFS traversal to mark all nodes reachable from SU and mark /// all nodes affected by the edge insertion. These nodes will later get new /// topological indexes by means of the Shift method. -void ScheduleDAGRRList::DFS(SUnit *SU, int UpperBound, bool& HasLoop) { - std::vector WorkList; +void ScheduleDAGRRList::DFS(const SUnit *SU, int UpperBound, bool& HasLoop) { + std::vector WorkList; WorkList.reserve(SUnits.size()); WorkList.push_back(SU); @@ -1403,7 +1403,7 @@ class VISIBILITY_HIDDEN BURegReductionPriorityQueue : public RegReductionPriorityQueue { // SUnits - The SUnits for the current graph. - const std::vector *SUnits; + std::vector *SUnits; // SethiUllmanNumbers - The SethiUllman number for each node. std::vector SethiUllmanNumbers; @@ -1692,11 +1692,11 @@ /// hasCopyToRegUse - Return true if SU has a value successor that is a /// CopyToReg node. -static bool hasCopyToRegUse(SUnit *SU) { +static bool hasCopyToRegUse(const SUnit *SU) { for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); I != E; ++I) { if (I->isCtrl) continue; - SUnit *SuccSU = I->Dep; + const SUnit *SuccSU = I->Dep; if (SuccSU->Node && SuccSU->Node->getOpcode() == ISD::CopyToReg) return true; } @@ -1705,7 +1705,7 @@ /// canClobberPhysRegDefs - True if SU would clobber one of SuccSU's /// physical register defs. -static bool canClobberPhysRegDefs(SUnit *SuccSU, SUnit *SU, +static bool canClobberPhysRegDefs(const SUnit *SuccSU, const SUnit *SU, const TargetInstrInfo *TII, const TargetRegisterInfo *TRI) { SDNode *N = SuccSU->Node; @@ -1739,7 +1739,7 @@ /// commutable, favor the one that's not commutable. void BURegReductionPriorityQueue::AddPseudoTwoAddrDeps() { for (unsigned i = 0, e = SUnits->size(); i != e; ++i) { - SUnit *SU = (SUnit *)&((*SUnits)[i]); + SUnit *SU = &(*SUnits)[i]; if (!SU->isTwoAddress) continue; @@ -1819,7 +1819,7 @@ unsigned Sum = 0; for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); I != E; ++I) { - SUnit *SuccSU = I->Dep; + const SUnit *SuccSU = I->Dep; for (SUnit::const_pred_iterator II = SuccSU->Preds.begin(), EE = SuccSU->Preds.end(); II != EE; ++II) { SUnit *PredSU = II->Dep; Modified: llvm/trunk/lib/Support/SmallPtrSet.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SmallPtrSet.cpp?rev=54349&r1=54348&r2=54349&view=diff ============================================================================== --- llvm/trunk/lib/Support/SmallPtrSet.cpp (original) +++ llvm/trunk/lib/Support/SmallPtrSet.cpp Tue Aug 5 09:45:15 2008 @@ -58,13 +58,13 @@ Grow(); // Okay, we know we have space. Find a hash bucket. - void **Bucket = const_cast(FindBucketFor((void*)Ptr)); + const void **Bucket = const_cast(FindBucketFor(Ptr)); if (*Bucket == Ptr) return false; // Already inserted, good. // Otherwise, insert it! if (*Bucket == getTombstoneMarker()) --NumTombstones; - *Bucket = (void*)Ptr; + *Bucket = Ptr; ++NumElements; // Track density. return true; } Modified: llvm/trunk/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=54349&r1=54348&r2=54349&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Constants.cpp (original) +++ llvm/trunk/lib/VMCore/Constants.cpp Tue Aug 5 09:45:15 2008 @@ -1070,7 +1070,8 @@ } typename MapTy::iterator I = - Map.find(MapKey((TypeClass*)CP->getRawType(), getValType(CP))); + Map.find(MapKey(static_cast(CP->getRawType()), + getValType(CP))); if (I == Map.end() || I->second != CP) { // FIXME: This should not use a linear scan. If this gets to be a // performance problem, someone should look at this. Modified: llvm/trunk/lib/VMCore/Type.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=54349&r1=54348&r2=54349&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Type.cpp (original) +++ llvm/trunk/lib/VMCore/Type.cpp Tue Aug 5 09:45:15 2008 @@ -84,9 +84,9 @@ // Now call the destructor for the subclass directly because we're going // to delete this as an array of char. if (isa(this)) - ((FunctionType*)this)->FunctionType::~FunctionType(); + static_cast(this)->FunctionType::~FunctionType(); else - ((StructType*)this)->StructType::~StructType(); + static_cast(this)->StructType::~StructType(); // Finally, remove the memory as an array deallocation of the chars it was // constructed from. From gohman at apple.com Tue Aug 5 10:32:26 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 05 Aug 2008 15:32:26 -0000 Subject: [llvm-commits] [llvm] r54350 - in /llvm/trunk/lib: ExecutionEngine/JIT/JIT.h Target/Alpha/AlphaJITInfo.h Target/Mips/MipsTargetAsmInfo.cpp Target/Mips/MipsTargetAsmInfo.h Transforms/Instrumentation/RSProfiling.cpp Message-ID: <200808051532.m75FWRcJ012496@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 5 10:32:23 2008 New Revision: 54350 URL: http://llvm.org/viewvc/llvm-project?rev=54350&view=rev Log: Trim #includes. Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.h llvm/trunk/lib/Target/Alpha/AlphaJITInfo.h llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.h?rev=54350&r1=54349&r2=54350&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.h (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.h Tue Aug 5 10:32:23 2008 @@ -16,7 +16,6 @@ #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/PassManager.h" -#include namespace llvm { Modified: llvm/trunk/lib/Target/Alpha/AlphaJITInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaJITInfo.h?rev=54350&r1=54349&r2=54350&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaJITInfo.h (original) +++ llvm/trunk/lib/Target/Alpha/AlphaJITInfo.h Tue Aug 5 10:32:23 2008 @@ -15,9 +15,6 @@ #define ALPHA_JITINFO_H #include "llvm/Target/TargetJITInfo.h" -#include "llvm/GlobalValue.h" -#include -#include namespace llvm { class TargetMachine; Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp?rev=54350&r1=54349&r2=54350&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Tue Aug 5 10:32:23 2008 @@ -13,6 +13,7 @@ #include "MipsTargetAsmInfo.h" #include "MipsTargetMachine.h" +#include "llvm/GlobalVariable.h" using namespace llvm; Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h?rev=54350&r1=54349&r2=54350&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h Tue Aug 5 10:32:23 2008 @@ -16,7 +16,6 @@ #include "MipsSubtarget.h" #include "llvm/DerivedTypes.h" -#include "llvm/GlobalVariable.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Target/ELFTargetAsmInfo.h" @@ -24,6 +23,7 @@ namespace llvm { // Forward declaration. + class GlobalValue; class MipsTargetMachine; struct MipsTargetAsmInfo : public ELFTargetAsmInfo { Modified: llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp?rev=54350&r1=54349&r2=54350&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp Tue Aug 5 10:32:23 2008 @@ -48,7 +48,6 @@ #include #include #include -#include using namespace llvm; namespace { From sabre at nondot.org Tue Aug 5 10:43:52 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 5 Aug 2008 10:43:52 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/Criswell_SVA.pdf index.html Message-ID: <200808051543.m75Fhqlf013172@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: Criswell_SVA.pdf added (r1.1) index.html updated: 1.21 -> 1.22 --- Log message: Add John's slides, add video for Chuck and Evan's talks. --- Diffs of the changes: (+29 -12) Criswell_SVA.pdf | 0 index.html | 41 +++++++++++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 12 deletions(-) Index: llvm-www/devmtg/2008-08/Criswell_SVA.pdf Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.21 llvm-www/devmtg/2008-08/index.html:1.22 --- llvm-www/devmtg/2008-08/index.html:1.21 Mon Aug 4 22:58:18 2008 +++ llvm-www/devmtg/2008-08/index.html Tue Aug 5 10:42:43 2008 @@ -35,19 +35,22 @@ - - + + - - - + + @@ -66,7 +69,12 @@ - + + - + + - + + @@ -345,7 +362,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
Last modified: $Date: 2008/08/05 03:58:18 $ +
Last modified: $Date: 2008/08/05 15:42:43 $ From sabre at nondot.org Tue Aug 5 10:44:59 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 5 Aug 2008 10:44:59 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/index.html Message-ID: <200808051544.m75FixYR013241@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: index.html updated: 1.22 -> 1.23 --- Log message: center media column --- Diffs of the changes: (+15 -14) index.html | 29 +++++++++++++++-------------- 1 files changed, 15 insertions(+), 14 deletions(-) Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.22 llvm-www/devmtg/2008-08/index.html:1.23 --- llvm-www/devmtg/2008-08/index.html:1.22 Tue Aug 5 10:42:43 2008 +++ llvm-www/devmtg/2008-08/index.html Tue Aug 5 10:44:41 2008 @@ -36,7 +36,7 @@ - @@ -46,7 +46,7 @@ - - - - @@ -100,7 +101,7 @@ - - - - - @@ -174,7 +175,7 @@ - - - @@ -363,7 +363,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
Last modified: $Date: 2008/08/05 15:44:41 $ +
Last modified: $Date: 2008/08/05 16:55:42 $ From sabre at nondot.org Tue Aug 5 12:10:22 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 5 Aug 2008 12:10:22 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/Geoffray_VMKitProject.pdf index.html Message-ID: <200808051710.m75HAMBI016467@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: Geoffray_VMKitProject.pdf updated: 1.1 -> 1.2 index.html updated: 1.24 -> 1.25 --- Log message: update Nicolas' slides, add blurb for John's talk. --- Diffs of the changes: (+6 -2) Geoffray_VMKitProject.pdf | 0 index.html | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) Index: llvm-www/devmtg/2008-08/Geoffray_VMKitProject.pdf Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.24 llvm-www/devmtg/2008-08/index.html:1.25 --- llvm-www/devmtg/2008-08/index.html:1.24 Tue Aug 5 11:55:42 2008 +++ llvm-www/devmtg/2008-08/index.html Tue Aug 5 12:04:51 2008 @@ -170,7 +170,11 @@ [No video] - @@ -363,7 +367,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
Last modified: $Date: 2008/08/05 16:55:42 $ +
Last modified: $Date: 2008/08/05 17:04:51 $ From lattner at cs.uiuc.edu Tue Aug 5 12:16:03 2008 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 5 Aug 2008 12:16:03 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/index.html Message-ID: <200808051716.m75HG2pX016640@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: index.html updated: 1.25 -> 1.26 --- Log message: improve clang talk description --- Diffs of the changes: (+6 -2) index.html | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.25 llvm-www/devmtg/2008-08/index.html:1.26 --- llvm-www/devmtg/2008-08/index.html:1.25 Tue Aug 5 12:04:51 2008 +++ llvm-www/devmtg/2008-08/index.html Tue Aug 5 12:09:34 2008 @@ -52,7 +52,11 @@ [Video Lo] - @@ -367,7 +371,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
Last modified: $Date: 2008/08/05 17:04:51 $ +
Last modified: $Date: 2008/08/05 17:09:34 $ From sabre at nondot.org Tue Aug 5 12:19:19 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 5 Aug 2008 12:19:19 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/index.html Message-ID: <200808051719.m75HJJga016771@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: index.html updated: 1.26 -> 1.27 --- Log message: fix broken links. --- Diffs of the changes: (+3 -3) index.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.26 llvm-www/devmtg/2008-08/index.html:1.27 --- llvm-www/devmtg/2008-08/index.html:1.26 Tue Aug 5 12:09:34 2008 +++ llvm-www/devmtg/2008-08/index.html Tue Aug 5 12:13:10 2008 @@ -76,8 +76,8 @@
MediaWhoDescription
[Video Hi] - [Video Lo]
+ [Video Hi] + [Video Lo] + Chris Lattner
Apple, Inc.
Welcome and Thanks - A brief welcome, thanks and some logistics for the day.
[Slides] - [Video Hi] - [Video Lo]
+ [Slides] + [Video Hi] + [Video Lo] + Steve Naroff
Apple, Inc.
Clang Internals - Clang status, design and architecture.
[Slides] [Video]
+ [Slides] + [Video Hi] + [Video Lo] + Evan Cheng
Apple, Inc.
LLVM Register Allocation - Description of the current design and architecture of the LLVM register allocator. The talk discusses some @@ -91,7 +99,12 @@
[Slides] [Video]
+ [Slides] + [Video Hi] + [Video Lo] + Chuck Rose III
Adobe Inc.
Adobe Image Foundation and Adobe PixelBender - Adobe Image Foundation is a system for JIT compiling code written in the Adobe @@ -150,7 +163,11 @@
[Slides] [No video]
+ [Slides] + [No video] + John Criswell
University of Illinois
SVA: Using LLVM to Provide Memory Safety - .
MediaWhoDescription
+ [Video Hi] [Video Lo]
+ [Slides] [Video Hi] [Video Lo] @@ -57,7 +57,7 @@
+ [Slides] [Video Hi] [Video Lo] @@ -70,7 +70,7 @@
+ [Slides] [Video Hi] [Video Lo] @@ -84,7 +84,8 @@
[Slides] + + [Slides] [Video Hi] [Video Lo]
+ [Slides] [Video Hi] [Video Lo] @@ -116,7 +117,7 @@
+ [Slides] [Video Hi] [Video Lo] @@ -134,7 +135,7 @@
+ [Slides] [Video Hi] [Video Lo] @@ -148,7 +149,7 @@
+ [Slides] [Video Hi] [Video Lo] @@ -164,7 +165,7 @@
+ [Slides] [No video]
+ [Slides] [Video Hi] [Video Lo] @@ -189,7 +190,7 @@
+ [Slides] [Video Hi] [Video Lo] @@ -205,7 +206,7 @@
+ [Slides] [Video Hi] [Video Lo] @@ -362,7 +363,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2008/08/05 15:42:43 $ +
Last modified: $Date: 2008/08/05 15:44:41 $ From gohman at apple.com Tue Aug 5 10:51:47 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 05 Aug 2008 15:51:47 -0000 Subject: [llvm-commits] [llvm] r54351 - in /llvm/trunk: lib/VMCore/AsmWriter.cpp lib/VMCore/ParameterAttributes.cpp lib/VMCore/Verifier.cpp test/Assembler/2006-05-26-VarargsCallEncode.ll Message-ID: <200808051551.m75FpmQA013519@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 5 10:51:44 2008 New Revision: 54351 URL: http://llvm.org/viewvc/llvm-project?rev=54351&view=rev Log: Fix the AsmWriter to not print extra spaces after parameter attributes. Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp llvm/trunk/lib/VMCore/ParameterAttributes.cpp llvm/trunk/lib/VMCore/Verifier.cpp llvm/trunk/test/Assembler/2006-05-26-VarargsCallEncode.ll Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=54351&r1=54350&r2=54351&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Tue Aug 5 10:51:44 2008 @@ -1385,7 +1385,7 @@ Out << " )"; if (PAL.getParamAttrs(0) != ParamAttr::None) - Out << " " << ParamAttr::getAsString(PAL.getParamAttrs(0)); + Out << ' ' << ParamAttr::getAsString(PAL.getParamAttrs(0)); Out << "\n\t\t\tto"; writeOperand(II->getNormalDest(), true); Out << " unwind"; Modified: llvm/trunk/lib/VMCore/ParameterAttributes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ParameterAttributes.cpp?rev=54351&r1=54350&r2=54351&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ParameterAttributes.cpp (original) +++ llvm/trunk/lib/VMCore/ParameterAttributes.cpp Tue Aug 5 10:51:44 2008 @@ -52,6 +52,8 @@ Result += utostr((Attrs & ParamAttr::Alignment) >> 16); Result += " "; } + // Trim the trailing space. + Result.erase(Result.end()-1); return Result; } Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=54351&r1=54350&r2=54351&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Aug 5 10:51:44 2008 @@ -404,18 +404,18 @@ if (isReturnValue) { ParameterAttributes RetI = Attrs & ParamAttr::ParameterOnly; Assert1(!RetI, "Attribute " + ParamAttr::getAsString(RetI) + - "does not apply to return values!", V); + " does not apply to return values!", V); } else { ParameterAttributes ParmI = Attrs & ParamAttr::ReturnOnly; Assert1(!ParmI, "Attribute " + ParamAttr::getAsString(ParmI) + - "only applies to return values!", V); + " only applies to return values!", V); } for (unsigned i = 0; i < array_lengthof(ParamAttr::MutuallyIncompatible); ++i) { ParameterAttributes MutI = Attrs & ParamAttr::MutuallyIncompatible[i]; Assert1(!(MutI & (MutI - 1)), "Attributes " + - ParamAttr::getAsString(MutI) + "are incompatible!", V); + ParamAttr::getAsString(MutI) + " are incompatible!", V); } ParameterAttributes TypeI = Attrs & ParamAttr::typeIncompatible(Ty); @@ -931,7 +931,7 @@ ParameterAttributes VArgI = Attr & ParamAttr::VarArgsIncompatible; Assert1(!VArgI, "Attribute " + ParamAttr::getAsString(VArgI) + - "cannot be used for vararg call arguments!", I); + " cannot be used for vararg call arguments!", I); } visitInstruction(*I); Modified: llvm/trunk/test/Assembler/2006-05-26-VarargsCallEncode.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2006-05-26-VarargsCallEncode.ll?rev=54351&r1=54350&r2=54351&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2006-05-26-VarargsCallEncode.ll (original) +++ llvm/trunk/test/Assembler/2006-05-26-VarargsCallEncode.ll Tue Aug 5 10:51:44 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llvm-dis | grep {tail call void.*sret null} +; RUN: llvm-as < %s | llvm-dis | grep {tail call void.*sret null} declare void @foo({ }* sret , ...) From clattner at apple.com Tue Aug 5 11:29:52 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 5 Aug 2008 09:29:52 -0700 Subject: [llvm-commits] [llvm] r54248 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/PowerPC/PPCTargetMachine.cpp lib/Target/TargetMachine.cpp In-Reply-To: References: <200807311813.m6VIDDrq000839@zion.cs.uiuc.edu> <0A042EDE-0156-4F24-92C9-6B2DDD4787AD@apple.com> Message-ID: <61A0696E-66B2-4CA5-9CDE-F5BE345FF9AF@apple.com> On Aug 5, 2008, at 12:19 AM, Evan Cheng wrote: >> TargetOptions is for things that clients of the code generator set >> when they want to affect the behavior of codegen. >> >> In this case, jump tables are never valid in ppc64 JIT mode. Why not >> just have the PPC backend mark BR_JT and BRIND as illegal when in 64- >> bit jit mode? That way no target-indep code changes. > > The issue is PPCTargetLowering doesn't know it's in JIT mode. > PPCTargetMachine::addCodeEmitter would have to toggle something to let > it know. It's not exactly clean either. > > This is a short term workaround. I suspect teaching PPCJITInfo about > PIC jumptable is pretty trivial. Once that's done, this whole thing > can be reverted. Are you guys planning to implement it? If not, this will live on for a very long time. I'd strongly prefer teaching PPCTargetLowering that it is in JIT mode. -Chris From clattner at apple.com Tue Aug 5 11:31:54 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 5 Aug 2008 09:31:54 -0700 Subject: [llvm-commits] [llvm] r54334 - in /llvm/trunk/test/CodeGen: ARM/2007-08-15-ReuseBug.ll ARM/remat.ll X86/2007-07-25-EpilogueBug.ll X86/2007-11-14-Coalescer-Bug.ll X86/2007-11-30-LoadFolding-Bug.ll X86/2007-11-30-TestLoadFolding.ll X86/2008-04-17-CoalescerBug.ll X86/2008-05-06-SpillerBug.ll X86/2008-05-21-CoalescerBug.ll X86/2008-06-13-SpillerCommuting.ll X86/ins_subreg_coalesce-3.ll In-Reply-To: <3BAE6DC5-F79A-4E79-9412-6C122152A641@apple.com> References: <200808042355.m74NtUQ8000644@zion.cs.uiuc.edu> <33F024A1-126D-4B5A-ADAC-02126683C5C8@apple.com> <3BAE6DC5-F79A-4E79-9412-6C122152A641@apple.com> Message-ID: <81E6A2A0-2A28-423E-8D37-B46ADAB42C87@apple.com> On Aug 5, 2008, at 12:27 AM, Evan Cheng wrote: > I believe there are 11 test cases that cannot be trivially fixed. I am > not sure how easy it is to go back and re-reduce these tests? That can > take a lot of time. Which tests? What are they doing? Why not just add non-dead edges (e.g. new bool arguments to the function or load of a bool for branch conditions) in the CFG to prevent the blocks from being deleted? > It's likely some of the tests will require more effort to fix up / > regen than it's worth. If you are totally against the option, we can > simply remove those tests that are now invalid. Fixing 11 tests is cheaper than carrying around a dead option *forever*. Why is updating the tests hard? I'm not suggesting you find the original source of the test and update them, just tweak the test to test the right thing. -Chris From sabre at nondot.org Tue Aug 5 12:04:28 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 5 Aug 2008 12:04:28 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2008-08/Begeman_EfficientJIT.pdf index.html Message-ID: <200808051704.m75H4SqS016268@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2008-08: Begeman_EfficientJIT.pdf added (r1.1) index.html updated: 1.23 -> 1.24 --- Log message: Add Nait's slides. --- Diffs of the changes: (+2 -2) Begeman_EfficientJIT.pdf | 0 index.html | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/devmtg/2008-08/Begeman_EfficientJIT.pdf Index: llvm-www/devmtg/2008-08/index.html diff -u llvm-www/devmtg/2008-08/index.html:1.23 llvm-www/devmtg/2008-08/index.html:1.24 --- llvm-www/devmtg/2008-08/index.html:1.23 Tue Aug 5 10:44:41 2008 +++ llvm-www/devmtg/2008-08/index.html Tue Aug 5 11:55:42 2008 @@ -85,7 +85,7 @@
- [Slides] + [Slides] [Video Hi] [Video Lo] John Criswell
University of Illinois
SVA: Using LLVM to Provide Memory Safety - . + SVA: Using LLVM to Provide Memory Safety - SVA is an aggressive approach to + provide an efficient compiler-based system with memory safety on top + of the LLVM IR. Unfortunately, video is not available due to + camera problems.
Steve Naroff
Apple, Inc.
Clang Internals - Clang status, design and architecture. + + Clang Internals - Clang is + is a new C/ObjC/C++ front-end in development as part of the LLVM project. + This talk describes its current status, high level architecture, and how + its Abstract Syntax Trees (ASTs) work.
[Slides] - [Video Hi] - [Video Lo] + [Video Hi] + [Video Lo] Evan Cheng
Apple, Inc.
LLVM Register Allocation - Description of the current design and @@ -371,7 +371,7 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2008/08/05 17:09:34 $ +
Last modified: $Date: 2008/08/05 17:13:10 $ From evan.cheng at apple.com Tue Aug 5 12:43:20 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 5 Aug 2008 10:43:20 -0700 Subject: [llvm-commits] [llvm] r54248 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/PowerPC/PPCTargetMachine.cpp lib/Target/TargetMachine.cpp In-Reply-To: <61A0696E-66B2-4CA5-9CDE-F5BE345FF9AF@apple.com> References: <200807311813.m6VIDDrq000839@zion.cs.uiuc.edu> <0A042EDE-0156-4F24-92C9-6B2DDD4787AD@apple.com> <61A0696E-66B2-4CA5-9CDE-F5BE345FF9AF@apple.com> Message-ID: <72AA15A6-0348-4AB2-9A67-B8001345605B@apple.com> That's the plan. But Dale is on something more critical right now. Implementing it should be extremely simple, it just require some testing. This is what X86 do: /// getPICJumpTableEntry - Returns the value of the jumptable entry for the /// specific basic block. intptr_t X86JITInfo::getPICJumpTableEntry(intptr_t BB, intptr_t Entry) { #if defined(X86_64_JIT) return BB - Entry; #else return BB - PICBase; #endif } Evan On Aug 5, 2008, at 9:29 AM, Chris Lattner wrote: > > On Aug 5, 2008, at 12:19 AM, Evan Cheng wrote: > >>> TargetOptions is for things that clients of the code generator set >>> when they want to affect the behavior of codegen. >>> >>> In this case, jump tables are never valid in ppc64 JIT mode. Why >>> not >>> just have the PPC backend mark BR_JT and BRIND as illegal when in >>> 64- >>> bit jit mode? That way no target-indep code changes. >> >> The issue is PPCTargetLowering doesn't know it's in JIT mode. >> PPCTargetMachine::addCodeEmitter would have to toggle something to >> let >> it know. It's not exactly clean either. >> >> This is a short term workaround. I suspect teaching PPCJITInfo about >> PIC jumptable is pretty trivial. Once that's done, this whole thing >> can be reverted. > > Are you guys planning to implement it? If not, this will live on for > a very long time. I'd strongly prefer teaching PPCTargetLowering that > it is in JIT mode. > > -Chris > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From resistor at mac.com Tue Aug 5 12:50:51 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 05 Aug 2008 17:50:51 -0000 Subject: [llvm-commits] [llvm] r54354 - /llvm/trunk/test/CodeGen/ARM/remat.ll Message-ID: <200808051751.m75Hp3Yu017865@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 5 12:49:52 2008 New Revision: 54354 URL: http://llvm.org/viewvc/llvm-project?rev=54354&view=rev Log: Remove the need for -disable-correct-folding from this test. Modified: llvm/trunk/test/CodeGen/ARM/remat.ll Modified: llvm/trunk/test/CodeGen/ARM/remat.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/remat.ll?rev=54354&r1=54353&r2=54354&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/remat.ll (original) +++ llvm/trunk/test/CodeGen/ARM/remat.ll Tue Aug 5 12:49:52 2008 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -disable-correct-folding -stats -info-output-file - | grep "Number of re-materialization" | grep 3 +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -stats -info-output-file - | grep "Number of re-materialization" | grep 3 %struct.CONTENTBOX = type { i32, i32, i32, i32, i32 } %struct.LOCBOX = type { i32, i32, i32, i32 } @@ -20,20 +20,21 @@ br label %bb490 bb8: ; preds = %bb490, %cond_false428 - br i1 false, label %cond_false58.i, label %cond_false.i + %foo3 = phi i1 [ 0, %bb490 ], [ 1, %cond_false428 ] + br i1 %foo3, label %cond_false58.i, label %cond_false.i cond_false.i: ; preds = %bb8 ret void cond_false58.i: ; preds = %bb8 %highBinX.0.i = select i1 false, i32 1, i32 0 ; [#uses=2] - br i1 false, label %cond_next85.i, label %cond_false76.i + br i1 %foo3, label %cond_next85.i, label %cond_false76.i cond_false76.i: ; preds = %cond_false58.i ret void cond_next85.i: ; preds = %cond_false58.i - br i1 false, label %cond_next105.i, label %cond_false98.i + br i1 %foo3, label %cond_next105.i, label %cond_false98.i cond_false98.i: ; preds = %cond_next85.i ret void @@ -43,7 +44,7 @@ %tmp115.i = icmp eq i32 1, %tmp77.i ; [#uses=1] %bothcond.i = and i1 %tmp115.i, %tmp108.i ; [#uses=1] %storemerge.i = select i1 %bothcond.i, i32 1, i32 0 ; [#uses=2] - br i1 false, label %whoOverlaps.exit, label %bb503.preheader.i + br i1 %bothcond.i, label %whoOverlaps.exit, label %bb503.preheader.i bb503.preheader.i: ; preds = %bb513.i, %cond_next105.i %i.022.0.i = phi i32 [ %tmp512.i, %bb513.i ], [ 0, %cond_next105.i ] ; [#uses=2] @@ -51,7 +52,7 @@ br label %bb503.i bb137.i: ; preds = %bb503.i - br i1 false, label %bb162.i, label %bb148.i + br i1 %tmp506.i, label %bb162.i, label %bb148.i bb148.i: ; preds = %bb137.i ret void @@ -100,15 +101,17 @@ br i1 %tmp516.i, label %whoOverlaps.exit, label %bb503.preheader.i whoOverlaps.exit: ; preds = %bb513.i, %cond_next105.i - br i1 false, label %cond_false428, label %bb490 + %foo = phi i1 [ 1, %bb513.i], [0, %cond_next105.i] + br i1 %foo, label %cond_false428, label %bb490 cond_false428: ; preds = %whoOverlaps.exit - br i1 false, label %bb497, label %bb8 + br i1 %foo, label %bb497, label %bb8 bb490: ; preds = %whoOverlaps.exit, %entry %binY.tmp.2 = phi i32 [ 0, %entry ], [ %storemerge.i, %whoOverlaps.exit ] ; [#uses=1] %cell.1 = phi i32 [ 1, %entry ], [ 0, %whoOverlaps.exit ] ; [#uses=1] - br i1 false, label %bb497, label %bb8 + %foo2 = phi i1 [ 1, %entry], [0, %whoOverlaps.exit] + br i1 %foo2, label %bb497, label %bb8 bb497: ; preds = %bb490, %cond_false428 %binY.tmp.3 = phi i32 [ %binY.tmp.2, %bb490 ], [ %storemerge.i, %cond_false428 ] ; [#uses=0] From resistor at mac.com Tue Aug 5 12:53:07 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 05 Aug 2008 17:53:07 -0000 Subject: [llvm-commits] [llvm] r54355 - /llvm/trunk/test/CodeGen/ARM/2007-08-15-ReuseBug.ll Message-ID: <200808051753.m75Hr9P3017962@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 5 12:52:54 2008 New Revision: 54355 URL: http://llvm.org/viewvc/llvm-project?rev=54355&view=rev Log: This check is unnecessary, and getting rid of it removes a use of -disable-correct-folding. Modified: llvm/trunk/test/CodeGen/ARM/2007-08-15-ReuseBug.ll Modified: llvm/trunk/test/CodeGen/ARM/2007-08-15-ReuseBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2007-08-15-ReuseBug.ll?rev=54355&r1=54354&r2=54355&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2007-08-15-ReuseBug.ll (original) +++ llvm/trunk/test/CodeGen/ARM/2007-08-15-ReuseBug.ll Tue Aug 5 12:52:54 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic -mattr=+v6 -disable-correct-folding | %prcontext {ldr.*\\!} 1 | grep mov +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -relocation-model=pic -mattr=+v6 ; PR1609 %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } From evan.cheng at apple.com Tue Aug 5 12:53:14 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 5 Aug 2008 10:53:14 -0700 Subject: [llvm-commits] [llvm] r54334 - in /llvm/trunk/test/CodeGen: ARM/2007-08-15-ReuseBug.ll ARM/remat.ll X86/2007-07-25-EpilogueBug.ll X86/2007-11-14-Coalescer-Bug.ll X86/2007-11-30-LoadFolding-Bug.ll X86/2007-11-30-TestLoadFolding.ll X86/2008-04-17-CoalescerBug.ll X86/2008-05-06-SpillerBug.ll X86/2008-05-21-CoalescerBug.ll X86/2008-06-13-SpillerCommuting.ll X86/ins_subreg_coalesce-3.ll In-Reply-To: <81E6A2A0-2A28-423E-8D37-B46ADAB42C87@apple.com> References: <200808042355.m74NtUQ8000644@zion.cs.uiuc.edu> <33F024A1-126D-4B5A-ADAC-02126683C5C8@apple.com> <3BAE6DC5-F79A-4E79-9412-6C122152A641@apple.com> <81E6A2A0-2A28-423E-8D37-B46ADAB42C87@apple.com> Message-ID: <79858346-2671-4355-997F-E9324B9FCF4A@apple.com> On Aug 5, 2008, at 9:31 AM, Chris Lattner wrote: > > On Aug 5, 2008, at 12:27 AM, Evan Cheng wrote: > >> I believe there are 11 test cases that cannot be trivially fixed. I >> am >> not sure how easy it is to go back and re-reduce these tests? That >> can >> take a lot of time. > > Which tests? What are they doing? Why not just add non-dead edges > (e.g. new bool arguments to the function or load of a bool for branch > conditions) in the CFG to prevent the blocks from being deleted? You do realize that's not always possible? Any tests that are dependent on behavior of register allocator / spiller / coalescer are very fragile as it is. > > >> It's likely some of the tests will require more effort to fix up / >> regen than it's worth. If you are totally against the option, we can >> simply remove those tests that are now invalid. > > Fixing 11 tests is cheaper than carrying around a dead option > *forever*. Why is updating the tests hard? I'm not suggesting you > find the original source of the test and update them, just tweak the > test to test the right thing. That's fine. Just realize some tests will not end up testing the same thing and some may end up being removed. Evan > > > -Chris > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From resistor at mac.com Tue Aug 5 13:03:49 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 05 Aug 2008 18:03:49 -0000 Subject: [llvm-commits] [llvm] r54356 - /llvm/trunk/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll Message-ID: <200808051803.m75I3uhu018282@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 5 13:03:01 2008 New Revision: 54356 URL: http://llvm.org/viewvc/llvm-project?rev=54356&view=rev Log: Eliminate another use of -disable-correct-folding. Modified: llvm/trunk/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll Modified: llvm/trunk/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll?rev=54356&r1=54355&r2=54356&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll Tue Aug 5 13:03:01 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -disable-correct-folding -stats |& \ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats |& \ ; RUN: grep {1 .*folded into instructions} declare fastcc void @rdft(i32, i32, double*, i32*, double*) @@ -9,25 +9,26 @@ bb.i5: ; preds = %bb.i5, %entry %nfft_init.0.i = phi i32 [ 1, %entry ], [ %tmp7.i3, %bb.i5 ] ; [#uses=1] + %foo = phi i1 [1, %entry], [0, %bb.i5] %tmp7.i3 = shl i32 %nfft_init.0.i, 1 ; [#uses=2] - br i1 false, label %bb.i5, label %mp_unexp_mp2d.exit.i + br i1 %foo, label %bb.i5, label %mp_unexp_mp2d.exit.i mp_unexp_mp2d.exit.i: ; preds = %bb.i5 - br i1 false, label %cond_next.i, label %cond_true.i + br i1 %foo, label %cond_next.i, label %cond_true.i cond_true.i: ; preds = %mp_unexp_mp2d.exit.i ret void cond_next.i: ; preds = %mp_unexp_mp2d.exit.i %tmp22.i = sdiv i32 0, 2 ; [#uses=2] - br i1 false, label %cond_true29.i, label %cond_next36.i + br i1 %foo, label %cond_true29.i, label %cond_next36.i cond_true29.i: ; preds = %cond_next.i ret void cond_next36.i: ; preds = %cond_next.i store i32 %tmp22.i, i32* null, align 4 - %tmp8.i14.i = select i1 false, i32 1, i32 0 ; [#uses=1] + %tmp8.i14.i = select i1 %foo, i32 1, i32 0 ; [#uses=1] br label %bb.i28.i bb.i28.i: ; preds = %bb.i28.i, %cond_next36.i @@ -47,7 +48,7 @@ mp_unexp_d2mp.exit29.i: ; preds = %bb.i28.i %tmp46.i = sub i32 0, %tmp22.i ; [#uses=1] store i32 %tmp46.i, i32* null, align 4 - br i1 false, label %bb.i.i, label %mp_sqrt_init.exit + br i1 %exitcond40.i, label %bb.i.i, label %mp_sqrt_init.exit bb.i.i: ; preds = %bb.i.i, %mp_unexp_d2mp.exit29.i br label %bb.i.i @@ -56,7 +57,7 @@ tail call fastcc void @mp_mul_csqu( i32 0, double* %tmp1fft ) tail call fastcc void @rdft( i32 0, i32 -1, double* null, i32* %ip, double* %w ) tail call fastcc void @mp_mul_d2i( i32 0, i32 %radix, i32 0, double* %tmp1fft, i32* %tmp2 ) - br i1 false, label %cond_false.i, label %cond_true36.i + br i1 %exitcond40.i, label %cond_false.i, label %cond_true36.i cond_true36.i: ; preds = %mp_sqrt_init.exit ret void From resistor at mac.com Tue Aug 5 13:06:11 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 05 Aug 2008 18:06:11 -0000 Subject: [llvm-commits] [llvm] r54357 - /llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll Message-ID: <200808051806.m75I6FZV018356@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 5 13:05:58 2008 New Revision: 54357 URL: http://llvm.org/viewvc/llvm-project?rev=54357&view=rev Log: Remove another -disable-correct-folding use. Modified: llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll Modified: llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll?rev=54357&r1=54356&r2=54357&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll Tue Aug 5 13:05:58 2008 @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | llc -march=x86 -disable-correct-folding -stats |& \ +; RUN: llvm-as < %s | llc -march=x86 -stats |& \ ; RUN: grep {1 .*folded into instructions} -; RUN: llvm-as < %s | llc -march=x86 -disable-correct-folding | grep cmp | count 3 +; RUN: llvm-as < %s | llc -march=x86 | grep cmp | count 4 %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* } @@ -31,7 +31,7 @@ %tmp19.i12.i171 = load %struct.quad_struct** %tmp18.i11.i170, align 4 ; <%struct.quad_struct*> [#uses=1] %tmp21.i173 = tail call fastcc i32 @sum_adjacent( %struct.quad_struct* %tmp19.i12.i171, i32 3, i32 2, i32 %tmp7.i162 ) ; [#uses=1] %tmp22.i174 = add i32 %tmp21.i173, %tmp13.i168 ; [#uses=1] - br i1 false, label %cond_true.i141, label %cond_false.i156 + br i1 %tmp4.i161, label %cond_true.i141, label %cond_false.i156 cond_false.i178: ; preds = %cond_true.i35 ret i32 0 From resistor at mac.com Tue Aug 5 13:09:37 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 05 Aug 2008 18:09:37 -0000 Subject: [llvm-commits] [llvm] r54358 - /llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll Message-ID: <200808051810.m75IA11r018487@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 5 13:08:56 2008 New Revision: 54358 URL: http://llvm.org/viewvc/llvm-project?rev=54358&view=rev Log: One more -disable-correct-folding case removed. Modified: llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll Modified: llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll?rev=54358&r1=54357&r2=54358&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll Tue Aug 5 13:08:56 2008 @@ -13,21 +13,21 @@ @.str33 = external constant [29 x i32] ; <[29 x i32]*> [#uses=1] @.str89 = external constant [5 x i32] ; <[5 x i32]*> [#uses=1] -define void @_ZNK10wxDateTime6FormatEPKwRKNS_8TimeZoneE(%struct.wxString* noalias sret %agg.result, %struct.wxDateTime* %this, i32* %format, %"struct.wxDateTime::TimeZone"* %tz) { +define void @_ZNK10wxDateTime6FormatEPKwRKNS_8TimeZoneE(%struct.wxString* noalias sret %agg.result, %struct.wxDateTime* %this, i32* %format, %"struct.wxDateTime::TimeZone"* %tz, i1 %foo) { entry: - br i1 false, label %bb116.i, label %bb115.critedge.i + br i1 %foo, label %bb116.i, label %bb115.critedge.i bb115.critedge.i: ; preds = %entry ret void bb116.i: ; preds = %entry - br i1 false, label %bb52.i.i, label %bb3118 + br i1 %foo, label %bb52.i.i, label %bb3118 bb3118: ; preds = %bb116.i ret void bb52.i.i: ; preds = %bb116.i - br i1 false, label %bb142.i, label %bb115.critedge.i.i + br i1 %foo, label %bb142.i, label %bb115.critedge.i.i bb115.critedge.i.i: ; preds = %bb52.i.i ret void bb142.i: ; preds = %bb52.i.i - br i1 false, label %bb161.i, label %bb182.i + br i1 %foo, label %bb161.i, label %bb182.i bb161.i: ; preds = %bb142.i br label %bb3261 bb182.i: ; preds = %bb142.i @@ -87,16 +87,16 @@ bb115.critedge.i.i8492: ; preds = %bb5809 ret void bb91.i8504: ; preds = %bb5809 - br i1 false, label %bb155.i8541, label %bb182.i8560 + br i1 %foo, label %bb155.i8541, label %bb182.i8560 bb155.i8541: ; preds = %bb91.i8504 %tmp156.i85398700 = invoke %struct.tm* @gmtime_r( i32* null, %struct.tm* null ) to label %bb182.i8560 unwind label %lpad ; <%struct.tm*> [#uses=1] bb182.i8560: ; preds = %bb155.i8541, %bb91.i8504 %tm48.0.i8558 = phi %struct.tm* [ null, %bb91.i8504 ], [ %tmp156.i85398700, %bb155.i8541 ] ; <%struct.tm*> [#uses=0] - br i1 false, label %bb278.i8617, label %bb187.i8591 + br i1 %foo, label %bb278.i8617, label %bb187.i8591 bb187.i8591: ; preds = %bb182.i8560 %tmp245.i8588 = srem i64 0, 86400000 ; [#uses=1] - br i1 false, label %bb264.i8592, label %bb265.i8606 + br i1 %foo, label %bb264.i8592, label %bb265.i8606 bb264.i8592: ; preds = %bb187.i8591 ret void bb265.i8606: ; preds = %bb187.i8591 @@ -106,7 +106,7 @@ br label %invcont5814 bb278.i8617: ; preds = %bb182.i8560 %timeOnly50.0.i8622 = add i32 0, 0 ; [#uses=1] - br i1 false, label %bb440.i8663, label %bb448.i8694 + br i1 %foo, label %bb440.i8663, label %bb448.i8694 bb440.i8663: ; preds = %bb278.i8617 invoke void @_Z10wxOnAssertPKwiPKcS0_S0_( i32* getelementptr ([27 x i32]* @.str, i32 0, i32 0), i32 1717, i8* getelementptr ([6 x i8]* @_ZZNK10wxDateTime5GetTmERKNS_8TimeZoneEE12__FUNCTION__, i32 0, i32 0), i32* getelementptr ([29 x i32]* @.str33, i32 0, i32 0), i32* getelementptr ([14 x i32]* @.str4, i32 0, i32 0) ) to label %bb448.i8694 unwind label %lpad From resistor at mac.com Tue Aug 5 13:20:13 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 05 Aug 2008 18:20:13 -0000 Subject: [llvm-commits] [llvm] r54359 - in /llvm/trunk/test/CodeGen/X86: 2007-07-25-EpilogueBug.ll 2008-04-17-CoalescerBug.ll 2008-05-06-SpillerBug.ll 2008-05-21-CoalescerBug.ll 2008-06-13-SpillerCommuting.ll ins_subreg_coalesce-3.ll Message-ID: <200808051820.m75IKWhW018855@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 5 13:19:14 2008 New Revision: 54359 URL: http://llvm.org/viewvc/llvm-project?rev=54359&view=rev Log: Update the remaining tests not to use -disable-correct-folding, and remove two that couldn't be updated. Removed: llvm/trunk/test/CodeGen/X86/2007-07-25-EpilogueBug.ll llvm/trunk/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll Modified: llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll llvm/trunk/test/CodeGen/X86/2008-05-06-SpillerBug.ll llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-3.ll Removed: llvm/trunk/test/CodeGen/X86/2007-07-25-EpilogueBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-07-25-EpilogueBug.ll?rev=54358&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-07-25-EpilogueBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-07-25-EpilogueBug.ll (removed) @@ -1,58 +0,0 @@ -; Verify that the addl comes before any popl. - -; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -disable-correct-folding -mcpu=i386 | \ -; RUN: %prcontext ret 1 | grep popl -; PR1573 - - %struct.c34006f__TsB = type { i8, i32, i32, %struct.c34006f__TsB___b___XVN } - %struct.c34006f__TsB___b___XVN = type { %struct.c34006f__TsB___b___XVN___O } - %struct.c34006f__TsB___b___XVN___O = type { float } - -define fastcc i8 @c34006f__pkg__parentEQ.213(%struct.c34006f__TsB* %x, %struct.c34006f__TsB* %y) zeroext { -entry: - %tmp190 = icmp eq i8 0, 0 ; [#uses=1] - %tmp207 = icmp eq i32 0, 0 ; [#uses=1] - %bothcond = and i1 %tmp190, %tmp207 ; [#uses=1] - %tmp224 = icmp eq i32 0, 0 ; [#uses=1] - %bothcond1 = and i1 %bothcond, %tmp224 ; [#uses=1] - br i1 %bothcond1, label %cond_next229, label %UnifiedReturnBlock - -cond_next229: ; preds = %entry - %tmp234 = icmp eq i8 0, 0 ; [#uses=1] - br i1 %tmp234, label %cond_false391, label %cond_true237 - -cond_true237: ; preds = %cond_next229 - %tmp268 = icmp sgt i32 0, -1 ; [#uses=2] - %max269 = select i1 %tmp268, i32 0, i32 0 ; [#uses=1] - %tmp305.op = add i32 0, -1 ; [#uses=1] - br i1 false, label %bb328, label %cond_next315 - -cond_next315: ; preds = %cond_true237 - ret i8 0 - -bb328: ; preds = %cond_true237 - %tmp337 = select i1 %tmp268, i32 %tmp305.op, i32 -1 ; [#uses=1] - %tmp347 = icmp eq i32 %tmp337, 0 ; [#uses=1] - br i1 %tmp347, label %cond_next351, label %UnifiedReturnBlock - -cond_next351: ; preds = %bb328 - %tmp354 = getelementptr %struct.c34006f__TsB* %y, i32 0, i32 3 ; <%struct.c34006f__TsB___b___XVN*> [#uses=1] - %tmp354355 = bitcast %struct.c34006f__TsB___b___XVN* %tmp354 to i8* ; [#uses=1] - %tmp358 = getelementptr %struct.c34006f__TsB* %x, i32 0, i32 3 ; <%struct.c34006f__TsB___b___XVN*> [#uses=1] - %tmp358359 = bitcast %struct.c34006f__TsB___b___XVN* %tmp358 to i8* ; [#uses=1] - %tmp360 = tail call i32 (i8*, i8*, i32, ...)* @memcmp( i8* %tmp358359, i8* %tmp354355, i32 %max269 ) ; [#uses=0] - ret i8 0 - -cond_false391: ; preds = %cond_next229 - %tmp1 = getelementptr %struct.c34006f__TsB* %y, i32 0, i32 3, i32 0, i32 0 - %tmp2 = load float* %tmp1 - %tmp400 = fcmp une float %tmp2, 0.000000e+00 ; [#uses=1] - %not.tmp400 = xor i1 %tmp400, true ; [#uses=1] - %retval = zext i1 %not.tmp400 to i8 ; [#uses=1] - ret i8 %retval - -UnifiedReturnBlock: ; preds = %bb328, %entry - ret i8 0 -} - -declare i32 @memcmp(i8*, i8*, i32, ...) Modified: llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll?rev=54359&r1=54358&r2=54359&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll Tue Aug 5 13:19:14 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -disable-correct-folding | grep xorl | grep {%e} +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep xorl | grep {%e} ; Make sure xorl operands are 32-bit registers. %struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8* } Modified: llvm/trunk/test/CodeGen/X86/2008-05-06-SpillerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-05-06-SpillerBug.ll?rev=54359&r1=54358&r2=54359&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-05-06-SpillerBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-05-06-SpillerBug.ll Tue Aug 5 13:19:14 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic -disable-fp-elim -disable-correct-folding | grep addb | grep ebp +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic -disable-fp-elim | grep addb | grep ebp %struct.rc4_state = type { i32, i32, [256 x i32] } @.str1 = internal constant [65 x i8] c"m[%d] = 0x%02x, m[%d] = 0x%02x, 0x%02x, k = %d, key[k] = 0x%02x\0A\00" ; <[65 x i8]*> [#uses=1] @@ -11,10 +11,12 @@ br label %bb25 bb25: ; preds = %bb25, %entry - br i1 false, label %bb.i, label %bb25 + %foo = phi i1 [ 0, %bb25], [ 1, %entry] + br i1 %foo, label %bb.i, label %bb25 bb.i: ; preds = %bb.i, %bb25 - br i1 false, label %bb21.i, label %bb.i + %foo2 = phi i1 [ 0, %bb.i], [1, %bb25] + br i1 %foo2, label %bb21.i, label %bb.i bb21.i: ; preds = %bb21.i, %bb.i %k.0.reg2mem.0.i = phi i32 [ %k.1.i, %bb21.i ], [ 0, %bb.i ] ; [#uses=2] Modified: llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll?rev=54359&r1=54358&r2=54359&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll Tue Aug 5 13:19:14 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -fast -disable-correct-folding | grep mov | count 4 +; RUN: llvm-as < %s | llc -march=x86 -fast | grep mov | count 5 ; PR2343 %llvm.dbg.anchor.type = type { i32, i32 } @@ -80,10 +80,11 @@ bb497: ; preds = %bb483, %entry %cases.0 = phi %struct.tree_node* [ %tmp496, %bb483 ], [ null, %entry ] ; <%struct.tree_node*> [#uses=1] %last.0 = phi %struct.tree_node* [ %cases.0, %bb483 ], [ undef, %entry ] ; <%struct.tree_node*> [#uses=1] - br i1 false, label %bb483, label %bb502 + %foo = phi i1 [ 0, %bb483 ], [ 1, %entry ] + br i1 %foo, label %bb483, label %bb502 bb502: ; preds = %bb497 - br i1 false, label %bb507, label %bb841 + br i1 %foo, label %bb507, label %bb841 bb507: ; preds = %bb502 %tmp517 = getelementptr %struct.tree_node* %last.0, i32 0, i32 0 ; <%struct.tree_function_decl*> [#uses=1] Removed: llvm/trunk/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll?rev=54358&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll (removed) @@ -1,42 +0,0 @@ -; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic -disable-correct-folding -stats |& grep {spiller - Number of instructions commuted} - - %struct.CABAC_context_element = type { i8, i8 } - %struct.MB_Info_CABAC = type { i8, i8, [2 x i8], i8, i8, i8, i16, i16, [4 x i8], [8 x %struct.MotionVector] } - %struct.MotionVector = type { i16, i16 } - %struct.RBSP2 = type { i32, i32, i16, i8, i16, i16, <1 x i64>, i32, i32, i32*, i32*, i32*, i32*, i32, i32, i32, i32, i32, i8, i16, i8, %struct.MB_Info_CABAC*, %struct.MB_Info_CABAC*, [2 x %struct.MB_Info_CABAC], [12 x i8], [460 x %struct.CABAC_context_element], [10 x i8], [10 x i8], [10 x i16], [4 x [120 x i32]], [15 x [36 x i8]], [6 x [8 x i8]], i16* } - %struct.Slice_Info = type { i32, i8, %struct.seq_parameter_set_rbsp_t*, %struct.seq_parameter_set_rbsp_t, i32, i16*, i8, i8, i8, i8, i16, i32 } - %struct.seq_parameter_set_rbsp_t = type { i32, i32, i32 } - at _ZL21CABAC_CTX_state_table = external constant [64 x i16] ; <[64 x i16]*> [#uses=1] - at _ZL15rLPS_table_64x4 = external constant [64 x [4 x i8]] ; <[64 x [4 x i8]]*> [#uses=1] - -define i32 @_ZN5RBSP220residual_block_cabacEP10Slice_InfoP13MB_Info_CABACS3_hjhhbPtPs(%struct.RBSP2* %this, %struct.Slice_Info* %slice, %struct.MB_Info_CABAC* %up, %struct.MB_Info_CABAC* %left, i8 zeroext %maxNumCoeff, i32 %blk_i, i8 zeroext %iCbCr, i8 zeroext %ctxBlockCat, i8 zeroext %intra_flag, i16* %mask, i16* %res) nounwind { -entry: - %tmp43.i1590 = getelementptr %struct.RBSP2* %this, i32 0, i32 0 ; [#uses=1] - br label %bb803 - -bb803: ; preds = %_ZN5RBSP211decode_1bitEP21CABAC_context_element.exit1581, %entry - %numCoeff.11749 = phi i32 [ 0, %entry ], [ %numCoeff.11749.tmp868, %_ZN5RBSP211decode_1bitEP21CABAC_context_element.exit1581 ] ; [#uses=1] - %tmp28.i1503 = load i8* null, align 1 ; [#uses=1] - %tmp30.i1504 = getelementptr %struct.RBSP2* %this, i32 0, i32 25, i32 0, i32 0 ; [#uses=2] - %tmp31.i1505 = load i8* %tmp30.i1504, align 1 ; [#uses=1] - %tmp3233.i1506 = zext i8 %tmp31.i1505 to i32 ; [#uses=2] - %tmp35.i1507 = getelementptr [64 x i16]* @_ZL21CABAC_CTX_state_table, i32 0, i32 %tmp3233.i1506 ; [#uses=1] - %tmp36.i1508 = load i16* %tmp35.i1507, align 2 ; [#uses=1] - %tmp363738.i1509 = zext i16 %tmp36.i1508 to i32 ; [#uses=1] - %tmp51.i1514 = getelementptr [64 x [4 x i8]]* @_ZL15rLPS_table_64x4, i32 0, i32 %tmp3233.i1506, i32 0 ; [#uses=1] - %tmp52.i1515 = load i8* %tmp51.i1514, align 1 ; [#uses=1] - %tmp5758.i1516 = zext i8 %tmp52.i1515 to i32 ; [#uses=1] - %tmp60.i1517 = sub i32 0, %tmp5758.i1516 ; [#uses=1] - store i32 %tmp60.i1517, i32* %tmp43.i1590, align 16 - br i1 false, label %_ZN5RBSP211decode_1bitEP21CABAC_context_element.exit1581, label %bb.i1537 - -bb.i1537: ; preds = %bb803 - unreachable - -_ZN5RBSP211decode_1bitEP21CABAC_context_element.exit1581: ; preds = %bb803 - %tmp328329.i1580 = trunc i32 %tmp363738.i1509 to i8 ; [#uses=1] - store i8 %tmp328329.i1580, i8* %tmp30.i1504, align 1 - %toBool865 = icmp eq i8 %tmp28.i1503, 0 ; [#uses=1] - %numCoeff.11749.tmp868 = select i1 %toBool865, i32 %numCoeff.11749, i32 0 ; [#uses=1] - br label %bb803 -} Modified: llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-3.ll?rev=54359&r1=54358&r2=54359&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-3.ll (original) +++ llvm/trunk/test/CodeGen/X86/ins_subreg_coalesce-3.ll Tue Aug 5 13:19:14 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86-64 -disable-correct-folding | grep mov | count 9 +; RUN: llvm-as < %s | llc -march=x86-64 | grep mov | count 11 %struct.COMPOSITE = type { i8, i16, i16 } %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } @@ -17,21 +17,21 @@ %struct.metrics = type { i16, i16, i16, i16, i16 } %struct.rec = type { %struct.head_type } -define void @FontChange() { +define void @FontChange(i1 %foo) { entry: - br i1 false, label %bb298, label %bb49 + br i1 %foo, label %bb298, label %bb49 bb49: ; preds = %entry ret void bb298: ; preds = %entry - br i1 false, label %bb304, label %bb366 + br i1 %foo, label %bb304, label %bb366 bb304: ; preds = %bb298 - br i1 false, label %bb330, label %bb428 + br i1 %foo, label %bb330, label %bb428 bb330: ; preds = %bb366, %bb304 br label %bb366 bb366: ; preds = %bb330, %bb298 - br i1 false, label %bb330, label %bb428 + br i1 %foo, label %bb330, label %bb428 bb428: ; preds = %bb366, %bb304 - br i1 false, label %bb650, label %bb433 + br i1 %foo, label %bb650, label %bb433 bb433: ; preds = %bb428 ret void bb650: ; preds = %bb650, %bb428 @@ -56,7 +56,7 @@ ret void bb4932: ; preds = %bb4884 %tmp4933 = load i32* null, align 4 ; [#uses=1] - br i1 false, label %bb5054, label %bb4940 + br i1 %foo, label %bb5054, label %bb4940 bb4940: ; preds = %bb4932 %tmp4943 = load i32* null, align 4 ; [#uses=2] switch i32 %tmp4933, label %bb5054 [ From sabre at nondot.org Tue Aug 5 13:21:24 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 05 Aug 2008 18:21:24 -0000 Subject: [llvm-commits] [llvm] r54360 - /llvm/trunk/docs/LangRef.html Message-ID: <200808051821.m75ILRNE018899@zion.cs.uiuc.edu> Author: lattner Date: Tue Aug 5 13:21:08 2008 New Revision: 54360 URL: http://llvm.org/viewvc/llvm-project?rev=54360&view=rev Log: Capitalize LLVM, suggested by Walt Pawley 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=54360&r1=54359&r2=54360&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Aug 5 13:21:08 2008 @@ -849,7 +849,7 @@
This indicates that the pointer parameter should really be passed by value to the function. The attribute implies that a hidden copy of the pointee is made between the caller and the callee, so the callee is unable - to modify the value in the callee. This attribute is only valid on llvm + to modify the value in the callee. This attribute is only valid on LLVM pointer arguments. It is generally used to pass structs and arrays by value, but is also valid on scalars (even though this is silly).
@@ -997,7 +997,7 @@
  • v128:128:128 - 128-bit vector is 128-bit aligned
  • a0:0:1 - aggregates are 8-bit aligned
  • -

    When llvm is determining the alignment for a given type, it uses the +

    When LLVM is determining the alignment for a given type, it uses the following rules:

    1. If the type sought is an exact match for one of the specifications, that From resistor at mac.com Tue Aug 5 13:28:27 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 05 Aug 2008 18:28:27 -0000 Subject: [llvm-commits] [llvm] r54361 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200808051828.m75ISYVl019093@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 5 13:27:54 2008 New Revision: 54361 URL: http://llvm.org/viewvc/llvm-project?rev=54361&view=rev Log: Remove the -disable-correct-folding option, which was ugly and is no longer needed. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=54361&r1=54360&r2=54361&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Aug 5 13:27:54 2008 @@ -53,9 +53,6 @@ EnableValueProp("enable-value-prop", cl::Hidden); static cl::opt EnableLegalizeTypes("enable-legalize-types", cl::Hidden); -static cl::opt -DisableCorrectBranchFolding("disable-correct-folding", cl::init(false), - cl::Hidden); #ifndef NDEBUG @@ -1638,14 +1635,12 @@ // If the branch was constant folded, fix up the CFG. if (BrCond.getOpcode() == ISD::BR) { - if (!DisableCorrectBranchFolding) - CurMBB->removeSuccessor(CB.FalseBB); + CurMBB->removeSuccessor(CB.FalseBB); DAG.setRoot(BrCond); } else { // Otherwise, go ahead and insert the false branch. if (BrCond == getControlRoot()) - if (!DisableCorrectBranchFolding) - CurMBB->removeSuccessor(CB.TrueBB); + CurMBB->removeSuccessor(CB.TrueBB); if (CB.FalseBB == NextBlock) DAG.setRoot(BrCond); From sabre at nondot.org Tue Aug 5 13:29:19 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 05 Aug 2008 18:29:19 -0000 Subject: [llvm-commits] [llvm] r54362 - /llvm/trunk/docs/LangRef.html Message-ID: <200808051829.m75ITLZG019123@zion.cs.uiuc.edu> Author: lattner Date: Tue Aug 5 13:29:16 2008 New Revision: 54362 URL: http://llvm.org/viewvc/llvm-project?rev=54362&view=rev Log: Expand acronyms, suggested by Walter Pawley 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=54362&r1=54361&r2=54362&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Aug 5 13:29:16 2008 @@ -255,9 +255,9 @@

      This document is a reference manual for the LLVM assembly language. -LLVM is an SSA based representation that provides type safety, -low-level operations, flexibility, and the capability of representing -'all' high-level languages cleanly. It is the common code +LLVM is an Static Single Assignment (SSA) based representation that provides +type safety, low-level operations, flexibility, and the capability of +representing 'all' high-level languages cleanly. It is the common code representation used throughout all phases of the LLVM compilation strategy.

      @@ -522,9 +522,9 @@
      extern_weak:
      -
      The semantics of this linkage follow the ELF model: the symbol is weak - until linked, if not linked, the symbol becomes null instead of being an - undefined reference. +
      The semantics of this linkage follow the ELF object file model: the + symbol is weak until linked, if not linked, the symbol becomes null instead + of being an undefined reference.
      externally visible:
      @@ -538,7 +538,7 @@

      The next two types of linkage are targeted for Microsoft Windows platform only. They are designed to support importing (exporting) symbols from (to) - DLLs. + DLLs (Dynamic Link Libraries).

      @@ -602,8 +602,8 @@
      This calling convention attempts to make calls as fast as possible (e.g. by passing things in registers). This calling convention allows the target to use whatever tricks it wants to produce fast code for the target, - without having to conform to an externally specified ABI. Implementations of - this convention should allow arbitrary + without having to conform to an externally specified ABI (Application Binary + Interface). Implementations of this convention should allow arbitrary tail call optimization to be supported. This calling convention does not support varargs and requires the prototype of all callees to exactly match the prototype of the function @@ -648,7 +648,8 @@
      "default" - Default style:
      -
      On ELF, default visibility means that the declaration is visible to other +
      On targets that use the ELF object file format, default visibility means + that the declaration is visible to other modules and, in shared libraries, means that the declared entity may be overridden. On Darwin, default visibility means that the declaration is visible to other modules. Default visibility corresponds to "external @@ -760,7 +761,8 @@ name, a possibly empty list of arguments, an optional alignment, and an optional garbage collector name.

      -

      A function definition contains a list of basic blocks, forming the CFG for +

      A function definition contains a list of basic blocks, forming the CFG +(Control Flow Graph) for the function. Each basic block may optionally start with a label (giving the basic block a symbol table entry), contains a list of instructions, and ends with a terminator instruction (such as a branch or @@ -957,7 +959,7 @@

      Specifies that the target lays out data in big-endian form. That is, the bits with the most significance have the lowest address location.
      e
      -
      Specifies that hte target lays out data in little-endian form. That is, +
      Specifies that the target lays out data in little-endian form. That is, the bits with the least significance have the lowest address location.
      p:size:abi:pref
      This specifies the size of a pointer and its abi and @@ -989,7 +991,7 @@
    2. i8:8:8 - i8 is 8-bit (byte) aligned
    3. i16:16:16 - i16 is 16-bit aligned
    4. i32:32:32 - i32 is 32-bit aligned
    5. -
    6. i64:32:64 - i64 has abi alignment of 32-bits but preferred +
    7. i64:32:64 - i64 has ABI alignment of 32-bits but preferred alignment of 64-bits
    8. f32:32:32 - float is 32-bit aligned
    9. f64:64:64 - double is 64-bit aligned
    10. @@ -1023,7 +1025,8 @@

      The LLVM type system is one of the most important features of the intermediate representation. Being typed enables a number of -optimizations to be performed on the IR directly, without having to do +optimizations to be performed on the intermediate representation directly, +without having to do extra analyses on the side before the transformation. A strong type system makes it easier to read the generated code and enables novel analyses and transformations that are not feasible to perform on normal @@ -4515,7 +4518,8 @@

      LLVM support for Accurate Garbage -Collection requires the implementation and generation of these intrinsics. +Collection (GC) requires the implementation and generation of these +intrinsics. These intrinsics allow identification of GC roots on the stack, as well as garbage collector implementations that require read and write barriers. @@ -4867,11 +4871,12 @@

      The 'llvm.pcmarker' intrinsic is a method to export a Program Counter -(PC) in a region of -code to simulators and other tools. The method is target specific, but it is -expected that the marker will use exported symbols to transmit the PC of the marker. -The marker makes no guarantees that it will remain with any specific instruction -after optimizations. It is possible that the presence of a marker will inhibit +(PC) in a region of +code to simulators and other tools. The method is target specific, but it is +expected that the marker will use exported symbols to transmit the PC of the +marker. +The marker makes no guarantees that it will remain with any specific instruction +after optimizations. It is possible that the presence of a marker will inhibit optimizations. The intended use is to be inserted after optimizations to allow correlations of simulation runs.

      @@ -5691,7 +5696,8 @@ These intrinsic functions expand the "universal IR" of LLVM to represent hardware constructs for atomic operations and memory synchronization. This provides an interface to the hardware, not an interface to the programmer. It - is aimed at a low enough level to allow any programming models or APIs which + is aimed at a low enough level to allow any programming models or APIs + (Application Programming Interfaces) which need atomic behaviors to map cleanly onto it. It is also modeled primarily on hardware behavior. Just as hardware provides a "universal IR" for source languages, it also provides a starting point for developing a "universal" From viridia at gmail.com Tue Aug 5 13:35:50 2008 From: viridia at gmail.com (Talin) Date: Tue, 5 Aug 2008 11:35:50 -0700 Subject: [llvm-commits] DebugInfoBuilder Message-ID: The attached patch file contains an initial implementation of DebugInfoBuilder, which is intended to help generate DWARF debugging information. Currently it only has support for creating global descriptors, I have not yet implemented descriptors for aggregate types or stop points. The API tries to simplify the task of creating descriptors by using the IR types. For example, instead of having to manually specify the size and alignment of an integer, you can just pass an IntegerType to CreateIntegerTypeDescriptor and it will figure that out for you. However, in some cases you'll need to pass extra information which is not represented in the IR - so for example CreateIntegerTypeDescriptor takes an argument indicating whether the type is intended to be signed or unsigned (since the IR integer type has no concept of signed-ness.) -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080805/195693da/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: DIB.patch Type: application/octet-stream Size: 17898 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080805/195693da/attachment.obj From clattner at apple.com Tue Aug 5 13:42:24 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 5 Aug 2008 11:42:24 -0700 Subject: [llvm-commits] [llvm] r54334 - in /llvm/trunk/test/CodeGen: ARM/2007-08-15-ReuseBug.ll ARM/remat.ll X86/2007-07-25-EpilogueBug.ll X86/2007-11-14-Coalescer-Bug.ll X86/2007-11-30-LoadFolding-Bug.ll X86/2007-11-30-TestLoadFolding.ll X86/2008-04-17-CoalescerBug.ll X86/2008-05-06-SpillerBug.ll X86/2008-05-21-CoalescerBug.ll X86/2008-06-13-SpillerCommuting.ll X86/ins_subreg_coalesce-3.ll In-Reply-To: <79858346-2671-4355-997F-E9324B9FCF4A@apple.com> References: <200808042355.m74NtUQ8000644@zion.cs.uiuc.edu> <33F024A1-126D-4B5A-ADAC-02126683C5C8@apple.com> <3BAE6DC5-F79A-4E79-9412-6C122152A641@apple.com> <81E6A2A0-2A28-423E-8D37-B46ADAB42C87@apple.com> <79858346-2671-4355-997F-E9324B9FCF4A@apple.com> Message-ID: <4F7F0740-0F75-4CC4-A1D1-6D0DD544F9FC@apple.com> On Aug 5, 2008, at 10:53 AM, Evan Cheng wrote: > On Aug 5, 2008, at 9:31 AM, Chris Lattner wrote: >> On Aug 5, 2008, at 12:27 AM, Evan Cheng wrote: >>> I believe there are 11 test cases that cannot be trivially fixed. I >>> am >>> not sure how easy it is to go back and re-reduce these tests? That >>> can >>> take a lot of time. >> >> Which tests? What are they doing? Why not just add non-dead edges >> (e.g. new bool arguments to the function or load of a bool for branch >> conditions) in the CFG to prevent the blocks from being deleted? > > You do realize that's not always possible? Any tests that are > dependent on behavior of register allocator / spiller / coalescer are > very fragile as it is. Do you intend to add a new option every time a change to codegen potentially perturbs one of these tests? They should be updated or removed if they are too fragile. Changing the RUN line of a test is perfectly acceptable. > That's fine. Just realize some tests will not end up testing the same > thing and some may end up being removed. Understood, thanks -Chris From clattner at apple.com Tue Aug 5 13:42:54 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 5 Aug 2008 11:42:54 -0700 Subject: [llvm-commits] [llvm] r54361 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp In-Reply-To: <200808051828.m75ISYVl019093@zion.cs.uiuc.edu> References: <200808051828.m75ISYVl019093@zion.cs.uiuc.edu> Message-ID: On Aug 5, 2008, at 11:28 AM, Owen Anderson wrote: > Author: resistor > Date: Tue Aug 5 13:27:54 2008 > New Revision: 54361 > > URL: http://llvm.org/viewvc/llvm-project?rev=54361&view=rev > Log: > Remove the -disable-correct-folding option, which was ugly and is no > longer needed. Yay, thanks Owen! -Chris From evan.cheng at apple.com Tue Aug 5 15:22:40 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 5 Aug 2008 13:22:40 -0700 Subject: [llvm-commits] DebugInfoBuilder In-Reply-To: References: Message-ID: <75963E22-3FE2-4914-9AC7-9CEA5CFAC9CD@apple.com> Very nice! This is sorely needed. Some comments: + // Calculate the size of the specified LLVM type. + Constant * Sizeof(const Type * type); + + // Calculate the alignment of the specified LLVM type. + Constant * Alignof(const Type * type); I find these names confusing. Perhaps getSize and getAlignment? That follows the convention which are used elsewhere in LLVM. + /// Set the reference to the module where we will insert debugging information. + /// Also defines the debug info types for the module and creates the initial anchors. + /// Also changes the current context to the global context for that module. + void SetModule(Module * m); 80 column please. :-) +// = = =---------------------------------------------------------------------- ===// +// Debug version -- copied from MachineModuleInfo (for now), in order to avoid +// creating a dependency on CodeGen. These declarations really should be moved +// to a better place where modules can get at them without being dependent on +// CodeGen. +enum { + LLVMDebugVersion = (6 << 16), // Current version of debug information. + LLVMDebugVersion5 = (5 << 16), // Constant for version 5. + LLVMDebugVersion4 = (4 << 16), // Constant for version 4. + LLVMDebugVersionMask = 0xffff0000 // Mask for version number. +}; What are the different versions? +GlobalVariable * DebugInfoBuilder::CreateCompileUnitDescriptor(unsigned langId, + const sys::Path & srcPath, const std::string & producer) { + + if (compileUnit == NULL) { + std::vector values; + values.push_back(ConstantInt::get(Type::Int32Ty, LLVMDebugVersion + dwarf::DW_TAG_compile_unit)); + values.push_back(ConstantExpr::getBitCast(compileUnitAnchor, anyPtrType)); + values.push_back(ConstantInt::get(Type::Int32Ty, langId)); + values.push_back(ConstantArray::get(srcPath.getLast())); + values.push_back(ConstantArray::get(srcPath.getDirname() + "/")); + values.push_back(ConstantArray::get(producer)); + + Constant * structVal = ConstantStruct::get(values, false); It would be nice if there is a ConstantStruct::get that takes SmallVectorImpl instead (hint :-). Then we can avoid heap allocation for a small vector. Thanks, Evan On Aug 5, 2008, at 11:35 AM, Talin wrote: > The attached patch file contains an initial implementation of > DebugInfoBuilder, which is intended to help generate DWARF debugging > information. Currently it only has support for creating global > descriptors, I have not yet implemented descriptors for aggregate > types or stop points. > > The API tries to simplify the task of creating descriptors by using > the IR types. For example, instead of having to manually specify the > size and alignment of an integer, you can just pass an IntegerType > to CreateIntegerTypeDescriptor and it will figure that out for you. > However, in some cases you'll need to pass extra information which > is not represented in the IR - so for example > CreateIntegerTypeDescriptor takes an argument indicating whether the > type is intended to be signed or unsigned (since the IR integer type > has no concept of signed-ness.) > > -- > -- Talin > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From resistor at mac.com Tue Aug 5 15:51:26 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 05 Aug 2008 20:51:26 -0000 Subject: [llvm-commits] [llvm] r54369 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Message-ID: <200808052051.m75KpQVq024003@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 5 15:51:26 2008 New Revision: 54369 URL: http://llvm.org/viewvc/llvm-project?rev=54369&view=rev Log: We don't need to update live intervals for dead PHIs. Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=54369&r1=54368&r2=54369&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Tue Aug 5 15:51:26 2008 @@ -884,38 +884,41 @@ I != E; ) { MachineInstr* PInstr = *(I++); - // Trim live intervals of input registers. They are no longer live into - // this block. - for (unsigned i = 1; i < PInstr->getNumOperands(); i += 2) { - unsigned reg = PInstr->getOperand(i).getReg(); - MachineBasicBlock* MBB = PInstr->getOperand(i+1).getMBB(); - LiveInterval& InputI = LI.getInterval(reg); - if (MBB != PInstr->getParent() && - InputI.liveAt(LI.getMBBStartIdx(PInstr->getParent()))) - InputI.removeRange(LI.getMBBStartIdx(PInstr->getParent()), - LI.getInstructionIndex(PInstr), - true); - } - - // If this is a dead PHI node, then remove it from LiveIntervals. - unsigned DestReg = PInstr->getOperand(0).getReg(); - LiveInterval& PI = LI.getInterval(DestReg); - if (PInstr->registerDefIsDead(DestReg)) { - if (PI.containsOneValue()) { - LI.removeInterval(DestReg); + // Don't do live interval updating for dead PHIs. + if (!PInstr->registerDefIsDead(PInstr->getOperand(0).getReg())) { + // Trim live intervals of input registers. They are no longer live into + // this block. + for (unsigned i = 1; i < PInstr->getNumOperands(); i += 2) { + unsigned reg = PInstr->getOperand(i).getReg(); + MachineBasicBlock* MBB = PInstr->getOperand(i+1).getMBB(); + LiveInterval& InputI = LI.getInterval(reg); + if (MBB != PInstr->getParent() && + InputI.liveAt(LI.getMBBStartIdx(PInstr->getParent()))) + InputI.removeRange(LI.getMBBStartIdx(PInstr->getParent()), + LI.getInstructionIndex(PInstr), + true); + } + + // If this is a dead PHI node, then remove it from LiveIntervals. + unsigned DestReg = PInstr->getOperand(0).getReg(); + LiveInterval& PI = LI.getInterval(DestReg); + if (PInstr->registerDefIsDead(DestReg)) { + if (PI.containsOneValue()) { + LI.removeInterval(DestReg); + } else { + unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr)); + PI.removeRange(*PI.getLiveRangeContaining(idx), true); + } } else { + // If the PHI is not dead, then the valno defined by the PHI + // now has an unknown def. unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr)); - PI.removeRange(*PI.getLiveRangeContaining(idx), true); + const LiveRange* PLR = PI.getLiveRangeContaining(idx); + PLR->valno->def = ~0U; + LiveRange R (LI.getMBBStartIdx(PInstr->getParent()), + PLR->start, PLR->valno); + PI.addRange(R); } - } else { - // If the PHI is not dead, then the valno defined by the PHI - // now has an unknown def. - unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr)); - const LiveRange* PLR = PI.getLiveRangeContaining(idx); - PLR->valno->def = ~0U; - LiveRange R (LI.getMBBStartIdx(PInstr->getParent()), - PLR->start, PLR->valno); - PI.addRange(R); } LI.RemoveMachineInstrFromMaps(PInstr); From gohman at apple.com Tue Aug 5 16:13:05 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 05 Aug 2008 21:13:05 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r54370 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Message-ID: <200808052113.m75LD5KK024734@zion.cs.uiuc.edu> Author: djg Date: Tue Aug 5 16:13:04 2008 New Revision: 54370 URL: http://llvm.org/viewvc/llvm-project?rev=54370&view=rev Log: Use uint64_t more consistently for field offsets, including bitfield offsets. This fixes gcc.c-torture/compile/961203-1.c. 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=54370&r1=54369&r2=54370&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Tue Aug 5 16:13:04 2008 @@ -518,14 +518,14 @@ /// FindLLVMTypePadding - If the specified struct has any inter-element padding, /// add it to the Padding array. -static void FindLLVMTypePadding(const Type *Ty, unsigned BitOffset, - SmallVector, 16> &Padding) { +static void FindLLVMTypePadding(const Type *Ty, uint64_t BitOffset, + SmallVector, 16> &Padding) { if (const StructType *STy = dyn_cast(Ty)) { const TargetData &TD = getTargetData(); const StructLayout *SL = TD.getStructLayout(STy); - unsigned PrevFieldBitOffset = 0; + uint64_t PrevFieldBitOffset = 0; for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) { - unsigned FieldBitOffset = SL->getElementOffset(i)*8; + uint64_t FieldBitOffset = SL->getElementOffset(i)*8; // Get padding of sub-elements. FindLLVMTypePadding(STy->getElementType(i), @@ -533,7 +533,7 @@ // Check to see if there is any padding between this element and the // previous one. if (i) { - unsigned PrevFieldEnd = + uint64_t PrevFieldEnd = PrevFieldBitOffset+TD.getTypeSizeInBits(STy->getElementType(i-1)); if (PrevFieldEnd < FieldBitOffset) Padding.push_back(std::make_pair(PrevFieldEnd+BitOffset, @@ -545,7 +545,7 @@ // Check for tail padding. if (unsigned EltCount = STy->getNumElements()) { - unsigned PrevFieldEnd = PrevFieldBitOffset + + uint64_t PrevFieldEnd = PrevFieldBitOffset + TD.getTypeSizeInBits(STy->getElementType(EltCount-1)); if (PrevFieldEnd < SL->getSizeInBytes()*8) Padding.push_back(std::make_pair(PrevFieldEnd, @@ -553,7 +553,7 @@ } } else if (const ArrayType *ATy = dyn_cast(Ty)) { - unsigned EltSize = getTargetData().getTypeSizeInBits(ATy->getElementType()); + uint64_t EltSize = getTargetData().getTypeSizeInBits(ATy->getElementType()); for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i) FindLLVMTypePadding(ATy->getElementType(), BitOffset+i*EltSize, Padding); } @@ -661,7 +661,7 @@ if (TREE_CODE(DECL_FIELD_OFFSET(Field)) != INTEGER_CST) return true; - unsigned FieldBitOffset = getFieldOffsetInBits(Field); + uint64_t FieldBitOffset = getFieldOffsetInBits(Field); if (GCCTypeOverlapsWithPadding(getDeclaredType(Field), PadStartBits-FieldBitOffset, PadSizeBits)) return true; @@ -695,7 +695,7 @@ const Type *Ty) { // Start by finding all of the padding in the LLVM Type. - SmallVector, 16> StructPadding; + SmallVector, 16> StructPadding; FindLLVMTypePadding(Ty, 0, StructPadding); for (unsigned i = 0, e = StructPadding.size(); i != e; ++i) @@ -1324,7 +1324,7 @@ /// getTypeSize - Return the size of the specified type in bytes. /// - unsigned getTypeSize(const Type *Ty) const { + uint64_t getTypeSize(const Type *Ty) const { return TD.getABITypeSize(Ty); } @@ -1414,7 +1414,7 @@ // Get the LLVM type for the field. If this field is a bitfield, use the // declared type, not the shrunk-to-fit type that GCC gives us in TREE_TYPE. unsigned ByteAlignment = getTypeAlignment(Ty); - unsigned NextByteOffset = getNewElementByteOffset(ByteAlignment); + uint64_t NextByteOffset = getNewElementByteOffset(ByteAlignment); if (NextByteOffset > ByteOffset || ByteAlignment > getGCCStructAlignmentInBytes()) { // LLVM disagrees as to where this field should go in the natural field @@ -1425,7 +1425,7 @@ // If alignment won't round us up to the right boundary, insert explicit // padding. if (NextByteOffset < ByteOffset) { - unsigned CurOffset = getNewElementByteOffset(1); + uint64_t CurOffset = getNewElementByteOffset(1); const Type *Pad = Type::Int8Ty; if (SavedTy && LastFieldStartsAtNonByteBoundry) // We want to reuse SavedType to access this bit field. @@ -1457,7 +1457,7 @@ /// getNewElementByteOffset - If we add a new element with the specified /// alignment, what byte offset will it land at? - unsigned getNewElementByteOffset(unsigned ByteAlignment) { + uint64_t getNewElementByteOffset(unsigned ByteAlignment) { if (Elements.empty()) return 0; uint64_t LastElementEnd = ElementOffsetInBytes.back() + ElementSizeInBytes.back(); @@ -1480,7 +1480,7 @@ /// getFieldEndOffsetInBytes - Return the byte offset of the byte immediately /// after the specified field. For example, if FieldNo is 0 and the field /// is 4 bytes in size, this will return 4. - unsigned getFieldEndOffsetInBytes(unsigned FieldNo) const { + uint64_t getFieldEndOffsetInBytes(unsigned FieldNo) const { assert(FieldNo < ElementOffsetInBytes.size() && "Invalid field #!"); return ElementOffsetInBytes[FieldNo]+ElementSizeInBytes[FieldNo]; } @@ -1488,7 +1488,7 @@ /// getEndUnallocatedByte - Return the first byte that isn't allocated at the /// end of a structure. For example, for {}, it's 0, for {int} it is 4, for /// {int,short}, it is 6. - unsigned getEndUnallocatedByte() const { + uint64_t getEndUnallocatedByte() const { if (ElementOffsetInBytes.empty()) return 0; return getFieldEndOffsetInBytes(ElementOffsetInBytes.size()-1); } @@ -1547,7 +1547,7 @@ return ~0U; } - void addNewBitField(unsigned Size, unsigned FirstUnallocatedByte); + void addNewBitField(uint64_t Size, uint64_t FirstUnallocatedByte); void dump() const; }; @@ -1555,8 +1555,8 @@ // Add new element which is a bit field. Size is not the size of bit filed, // but size of bits required to determine type of new Field which will be // used to access this bit field. -void StructTypeConversionInfo::addNewBitField(unsigned Size, - unsigned FirstUnallocatedByte) { +void StructTypeConversionInfo::addNewBitField(uint64_t Size, + uint64_t FirstUnallocatedByte) { // Figure out the LLVM type that we will use for the new field. // Note, Size is not necessarily size of the new field. It indicates @@ -1859,13 +1859,13 @@ return; // Get the starting offset in the record. - unsigned StartOffsetInBits = getFieldOffsetInBits(Field); - unsigned EndBitOffset = FieldSizeInBits+StartOffsetInBits; + uint64_t StartOffsetInBits = getFieldOffsetInBits(Field); + uint64_t EndBitOffset = FieldSizeInBits+StartOffsetInBits; // If the last inserted LLVM field completely contains this bitfield, just // ignore this field. if (!Info.Elements.empty()) { - unsigned LastFieldBitOffset = Info.ElementOffsetInBytes.back()*8; + uint64_t LastFieldBitOffset = Info.ElementOffsetInBytes.back()*8; unsigned LastFieldBitSize = Info.ElementSizeInBytes.back()*8; assert(LastFieldBitOffset <= StartOffsetInBits && "This bitfield isn't part of the last field!"); @@ -1886,12 +1886,12 @@ // Compute the number of bits that we need to add to this struct to cover // this field. - unsigned FirstUnallocatedByte = Info.getEndUnallocatedByte(); - unsigned StartOffsetFromByteBoundry = StartOffsetInBits & 7; + uint64_t FirstUnallocatedByte = Info.getEndUnallocatedByte(); + uint64_t StartOffsetFromByteBoundry = StartOffsetInBits & 7; if (StartOffsetInBits < FirstUnallocatedByte*8) { - unsigned AvailableBits = FirstUnallocatedByte * 8 - StartOffsetInBits; + uint64_t AvailableBits = FirstUnallocatedByte * 8 - StartOffsetInBits; // This field's starting point is already allocated. if (StartOffsetFromByteBoundry == 0) { // This field starts at byte boundry. Need to allocate space From resistor at mac.com Tue Aug 5 16:18:52 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 05 Aug 2008 21:18:52 -0000 Subject: [llvm-commits] [llvm] r54371 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Message-ID: <200808052118.m75LIqmt024928@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 5 16:18:51 2008 New Revision: 54371 URL: http://llvm.org/viewvc/llvm-project?rev=54371&view=rev Log: Oops, we were already checking for dead phis. Handle this the proper way, then. Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=54371&r1=54370&r2=54371&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Tue Aug 5 16:18:51 2008 @@ -884,8 +884,17 @@ I != E; ) { MachineInstr* PInstr = *(I++); - // Don't do live interval updating for dead PHIs. - if (!PInstr->registerDefIsDead(PInstr->getOperand(0).getReg())) { + // If this is a dead PHI node, then remove it from LiveIntervals. + unsigned DestReg = PInstr->getOperand(0).getReg(); + LiveInterval& PI = LI.getInterval(DestReg); + if (PInstr->registerDefIsDead(DestReg)) { + if (PI.containsOneValue()) { + LI.removeInterval(DestReg); + } else { + unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr)); + PI.removeRange(*PI.getLiveRangeContaining(idx), true); + } + } else { // Trim live intervals of input registers. They are no longer live into // this block. for (unsigned i = 1; i < PInstr->getNumOperands(); i += 2) { @@ -899,26 +908,14 @@ true); } - // If this is a dead PHI node, then remove it from LiveIntervals. - unsigned DestReg = PInstr->getOperand(0).getReg(); - LiveInterval& PI = LI.getInterval(DestReg); - if (PInstr->registerDefIsDead(DestReg)) { - if (PI.containsOneValue()) { - LI.removeInterval(DestReg); - } else { - unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr)); - PI.removeRange(*PI.getLiveRangeContaining(idx), true); - } - } else { - // If the PHI is not dead, then the valno defined by the PHI - // now has an unknown def. - unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr)); - const LiveRange* PLR = PI.getLiveRangeContaining(idx); - PLR->valno->def = ~0U; - LiveRange R (LI.getMBBStartIdx(PInstr->getParent()), - PLR->start, PLR->valno); - PI.addRange(R); - } + // If the PHI is not dead, then the valno defined by the PHI + // now has an unknown def. + unsigned idx = LI.getDefIndex(LI.getInstructionIndex(PInstr)); + const LiveRange* PLR = PI.getLiveRangeContaining(idx); + PLR->valno->def = ~0U; + LiveRange R (LI.getMBBStartIdx(PInstr->getParent()), + PLR->start, PLR->valno); + PI.addRange(R); } LI.RemoveMachineInstrFromMaps(PInstr); From isanbard at gmail.com Tue Aug 5 16:23:45 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 05 Aug 2008 21:23:45 -0000 Subject: [llvm-commits] [llvm] r54372 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-07-08-AndICmp.ll Message-ID: <200808052123.m75LNjCH025126@zion.cs.uiuc.edu> Author: void Date: Tue Aug 5 16:23:45 2008 New Revision: 54372 URL: http://llvm.org/viewvc/llvm-project?rev=54372&view=rev Log: Revert r53282. This was causing a miscompile on Linux. Also, the transformation looks bogus. Please see PR2629 for details on why this is breaking things. Removed: llvm/trunk/test/Transforms/InstCombine/2008-07-08-AndICmp.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=54372&r1=54371&r2=54372&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Aug 5 16:23:45 2008 @@ -3586,22 +3586,6 @@ } } - - { // (icmp ugt/ult A, C) & (icmp B, C) --> (icmp (A|B), C) - // where C is a power of 2 - Value *A, *B; - ConstantInt *C1, *C2; - ICmpInst::Predicate LHSCC, RHSCC; - if (match(&I, m_And(m_ICmp(LHSCC, m_Value(A), m_ConstantInt(C1)), - m_ICmp(RHSCC, m_Value(B), m_ConstantInt(C2))))) - if (C1 == C2 && LHSCC == RHSCC && C1->getValue().isPowerOf2() && - (LHSCC == ICmpInst::ICMP_ULT || LHSCC == ICmpInst::ICMP_UGT)) { - Instruction *NewOr = BinaryOperator::CreateOr(A, B); - InsertNewInstBefore(NewOr, I); - return new ICmpInst(LHSCC, NewOr, C1); - } - } - if (ICmpInst *RHS = dyn_cast(Op1)) { // (icmp1 A, B) & (icmp2 A, B) --> (icmp3 A, B) if (Instruction *R = AssociativeOpt(I, FoldICmpLogical(*this, RHS))) Removed: llvm/trunk/test/Transforms/InstCombine/2008-07-08-AndICmp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-07-08-AndICmp.ll?rev=54371&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/2008-07-08-AndICmp.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/2008-07-08-AndICmp.ll (removed) @@ -1,10 +0,0 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep icmp | count 1 -; PR2330 - -define i1 @foo(i32 %a, i32 %b) nounwind { -entry: - icmp ult i32 %a, 8 ; :0 [#uses=1] - icmp ult i32 %b, 8 ; :1 [#uses=1] - and i1 %1, %0 ; :2 [#uses=1] - ret i1 %2 -} From resistor at mac.com Tue Aug 5 16:40:48 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 05 Aug 2008 21:40:48 -0000 Subject: [llvm-commits] [llvm] r54374 - /llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Message-ID: <200808052140.m75LempP025805@zion.cs.uiuc.edu> Author: resistor Date: Tue Aug 5 16:40:45 2008 New Revision: 54374 URL: http://llvm.org/viewvc/llvm-project?rev=54374&view=rev Log: Correctly handle replacement and removal of PHIs with one incoming register. Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp?rev=54374&r1=54373&r2=54374&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp (original) +++ llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Tue Aug 5 16:40:45 2008 @@ -27,6 +27,7 @@ #include "llvm/Pass.h" #include "llvm/Type.h" #include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/Support/CFG.h" #include "llvm/Support/Compiler.h" #include "llvm/Target/TargetInstrInfo.h" @@ -128,10 +129,15 @@ start->RemoveOperand(i-1); } - if (start->getNumOperands() == 1) { + if (start->getNumOperands() == 3) { MachineInstr* phi = start; + unsigned Input = phi->getOperand(1).getReg(); + unsigned Output = phi->getOperand(0).getReg(); + start++; phi->eraseFromParent(); + + F.getRegInfo().replaceRegWith(Output, Input); } else start++; } From evan.cheng at apple.com Tue Aug 5 16:51:54 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 05 Aug 2008 21:51:54 -0000 Subject: [llvm-commits] [llvm] r54375 - in /llvm/trunk: lib/CodeGen/VirtRegMap.cpp test/CodeGen/X86/2008-08-06-RewriterBug.ll Message-ID: <200808052151.m75LptF3026271@zion.cs.uiuc.edu> Author: evancheng Date: Tue Aug 5 16:51:46 2008 New Revision: 54375 URL: http://llvm.org/viewvc/llvm-project?rev=54375&view=rev Log: Fix PR2596: out of bound reference. Added: llvm/trunk/test/CodeGen/X86/2008-08-06-RewriterBug.ll Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=54375&r1=54374&r2=54375&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original) +++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Tue Aug 5 16:51:46 2008 @@ -560,8 +560,11 @@ if (!MO.isRegister() || !MO.isUse() || !MO.isKill()) continue; unsigned Reg = MO.getReg(); + if (TargetRegisterInfo::isVirtualRegister(Reg)) + continue; if (KillRegs) KillRegs->push_back(Reg); + assert(Reg < KillOps.size()); if (KillOps[Reg] == &MO) { RegKills.reset(Reg); KillOps[Reg] = NULL; @@ -943,9 +946,11 @@ return false; continue; } - PhysReg = VRM.getPhys(VirtReg); - if (!TRI->regsOverlap(PhysReg, UnfoldPR)) - continue; + if (VRM.hasPhys(VirtReg)) { + PhysReg = VRM.getPhys(VirtReg); + if (!TRI->regsOverlap(PhysReg, UnfoldPR)) + continue; + } // Ok, we'll need to reload the value into a register which makes // it impossible to perform the store unfolding optimization later. Added: llvm/trunk/test/CodeGen/X86/2008-08-06-RewriterBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-08-06-RewriterBug.ll?rev=54375&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-08-06-RewriterBug.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-08-06-RewriterBug.ll Tue Aug 5 16:51:46 2008 @@ -0,0 +1,40 @@ +; RUN: llvm-as < %s | llc -march=x86 +; PR2596 + + at data = external global [400 x i64] ; <[400 x i64]*> [#uses=5] + +define void @foo(double* noalias, double* noalias) { + load i64* getelementptr ([400 x i64]* @data, i32 0, i64 200), align 4 ; :3 [#uses=1] + load i64* getelementptr ([400 x i64]* @data, i32 0, i64 199), align 4 ; :4 [#uses=1] + load i64* getelementptr ([400 x i64]* @data, i32 0, i64 198), align 4 ; :5 [#uses=2] + load i64* getelementptr ([400 x i64]* @data, i32 0, i64 197), align 4 ; :6 [#uses=1] + br i1 false, label %28, label %7 + +;