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 @@
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 @@
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 @@
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 - .
@@ -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 @@
Talin -
Google
Vikram Adve
University of Illinois at Urbana-Champaign
Nathan Allan
Alphora / Database Consulting Group
-
Owen Anderson
Apple
+
Owen Anderson
Apple, Inc.
Chris Aoki
Sun Microsystems, Inc.
Michael AuYeung
The Aerospace Corporation
Joseph Battelle
Logitech
Nate Begeman
Apple, Inc.
-
Kris Bell
Apple
+
Kris Bell
Apple, Inc.
Jay Bharadwaj
Intel Corporation
Robert Bowdidge
Self
Max Burke
Electronic Arts
-
Anders Carlsson
Apple Inc.
+
Anders Carlsson
Apple, Inc.
Chandler Carruth
Google, Inc
-
Evan Cheng
Apple
+
Evan Cheng
Apple, Inc.
Andy Chou
Coverity, Inc.
Eric Christopher
Apple, Inc
Jan Civlin
AMD
@@ -193,35 +196,35 @@
Stefanus Du Toit
RapidMind
Daniel Dunbar
Stanford University / Apple Inc.
Bernardo Elayda
Wind River
-
Ken Ferry
Apple
+
Ken Ferry
Apple, Inc.
Tim Foley
Self
Chandrashekhar Garud
Sun Microsystems
Nicolas Geoffray
Universit?? Pierre et Marie Curie
-
Dan Gohman
Apple
+
Dan Gohman
Apple, Inc.
John Golenbieski
Self
-
Eric Gouriou
Apple
+
Eric Gouriou
Apple, Inc.
Ryan Govostes
Alacatia Labs, Inc.
David Greene
Cray, Inc.
-
Jim Grosbach
Apple
+
Jim Grosbach
Apple, Inc.
Vinod Grover
NVIDIA
Alfonso Guerra
Apokalypse Software Corp.
Mohammad Reza Haghighat
Intel Corporation
-
Chris Hanson
Apple Inc.
+
Chris Hanson
Apple, Inc.
Kurt Harriman
Greenplum
-
Stuart Hastings
Apple
+
Stuart Hastings
Apple, Inc.
John Hixson
University of the Pacific
Robert Hundt
Google
Oliver Hunt
Apple, Inc.
Changhao Jiang
Facebook Inc.
-
dale johannesen
Apple
-
Francois Jouaux
Apple Inc.
+
dale johannesen
Apple, Inc.
+
Francois Jouaux
Apple, Inc.
Benjamin King
DemandEO.com
George King
arboreality.net
-
Nick Kledzik
Apple Inc
+
Nick Kledzik
Apple, Inc.
Anton Korobeynikov
Saint Petersburg State University
-
Ted Kremenek
Apple Inc.
-
Chris Lattner
Apple Inc
-
Tanya Lattner
Apple
+
Ted Kremenek
Apple, Inc.
+
Chris Lattner
Apple, Inc.
+
Tanya Lattner
Apple, Inc.
Andrew Lenharth
University of Illinois
Mark Leone
Self
Julien Lerouge
Apple, Inc.
@@ -230,24 +233,24 @@
olivier maggi
numeriz
Dmitri Makarov
AMD
Ali Mashtizadeh
VMware, Inc.
-
Henry Mason
Apple
+
Henry Mason
Apple, Inc.
Scott Michel
Aerospace
Keir Mierle
Google
Daniel Moniz
Unified Research
Marcel Moolenaar
The FreeBSD Project
Alireza Moshtaghi
Microchip Technology
-
Ginger Myles
Apple Inc.
+
Ginger Myles
Apple, Inc.
Prashanth Narayanaswamy
Sun Microsystems
-
Steve Naroff
Apple Inc.
+
Steve Naroff
Apple, Inc.
Ted Neward
Neward & Associates
Jay O'Conor
Self
Maksim Panchenko
Sun Microsystems
Ji Young Park
AMD Inc.
Terence Parr
University of San Francisco
-
Devang Patel
Apple
+
Devang Patel
Apple, Inc.
Scott Petersen
Adobe Systems, Inc.
Richard Phillips
Wolfram Research
-
Ernest Prabhakar
Apple
+
Ernest Prabhakar
Apple, Inc.
Gregor Purdy
Apple, Inc.
Paul Ramsey
Dreamworks Animation
Joseph Ranieri
Alacatia Labs, Inc.
@@ -261,23 +264,23 @@
Mitesh Shah
ARC International
Craig Smith
National Instruments
Evan Smyth
DreamWorks Animation
-
Pratik Solanki
Apple
-
Mike Stump
Apple
+
Pratik Solanki
Apple, Inc.
+
Mike Stump
Apple, Inc.
Andre Sublette
Self
Richard Sweet
Adobe Systems
Yan Tang
VMware
-
Caroline Tice
Apple Inc.
+
Caroline Tice
Apple, Inc.
Ross Towle
Sun
Andrew Trick
Hewlett-Packard
Hemant Trivedi
Silicon Informatics, Inc
Erick Tryzelaar
self
-
Mon Ping Wang
Apple
+
Mon Ping Wang
Apple, Inc.
Douglas Watt
XMOS Semiconductor
Patrick Webster
Self
-
Marcel Weiher
Apple
-
Sam Weinig
Apple Inc.
+
Marcel Weiher
Apple, Inc.
+
Sam Weinig
Apple, Inc.
Steve Weissinger
Wind River
-
Bill Wendling
Apple Inc.
+
Bill Wendling
Apple, Inc.
Hans-Martin Will
Vincent 3D Rendering Library (OSS project)
Pen-Chung Yew
University of Minnesota
Anna Zaks
New York University
@@ -297,7 +300,7 @@
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">
- 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 @@
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!">
- 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!">
- 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.
-
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 @@
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 @@
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 @@
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 @@
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!">
- 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!">
- 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 @@
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!">
- 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