From anton at korobeynikov.info Mon May 17 01:40:37 2010
From: anton at korobeynikov.info (Anton Korobeynikov)
Date: Mon, 17 May 2010 10:40:37 +0400
Subject: [llvm-commits] Global Merge Pass for ARM
In-Reply-To: <00CB9243-E49C-4A8D-B63E-226FC9ADAFD6@apple.com>
References: <1274006983.22060.61.camel@aslstation>
<00CB9243-E49C-4A8D-B63E-226FC9ADAFD6@apple.com>
Message-ID:
Hi, Eric
> This is pretty cool and simple so far. ?What's the benchmarking look like?
In fact the poor results of some numeric codes was the main motivation
for this pass. The typical "bad" code is some sort of FIR/IIR filter
applications (or something similar in the spirit) which needs to
operate on several global memory buffers at once in the tight internal
loop. Like in the mentioned toy example the addresses of globals need
to be kept in the registers leading to spills & reloads inside hot
computation loops. The speedup of such computational kernels might be
up to 2x-3x.
I didn't see any speed degradation for "normal" code.
> At the very least do you mind including the above writeup in a big block comment
> on the pass? ?I make no claims about the rest of it, but the pass is pretty
> sparse on documentation and much easier to read with the example there.
Yes, will add with the final version.
--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
From asl at math.spbu.ru Mon May 17 03:10:57 2010
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Mon, 17 May 2010 12:10:57 +0400
Subject: [llvm-commits] [llvm] r103917 -
/llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp
In-Reply-To: <4E37E15C-26D7-4095-A793-510C744BF1EF@apple.com>
References: <20100517011146.A3F04312800A@llvm.org>
<4E37E15C-26D7-4095-A793-510C744BF1EF@apple.com>
Message-ID:
Hi, Evan
> Let me know if this is not correct. I don't see why this pass is only run in ARM mode.
This looks ok for me. Maybe I was over-conservative :)
--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
From baldrick at free.fr Mon May 17 04:12:46 2010
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 17 May 2010 11:12:46 +0200
Subject: [llvm-commits] [PATCH] InstCombine: remove malloc+free if
malloc's only uses are comparisons to null
In-Reply-To: <4BF02485.2050508@iki.fi>
References: <4BF02485.2050508@iki.fi>
Message-ID: <4BF1088E.30805@free.fr>
Hi Matti,
> There's one slight weirdness in it whose cleanness I'm not so sure
> about: when getting rid of the malloc+free, we want to replace the
> remaining uses of the malloc with a constant (trivially folded) non-null
> pointer. The only way of getting such a thing I could think of was to
> bitcast the enclosing function's address, since that's a GlobalValue and
> hence can be handled by ConstantFoldCompareInstruction. It definitely
> works, but it seems a bit hacky.
why not just directly replace the comparisons with true/false? Also,
InstCombineCompares.cpp has a similar transformation in which a malloc
which is never freed, but only used in comparisons (for some reason it
is limited to only one comparison) is removed. You may want to share
some code/logic with that.
Ciao,
Duncan.
From baldrick at free.fr Mon May 17 04:18:09 2010
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 17 May 2010 11:18:09 +0200
Subject: [llvm-commits] [llvm-gcc-4.2] r103918
- /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
In-Reply-To: <20100517012918.68ED8312800A@llvm.org>
References: <20100517012918.68ED8312800A@llvm.org>
Message-ID: <4BF109D1.5030203@free.fr>
> Fix divide by 8 thinko in palignr128 expansion. It's there in the
> mmx version.
Testcase?
Ciao,
Duncan.
From xuzhongxing at gmail.com Mon May 17 04:47:55 2010
From: xuzhongxing at gmail.com (Zhongxing Xu)
Date: Mon, 17 May 2010 09:47:55 -0000
Subject: [llvm-commits] [llvm] r103936 - in /llvm/trunk:
include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/ScheduleDAG.cpp
Message-ID: <20100517094755.DEE71312800A@llvm.org>
Author: zhongxingxu
Date: Mon May 17 04:47:55 2010
New Revision: 103936
URL: http://llvm.org/viewvc/llvm-project?rev=103936&view=rev
Log:
Remove unused member variable.
Modified:
llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
llvm/trunk/lib/CodeGen/ScheduleDAG.cpp
Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=103936&r1=103935&r2=103936&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Mon May 17 04:47:55 2010
@@ -34,7 +34,6 @@
class SDNode;
class TargetInstrInfo;
class TargetInstrDesc;
- class TargetLowering;
class TargetMachine;
class TargetRegisterClass;
template class GraphWriter;
@@ -456,7 +455,6 @@
const TargetMachine &TM; // Target processor
const TargetInstrInfo *TII; // Target instruction information
const TargetRegisterInfo *TRI; // Target processor register info
- const TargetLowering *TLI; // Target lowering info
MachineFunction &MF; // Machine function
MachineRegisterInfo &MRI; // Virtual/real register map
std::vector Sequence; // The schedule. Null SUnit*'s
Modified: llvm/trunk/lib/CodeGen/ScheduleDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAG.cpp?rev=103936&r1=103935&r2=103936&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ScheduleDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/ScheduleDAG.cpp Mon May 17 04:47:55 2010
@@ -27,7 +27,6 @@
: TM(mf.getTarget()),
TII(TM.getInstrInfo()),
TRI(TM.getRegisterInfo()),
- TLI(TM.getTargetLowering()),
MF(mf), MRI(mf.getRegInfo()),
EntrySU(), ExitSU() {
}
From matti.niemenmaa+llvm at iki.fi Mon May 17 06:07:06 2010
From: matti.niemenmaa+llvm at iki.fi (Matti Niemenmaa)
Date: Mon, 17 May 2010 14:07:06 +0300
Subject: [llvm-commits] [PATCH] InstCombine: remove malloc+free if
malloc's only uses are comparisons to null
In-Reply-To: <4BF1088E.30805@free.fr>
References: <4BF02485.2050508@iki.fi> <4BF1088E.30805@free.fr>
Message-ID:
On 2010-05-17 12:12, Duncan Sands wrote:
>> There's one slight weirdness in it whose cleanness I'm not so sure
>> about: when getting rid of the malloc+free, we want to replace the
>> remaining uses of the malloc with a constant (trivially folded) non-null
>> pointer. The only way of getting such a thing I could think of was to
>> bitcast the enclosing function's address, since that's a GlobalValue and
>> hence can be handled by ConstantFoldCompareInstruction. It definitely
>> works, but it seems a bit hacky.
>
> why not just directly replace the comparisons with true/false? Also,
> InstCombineCompares.cpp has a similar transformation in which a malloc
> which is never freed, but only used in comparisons (for some reason it
> is limited to only one comparison) is removed. You may want to share
> some code/logic with that.
I did it like that mostly to make the code simpler, since it's then just
a single RAUW to get rid of the malloc. I suppose you're right that it's
cleaner to replace the icmps themselves, even though it takes some more
code.
Another issue was that I wasn't sure what to do with comparisons that
aren't eq/ne, since the value of null is target-specific. Apparently
ConstantFoldCompareInstruction does nothing to them anyway. I think the
safest thing to do is to bail on such comparisons and not perform the
optimization. I'll amend the patch to only operate on icmp eq/ne.
The code in InstCombineCompares.cpp makes me wonder whether we should be
operating on the malloc call to begin with? That is, move this 'malloc +
[icmps] + [free]' removal from visitFree and InstCombineCompares.cpp to
a new InstCombiner::visitMalloc function which would be called like
visitFree currently is, from InstCombiner::visitCallInst.
From stoklund at 2pi.dk Mon May 17 10:30:32 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Mon, 17 May 2010 15:30:32 -0000
Subject: [llvm-commits] [llvm] r103939 -
/llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Message-ID: <20100517153032.CE115312800A@llvm.org>
Author: stoklund
Date: Mon May 17 10:30:32 2010
New Revision: 103939
URL: http://llvm.org/viewvc/llvm-project?rev=103939&view=rev
Log:
Extract spill cost calculation to a new method, and use definePhysReg() to clear
out aliases when allocating. Clean up allocVirtReg().
Use calcSpillCost() to allow more aggressive hinting. Now the hint is always
taken unless blocked by a reserved register. This leads to more coalescing,
lower register pressure, and less spilling.
Modified:
llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=103939&r1=103938&r2=103939&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Mon May 17 10:30:32 2010
@@ -118,6 +118,11 @@
// not be erased.
bool isBulkSpilling;
+ enum {
+ spillClean = 1,
+ spillDirty = 100,
+ spillImpossible = ~0u
+ };
public:
virtual const char *getPassName() const {
return "Fast Register Allocator";
@@ -144,6 +149,7 @@
void usePhysReg(MachineOperand&);
void definePhysReg(MachineInstr *MI, unsigned PhysReg, RegState NewState);
+ unsigned calcSpillCost(unsigned PhysReg) const;
void assignVirtToPhysReg(LiveRegEntry &LRE, unsigned PhysReg);
void allocVirtReg(MachineInstr *MI, LiveRegEntry &LRE, unsigned Hint);
LiveRegMap::iterator defineVirtReg(MachineInstr *MI, unsigned OpNum,
@@ -369,6 +375,44 @@
}
+// calcSpillCost - Return the cost of spilling clearing out PhysReg and
+// aliases so it is free for allocation.
+// Returns 0 when PhysReg is free or disabled with all aliases disabled - it
+// can be allocated directly.
+// Returns spillImpossible when PhysReg or an alias can't be spilled.
+unsigned RAFast::calcSpillCost(unsigned PhysReg) const {
+ switch (unsigned VirtReg = PhysRegState[PhysReg]) {
+ case regDisabled:
+ break;
+ case regFree:
+ return 0;
+ case regReserved:
+ return spillImpossible;
+ default:
+ return LiveVirtRegs.lookup(VirtReg).Dirty ? spillDirty : spillClean;
+ }
+
+ // This is a disabled register, add up const of aliases.
+ unsigned Cost = 0;
+ for (const unsigned *AS = TRI->getAliasSet(PhysReg);
+ unsigned Alias = *AS; ++AS) {
+ switch (unsigned VirtReg = PhysRegState[Alias]) {
+ case regDisabled:
+ break;
+ case regFree:
+ ++Cost;
+ break;
+ case regReserved:
+ return spillImpossible;
+ default:
+ Cost += LiveVirtRegs.lookup(VirtReg).Dirty ? spillDirty : spillClean;
+ break;
+ }
+ }
+ return Cost;
+}
+
+
/// assignVirtToPhysReg - This method updates local state so that we know
/// that PhysReg is the proper container for VirtReg now. The physical
/// register must not be used for anything else when this is called.
@@ -383,15 +427,12 @@
/// allocVirtReg - Allocate a physical register for VirtReg.
void RAFast::allocVirtReg(MachineInstr *MI, LiveRegEntry &LRE, unsigned Hint) {
- const unsigned SpillCost = 100;
const unsigned VirtReg = LRE.first;
assert(TargetRegisterInfo::isVirtualRegister(VirtReg) &&
"Can only allocate virtual registers");
const TargetRegisterClass *RC = MRI->getRegClass(VirtReg);
- TargetRegisterClass::iterator AOB = RC->allocation_order_begin(*MF);
- TargetRegisterClass::iterator AOE = RC->allocation_order_end(*MF);
// Ignore invalid hints.
if (Hint && (!TargetRegisterInfo::isPhysicalRegister(Hint) ||
@@ -403,107 +444,44 @@
if (Hint) {
assert(RC->contains(Hint) && !UsedInInstr.test(Hint) &&
Allocatable.test(Hint) && "Invalid hint should have been cleared");
- switch(PhysRegState[Hint]) {
- case regDisabled:
- case regReserved:
- break;
+ switch(calcSpillCost(Hint)) {
default:
- spillVirtReg(MI, PhysRegState[Hint]);
+ definePhysReg(MI, Hint, regFree);
// Fall through.
- case regFree:
+ case 0:
return assignVirtToPhysReg(LRE, Hint);
+ case spillImpossible:
+ break;
}
}
+ TargetRegisterClass::iterator AOB = RC->allocation_order_begin(*MF);
+ TargetRegisterClass::iterator AOE = RC->allocation_order_end(*MF);
+
// First try to find a completely free register.
- unsigned BestCost = 0, BestReg = 0;
- bool hasDisabled = false;
for (TargetRegisterClass::iterator I = AOB; I != AOE; ++I) {
unsigned PhysReg = *I;
- switch(PhysRegState[PhysReg]) {
- case regDisabled:
- hasDisabled = true;
- case regReserved:
- continue;
- case regFree:
- if (!UsedInInstr.test(PhysReg))
- return assignVirtToPhysReg(LRE, PhysReg);
- continue;
- default:
- // Grab the first spillable register we meet.
- if (!BestReg && !UsedInInstr.test(PhysReg))
- BestReg = PhysReg, BestCost = SpillCost;
- continue;
- }
+ if (PhysRegState[PhysReg] == regFree && !UsedInInstr.test(PhysReg))
+ return assignVirtToPhysReg(LRE, PhysReg);
}
DEBUG(dbgs() << "Allocating %reg" << VirtReg << " from " << RC->getName()
- << " candidate=" << TRI->getName(BestReg) << "\n");
-
- // Try to extend the working set for RC if there were any disabled registers.
- if (hasDisabled && (!BestReg || BestCost >= SpillCost)) {
- for (TargetRegisterClass::iterator I = AOB; I != AOE; ++I) {
- unsigned PhysReg = *I;
- if (PhysRegState[PhysReg] != regDisabled || UsedInInstr.test(PhysReg))
- continue;
+ << "\n");
- // Calculate the cost of bringing PhysReg into the working set.
- unsigned Cost=0;
- bool Impossible = false;
- for (const unsigned *AS = TRI->getAliasSet(PhysReg);
- unsigned Alias = *AS; ++AS) {
- if (UsedInInstr.test(Alias)) {
- Impossible = true;
- break;
- }
- switch (PhysRegState[Alias]) {
- case regDisabled:
- break;
- case regReserved:
- Impossible = true;
- break;
- case regFree:
- Cost++;
- break;
- default:
- Cost += SpillCost;
- break;
- }
- }
- if (Impossible) continue;
- DEBUG(dbgs() << "- candidate " << TRI->getName(PhysReg)
- << " cost=" << Cost << "\n");
- if (!BestReg || Cost < BestCost) {
- BestReg = PhysReg;
- BestCost = Cost;
- if (Cost < SpillCost) break;
- }
+ unsigned BestReg = 0, BestCost = spillImpossible;
+ for (TargetRegisterClass::iterator I = AOB; I != AOE; ++I) {
+ unsigned Cost = calcSpillCost(*I);
+ if (Cost < BestCost) {
+ BestReg = *I;
+ BestCost = Cost;
+ if (Cost == 0) break;
}
}
if (BestReg) {
// BestCost is 0 when all aliases are already disabled.
- if (BestCost) {
- if (PhysRegState[BestReg] != regDisabled)
- spillVirtReg(MI, PhysRegState[BestReg]);
- else {
- // Make sure all aliases are disabled.
- for (const unsigned *AS = TRI->getAliasSet(BestReg);
- unsigned Alias = *AS; ++AS) {
- switch (PhysRegState[Alias]) {
- case regDisabled:
- continue;
- case regFree:
- PhysRegState[Alias] = regDisabled;
- break;
- default:
- spillVirtReg(MI, PhysRegState[Alias]);
- PhysRegState[Alias] = regDisabled;
- break;
- }
- }
- }
- }
+ if (BestCost)
+ definePhysReg(MI, BestReg, regFree);
return assignVirtToPhysReg(LRE, BestReg);
}
From stoklund at 2pi.dk Mon May 17 10:30:37 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Mon, 17 May 2010 15:30:37 -0000
Subject: [llvm-commits] [llvm] r103940 -
/llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Message-ID: <20100517153037.8A46F3128018@llvm.org>
Author: stoklund
Date: Mon May 17 10:30:37 2010
New Revision: 103940
URL: http://llvm.org/viewvc/llvm-project?rev=103940&view=rev
Log:
Minor optimizations. DenseMap::begin() is surprisingly slow on an empty map.
Modified:
llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=103940&r1=103939&r2=103940&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Mon May 17 10:30:37 2010
@@ -267,6 +267,7 @@
/// spillAll - Spill all dirty virtregs without killing them.
void RAFast::spillAll(MachineInstr *MI) {
+ if (LiveVirtRegs.empty()) return;
isBulkSpilling = true;
for (LiveRegMap::iterator i = LiveVirtRegs.begin(),
e = LiveVirtRegs.end(); i != e; ++i)
@@ -471,17 +472,15 @@
unsigned BestReg = 0, BestCost = spillImpossible;
for (TargetRegisterClass::iterator I = AOB; I != AOE; ++I) {
unsigned Cost = calcSpillCost(*I);
- if (Cost < BestCost) {
- BestReg = *I;
- BestCost = Cost;
- if (Cost == 0) break;
- }
+ // Cost is 0 when all aliases are already disabled.
+ if (Cost == 0)
+ return assignVirtToPhysReg(LRE, *I);
+ if (Cost < BestCost)
+ BestReg = *I, BestCost = Cost;
}
if (BestReg) {
- // BestCost is 0 when all aliases are already disabled.
- if (BestCost)
- definePhysReg(MI, BestReg, regFree);
+ definePhysReg(MI, BestReg, regFree);
return assignVirtToPhysReg(LRE, BestReg);
}
From echristo at apple.com Mon May 17 10:33:34 2010
From: echristo at apple.com (Eric Christopher)
Date: Mon, 17 May 2010 08:33:34 -0700
Subject: [llvm-commits] [llvm-gcc-4.2] r103918 -
/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
In-Reply-To: <4BF109D1.5030203@free.fr>
References: <20100517012918.68ED8312800A@llvm.org> <4BF109D1.5030203@free.fr>
Message-ID:
On May 17, 2010, at 2:18 AM, Duncan Sands wrote:
>> Fix divide by 8 thinko in palignr128 expansion. It's there in the
>> mmx version.
>
> Testcase?
I'll throw one in today.
-eric
From Edmund.Grimley-Evans at arm.com Mon May 17 10:50:51 2010
From: Edmund.Grimley-Evans at arm.com (Edmund Grimley-Evans)
Date: Mon, 17 May 2010 16:50:51 +0100
Subject: [llvm-commits] [PATCH] Test NEON code generation and calling
convention
Message-ID: <89A528FE6DB0FA44877BB2F05B8467180BACA420@ZIPPY.Emea.Arm.com>
Could this file (vadd2.ll) be added in test/CodeGen/ARM/?
It broke in r103411 and was fixed again in r103854. It would be nice
to keep it working.
I'm not sure what if any official rules govern how vector quantities
should be passed as arguments and returned. It appears that vectors of
less than 64 bits (such as the <2 x i8> in the first example in
vadd2.ll) currently get passed in R0-R3 rather than Q0-Q3, which leads
to some ugly code. Is this a bug or a feature?
--
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vadd2.ll
Type: application/octet-stream
Size: 8885 bytes
Desc: vadd2.ll
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100517/60615ebe/attachment.obj
From criswell at cs.uiuc.edu Mon May 17 12:07:27 2010
From: criswell at cs.uiuc.edu (John Criswell)
Date: Mon, 17 May 2010 12:07:27 -0500
Subject: [llvm-commits] CVS: llvm-www/safecode/downloads.html index.html
links.html mailing.html people.html pubs.html
Message-ID: <201005171707.o4HH7RO2024857@zion.cs.uiuc.edu>
Changes in directory llvm-www/safecode:
downloads.html updated: 1.4 -> 1.5
index.html updated: 1.28 -> 1.29
links.html updated: 1.4 -> 1.5
mailing.html updated: 1.2 -> 1.3
people.html updated: 1.4 -> 1.5
pubs.html updated: 1.5 -> 1.6
---
Log message:
Updated the copyright year to 2010.
---
Diffs of the changes: (+6 -6)
downloads.html | 2 +-
index.html | 2 +-
links.html | 2 +-
mailing.html | 2 +-
people.html | 2 +-
pubs.html | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
Index: llvm-www/safecode/downloads.html
diff -u llvm-www/safecode/downloads.html:1.4 llvm-www/safecode/downloads.html:1.5
--- llvm-www/safecode/downloads.html:1.4 Fri Apr 16 10:15:55 2010
+++ llvm-www/safecode/downloads.html Mon May 17 12:06:28 2010
@@ -79,7 +79,7 @@
+
+
+
+
From daniel at zuster.org Mon May 17 12:46:23 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Mon, 17 May 2010 17:46:23 -0000
Subject: [llvm-commits] [llvm] r103950 - in /llvm/trunk:
include/llvm/MC/MCSymbol.h lib/MC/MCParser/AsmParser.cpp
test/MC/AsmParser/assignment.s
Message-ID: <20100517174623.611DC312800A@llvm.org>
Author: ddunbar
Date: Mon May 17 12:46:23 2010
New Revision: 103950
URL: http://llvm.org/viewvc/llvm-project?rev=103950&view=rev
Log:
llvm-mc: Support reassignment of variables in one special case, when the
variable has not yet been used in an expression. This allows us to support a few
cases that show up in real code (mostly because gcc generates it for Objective-C
on Darwin), without giving up a reasonable semantic model for assignment.
Modified:
llvm/trunk/include/llvm/MC/MCSymbol.h
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/test/MC/AsmParser/assignment.s
Modified: llvm/trunk/include/llvm/MC/MCSymbol.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSymbol.h?rev=103950&r1=103949&r2=103950&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSymbol.h (original)
+++ llvm/trunk/include/llvm/MC/MCSymbol.h Mon May 17 12:46:23 2010
@@ -52,10 +52,15 @@
/// "Lfoo" or ".foo".
unsigned IsTemporary : 1;
+ /// IsUsedInExpr - True if this symbol has been used in an expression and
+ /// cannot be redefined.
+ unsigned IsUsedInExpr : 1;
+
private: // MCContext creates and uniques these.
friend class MCContext;
MCSymbol(StringRef name, bool isTemporary)
- : Name(name), Section(0), Value(0), IsTemporary(isTemporary) {}
+ : Name(name), Section(0), Value(0),
+ IsTemporary(isTemporary), IsUsedInExpr(false) {}
MCSymbol(const MCSymbol&); // DO NOT IMPLEMENT
void operator=(const MCSymbol&); // DO NOT IMPLEMENT
@@ -63,13 +68,15 @@
/// getName - Get the symbol name.
StringRef getName() const { return Name; }
- /// @name Symbol Type
+ /// @name Accessors
/// @{
/// isTemporary - Check if this is an assembler temporary symbol.
- bool isTemporary() const {
- return IsTemporary;
- }
+ bool isTemporary() const { return IsTemporary; }
+
+ /// isUsedInExpr - Check if this is an assembler temporary symbol.
+ bool isUsedInExpr() const { return IsUsedInExpr; }
+ void setUsedInExpr(bool Value) { IsUsedInExpr = Value; }
/// @}
/// @name Associated Sections
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=103950&r1=103949&r2=103950&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Mon May 17 12:46:23 2010
@@ -189,6 +189,9 @@
std::pair Split = getTok().getIdentifier().split('@');
MCSymbol *Sym = CreateSymbol(Split.first);
+ // Mark the symbol as used in an expression.
+ Sym->setUsedInExpr(true);
+
// Lookup the symbol variant if used.
MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
if (Split.first.size() != getTok().getIdentifier().size())
@@ -788,7 +791,9 @@
//
// FIXME: Diagnostics. Note the location of the definition as a label.
// FIXME: Diagnose assignment to protected identifier (e.g., register name).
- if (!Sym->isUndefined() && !Sym->isAbsolute())
+ if (Sym->isUndefined() && !Sym->isUsedInExpr())
+ ; // Allow redefinitions of undefined symbols only used in directives.
+ else if (!Sym->isUndefined() && !Sym->isAbsolute())
return Error(EqualLoc, "redefinition of '" + Name + "'");
else if (!Sym->isVariable())
return Error(EqualLoc, "invalid assignment to '" + Name + "'");
@@ -800,6 +805,8 @@
// FIXME: Handle '.'.
+ Sym->setUsedInExpr(true);
+
// Do the assignment.
Out.EmitAssignment(Sym, Value);
Modified: llvm/trunk/test/MC/AsmParser/assignment.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/assignment.s?rev=103950&r1=103949&r2=103950&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/assignment.s (original)
+++ llvm/trunk/test/MC/AsmParser/assignment.s Mon May 17 12:46:23 2010
@@ -2,6 +2,10 @@
# CHECK: TEST0:
# CHECK: a = 0
-TEST0:
+TEST0:
a = 0
-
+
+# CHECK: .globl _f1
+# CHECK: _f1 = 0
+ .globl _f1
+ _f1 = 0
From criswell at cs.uiuc.edu Mon May 17 13:25:34 2010
From: criswell at cs.uiuc.edu (John Criswell)
Date: Mon, 17 May 2010 13:25:34 -0500
Subject: [llvm-commits] CVS: llvm-www/safecode/sva.html
Message-ID: <201005171825.o4HIPYCD027465@zion.cs.uiuc.edu>
Changes in directory llvm-www/safecode:
sva.html updated: 1.1 -> 1.2
---
Log message:
Added text about how SVA uses SAFECode and a V-ISA.
---
Diffs of the changes: (+17 -2)
sva.html | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
Index: llvm-www/safecode/sva.html
diff -u llvm-www/safecode/sva.html:1.1 llvm-www/safecode/sva.html:1.2
--- llvm-www/safecode/sva.html:1.1 Mon May 17 12:25:51 2010
+++ llvm-www/safecode/sva.html Mon May 17 13:25:18 2010
@@ -60,8 +60,23 @@
software security and reliability problems, including intrusion
prevention, intrusion detection and analysis, OS component isolation,
full system recovery, application data confidentiality, secure
- application- and system-level information flow, and many others. The
- SVA research group is funded by grants from the National Science
+ application- and system-level information flow, and many others.
+
+
+
+ SVA currently uses techniques employed by the
+ SAFECode compiler
+ to provide strong memory safety guarantees to the Linux kernel. All
+ software in SVA is compiled down to a virtual instruction set; SVA
+ translates code from the virtual instruction set to the native
+ processor's instruction set transparently. SVA's virtual instruction
+ set is the LLVM IR enhanced with
+ additional instructions
+ to provide memory safety for low-level software/hardware interactions.
+
+
+
+ The SVA research group is funded by grants from the National Science
Foundation, Apple Computer, Inc., and the University of Illinois.
From wendling at apple.com Mon May 17 13:53:15 2010
From: wendling at apple.com (Bill Wendling)
Date: Mon, 17 May 2010 11:53:15 -0700
Subject: [llvm-commits] [llvm] r103940 -
/llvm/trunk/lib/CodeGen/RegAllocFast.cpp
In-Reply-To: <20100517153037.8A46F3128018@llvm.org>
References: <20100517153037.8A46F3128018@llvm.org>
Message-ID: <541CE162-1CBB-4BC7-A7D5-665F47875950@apple.com>
On May 17, 2010, at 8:30 AM, Jakob Stoklund Olesen wrote:
> Author: stoklund
> Date: Mon May 17 10:30:37 2010
> New Revision: 103940
>
> URL: http://llvm.org/viewvc/llvm-project?rev=103940&view=rev
> Log:
> Minor optimizations. DenseMap::begin() is surprisingly slow on an empty map.
>
Really?! Is there a good reason, or should that be fixed?
-bw
From stoklund at 2pi.dk Mon May 17 14:01:58 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Mon, 17 May 2010 12:01:58 -0700
Subject: [llvm-commits] [llvm] r103940 -
/llvm/trunk/lib/CodeGen/RegAllocFast.cpp
In-Reply-To: <541CE162-1CBB-4BC7-A7D5-665F47875950@apple.com>
References: <20100517153037.8A46F3128018@llvm.org>
<541CE162-1CBB-4BC7-A7D5-665F47875950@apple.com>
Message-ID:
On May 17, 2010, at 11:53 AM, Bill Wendling wrote:
> On May 17, 2010, at 8:30 AM, Jakob Stoklund Olesen wrote:
>
>> Author: stoklund
>> Date: Mon May 17 10:30:37 2010
>> New Revision: 103940
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=103940&view=rev
>> Log:
>> Minor optimizations. DenseMap::begin() is surprisingly slow on an empty map.
>>
> Really?! Is there a good reason, or should that be fixed?
The DenseMap typically holds 64 or more buckets. The iterator constructor skips the empty buckets which is all of them when the map is empty. The scan is really necessary when the map is not empty.
Changing begin() to return end() when empty() would avoid this issue:
inline iterator begin() {
return empty() ? end() : iterator(Buckets, Buckets+NumBuckets);
}
The fast allocator happens to be iterating over empty maps a lot, but it might be worth fixing in the general case too.
From criswell at cs.uiuc.edu Mon May 17 14:25:45 2010
From: criswell at cs.uiuc.edu (John Criswell)
Date: Mon, 17 May 2010 14:25:45 -0500
Subject: [llvm-commits] CVS: llvm-www/safecode/pubs.html
Message-ID: <201005171925.o4HJPjJe029272@zion.cs.uiuc.edu>
Changes in directory llvm-www/safecode:
pubs.html updated: 1.7 -> 1.8
---
Log message:
Added related publications per Vikram's request.
Changed color of notes indicating that papers won awards.
---
Diffs of the changes: (+72 -1)
pubs.html | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 72 insertions(+), 1 deletion(-)
Index: llvm-www/safecode/pubs.html
diff -u llvm-www/safecode/pubs.html:1.7 llvm-www/safecode/pubs.html:1.8
--- llvm-www/safecode/pubs.html:1.7 Mon May 17 12:19:19 2010
+++ llvm-www/safecode/pubs.html Mon May 17 14:25:29 2010
@@ -75,7 +75,9 @@
Proceedings of the Twenty First ACM Symposium on Operating Systems
Principles (SOSP '07) , Stevenson, WA, October 2007.
- Received an SOSP 2007 Audience Choice Award.
+
+ Received an SOSP 2007 Audience Choice Award.
+
@@ -182,6 +184,75 @@
+
+
+
+
+
Related Publications
+
+
+
+
+
+
+ Making Context-Sensitive Points-to Analysis with Heap Cloning
+ Practical For The Real World
+
+
+ Chris Lattner, Andrew Lenharth, and Vikram Adve.
+
+ Proceedings of the 2007 ACM SIGPLAN Conference on Programming
+ Language Design and Implementation (PLDI), June 2007.
+
+
+
+
+
+
+ Automatic Pool Allocation: Improving Performance by Controlling
+ Data Structure Layout in the Heap
+
+
+ Chris Lattner and Vikram Adve.
+
+ Proceedings of the 2005 ACM SIGPLAN Conference on Programming
+ Language Design and Implementation (PLDI), June 2005.
+
+
+ Received PLDI 2005 Best Paper Award.
+
+
+
+
+
+
+
+ LLVM: A Compilation Framework for Lifelong Program Analysis &
+ Transformation
+
+
+ Chris Lattner and Vikram Adve.
+
+ Proceedings of the 2004 International Symposium on Code Generation
+ and Optimization (CGO), March 2004.
+
+
+
+
+
+
+ LLVA: A Low-level Virtual Instruction Set Architecture
+
+
+ Vikram Adve, Chris Lattner, Michael Brukman, Anand Shukla, and
+ Brian Gaeke.
+
+ Proceedings of the 36th annual ACM/IEEE international symposium on
+ Microarchitecture (MICRO), December 2003.
+
+
+
+
From criswell at cs.uiuc.edu Mon May 17 14:42:54 2010
From: criswell at cs.uiuc.edu (John Criswell)
Date: Mon, 17 May 2010 14:42:54 -0500
Subject: [llvm-commits] CVS: llvm-www/safecode/pubs.html
Message-ID: <201005171942.o4HJgs6k029773@zion.cs.uiuc.edu>
Changes in directory llvm-www/safecode:
pubs.html updated: 1.8 -> 1.9
---
Log message:
Added Andrew's Recovery Domains paper.
---
Diffs of the changes: (+15 -0)
pubs.html | 15 +++++++++++++++
1 files changed, 15 insertions(+)
Index: llvm-www/safecode/pubs.html
diff -u llvm-www/safecode/pubs.html:1.8 llvm-www/safecode/pubs.html:1.9
--- llvm-www/safecode/pubs.html:1.8 Mon May 17 14:25:29 2010
+++ llvm-www/safecode/pubs.html Mon May 17 14:42:39 2010
@@ -65,6 +65,21 @@
+
+
+ Recovery Domains: An Organizing Principle for Recoverable Operating
+ Systems
+
+
+ Andrew Lenharth, Samuel T. King, and and Vikram Adve
+
+ Proceedings of the Fourteenth International Conference on
+Architectural Support for Programming Languages and Operating Systems (ASPLOS) ,
+ Washington, D.C., March 2009.
+
+
+
+
Secure Virtual Architecture: A Safe Execution Environment for Commodity
From clattner at apple.com Mon May 17 14:52:15 2010
From: clattner at apple.com (Chris Lattner)
Date: Mon, 17 May 2010 12:52:15 -0700
Subject: [llvm-commits] [llvm] r103940 -
/llvm/trunk/lib/CodeGen/RegAllocFast.cpp
In-Reply-To:
References: <20100517153037.8A46F3128018@llvm.org>
<541CE162-1CBB-4BC7-A7D5-665F47875950@apple.com>
Message-ID: <90911873-4625-4D9F-9B61-B51464503DDC@apple.com>
On May 17, 2010, at 12:01 PM, Jakob Stoklund Olesen wrote:
>
> On May 17, 2010, at 11:53 AM, Bill Wendling wrote:
>
>> On May 17, 2010, at 8:30 AM, Jakob Stoklund Olesen wrote:
>>
>>> Author: stoklund
>>> Date: Mon May 17 10:30:37 2010
>>> New Revision: 103940
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=103940&view=rev
>>> Log:
>>> Minor optimizations. DenseMap::begin() is surprisingly slow on an empty map.
>>>
>> Really?! Is there a good reason, or should that be fixed?
>
> The DenseMap typically holds 64 or more buckets. The iterator constructor skips the empty buckets which is all of them when the map is empty. The scan is really necessary when the map is not empty.
>
> Changing begin() to return end() when empty() would avoid this issue:
>
> inline iterator begin() {
> return empty() ? end() : iterator(Buckets, Buckets+NumBuckets);
> }
>
> The fast allocator happens to be iterating over empty maps a lot, but it might be worth fixing in the general case too.
I think this is a good idea, please do (with a comment). Please also add a comment to your regalloc saying why iterating in densemap order really is deterministic :)
-Chris
From evan.cheng at apple.com Mon May 17 14:51:20 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 17 May 2010 19:51:20 -0000
Subject: [llvm-commits] [llvm] r103960 - in /llvm/trunk:
lib/Target/ARM/ARMISelDAGToDAG.cpp test/CodeGen/ARM/reg_sequence.ll
Message-ID: <20100517195120.84748312800A@llvm.org>
Author: evancheng
Date: Mon May 17 14:51:20 2010
New Revision: 103960
URL: http://llvm.org/viewvc/llvm-project?rev=103960&view=rev
Log:
Turn on -neon-reg-sequence by default.
Using NEON load / store multiple instructions will no longer create gobs of vmov of D registers!
Added:
llvm/trunk/test/CodeGen/ARM/reg_sequence.ll
Modified:
llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=103960&r1=103959&r2=103960&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon May 17 14:51:20 2010
@@ -37,7 +37,8 @@
static cl::opt
UseRegSeq("neon-reg-sequence", cl::Hidden,
- cl::desc("Use reg_sequence to model ld / st of multiple neon regs"));
+ cl::desc("Use reg_sequence to model ld / st of multiple neon regs"),
+ cl::init(true));
//===--------------------------------------------------------------------===//
/// ARMDAGToDAGISel - ARM specific code to select ARM machine
Added: llvm/trunk/test/CodeGen/ARM/reg_sequence.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/reg_sequence.ll?rev=103960&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/reg_sequence.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/reg_sequence.ll Mon May 17 14:51:20 2010
@@ -0,0 +1,170 @@
+; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
+; Implementing vld / vst as REG_SEQUENCE eliminates the extra vmov's.
+
+%struct.int16x8_t = type { <8 x i16> }
+%struct.int32x4_t = type { <4 x i32> }
+%struct.__neon_int8x8x3_t = type { <8 x i8>, <8 x i8>, <8 x i8> }
+%struct.__neon_int16x8x2_t = type { <8 x i16>, <8 x i16> }
+%struct.__neon_int32x4x2_t = type { <4 x i32>, <4 x i32> }
+
+define arm_apcscc void @t1(i16* %i_ptr, i16* %o_ptr, %struct.int32x4_t* nocapture %vT0ptr, %struct.int32x4_t* nocapture %vT1ptr) nounwind {
+entry:
+; CHECK: t1:
+; CHECK: vld1.16
+; CHECK-NOT: vmov d
+; CHECK: vmovl.s16
+; CHECK: vshrn.i32
+; CHECK: vshrn.i32
+; CHECK-NOT: vmov d
+; CHECK-NEXT: vst1.16
+ %0 = getelementptr inbounds %struct.int32x4_t* %vT0ptr, i32 0, i32 0 ; <<4 x i32>*> [#uses=1]
+ %1 = load <4 x i32>* %0, align 16 ; <<4 x i32>> [#uses=1]
+ %2 = getelementptr inbounds %struct.int32x4_t* %vT1ptr, i32 0, i32 0 ; <<4 x i32>*> [#uses=1]
+ %3 = load <4 x i32>* %2, align 16 ; <<4 x i32>> [#uses=1]
+ %4 = bitcast i16* %i_ptr to i8* ; [#uses=1]
+ %5 = tail call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %4) ; <<8 x i16>> [#uses=1]
+ %6 = bitcast <8 x i16> %5 to <2 x double> ; <<2 x double>> [#uses=2]
+ %7 = extractelement <2 x double> %6, i32 0 ; [#uses=1]
+ %8 = bitcast double %7 to <4 x i16> ; <<4 x i16>> [#uses=1]
+ %9 = tail call <4 x i32> @llvm.arm.neon.vmovls.v4i32(<4 x i16> %8) ; <<4 x i32>> [#uses=1]
+ %10 = extractelement <2 x double> %6, i32 1 ; [#uses=1]
+ %11 = bitcast double %10 to <4 x i16> ; <<4 x i16>> [#uses=1]
+ %12 = tail call <4 x i32> @llvm.arm.neon.vmovls.v4i32(<4 x i16> %11) ; <<4 x i32>> [#uses=1]
+ %13 = mul <4 x i32> %1, %9 ; <<4 x i32>> [#uses=1]
+ %14 = mul <4 x i32> %3, %12 ; <<4 x i32>> [#uses=1]
+ %15 = tail call <4 x i16> @llvm.arm.neon.vshiftn.v4i16(<4 x i32> %13, <4 x i32> ) ; <<4 x i16>> [#uses=1]
+ %16 = tail call <4 x i16> @llvm.arm.neon.vshiftn.v4i16(<4 x i32> %14, <4 x i32> ) ; <<4 x i16>> [#uses=1]
+ %17 = shufflevector <4 x i16> %15, <4 x i16> %16, <8 x i32> ; <<8 x i16>> [#uses=1]
+ %18 = bitcast i16* %o_ptr to i8* ; [#uses=1]
+ tail call void @llvm.arm.neon.vst1.v8i16(i8* %18, <8 x i16> %17)
+ ret void
+}
+
+define arm_apcscc void @t2(i16* %i_ptr, i16* %o_ptr, %struct.int16x8_t* nocapture %vT0ptr, %struct.int16x8_t* nocapture %vT1ptr) nounwind {
+entry:
+; CHECK: t2:
+; CHECK: vld1.16
+; CHECK-NOT: vmov
+; CHECK: vmul.i16
+; CHECK: vld1.16
+; CHECK: vst1.16
+; CHECK-NOT: vmov
+; CHECK: vmul.i16
+; CHECK: vst1.16
+ %0 = getelementptr inbounds %struct.int16x8_t* %vT0ptr, i32 0, i32 0 ; <<8 x i16>*> [#uses=1]
+ %1 = load <8 x i16>* %0, align 16 ; <<8 x i16>> [#uses=1]
+ %2 = getelementptr inbounds %struct.int16x8_t* %vT1ptr, i32 0, i32 0 ; <<8 x i16>*> [#uses=1]
+ %3 = load <8 x i16>* %2, align 16 ; <<8 x i16>> [#uses=1]
+ %4 = bitcast i16* %i_ptr to i8* ; [#uses=1]
+ %5 = tail call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %4) ; <<8 x i16>> [#uses=1]
+ %6 = getelementptr inbounds i16* %i_ptr, i32 8 ; [#uses=1]
+ %7 = bitcast i16* %6 to i8* ; [#uses=1]
+ %8 = tail call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %7) ; <<8 x i16>> [#uses=1]
+ %9 = mul <8 x i16> %1, %5 ; <<8 x i16>> [#uses=1]
+ %10 = mul <8 x i16> %3, %8 ; <<8 x i16>> [#uses=1]
+ %11 = bitcast i16* %o_ptr to i8* ; [#uses=1]
+ tail call void @llvm.arm.neon.vst1.v8i16(i8* %11, <8 x i16> %9)
+ %12 = getelementptr inbounds i16* %o_ptr, i32 8 ; [#uses=1]
+ %13 = bitcast i16* %12 to i8* ; [#uses=1]
+ tail call void @llvm.arm.neon.vst1.v8i16(i8* %13, <8 x i16> %10)
+ ret void
+}
+
+define <8 x i8> @t3(i8* %A, i8* %B) nounwind {
+; CHECK: t3:
+; CHECK: vld3.8
+; CHECK: vmul.i8
+; CHECK-NOT: vmov
+; CHECK: vst3.8
+ %tmp1 = call %struct.__neon_int8x8x3_t @llvm.arm.neon.vld3.v8i8(i8* %A) ; <%struct.__neon_int8x8x3_t> [#uses=2]
+ %tmp2 = extractvalue %struct.__neon_int8x8x3_t %tmp1, 0 ; <<8 x i8>> [#uses=1]
+ %tmp3 = extractvalue %struct.__neon_int8x8x3_t %tmp1, 2 ; <<8 x i8>> [#uses=1]
+ %tmp4 = extractvalue %struct.__neon_int8x8x3_t %tmp1, 1 ; <<8 x i8>> [#uses=1]
+ %tmp5 = sub <8 x i8> %tmp3, %tmp4
+ %tmp6 = add <8 x i8> %tmp2, %tmp3 ; <<8 x i8>> [#uses=1]
+ %tmp7 = mul <8 x i8> %tmp4, %tmp2
+ tail call void @llvm.arm.neon.vst3.v8i8(i8* %B, <8 x i8> %tmp5, <8 x i8> %tmp6, <8 x i8> %tmp7)
+ ret <8 x i8> %tmp4
+}
+
+define arm_apcscc void @t4(i32* %in, i32* %out) nounwind {
+entry:
+; CHECK: t4:
+; CHECK: vld2.32
+; CHECK-NOT: vmov
+; CHECK: vld2.32
+; CHECK-NOT: vmov
+; CHECK: bne
+ %tmp1 = bitcast i32* %in to i8* ; [#uses=1]
+ %tmp2 = tail call %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2.v4i32(i8* %tmp1) ; <%struct.__neon_int32x4x2_t> [#uses=2]
+ %tmp3 = getelementptr inbounds i32* %in, i32 8 ; [#uses=1]
+ %tmp4 = bitcast i32* %tmp3 to i8* ; [#uses=1]
+ %tmp5 = tail call %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2.v4i32(i8* %tmp4) ; <%struct.__neon_int32x4x2_t> [#uses=2]
+ %tmp8 = bitcast i32* %out to i8* ; [#uses=1]
+ br i1 undef, label %return1, label %return2
+
+return1:
+; CHECK: %return1
+; CHECK-NOT: vmov
+; CHECK-NEXT: vadd.i32
+; CHECK-NEXT: vadd.i32
+; CHECK-NEXT: vst2.32
+ %tmp52 = extractvalue %struct.__neon_int32x4x2_t %tmp2, 0 ; <<4 x i32>> [#uses=1]
+ %tmp57 = extractvalue %struct.__neon_int32x4x2_t %tmp2, 1 ; <<4 x i32>> [#uses=1]
+ %tmp = extractvalue %struct.__neon_int32x4x2_t %tmp5, 0 ; <<4 x i32>> [#uses=1]
+ %tmp39 = extractvalue %struct.__neon_int32x4x2_t %tmp5, 1 ; <<4 x i32>> [#uses=1]
+ %tmp6 = add <4 x i32> %tmp52, %tmp ; <<4 x i32>> [#uses=1]
+ %tmp7 = add <4 x i32> %tmp57, %tmp39 ; <<4 x i32>> [#uses=1]
+ tail call void @llvm.arm.neon.vst2.v4i32(i8* %tmp8, <4 x i32> %tmp6, <4 x i32> %tmp7)
+ ret void
+
+return2:
+; CHECK: %return2
+; CHECK: vadd.i32
+; CHECK: vmov q1, q3
+; CHECK-NOT: vmov
+; CHECK: vst2.32 {d0, d1, d2, d3}
+ %tmp100 = extractvalue %struct.__neon_int32x4x2_t %tmp2, 0 ; <<4 x i32>> [#uses=1]
+ %tmp101 = extractvalue %struct.__neon_int32x4x2_t %tmp5, 1 ; <<4 x i32>> [#uses=1]
+ %tmp102 = add <4 x i32> %tmp100, %tmp101 ; <<4 x i32>> [#uses=1]
+ tail call void @llvm.arm.neon.vst2.v4i32(i8* %tmp8, <4 x i32> %tmp102, <4 x i32> %tmp101)
+ call void @llvm.trap()
+ unreachable
+}
+
+define <8 x i16> @t5(i16* %A, <8 x i16>* %B) nounwind {
+; CHECK: t5:
+; CHECK: vldmia
+; CHECK: vmov q1, q0
+; CHECK-NOT: vmov
+; CHECK: vld2.16 {d0[1], d2[1]}, [r0]
+; CHECK-NOT: vmov
+; CHECK: vadd.i16
+ %tmp0 = bitcast i16* %A to i8* ; [#uses=1]
+ %tmp1 = load <8 x i16>* %B ; <<8 x i16>> [#uses=2]
+ %tmp2 = call %struct.__neon_int16x8x2_t @llvm.arm.neon.vld2lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 1) ; <%struct.__neon_int16x8x2_t> [#uses=2]
+ %tmp3 = extractvalue %struct.__neon_int16x8x2_t %tmp2, 0 ; <<8 x i16>> [#uses=1]
+ %tmp4 = extractvalue %struct.__neon_int16x8x2_t %tmp2, 1 ; <<8 x i16>> [#uses=1]
+ %tmp5 = add <8 x i16> %tmp3, %tmp4 ; <<8 x i16>> [#uses=1]
+ ret <8 x i16> %tmp5
+}
+
+declare <8 x i16> @llvm.arm.neon.vld1.v8i16(i8*) nounwind readonly
+
+declare <4 x i32> @llvm.arm.neon.vmovls.v4i32(<4 x i16>) nounwind readnone
+
+declare <4 x i16> @llvm.arm.neon.vshiftn.v4i16(<4 x i32>, <4 x i32>) nounwind readnone
+
+declare void @llvm.arm.neon.vst1.v8i16(i8*, <8 x i16>) nounwind
+
+declare void @llvm.arm.neon.vst3.v8i8(i8*, <8 x i8>, <8 x i8>, <8 x i8>) nounwind
+
+declare %struct.__neon_int8x8x3_t @llvm.arm.neon.vld3.v8i8(i8*) nounwind readonly
+
+declare %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2.v4i32(i8*) nounwind readonly
+
+declare %struct.__neon_int16x8x2_t @llvm.arm.neon.vld2lane.v8i16(i8*, <8 x i16>, <8 x i16>, i32) nounwind readonly
+
+declare void @llvm.arm.neon.vst2.v4i32(i8*, <4 x i32>, <4 x i32>) nounwind
+
+declare void @llvm.trap() nounwind
From criswell at cs.uiuc.edu Mon May 17 14:53:36 2010
From: criswell at cs.uiuc.edu (John Criswell)
Date: Mon, 17 May 2010 14:53:36 -0500
Subject: [llvm-commits] CVS: llvm-www/safecode/index.html sva.html
Message-ID: <201005171953.o4HJrawd030173@zion.cs.uiuc.edu>
Changes in directory llvm-www/safecode:
index.html updated: 1.29 -> 1.30
sva.html updated: 1.2 -> 1.3
---
Log message:
Moved funding blurb to top page.
Added MURI to funding blurb.
---
Diffs of the changes: (+7 -5)
index.html | 7 +++++++
sva.html | 5 -----
2 files changed, 7 insertions(+), 5 deletions(-)
Index: llvm-www/safecode/index.html
diff -u llvm-www/safecode/index.html:1.29 llvm-www/safecode/index.html:1.30
--- llvm-www/safecode/index.html:1.29 Mon May 17 12:06:28 2010
+++ llvm-www/safecode/index.html Mon May 17 14:53:21 2010
@@ -84,6 +84,13 @@
+
+
+ The SAFECode and SVA research is funded by grants from the National
+ Science Foundation, the DoD Multi-disciplinary University Research
+ Initiative (MURI), Apple Computer, Inc., and the University of
+ Illinois.
+
Index: llvm-www/safecode/sva.html
diff -u llvm-www/safecode/sva.html:1.2 llvm-www/safecode/sva.html:1.3
--- llvm-www/safecode/sva.html:1.2 Mon May 17 13:25:18 2010
+++ llvm-www/safecode/sva.html Mon May 17 14:53:21 2010
@@ -74,11 +74,6 @@
additional instructions
to provide memory safety for low-level software/hardware interactions.
-
-
- The SVA research group is funded by grants from the National Science
- Foundation, Apple Computer, Inc., and the University of Illinois.
-
From stoklund at 2pi.dk Mon May 17 15:01:22 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Mon, 17 May 2010 20:01:22 -0000
Subject: [llvm-commits] [llvm] r103961 -
/llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Message-ID: <20100517200122.A1EC7312800A@llvm.org>
Author: stoklund
Date: Mon May 17 15:01:22 2010
New Revision: 103961
URL: http://llvm.org/viewvc/llvm-project?rev=103961&view=rev
Log:
Remove debug option. Add comment on spill order determinism.
Modified:
llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=103961&r1=103960&r2=103961&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Mon May 17 15:01:22 2010
@@ -35,9 +35,6 @@
#include
using namespace llvm;
-static cl::opt VerifyFastRegalloc("verify-fast-regalloc", cl::Hidden,
- cl::desc("Verify machine code before fast regalloc"));
-
STATISTIC(NumStores, "Number of stores added");
STATISTIC(NumLoads , "Number of loads added");
STATISTIC(NumCopies, "Number of copies coalesced");
@@ -269,8 +266,10 @@
void RAFast::spillAll(MachineInstr *MI) {
if (LiveVirtRegs.empty()) return;
isBulkSpilling = true;
- for (LiveRegMap::iterator i = LiveVirtRegs.begin(),
- e = LiveVirtRegs.end(); i != e; ++i)
+ // The LiveRegMap is keyed by an unsigned (the virtreg number), so the order
+ // of spilling here is deterministic, if arbitrary.
+ for (LiveRegMap::iterator i = LiveVirtRegs.begin(), e = LiveVirtRegs.end();
+ i != e; ++i)
spillVirtReg(MI, i);
LiveVirtRegs.clear();
isBulkSpilling = false;
@@ -796,8 +795,6 @@
DEBUG(dbgs() << "********** FAST REGISTER ALLOCATION **********\n"
<< "********** Function: "
<< ((Value*)Fn.getFunction())->getName() << '\n');
- if (VerifyFastRegalloc)
- Fn.verify(this, true);
MF = &Fn;
MRI = &MF->getRegInfo();
TM = &Fn.getTarget();
From stoklund at 2pi.dk Mon May 17 15:01:24 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Mon, 17 May 2010 20:01:24 -0000
Subject: [llvm-commits] [llvm] r103962 -
/llvm/trunk/include/llvm/ADT/DenseMap.h
Message-ID: <20100517200125.065083128018@llvm.org>
Author: stoklund
Date: Mon May 17 15:01:24 2010
New Revision: 103962
URL: http://llvm.org/viewvc/llvm-project?rev=103962&view=rev
Log:
Optimize empty DenseMap iteration.
Modified:
llvm/trunk/include/llvm/ADT/DenseMap.h
Modified: llvm/trunk/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=103962&r1=103961&r2=103962&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseMap.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseMap.h Mon May 17 15:01:24 2010
@@ -79,13 +79,14 @@
typedef DenseMapIterator const_iterator;
inline iterator begin() {
- return iterator(Buckets, Buckets+NumBuckets);
+ // When the map is empty, avoid the overhead of AdvancePastEmptyBuckets().
+ return empty() ? end() : iterator(Buckets, Buckets+NumBuckets);
}
inline iterator end() {
return iterator(Buckets+NumBuckets, Buckets+NumBuckets);
}
inline const_iterator begin() const {
- return const_iterator(Buckets, Buckets+NumBuckets);
+ return empty() ? end() : const_iterator(Buckets, Buckets+NumBuckets);
}
inline const_iterator end() const {
return const_iterator(Buckets+NumBuckets, Buckets+NumBuckets);
From daniel at zuster.org Mon May 17 15:12:31 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Mon, 17 May 2010 20:12:31 -0000
Subject: [llvm-commits] [llvm] r103964 - in /llvm/trunk:
lib/MC/MCMachOStreamer.cpp test/MC/MachO/symbol-flags.s
Message-ID: <20100517201231.748DB312800A@llvm.org>
Author: ddunbar
Date: Mon May 17 15:12:31 2010
New Revision: 103964
URL: http://llvm.org/viewvc/llvm-project?rev=103964&view=rev
Log:
MC/Mach-O: Fix some differences in symbol flag handling.
- Don't clear weak reference flag, 'as' was only "trying" to do this, it wasn't
actually succeeding.
- Clear the "lazy bound" bit when we mark something external. This corresponds
roughly to the lazy clearing of the bit that 'as' implements in
symbol_table_lookup.
- The exact meaning of these flags appears pretty loose, since 'as' isn't very
consistent. For now we just try to match 'as', we will clean this up one day
hopefully.
Modified:
llvm/trunk/lib/MC/MCMachOStreamer.cpp
llvm/trunk/test/MC/MachO/symbol-flags.s
Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=103964&r1=103963&r2=103964&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Mon May 17 15:12:31 2010
@@ -192,8 +192,14 @@
SD.setFragment(F);
SD.setOffset(F->getContents().size());
- // This causes the reference type and weak reference flags to be cleared.
- SD.setFlags(SD.getFlags() & ~(SF_WeakReference | SF_ReferenceTypeMask));
+ // This causes the reference type flag to be cleared. Darwin 'as' was "trying"
+ // to clear the weak reference and weak definition bits too, but the
+ // implementation was buggy. For now we just try to match 'as', for
+ // diffability.
+ //
+ // FIXME: Cleanup this code, these bits should be emitted based on semantic
+ // properties, not on the order of definition, etc.
+ SD.setFlags(SD.getFlags() & ~SF_ReferenceTypeMask);
Symbol->setSection(*CurSection);
}
@@ -257,6 +263,13 @@
case MCSA_Global:
SD.setExternal(true);
+ // This effectively clears the undefined lazy bit, in Darwin 'as', although
+ // it isn't very consistent because it implements this as part of symbol
+ // lookup.
+ //
+ // FIXME: Cleanup this code, these bits should be emitted based on semantic
+ // properties, not on the order of definition, etc.
+ SD.setFlags(SD.getFlags() & ~SF_ReferenceTypeUndefinedLazy);
break;
case MCSA_LazyReference:
Modified: llvm/trunk/test/MC/MachO/symbol-flags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/symbol-flags.s?rev=103964&r1=103963&r2=103964&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/symbol-flags.s (original)
+++ llvm/trunk/test/MC/MachO/symbol-flags.s Mon May 17 15:12:31 2010
@@ -5,6 +5,10 @@
sym_ref_def_A:
sym_ref_def_C:
.reference sym_ref_def_C
+ .reference sym_ref_def_D
+ .globl sym_ref_def_D
+ .globl sym_ref_def_E
+ .reference sym_ref_def_E
.weak_reference sym_weak_ref_A
.weak_reference sym_weak_ref_def_A
@@ -16,12 +20,22 @@
.globl sym_weak_def_A
.weak_definition sym_weak_def_A
sym_weak_def_A:
+sym_weak_def_B:
+ .weak_definition sym_weak_def_B
+ .globl sym_weak_def_B
+ .weak_definition sym_weak_def_C
+sym_weak_def_C:
+ .globl sym_weak_def_C
.lazy_reference sym_lazy_ref_A
.lazy_reference sym_lazy_ref_B
sym_lazy_ref_B:
sym_lazy_ref_C:
.lazy_reference sym_lazy_ref_C
+ .lazy_reference sym_lazy_ref_D
+ .globl sym_lazy_ref_D
+ .globl sym_lazy_ref_E
+ .lazy_reference sym_lazy_ref_E
.private_extern sym_private_ext_A
.private_extern sym_private_ext_B
@@ -30,6 +44,8 @@
.private_extern sym_private_ext_C
.private_extern sym_private_ext_D
.globl sym_private_ext_D
+ .globl sym_private_ext_E
+ .private_extern sym_private_ext_E
.no_dead_strip sym_no_dead_strip_A
@@ -39,7 +55,7 @@
.desc sym_desc_flags,0x47
sym_desc_flags:
-
+
// CHECK: ('cputype', 7)
// CHECK: ('cpusubtype', 3)
// CHECK: ('filetype', 1)
@@ -73,6 +89,8 @@
// CHECK: ('reserved1', 0)
// CHECK: ('reserved2', 0)
// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
// CHECK: # Section 1
// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
@@ -86,19 +104,21 @@
// CHECK: ('reserved1', 0)
// CHECK: ('reserved2', 0)
// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
// CHECK: ])
// CHECK: ),
// CHECK: # Load Command 1
// CHECK: (('command', 2)
// CHECK: ('size', 24)
// CHECK: ('symoff', 324)
-// CHECK: ('nsyms', 16)
-// CHECK: ('stroff', 516)
-// CHECK: ('strsize', 260)
-// CHECK: ('_string_data', '\x00sym_ref_A\x00sym_weak_ref_A\x00sym_weak_def_A\x00sym_lazy_ref_A\x00sym_private_ext_A\x00sym_private_ext_B\x00sym_private_ext_C\x00sym_private_ext_D\x00sym_no_dead_strip_A\x00sym_ref_def_A\x00sym_ref_def_C\x00sym_weak_ref_def_A\x00sym_weak_ref_def_B\x00sym_lazy_ref_B\x00sym_lazy_ref_C\x00sym_desc_flags\x00\x00')
+// CHECK: ('nsyms', 23)
+// CHECK: ('stroff', 600)
+// CHECK: ('strsize', 368)
+// CHECK: ('_string_data', '\x00sym_ref_A\x00sym_ref_def_D\x00sym_ref_def_E\x00sym_weak_ref_A\x00sym_weak_def_A\x00sym_weak_def_B\x00sym_weak_def_C\x00sym_lazy_ref_A\x00sym_lazy_ref_D\x00sym_lazy_ref_E\x00sym_private_ext_A\x00sym_private_ext_B\x00sym_private_ext_C\x00sym_private_ext_D\x00sym_private_ext_E\x00sym_no_dead_strip_A\x00sym_ref_def_A\x00sym_ref_def_C\x00sym_weak_ref_def_A\x00sym_weak_ref_def_B\x00sym_lazy_ref_B\x00sym_lazy_ref_C\x00sym_desc_flags\x00\x00\x00\x00')
// CHECK: ('_symbols', [
// CHECK: # Symbol 0
-// CHECK: (('n_strx', 148)
+// CHECK: (('n_strx', 254)
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 1)
// CHECK: ('n_desc', 32)
@@ -106,7 +126,7 @@
// CHECK: ('_string', 'sym_ref_def_A')
// CHECK: ),
// CHECK: # Symbol 1
-// CHECK: (('n_strx', 162)
+// CHECK: (('n_strx', 268)
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 1)
// CHECK: ('n_desc', 32)
@@ -114,15 +134,15 @@
// CHECK: ('_string', 'sym_ref_def_C')
// CHECK: ),
// CHECK: # Symbol 2
-// CHECK: (('n_strx', 176)
+// CHECK: (('n_strx', 282)
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 1)
-// CHECK: ('n_desc', 0)
+// CHECK: ('n_desc', 64)
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_weak_ref_def_A')
// CHECK: ),
// CHECK: # Symbol 3
-// CHECK: (('n_strx', 195)
+// CHECK: (('n_strx', 301)
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 1)
// CHECK: ('n_desc', 0)
@@ -130,7 +150,7 @@
// CHECK: ('_string', 'sym_weak_ref_def_B')
// CHECK: ),
// CHECK: # Symbol 4
-// CHECK: (('n_strx', 214)
+// CHECK: (('n_strx', 320)
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 32)
@@ -138,7 +158,7 @@
// CHECK: ('_string', 'sym_lazy_ref_B')
// CHECK: ),
// CHECK: # Symbol 5
-// CHECK: (('n_strx', 229)
+// CHECK: (('n_strx', 335)
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 32)
@@ -146,15 +166,15 @@
// CHECK: ('_string', 'sym_lazy_ref_C')
// CHECK: ),
// CHECK: # Symbol 6
-// CHECK: (('n_strx', 244)
+// CHECK: (('n_strx', 350)
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 2)
-// CHECK: ('n_desc', 0)
+// CHECK: ('n_desc', 64)
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_desc_flags')
// CHECK: ),
// CHECK: # Symbol 7
-// CHECK: (('n_strx', 74)
+// CHECK: (('n_strx', 162)
// CHECK: ('n_type', 0x1f)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 0)
@@ -162,7 +182,7 @@
// CHECK: ('_string', 'sym_private_ext_B')
// CHECK: ),
// CHECK: # Symbol 8
-// CHECK: (('n_strx', 92)
+// CHECK: (('n_strx', 180)
// CHECK: ('n_type', 0x1f)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 0)
@@ -170,7 +190,7 @@
// CHECK: ('_string', 'sym_private_ext_C')
// CHECK: ),
// CHECK: # Symbol 9
-// CHECK: (('n_strx', 26)
+// CHECK: (('n_strx', 54)
// CHECK: ('n_type', 0xf)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 128)
@@ -178,38 +198,78 @@
// CHECK: ('_string', 'sym_weak_def_A')
// CHECK: ),
// CHECK: # Symbol 10
-// CHECK: (('n_strx', 41)
+// CHECK: (('n_strx', 69)
+// CHECK: ('n_type', 0xf)
+// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 128)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', 'sym_weak_def_B')
+// CHECK: ),
+// CHECK: # Symbol 11
+// CHECK: (('n_strx', 84)
+// CHECK: ('n_type', 0xf)
+// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 128)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', 'sym_weak_def_C')
+// CHECK: ),
+// CHECK: # Symbol 12
+// CHECK: (('n_strx', 99)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
// CHECK: ('n_desc', 33)
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_lazy_ref_A')
// CHECK: ),
-// CHECK: # Symbol 11
-// CHECK: (('n_strx', 128)
+// CHECK: # Symbol 13
+// CHECK: (('n_strx', 114)
+// CHECK: ('n_type', 0x1)
+// CHECK: ('n_sect', 0)
+// CHECK: ('n_desc', 32)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', 'sym_lazy_ref_D')
+// CHECK: ),
+// CHECK: # Symbol 14
+// CHECK: (('n_strx', 129)
+// CHECK: ('n_type', 0x1)
+// CHECK: ('n_sect', 0)
+// CHECK: ('n_desc', 33)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', 'sym_lazy_ref_E')
+// CHECK: ),
+// CHECK: # Symbol 15
+// CHECK: (('n_strx', 234)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
// CHECK: ('n_desc', 32)
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_no_dead_strip_A')
// CHECK: ),
-// CHECK: # Symbol 12
-// CHECK: (('n_strx', 56)
+// CHECK: # Symbol 16
+// CHECK: (('n_strx', 144)
// CHECK: ('n_type', 0x11)
// CHECK: ('n_sect', 0)
// CHECK: ('n_desc', 0)
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_private_ext_A')
// CHECK: ),
-// CHECK: # Symbol 13
-// CHECK: (('n_strx', 110)
+// CHECK: # Symbol 17
+// CHECK: (('n_strx', 198)
// CHECK: ('n_type', 0x11)
// CHECK: ('n_sect', 0)
// CHECK: ('n_desc', 0)
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_private_ext_D')
// CHECK: ),
-// CHECK: # Symbol 14
+// CHECK: # Symbol 18
+// CHECK: (('n_strx', 216)
+// CHECK: ('n_type', 0x11)
+// CHECK: ('n_sect', 0)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', 'sym_private_ext_E')
+// CHECK: ),
+// CHECK: # Symbol 19
// CHECK: (('n_strx', 1)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
@@ -217,10 +277,26 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_ref_A')
// CHECK: ),
-// CHECK: # Symbol 15
+// CHECK: # Symbol 20
// CHECK: (('n_strx', 11)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
+// CHECK: ('n_desc', 32)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', 'sym_ref_def_D')
+// CHECK: ),
+// CHECK: # Symbol 21
+// CHECK: (('n_strx', 25)
+// CHECK: ('n_type', 0x1)
+// CHECK: ('n_sect', 0)
+// CHECK: ('n_desc', 32)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', 'sym_ref_def_E')
+// CHECK: ),
+// CHECK: # Symbol 22
+// CHECK: (('n_strx', 39)
+// CHECK: ('n_type', 0x1)
+// CHECK: ('n_sect', 0)
// CHECK: ('n_desc', 64)
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_weak_ref_A')
@@ -233,9 +309,9 @@
// CHECK: ('ilocalsym', 0)
// CHECK: ('nlocalsym', 7)
// CHECK: ('iextdefsym', 7)
-// CHECK: ('nextdefsym', 3)
-// CHECK: ('iundefsym', 10)
-// CHECK: ('nundefsym', 6)
+// CHECK: ('nextdefsym', 5)
+// CHECK: ('iundefsym', 12)
+// CHECK: ('nundefsym', 11)
// CHECK: ('tocoff', 0)
// CHECK: ('ntoc', 0)
// CHECK: ('modtaboff', 0)
From baldrick at free.fr Mon May 17 15:20:47 2010
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 17 May 2010 20:20:47 -0000
Subject: [llvm-commits] [dragonegg] r103967 - /dragonegg/trunk/llvm-types.cpp
Message-ID: <20100517202047.2AC35312800A@llvm.org>
Author: baldrick
Date: Mon May 17 15:20:46 2010
New Revision: 103967
URL: http://llvm.org/viewvc/llvm-project?rev=103967&view=rev
Log:
Port commit 100721 (stoklund) from llvm-gcc:
Create larger struct fields for consecutive bitfields. (Again).
When creating an LLVM struct type for a struct with bitfields, try to allocate
integer fields that are as large as possible, taking the following bitfields
into account.
For example, this struct:
struct S {
int a, b;
void *c;
unsigned d : 8;
unsigned e : 8;
};
used to be:
%struct.S = type { i32, i32, i8*, i8, i8 },
but now it becomes:
%struct.S = type { i32, i32, i8*, i16 }
This makes it easier for the code generator to shuffle register sized bitfield
groups around in fewer registers. It also means that it is harder for SROA to
isolate bit fields as scalars.
The larger struct fields are only produced when they would be properly aligned
and smaller than the natural machine word size.
This strategy is similar to what clang will be doing. We will see how it works
out.
Modified:
dragonegg/trunk/llvm-types.cpp
Modified: dragonegg/trunk/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-types.cpp?rev=103967&r1=103966&r2=103967&view=diff
==============================================================================
--- dragonegg/trunk/llvm-types.cpp (original)
+++ dragonegg/trunk/llvm-types.cpp Mon May 17 15:20:46 2010
@@ -1507,7 +1507,8 @@
return getFieldEndOffsetInBytes(ElementOffsetInBytes.size()-1);
}
- void addNewBitField(uint64_t Size, uint64_t FirstUnallocatedByte);
+ void addNewBitField(uint64_t Size, uint64_t Extra,
+ uint64_t FirstUnallocatedByte);
void dump() const;
};
@@ -1515,22 +1516,43 @@
// Add new element which is a bit field. Size is not the size of bit field,
// but size of bits required to determine type of new Field which will be
// used to access this bit field.
-void StructTypeConversionInfo::addNewBitField(uint64_t Size,
+// If possible, allocate a field with room for Size+Extra bits.
+void StructTypeConversionInfo::addNewBitField(uint64_t Size, uint64_t Extra,
uint64_t FirstUnallocatedByte) {
// Figure out the LLVM type that we will use for the new field.
// Note, Size is not necessarily size of the new field. It indicates
// additional bits required after FirstunallocatedByte to cover new field.
- const Type *NewFieldTy;
- if (Size <= 8)
- NewFieldTy = Type::getInt8Ty(Context);
- else if (Size <= 16)
- NewFieldTy = Type::getInt16Ty(Context);
- else if (Size <= 32)
- NewFieldTy = Type::getInt32Ty(Context);
- else {
- assert(Size <= 64 && "Bitfield too large!");
- NewFieldTy = Type::getInt64Ty(Context);
+ const Type *NewFieldTy = 0;
+
+ // First try an ABI-aligned field including (some of) the Extra bits.
+ // This field must satisfy Size <= w && w <= XSize.
+ uint64_t XSize = Size + Extra;
+ for (unsigned w = NextPowerOf2(std::min(UINT64_C(64), XSize))/2;
+ w >= Size && w >= 8; w /= 2) {
+ if (TD.isIllegalInteger(w))
+ continue;
+ // Would a w-sized integer field be aligned here?
+ const unsigned a = TD.getABIIntegerTypeAlignment(w);
+ if (FirstUnallocatedByte & (a-1) || a > getGCCStructAlignmentInBytes())
+ continue;
+ // OK, use w-sized integer.
+ NewFieldTy = IntegerType::get(Context, w);
+ break;
+ }
+
+ // Try an integer field that holds Size bits.
+ if (!NewFieldTy) {
+ if (Size <= 8)
+ NewFieldTy = Type::getInt8Ty(Context);
+ else if (Size <= 16)
+ NewFieldTy = Type::getInt16Ty(Context);
+ else if (Size <= 32)
+ NewFieldTy = Type::getInt32Ty(Context);
+ else {
+ assert(Size <= 64 && "Bitfield too large!");
+ NewFieldTy = Type::getInt64Ty(Context);
+ }
}
// Check that the alignment of NewFieldTy won't cause a gap in the structure!
@@ -1707,7 +1729,34 @@
// LLVM struct such that there are no holes in the struct where the bitfield
// is: these holes would make it impossible to statically initialize a global
// of this type that has an initializer for the bitfield.
-
+
+ // We want the integer-typed fields as large as possible up to the machine
+ // word size. If there are more bitfields following this one, try to include
+ // them in the same field.
+
+ // Calculate the total number of bits in the continuous group of bitfields
+ // following this one. This is the number of bits that addNewBitField should
+ // try to include.
+ unsigned ExtraSizeInBits = 0;
+ tree LastBitField = 0;
+ for (tree f = TREE_CHAIN(Field); f; f = TREE_CHAIN(f)) {
+ if (TREE_CODE(f) != FIELD_DECL ||
+ TREE_CODE(DECL_FIELD_OFFSET(f)) != INTEGER_CST)
+ break;
+ if (isBitfield(f))
+ LastBitField = f;
+ else {
+ // We can use all this bits up to the next non-bitfield.
+ LastBitField = 0;
+ ExtraSizeInBits = getFieldOffsetInBits(f) - EndBitOffset;
+ break;
+ }
+ }
+ // Record ended in a bitfield? Use all of the last byte.
+ if (LastBitField)
+ ExtraSizeInBits = RoundUpToAlignment(getFieldOffsetInBits(LastBitField) +
+ TREE_INT_CST_LOW(DECL_SIZE(LastBitField)), 8) - EndBitOffset;
+
// Compute the number of bits that we need to add to this struct to cover
// this field.
uint64_t FirstUnallocatedByte = Info.getEndUnallocatedByte();
@@ -1721,7 +1770,7 @@
// This field starts at byte boundry. Need to allocate space
// for additional bytes not yet allocated.
unsigned NumBitsToAdd = FieldSizeInBits - AvailableBits;
- Info.addNewBitField(NumBitsToAdd, FirstUnallocatedByte);
+ Info.addNewBitField(NumBitsToAdd, ExtraSizeInBits, FirstUnallocatedByte);
return;
}
@@ -1745,7 +1794,7 @@
for (unsigned idx = 0; idx < (prevFieldTypeSizeInBits/8); ++idx)
FirstUnallocatedByte--;
}
- Info.addNewBitField(NumBitsRequired, FirstUnallocatedByte);
+ Info.addNewBitField(NumBitsRequired, ExtraSizeInBits, FirstUnallocatedByte);
// Do this after adding Field.
Info.lastFieldStartsAtNonByteBoundry(true);
return;
@@ -1779,7 +1828,7 @@
}
// Now, Field starts at FirstUnallocatedByte and everything is aligned.
- Info.addNewBitField(FieldSizeInBits, FirstUnallocatedByte);
+ Info.addNewBitField(FieldSizeInBits, ExtraSizeInBits, FirstUnallocatedByte);
}
/// UnionHasOnlyZeroOffsets - Check if a union type has only members with
@@ -1857,7 +1906,7 @@
if (isBitfield(UnionField)) {
unsigned FieldSizeInBits = TREE_INT_CST_LOW(DECL_SIZE(UnionField));
- Info.addNewBitField(FieldSizeInBits, 0);
+ Info.addNewBitField(FieldSizeInBits, 0, 0);
} else {
Info.allFieldsAreNotBitFields();
Info.addElement(UnionTy, 0, Info.getTypeSize(UnionTy));
From bob.wilson at apple.com Mon May 17 15:31:13 2010
From: bob.wilson at apple.com (Bob Wilson)
Date: Mon, 17 May 2010 20:31:13 -0000
Subject: [llvm-commits] [llvm] r103969 -
/llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
Message-ID: <20100517203113.9BBEE312800A@llvm.org>
Author: bwilson
Date: Mon May 17 15:31:13 2010
New Revision: 103969
URL: http://llvm.org/viewvc/llvm-project?rev=103969&view=rev
Log:
Fix a regression in 464.h264 for thumb1 and thumb2 nightly tests.
Obvious in retrospect but not fun to debug.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb.td?rev=103969&r1=103968&r2=103969&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Mon May 17 15:31:13 2010
@@ -423,7 +423,7 @@
// binutils
let isBarrier = 1, isTerminator = 1 in
def tTRAP : TI<(outs), (ins), IIC_Br,
- ".word 0xdefe ${:comment} trap", [(trap)]>, Encoding16 {
+ ".short 0xdefe ${:comment} trap", [(trap)]>, Encoding16 {
let Inst{15-12} = 0b1101;
let Inst{11-8} = 0b1110;
}
From evan.cheng at apple.com Mon May 17 15:57:12 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 17 May 2010 20:57:12 -0000
Subject: [llvm-commits] [llvm] r103971 - in /llvm/trunk:
lib/CodeGen/TwoAddressInstructionPass.cpp test/CodeGen/ARM/reg_sequence.ll
Message-ID: <20100517205713.0846F312800A@llvm.org>
Author: evancheng
Date: Mon May 17 15:57:12 2010
New Revision: 103971
URL: http://llvm.org/viewvc/llvm-project?rev=103971&view=rev
Log:
Careful with reg_sequence coalescing to not to overwrite sub-register indices.
Modified:
llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
llvm/trunk/test/CodeGen/ARM/reg_sequence.ll
Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=103971&r1=103970&r2=103971&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon May 17 15:57:12 2010
@@ -128,6 +128,8 @@
void ProcessCopy(MachineInstr *MI, MachineBasicBlock *MBB,
SmallPtrSet &Processed);
+ void CoalesceExtSubRegs(SmallVector &Srcs, unsigned DstReg);
+
/// EliminateRegSequences - Eliminate REG_SEQUENCE instructions as part
/// of the de-ssa process. This replaces sources of REG_SEQUENCE as
/// sub-register references of the register defined by REG_SEQUENCE.
@@ -1132,7 +1134,7 @@
}
static void UpdateRegSequenceSrcs(unsigned SrcReg,
- unsigned DstReg, unsigned SrcIdx,
+ unsigned DstReg, unsigned SubIdx,
MachineRegisterInfo *MRI) {
for (MachineRegisterInfo::reg_iterator RI = MRI->reg_begin(SrcReg),
RE = MRI->reg_end(); RI != RE; ) {
@@ -1140,7 +1142,77 @@
++RI;
MO.setReg(DstReg);
assert(MO.getSubReg() == 0);
- MO.setSubReg(SrcIdx);
+ MO.setSubReg(SubIdx);
+ }
+}
+
+/// CoalesceExtSubRegs - If a number of sources of the REG_SEQUENCE are
+/// EXTRACT_SUBREG from the same register and to the same virtual register
+/// with different sub-register indices, attempt to combine the
+/// EXTRACT_SUBREGs and pre-coalesce them. e.g.
+/// %reg1026 = VLDMQ %reg1025, 260, pred:14, pred:%reg0
+/// %reg1029:6 = EXTRACT_SUBREG %reg1026, 6
+/// %reg1029:5 = EXTRACT_SUBREG %reg1026, 5
+/// Since D subregs 5, 6 can combine to a Q register, we can coalesce
+/// reg1026 to reg1029.
+void
+TwoAddressInstructionPass::CoalesceExtSubRegs(SmallVector &Srcs,
+ unsigned DstReg) {
+ SmallSet Seen;
+ for (unsigned i = 0, e = Srcs.size(); i != e; ++i) {
+ unsigned SrcReg = Srcs[i];
+ if (!Seen.insert(SrcReg))
+ continue;
+
+ // If there are no other uses than extract_subreg which feed into
+ // the reg_sequence, then we might be able to coalesce them.
+ bool CanCoalesce = true;
+ SmallVector SubIndices;
+ for (MachineRegisterInfo::use_nodbg_iterator
+ UI = MRI->use_nodbg_begin(SrcReg),
+ UE = MRI->use_nodbg_end(); UI != UE; ++UI) {
+ MachineInstr *UseMI = &*UI;
+ if (!UseMI->isExtractSubreg() ||
+ UseMI->getOperand(0).getReg() != DstReg) {
+ CanCoalesce = false;
+ break;
+ }
+ SubIndices.push_back(UseMI->getOperand(2).getImm());
+ }
+
+ if (!CanCoalesce || SubIndices.size() < 2)
+ continue;
+
+ std::sort(SubIndices.begin(), SubIndices.end());
+ unsigned NewSubIdx = 0;
+ if (TRI->canCombinedSubRegIndex(MRI->getRegClass(SrcReg), SubIndices,
+ NewSubIdx)) {
+ bool Proceed = true;
+ if (NewSubIdx)
+ for (MachineRegisterInfo::reg_iterator RI = MRI->reg_begin(SrcReg),
+ RE = MRI->reg_end(); RI != RE; ) {
+ MachineOperand &MO = RI.getOperand();
+ ++RI;
+ // FIXME: If the sub-registers do not combine to the whole
+ // super-register, i.e. NewSubIdx != 0, and any of the use has a
+ // sub-register index, then abort the coalescing attempt.
+ if (MO.getSubReg()) {
+ Proceed = false;
+ break;
+ }
+ MO.setReg(DstReg);
+ MO.setSubReg(NewSubIdx);
+ }
+ if (Proceed)
+ for (MachineRegisterInfo::reg_iterator RI = MRI->reg_begin(SrcReg),
+ RE = MRI->reg_end(); RI != RE; ) {
+ MachineOperand &MO = RI.getOperand();
+ ++RI;
+ MO.setReg(DstReg);
+ if (NewSubIdx)
+ MO.setSubReg(NewSubIdx);
+ }
+ }
}
}
@@ -1221,50 +1293,15 @@
for (unsigned i = 1, e = MI->getNumOperands(); i < e; i += 2) {
unsigned SrcReg = MI->getOperand(i).getReg();
- unsigned SrcIdx = MI->getOperand(i+1).getImm();
- UpdateRegSequenceSrcs(SrcReg, DstReg, SrcIdx, MRI);
+ unsigned SubIdx = MI->getOperand(i+1).getImm();
+ UpdateRegSequenceSrcs(SrcReg, DstReg, SubIdx, MRI);
}
DEBUG(dbgs() << "Eliminated: " << *MI);
MI->eraseFromParent();
// Try coalescing some EXTRACT_SUBREG instructions.
- Seen.clear();
- for (unsigned i = 0, e = RealSrcs.size(); i != e; ++i) {
- unsigned SrcReg = RealSrcs[i];
- if (!Seen.insert(SrcReg))
- continue;
-
- // If there are no other uses than extract_subreg which feed into
- // the reg_sequence, then we might be able to coalesce them.
- bool CanCoalesce = true;
- SmallVector SubIndices;
- for (MachineRegisterInfo::use_nodbg_iterator
- UI = MRI->use_nodbg_begin(SrcReg),
- UE = MRI->use_nodbg_end(); UI != UE; ++UI) {
- MachineInstr *UseMI = &*UI;
- if (!UseMI->isExtractSubreg() ||
- UseMI->getOperand(0).getReg() != DstReg) {
- CanCoalesce = false;
- break;
- }
- SubIndices.push_back(UseMI->getOperand(2).getImm());
- }
-
- if (!CanCoalesce)
- continue;
-
- // %reg1026 = VLDMQ %reg1025, 260, pred:14, pred:%reg0
- // %reg1029:6 = EXTRACT_SUBREG %reg1026, 6
- // %reg1029:5 = EXTRACT_SUBREG %reg1026, 5
- // Since D subregs 5, 6 can combine to a Q register, we can coalesce
- // reg1026 to reg1029.
- std::sort(SubIndices.begin(), SubIndices.end());
- unsigned NewSubIdx = 0;
- if (TRI->canCombinedSubRegIndex(MRI->getRegClass(SrcReg), SubIndices,
- NewSubIdx))
- UpdateRegSequenceSrcs(SrcReg, DstReg, NewSubIdx, MRI);
- }
+ CoalesceExtSubRegs(RealSrcs, DstReg);
}
RegSequences.clear();
Modified: llvm/trunk/test/CodeGen/ARM/reg_sequence.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/reg_sequence.ll?rev=103971&r1=103970&r2=103971&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/reg_sequence.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/reg_sequence.ll Mon May 17 15:57:12 2010
@@ -3,6 +3,7 @@
%struct.int16x8_t = type { <8 x i16> }
%struct.int32x4_t = type { <4 x i32> }
+%struct.__neon_int8x8x2_t = type { <8 x i8>, <8 x i8> }
%struct.__neon_int8x8x3_t = type { <8 x i8>, <8 x i8>, <8 x i8> }
%struct.__neon_int16x8x2_t = type { <8 x i16>, <8 x i16> }
%struct.__neon_int32x4x2_t = type { <4 x i32>, <4 x i32> }
@@ -149,12 +150,51 @@
ret <8 x i16> %tmp5
}
+define <8 x i8> @t6(i8* %A, <8 x i8>* %B) nounwind {
+; CHECK: t6:
+; CHECK: vldr.64
+; CHECK: vmov d1, d0
+; CHECK-NEXT: vld2.8 {d0[1], d1[1]}
+ %tmp1 = load <8 x i8>* %B ; <<8 x i8>> [#uses=2]
+ %tmp2 = call %struct.__neon_int8x8x2_t @llvm.arm.neon.vld2lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1) ; <%struct.__neon_int8x8x2_t> [#uses=2]
+ %tmp3 = extractvalue %struct.__neon_int8x8x2_t %tmp2, 0 ; <<8 x i8>> [#uses=1]
+ %tmp4 = extractvalue %struct.__neon_int8x8x2_t %tmp2, 1 ; <<8 x i8>> [#uses=1]
+ %tmp5 = add <8 x i8> %tmp3, %tmp4 ; <<8 x i8>> [#uses=1]
+ ret <8 x i8> %tmp5
+}
+
+define arm_apcscc void @t7(i32* %iptr, i32* %optr) nounwind {
+entry:
+; CHECK: t7:
+; CHECK: vld2.32
+; CHECK: vst2.32
+; CHECK: vld1.32 {d0, d1},
+; CHECK: vmov q1, q0
+; CHECK-NOT: vmov
+; CHECK: vuzp.32 q0, q1
+; CHECK: vst1.32
+ %0 = bitcast i32* %iptr to i8* ; [#uses=2]
+ %1 = tail call %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2.v4i32(i8* %0) ; <%struct.__neon_int32x4x2_t> [#uses=2]
+ %tmp57 = extractvalue %struct.__neon_int32x4x2_t %1, 0 ; <<4 x i32>> [#uses=1]
+ %tmp60 = extractvalue %struct.__neon_int32x4x2_t %1, 1 ; <<4 x i32>> [#uses=1]
+ %2 = bitcast i32* %optr to i8* ; [#uses=2]
+ tail call void @llvm.arm.neon.vst2.v4i32(i8* %2, <4 x i32> %tmp57, <4 x i32> %tmp60)
+ %3 = tail call <4 x i32> @llvm.arm.neon.vld1.v4i32(i8* %0) ; <<4 x i32>> [#uses=1]
+ %4 = shufflevector <4 x i32> %3, <4 x i32> undef, <4 x i32> ; <<4 x i32>> [#uses=1]
+ tail call void @llvm.arm.neon.vst1.v4i32(i8* %2, <4 x i32> %4)
+ ret void
+}
+
+declare <4 x i32> @llvm.arm.neon.vld1.v4i32(i8*) nounwind readonly
+
declare <8 x i16> @llvm.arm.neon.vld1.v8i16(i8*) nounwind readonly
declare <4 x i32> @llvm.arm.neon.vmovls.v4i32(<4 x i16>) nounwind readnone
declare <4 x i16> @llvm.arm.neon.vshiftn.v4i16(<4 x i32>, <4 x i32>) nounwind readnone
+declare void @llvm.arm.neon.vst1.v4i32(i8*, <4 x i32>) nounwind
+
declare void @llvm.arm.neon.vst1.v8i16(i8*, <8 x i16>) nounwind
declare void @llvm.arm.neon.vst3.v8i8(i8*, <8 x i8>, <8 x i8>, <8 x i8>) nounwind
@@ -163,6 +203,8 @@
declare %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2.v4i32(i8*) nounwind readonly
+declare %struct.__neon_int8x8x2_t @llvm.arm.neon.vld2lane.v8i8(i8*, <8 x i8>, <8 x i8>, i32) nounwind readonly
+
declare %struct.__neon_int16x8x2_t @llvm.arm.neon.vld2lane.v8i16(i8*, <8 x i16>, <8 x i16>, i32) nounwind readonly
declare void @llvm.arm.neon.vst2.v4i32(i8*, <4 x i32>, <4 x i32>) nounwind
From echristo at apple.com Mon May 17 16:02:07 2010
From: echristo at apple.com (Eric Christopher)
Date: Mon, 17 May 2010 21:02:07 -0000
Subject: [llvm-commits] [llvm] r103974 - in /llvm/trunk:
include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
include/llvm/MC/MCSectionMachO.h
lib/CodeGen/TargetLoweringObjectFileImpl.cpp lib/MC/MCSectionMachO.cpp
lib/Target/X86/X86AsmBackend.cpp
Message-ID: <20100517210208.018D2312800A@llvm.org>
Author: echristo
Date: Mon May 17 16:02:07 2010
New Revision: 103974
URL: http://llvm.org/viewvc/llvm-project?rev=103974&view=rev
Log:
Add some section and constant support for darwin TLS.
Modified:
llvm/trunk/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
llvm/trunk/include/llvm/MC/MCSectionMachO.h
llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/trunk/lib/MC/MCSectionMachO.cpp
llvm/trunk/lib/Target/X86/X86AsmBackend.cpp
Modified: llvm/trunk/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h?rev=103974&r1=103973&r2=103974&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h (original)
+++ llvm/trunk/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h Mon May 17 16:02:07 2010
@@ -84,6 +84,19 @@
class TargetLoweringObjectFileMachO : public TargetLoweringObjectFile {
+ /// TLSDataSection - Section directive for Thread Local data.
+ ///
+ const MCSection *TLSDataSection; // Defaults to ".tdata".
+
+ /// TLSBSSSection - Section directive for Thread Local uninitialized data.
+ ///
+ const MCSection *TLSBSSSection; // Defaults to ".tbss".
+
+ /// TLSTLVSection - Section directive for Thread Local structure infomation.
+ /// Contains the source code name of the variable, visibility and a pointer
+ /// to the initial value (.tdata or .tbss).
+ const MCSection *TLSTLVSection; // Defaults to ".tlv".
+
const MCSection *CStringSection;
const MCSection *UStringSection;
const MCSection *TextCoalSection;
Modified: llvm/trunk/include/llvm/MC/MCSectionMachO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionMachO.h?rev=103974&r1=103973&r2=103974&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSectionMachO.h (original)
+++ llvm/trunk/include/llvm/MC/MCSectionMachO.h Mon May 17 16:02:07 2010
@@ -87,8 +87,20 @@
/// S_LAZY_DYLIB_SYMBOL_POINTERS - Section with lazy symbol pointers to
/// lazy loaded dylibs.
S_LAZY_DYLIB_SYMBOL_POINTERS = 0x10U,
+ /// S_THREAD_LOCAL_REGULAR - Section with ....
+ S_THREAD_LOCAL_REGULAR = 0x11U,
+ /// S_THREAD_LOCAL_ZEROFILL - Thread local zerofill section.
+ S_THREAD_LOCAL_ZEROFILL = 0x12U,
+ /// S_THREAD_LOCAL_VARIABLES - Section with thread local variable structure
+ /// data.
+ S_THREAD_LOCAL_VARIABLES = 0x13U,
+ /// S_THREAD_LOCAL_VARIABLE_POINTERS - Section with ....
+ S_THREAD_LOCAL_VARIABLE_POINTERS = 0x14U,
+ /// S_THREAD_LOCAL_INIT_FUNCTION_POINTERS - Section with thread local
+ /// variable initialization pointers to functions.
+ S_THREAD_LOCAL_INIT_FUNCTION_POINTERS = 0x15,
- LAST_KNOWN_SECTION_TYPE = S_LAZY_DYLIB_SYMBOL_POINTERS,
+ LAST_KNOWN_SECTION_TYPE = S_THREAD_LOCAL_INIT_FUNCTION_POINTERS,
// Valid section attributes.
Modified: llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp?rev=103974&r1=103973&r2=103974&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Mon May 17 16:02:07 2010
@@ -461,6 +461,20 @@
= getContext().getMachOSection("__DATA", "__data", 0,
SectionKind::getDataRel());
+ TLSDataSection // .tdata
+ = getContext().getMachOSection("__DATA", "__thread_data",
+ MCSectionMachO::S_THREAD_LOCAL_REGULAR,
+ SectionKind::getDataRel());
+ TLSBSSSection // .tbss
+ = getContext().getMachOSection("__DATA", "__thread_bss",
+ MCSectionMachO::S_THREAD_LOCAL_ZEROFILL,
+ SectionKind::getThreadBSS());
+
+ // TODO: Verify datarel below.
+ TLSTLVSection // .tlv
+ = getContext().getMachOSection("__DATA", "__thread_vars",
+ MCSectionMachO::S_THREAD_LOCAL_VARIABLES,
+ SectionKind::getDataRel());
CStringSection // .cstring
= getContext().getMachOSection("__TEXT", "__cstring",
MCSectionMachO::S_CSTRING_LITERALS,
@@ -646,7 +660,7 @@
const MCSection *TargetLoweringObjectFileMachO::
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const {
+ Mangler *Mang, const TargetMachine &TM) const {
assert(!Kind.isThreadLocal() && "Darwin doesn't support TLS");
if (Kind.isText())
Modified: llvm/trunk/lib/MC/MCSectionMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCSectionMachO.cpp?rev=103974&r1=103973&r2=103974&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCSectionMachO.cpp (original)
+++ llvm/trunk/lib/MC/MCSectionMachO.cpp Mon May 17 16:02:07 2010
@@ -34,7 +34,14 @@
{ "interposing", "S_INTERPOSING" }, // 0x0D
{ "16byte_literals", "S_16BYTE_LITERALS" }, // 0x0E
{ 0, /*FIXME??*/ "S_DTRACE_DOF" }, // 0x0F
- { 0, /*FIXME??*/ "S_LAZY_DYLIB_SYMBOL_POINTERS" } // 0x10
+ { 0, /*FIXME??*/ "S_LAZY_DYLIB_SYMBOL_POINTERS" }, // 0x10
+ { "thread_local_regular", "S_THREAD_LOCAL_REGULAR" }, // 0x11
+ { "thread_bss", "S_THREAD_LOCAL_ZEROFILL" }, // 0x12
+ { "thread_local_variables", "S_THREAD_LOCAL_VARIABLES" }, // 0x13
+ { "thread_local_variable_pointers",
+ "S_THREAD_LOCAL_VARIABLE_POINTERS" }, // 0x14
+ { "thread_local_init_function_pointers",
+ "S_THREAD_LOCAL_INIT_FUNCTION_POINTERS"}, // 0x15
};
Modified: llvm/trunk/lib/Target/X86/X86AsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmBackend.cpp?rev=103974&r1=103973&r2=103974&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86AsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86AsmBackend.cpp Mon May 17 16:02:07 2010
@@ -222,7 +222,8 @@
bool isVirtualSection(const MCSection &Section) const {
const MCSectionMachO &SMO = static_cast(Section);
return (SMO.getType() == MCSectionMachO::S_ZEROFILL ||
- SMO.getType() == MCSectionMachO::S_GB_ZEROFILL);
+ SMO.getType() == MCSectionMachO::S_GB_ZEROFILL ||
+ SMO.getType() == MCSectionMachO::S_THREAD_LOCAL_ZEROFILL);
}
};
From stoklund at 2pi.dk Mon May 17 16:02:08 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Mon, 17 May 2010 21:02:08 -0000
Subject: [llvm-commits] [llvm] r103975 -
/llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Message-ID: <20100517210208.979183128018@llvm.org>
Author: stoklund
Date: Mon May 17 16:02:08 2010
New Revision: 103975
URL: http://llvm.org/viewvc/llvm-project?rev=103975&view=rev
Log:
Pull the UsedInInstr.test() calls into calcSpillCost() and remember aliases.
This fixes the miscompilations of MultiSource/Applications/JM/l{en,de}cod.
Clang now successfully self hosts in a debug build with the fast register allocator.
Modified:
llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=103975&r1=103974&r2=103975&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Mon May 17 16:02:08 2010
@@ -381,6 +381,8 @@
// can be allocated directly.
// Returns spillImpossible when PhysReg or an alias can't be spilled.
unsigned RAFast::calcSpillCost(unsigned PhysReg) const {
+ if (UsedInInstr.test(PhysReg))
+ return spillImpossible;
switch (unsigned VirtReg = PhysRegState[PhysReg]) {
case regDisabled:
break;
@@ -396,6 +398,8 @@
unsigned Cost = 0;
for (const unsigned *AS = TRI->getAliasSet(PhysReg);
unsigned Alias = *AS; ++AS) {
+ if (UsedInInstr.test(Alias))
+ return spillImpossible;
switch (unsigned VirtReg = PhysRegState[Alias]) {
case regDisabled:
break;
@@ -436,14 +440,11 @@
// Ignore invalid hints.
if (Hint && (!TargetRegisterInfo::isPhysicalRegister(Hint) ||
- !RC->contains(Hint) || UsedInInstr.test(Hint) ||
- !Allocatable.test(Hint)))
+ !RC->contains(Hint) || !Allocatable.test(Hint)))
Hint = 0;
// Take hint when possible.
if (Hint) {
- assert(RC->contains(Hint) && !UsedInInstr.test(Hint) &&
- Allocatable.test(Hint) && "Invalid hint should have been cleared");
switch(calcSpillCost(Hint)) {
default:
definePhysReg(MI, Hint, regFree);
@@ -470,7 +471,6 @@
unsigned BestReg = 0, BestCost = spillImpossible;
for (TargetRegisterClass::iterator I = AOB; I != AOE; ++I) {
- if (UsedInInstr.test(*I)) continue;
unsigned Cost = calcSpillCost(*I);
// Cost is 0 when all aliases are already disabled.
if (Cost == 0)
From isanbard at gmail.com Mon May 17 16:06:04 2010
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 17 May 2010 21:06:04 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r103976 -
/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
Message-ID: <20100517210604.B2B51312800A@llvm.org>
Author: void
Date: Mon May 17 16:06:04 2010
New Revision: 103976
URL: http://llvm.org/viewvc/llvm-project?rev=103976&view=rev
Log:
Turn on "--disable-non-leaf-fp-elim" if -momit-leaf-frame-pointer is specified.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h?rev=103976&r1=103975&r2=103976&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/i386.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Mon May 17 16:06:04 2010
@@ -3933,33 +3933,31 @@
(ISDIGIT (*nm) ? reg_names[REG_NUM] : nm); })
/* Propagate code model setting to backend */
-/*
- FIXME: (See ) This option was mis-compiling a library.
-
- if (TARGET_OMIT_LEAF_FRAME_POINTER)
- argvec.push_back("--disable-non-leaf-fp-elim");
-*/
-#define LLVM_SET_MACHINE_OPTIONS(argvec) \
- switch (ix86_cmodel) { \
- default: \
- sorry ("code model %<%s%> not supported yet", ix86_cmodel_string); \
- break; \
- case CM_SMALL: \
- case CM_SMALL_PIC: \
- argvec.push_back("--code-model=small"); \
- break; \
- case CM_KERNEL: \
- argvec.push_back("--code-model=kernel"); \
- break; \
- case CM_MEDIUM: \
- case CM_MEDIUM_PIC: \
- argvec.push_back("--code-model=medium"); \
- break; \
- case CM_32: \
- argvec.push_back("--code-model=default"); \
- break; \
- }
-
+#define LLVM_SET_MACHINE_OPTIONS(argvec) \
+ do { \
+ switch (ix86_cmodel) { \
+ default: \
+ sorry ("code model %<%s%> not supported yet", \
+ ix86_cmodel_string); \
+ break; \
+ case CM_SMALL: \
+ case CM_SMALL_PIC: \
+ argvec.push_back("--code-model=small"); \
+ break; \
+ case CM_KERNEL: \
+ argvec.push_back("--code-model=kernel"); \
+ break; \
+ case CM_MEDIUM: \
+ case CM_MEDIUM_PIC: \
+ argvec.push_back("--code-model=medium"); \
+ break; \
+ case CM_32: \
+ argvec.push_back("--code-model=default"); \
+ break; \
+ } \
+ if (TARGET_OMIT_LEAF_FRAME_POINTER) \
+ argvec.push_back("--disable-non-leaf-fp-elim"); \
+ } while (0)
#endif /* ENABLE_LLVM */
/* LLVM LOCAL end */
From daniel at zuster.org Mon May 17 16:20:00 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Mon, 17 May 2010 21:20:00 -0000
Subject: [llvm-commits] [llvm] r103979 - in /llvm/trunk:
lib/MC/MCMachOStreamer.cpp test/MC/MachO/string-table.s
Message-ID: <20100517212000.1F685312800A@llvm.org>
Author: ddunbar
Date: Mon May 17 16:19:59 2010
New Revision: 103979
URL: http://llvm.org/viewvc/llvm-project?rev=103979&view=rev
Log:
MC/Mach-O: Reverse order of SymbolData scanning when emitting instructions.
- This fixes a string table mismatch with 'as' when two new symbols are defined
in a single instruction.
Added:
llvm/trunk/test/MC/MachO/string-table.s
Modified:
llvm/trunk/lib/MC/MCMachOStreamer.cpp
Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=103979&r1=103978&r2=103979&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Mon May 17 16:19:59 2010
@@ -414,7 +414,7 @@
void MCMachOStreamer::EmitInstruction(const MCInst &Inst) {
// Scan for values.
- for (unsigned i = 0; i != Inst.getNumOperands(); ++i)
+ for (unsigned i = Inst.getNumOperands(); i--; )
if (Inst.getOperand(i).isExpr())
AddValueSymbols(Inst.getOperand(i).getExpr());
Added: llvm/trunk/test/MC/MachO/string-table.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/string-table.s?rev=103979&view=auto
==============================================================================
--- llvm/trunk/test/MC/MachO/string-table.s (added)
+++ llvm/trunk/test/MC/MachO/string-table.s Mon May 17 16:19:59 2010
@@ -0,0 +1,100 @@
+// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+
+ movl $a, b
+
+// CHECK: ('cputype', 7)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 228)
+// CHECK: ('flag', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 1)
+// CHECK: ('size', 124)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 10)
+// CHECK: ('file_offset', 256)
+// CHECK: ('file_size', 10)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 1)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 10)
+// CHECK: ('offset', 256)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 268)
+// CHECK: ('num_reloc', 2)
+// CHECK: ('flags', 0x80000400)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: # Relocation 0
+// CHECK: (('word-0', 0x6),
+// CHECK: ('word-1', 0xc000000)),
+// CHECK: # Relocation 1
+// CHECK: (('word-0', 0x2),
+// CHECK: ('word-1', 0xc000001)),
+// CHECK: ])
+// CHECK: ('_section_data', '\xc7\x05\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 1
+// CHECK: (('command', 2)
+// CHECK: ('size', 24)
+// CHECK: ('symoff', 284)
+// CHECK: ('nsyms', 2)
+// CHECK: ('stroff', 308)
+// CHECK: ('strsize', 8)
+// CHECK: ('_string_data', '\x00a\x00b\x00\x00\x00\x00')
+// CHECK: ('_symbols', [
+// CHECK: # Symbol 0
+// CHECK: (('n_strx', 1)
+// CHECK: ('n_type', 0x1)
+// CHECK: ('n_sect', 0)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', 'a')
+// CHECK: ),
+// CHECK: # Symbol 1
+// CHECK: (('n_strx', 3)
+// CHECK: ('n_type', 0x1)
+// CHECK: ('n_sect', 0)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', 'b')
+// CHECK: ),
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 2
+// CHECK: (('command', 11)
+// CHECK: ('size', 80)
+// CHECK: ('ilocalsym', 0)
+// CHECK: ('nlocalsym', 0)
+// CHECK: ('iextdefsym', 0)
+// CHECK: ('nextdefsym', 0)
+// CHECK: ('iundefsym', 0)
+// CHECK: ('nundefsym', 2)
+// CHECK: ('tocoff', 0)
+// CHECK: ('ntoc', 0)
+// CHECK: ('modtaboff', 0)
+// CHECK: ('nmodtab', 0)
+// CHECK: ('extrefsymoff', 0)
+// CHECK: ('nextrefsyms', 0)
+// CHECK: ('indirectsymoff', 0)
+// CHECK: ('nindirectsyms', 0)
+// CHECK: ('extreloff', 0)
+// CHECK: ('nextrel', 0)
+// CHECK: ('locreloff', 0)
+// CHECK: ('nlocrel', 0)
+// CHECK: ('_indirect_symbols', [
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
From daniel at zuster.org Mon May 17 16:54:26 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Mon, 17 May 2010 21:54:26 -0000
Subject: [llvm-commits] [llvm] r103980 - in /llvm/trunk:
include/llvm/MC/MCSection.h include/llvm/MC/MCSectionCOFF.h
include/llvm/MC/MCSectionELF.h include/llvm/MC/MCSectionMachO.h
lib/MC/MCSectionMachO.cpp lib/Target/PIC16/PIC16Section.h
Message-ID: <20100517215426.DE9CF312800A@llvm.org>
Author: ddunbar
Date: Mon May 17 16:54:26 2010
New Revision: 103980
URL: http://llvm.org/viewvc/llvm-project?rev=103980&view=rev
Log:
MC: Add dyn_cast support to MCSection.
- Of questionable utility, since in general anything which wants to do this should probably be within a target specific hook, which can rely on the sections being of the appropriate type. However, it can be useful for short term hacks.
Modified:
llvm/trunk/include/llvm/MC/MCSection.h
llvm/trunk/include/llvm/MC/MCSectionCOFF.h
llvm/trunk/include/llvm/MC/MCSectionELF.h
llvm/trunk/include/llvm/MC/MCSectionMachO.h
llvm/trunk/lib/MC/MCSectionMachO.cpp
llvm/trunk/lib/Target/PIC16/PIC16Section.h
Modified: llvm/trunk/include/llvm/MC/MCSection.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSection.h?rev=103980&r1=103979&r2=103980&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSection.h (original)
+++ llvm/trunk/include/llvm/MC/MCSection.h Mon May 17 16:54:26 2010
@@ -17,6 +17,7 @@
#include
#include "llvm/ADT/StringRef.h"
#include "llvm/MC/SectionKind.h"
+#include "llvm/Support/Casting.h"
namespace llvm {
class MCContext;
@@ -27,15 +28,27 @@
/// section in the current translation unit. The MCContext class uniques and
/// creates these.
class MCSection {
+ public:
+ enum SectionVariant {
+ SV_COFF = 0,
+ SV_ELF,
+ SV_MachO,
+ SV_PIC16
+ };
+
+ private:
MCSection(const MCSection&); // DO NOT IMPLEMENT
void operator=(const MCSection&); // DO NOT IMPLEMENT
protected:
- MCSection(SectionKind K) : Kind(K) {}
+ MCSection(SectionVariant V, SectionKind K) : Variant(V), Kind(K) {}
+ SectionVariant Variant;
SectionKind Kind;
public:
virtual ~MCSection();
SectionKind getKind() const { return Kind; }
+
+ SectionVariant getVariant() const { return Variant; }
virtual void PrintSwitchToSection(const MCAsmInfo &MAI,
raw_ostream &OS) const = 0;
@@ -47,6 +60,8 @@
virtual bool isBaseAddressKnownZero() const {
return false;
}
+
+ static bool classof(const MCSection *) { return true; }
};
} // end namespace llvm
Modified: llvm/trunk/include/llvm/MC/MCSectionCOFF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionCOFF.h?rev=103980&r1=103979&r2=103980&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSectionCOFF.h (original)
+++ llvm/trunk/include/llvm/MC/MCSectionCOFF.h Mon May 17 16:54:26 2010
@@ -35,8 +35,8 @@
friend class MCContext;
MCSectionCOFF(StringRef Section, unsigned Characteristics,
int Selection, SectionKind K)
- : MCSection(K), SectionName(Section), Characteristics(Characteristics),
- Selection (Selection) {
+ : MCSection(SV_COFF, K), SectionName(Section),
+ Characteristics(Characteristics), Selection (Selection) {
assert ((Characteristics & 0x00F00000) == 0 &&
"alignment must not be set upon section creation");
}
@@ -103,6 +103,11 @@
virtual void PrintSwitchToSection(const MCAsmInfo &MAI,
raw_ostream &OS) const;
+
+ static bool classof(const MCSection *S) {
+ return S->getVariant() == SV_COFF;
+ }
+ static bool classof(const MCSectionCOFF *) { return true; }
};
} // end namespace llvm
Modified: llvm/trunk/include/llvm/MC/MCSectionELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionELF.h?rev=103980&r1=103979&r2=103980&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSectionELF.h (original)
+++ llvm/trunk/include/llvm/MC/MCSectionELF.h Mon May 17 16:54:26 2010
@@ -40,7 +40,7 @@
friend class MCContext;
MCSectionELF(StringRef Section, unsigned type, unsigned flags,
SectionKind K, bool isExplicit)
- : MCSection(K), SectionName(Section), Type(type), Flags(flags),
+ : MCSection(SV_ELF, K), SectionName(Section), Type(type), Flags(flags),
IsExplicit(isExplicit) {}
~MCSectionELF();
public:
@@ -178,6 +178,11 @@
virtual bool isBaseAddressKnownZero() const {
return (getFlags() & SHF_ALLOC) == 0;
}
+
+ static bool classof(const MCSection *S) {
+ return S->getVariant() == SV_ELF;
+ }
+ static bool classof(const MCSectionELF *) { return true; }
};
} // end namespace llvm
Modified: llvm/trunk/include/llvm/MC/MCSectionMachO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionMachO.h?rev=103980&r1=103979&r2=103980&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSectionMachO.h (original)
+++ llvm/trunk/include/llvm/MC/MCSectionMachO.h Mon May 17 16:54:26 2010
@@ -165,6 +165,11 @@
virtual void PrintSwitchToSection(const MCAsmInfo &MAI,
raw_ostream &OS) const;
+
+ static bool classof(const MCSection *S) {
+ return S->getVariant() == SV_MachO;
+ }
+ static bool classof(const MCSectionMachO *) { return true; }
};
} // end namespace llvm
Modified: llvm/trunk/lib/MC/MCSectionMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCSectionMachO.cpp?rev=103980&r1=103979&r2=103980&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCSectionMachO.cpp (original)
+++ llvm/trunk/lib/MC/MCSectionMachO.cpp Mon May 17 16:54:26 2010
@@ -73,7 +73,7 @@
MCSectionMachO::MCSectionMachO(StringRef Segment, StringRef Section,
unsigned TAA, unsigned reserved2, SectionKind K)
- : MCSection(K), TypeAndAttributes(TAA), Reserved2(reserved2) {
+ : MCSection(SV_MachO, K), TypeAndAttributes(TAA), Reserved2(reserved2) {
assert(Segment.size() <= 16 && Section.size() <= 16 &&
"Segment or section string too long");
for (unsigned i = 0; i != 16; ++i) {
Modified: llvm/trunk/lib/Target/PIC16/PIC16Section.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Section.h?rev=103980&r1=103979&r2=103980&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16Section.h (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16Section.h Mon May 17 16:54:26 2010
@@ -44,7 +44,8 @@
unsigned Size;
PIC16Section(StringRef name, SectionKind K, StringRef addr, int color)
- : MCSection(K), Name(name), Address(addr), Color(color), Size(0) {
+ : MCSection(SV_PIC16, K), Name(name), Address(addr),
+ Color(color), Size(0) {
}
public:
@@ -86,6 +87,11 @@
/// to a section.
virtual void PrintSwitchToSection(const MCAsmInfo &MAI,
raw_ostream &OS) const;
+
+ static bool classof(const MCSection *S) {
+ return S->getVariant() == SV_PIC16;
+ }
+ static bool classof(const PIC16Section *) { return true; }
};
} // end namespace llvm
From daniel at zuster.org Mon May 17 16:54:30 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Mon, 17 May 2010 21:54:30 -0000
Subject: [llvm-commits] [llvm] r103981 - in /llvm/trunk:
lib/MC/MCParser/AsmParser.cpp test/MC/MachO/x86_32-optimal_nop.s
Message-ID: <20100517215430.9BDA93128018@llvm.org>
Author: ddunbar
Date: Mon May 17 16:54:30 2010
New Revision: 103981
URL: http://llvm.org/viewvc/llvm-project?rev=103981&view=rev
Log:
MC/Mach-O/x86: Optimal nop sequences should only be used for the .text sections, not all sections in the text segment.
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/test/MC/MachO/x86_32-optimal_nop.s
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=103981&r1=103980&r2=103981&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Mon May 17 16:54:30 2010
@@ -1178,10 +1178,8 @@
Lex();
- if (!HasFillExpr) {
- // FIXME: Sometimes fill with nop.
+ if (!HasFillExpr)
FillExpr = 0;
- }
// Compute alignment in bytes.
if (IsPow2) {
@@ -1209,14 +1207,21 @@
}
}
- // FIXME: hard code the parser to use EmitCodeAlignment for text when using
- // the TextAlignFillValue.
- if(Out.getCurrentSection()->getKind().isText() &&
- Lexer.getMAI().getTextAlignFillValue() == FillExpr)
+ // Check whether we should use optimal code alignment for this .align
+ // directive.
+ //
+ // FIXME: This should be using a target hook.
+ bool UseCodeAlign = false;
+ if (const MCSectionMachO *S = dyn_cast(
+ Out.getCurrentSection()))
+ UseCodeAlign = S->hasAttribute(MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS);
+ if ((!HasFillExpr || Lexer.getMAI().getTextAlignFillValue() == FillExpr) &&
+ ValueSize == 1 && UseCodeAlign) {
Out.EmitCodeAlignment(Alignment, MaxBytesToFill);
- else
+ } else {
// FIXME: Target specific behavior about how the "extra" bytes are filled.
Out.EmitValueToAlignment(Alignment, FillExpr, ValueSize, MaxBytesToFill);
+ }
return false;
}
Modified: llvm/trunk/test/MC/MachO/x86_32-optimal_nop.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/x86_32-optimal_nop.s?rev=103981&r1=103980&r2=103981&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/x86_32-optimal_nop.s (original)
+++ llvm/trunk/test/MC/MachO/x86_32-optimal_nop.s Mon May 17 16:54:30 2010
@@ -150,24 +150,31 @@
.align 4, 0x90
ret
+ # Only the .text sections gets optimal nops.
+ .section __TEXT,__const
+f0:
+ .byte 0
+ .align 4, 0x90
+ .long 0
+
// CHECK: ('cputype', 7)
// CHECK: ('cpusubtype', 3)
// CHECK: ('filetype', 1)
// CHECK: ('num_load_commands', 1)
-// CHECK: ('load_commands_size', 124)
+// CHECK: ('load_commands_size', 296)
// CHECK: ('flag', 0)
// CHECK: ('load_commands', [
// CHECK: # Load Command 0
// CHECK: (('command', 1)
-// CHECK: ('size', 124)
+// CHECK: ('size', 192)
// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('vm_addr', 0)
-// CHECK: ('vm_size', 337)
-// CHECK: ('file_offset', 152)
-// CHECK: ('file_size', 337)
+// CHECK: ('vm_size', 372)
+// CHECK: ('file_offset', 324)
+// CHECK: ('file_size', 372)
// CHECK: ('maxprot', 7)
// CHECK: ('initprot', 7)
-// CHECK: ('num_sections', 1)
+// CHECK: ('num_sections', 2)
// CHECK: ('flags', 0)
// CHECK: ('sections', [
// CHECK: # Section 0
@@ -175,7 +182,7 @@
// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('address', 0)
// CHECK: ('size', 337)
-// CHECK: ('offset', 152)
+// CHECK: ('offset', 324)
// CHECK: ('alignment', 4)
// CHECK: ('reloc_offset', 0)
// CHECK: ('num_reloc', 0)
@@ -186,6 +193,65 @@
// CHECK: ('_relocations', [
// CHECK: ])
// CHECK: ('_section_data', '\xc3\x90\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3f\x90\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\x0f\x1f\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\x0f\x1f@\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3f\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\x0f\x1f\x80\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\xc3\xc3f\x0f\x1f\x84\x00\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\xc3\xc3f\x0f\x1f\x84\x00\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\x0f\x1fD\x00\x00f\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3f\x0f\x1fD\x00\x00f\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3f\x0f\x1fD\x00\x00\x0f\x1f\x80\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\x0f\x1f\x80\x00\x00\x00\x00\x0f\x1f\x80\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\x0f\x1f\x80\x00\x00\x00\x00\x0f\x1f\x84\x00\x00\x00\x00\x00\xc3')
+// CHECK: # Section 1
+// CHECK: (('section_name', '__const\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 352)
+// CHECK: ('size', 20)
+// CHECK: ('offset', 676)
+// CHECK: ('alignment', 4)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x0)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '\x00\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x00\x00\x00\x00')
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 1
+// CHECK: (('command', 2)
+// CHECK: ('size', 24)
+// CHECK: ('symoff', 696)
+// CHECK: ('nsyms', 1)
+// CHECK: ('stroff', 708)
+// CHECK: ('strsize', 4)
+// CHECK: ('_string_data', '\x00f0\x00')
+// CHECK: ('_symbols', [
+// CHECK: # Symbol 0
+// CHECK: (('n_strx', 1)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 352)
+// CHECK: ('_string', 'f0')
+// CHECK: ),
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 2
+// CHECK: (('command', 11)
+// CHECK: ('size', 80)
+// CHECK: ('ilocalsym', 0)
+// CHECK: ('nlocalsym', 1)
+// CHECK: ('iextdefsym', 1)
+// CHECK: ('nextdefsym', 0)
+// CHECK: ('iundefsym', 1)
+// CHECK: ('nundefsym', 0)
+// CHECK: ('tocoff', 0)
+// CHECK: ('ntoc', 0)
+// CHECK: ('modtaboff', 0)
+// CHECK: ('nmodtab', 0)
+// CHECK: ('extrefsymoff', 0)
+// CHECK: ('nextrefsyms', 0)
+// CHECK: ('indirectsymoff', 0)
+// CHECK: ('nindirectsyms', 0)
+// CHECK: ('extreloff', 0)
+// CHECK: ('nextrel', 0)
+// CHECK: ('locreloff', 0)
+// CHECK: ('nlocrel', 0)
+// CHECK: ('_indirect_symbols', [
// CHECK: ])
// CHECK: ),
// CHECK: ])
From evan.cheng at apple.com Mon May 17 16:54:51 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 17 May 2010 21:54:51 -0000
Subject: [llvm-commits] [llvm] r103982 -
/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td
Message-ID: <20100517215451.2913D312800A@llvm.org>
Author: evancheng
Date: Mon May 17 16:54:50 2010
New Revision: 103982
URL: http://llvm.org/viewvc/llvm-project?rev=103982&view=rev
Log:
vmov of immediates are trivially re-materializable.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrNEON.td
Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=103982&r1=103981&r2=103982&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Mon May 17 16:54:50 2010
@@ -2862,6 +2862,7 @@
// Note: Some of the cmode bits in the following VMOV instructions need to
// be encoded based on the immed values.
+let isReMaterializable = 1 in {
def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$dst),
(ins h8imm:$SIMM), IIC_VMOVImm,
"vmov", "i8", "$dst, $SIMM", "",
@@ -2897,6 +2898,7 @@
(ins h64imm:$SIMM), IIC_VMOVImm,
"vmov", "i64", "$dst, $SIMM", "",
[(set QPR:$dst, (v2i64 vmovImm64:$SIMM))]>;
+} // isReMaterializable
// VMOV : Vector Get Lane (move scalar to ARM core register)
From evan.cheng at apple.com Mon May 17 17:09:49 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 17 May 2010 22:09:49 -0000
Subject: [llvm-commits] [llvm] r103984 - in /llvm/trunk:
lib/CodeGen/TwoAddressInstructionPass.cpp test/CodeGen/ARM/reg_sequence.ll
Message-ID: <20100517220949.5FC15312800A@llvm.org>
Author: evancheng
Date: Mon May 17 17:09:49 2010
New Revision: 103984
URL: http://llvm.org/viewvc/llvm-project?rev=103984&view=rev
Log:
Fix PR7156. If the sources of a REG_SEQUENCE are all IMPLICIT_DEF's. Replace it with an IMPLICIT_DEF rather than deleting it or else it would be left without a def.
Modified:
llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
llvm/trunk/test/CodeGen/ARM/reg_sequence.ll
Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=103984&r1=103983&r2=103984&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon May 17 17:09:49 2010
@@ -1238,6 +1238,7 @@
llvm_unreachable(0);
}
+ bool IsImpDef = true;
SmallVector RealSrcs;
SmallSet Seen;
for (unsigned i = 1, e = MI->getNumOperands(); i < e; i += 2) {
@@ -1253,6 +1254,7 @@
DefMI->eraseFromParent();
continue;
}
+ IsImpDef = false;
// Remember EXTRACT_SUBREG sources. These might be candidate for
// coalescing.
@@ -1297,8 +1299,15 @@
UpdateRegSequenceSrcs(SrcReg, DstReg, SubIdx, MRI);
}
- DEBUG(dbgs() << "Eliminated: " << *MI);
- MI->eraseFromParent();
+ if (IsImpDef) {
+ DEBUG(dbgs() << "Turned: " << *MI << " into an IMPLICIT_DEF");
+ MI->setDesc(TII->get(TargetOpcode::IMPLICIT_DEF));
+ for (int j = MI->getNumOperands() - 1, ee = 0; j > ee; --j)
+ MI->RemoveOperand(j);
+ } else {
+ DEBUG(dbgs() << "Eliminated: " << *MI);
+ MI->eraseFromParent();
+ }
// Try coalescing some EXTRACT_SUBREG instructions.
CoalesceExtSubRegs(RealSrcs, DstReg);
Modified: llvm/trunk/test/CodeGen/ARM/reg_sequence.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/reg_sequence.ll?rev=103984&r1=103983&r2=103984&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/reg_sequence.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/reg_sequence.ll Mon May 17 17:09:49 2010
@@ -185,6 +185,50 @@
ret void
}
+; PR7156
+define arm_aapcs_vfpcc i32 @t8() nounwind {
+; CHECK: t8:
+; CHECK: vrsqrte.f32 q0, q0
+bb.nph55.bb.nph55.split_crit_edge:
+ br label %bb3
+
+bb3: ; preds = %bb3, %bb.nph55.bb.nph55.split_crit_edge
+ br i1 undef, label %bb5, label %bb3
+
+bb5: ; preds = %bb3
+ br label %bb.i25
+
+bb.i25: ; preds = %bb.i25, %bb5
+ %0 = shufflevector <2 x float> undef, <2 x float> undef, <4 x i32> ; <<4 x float>> [#uses=1]
+ %1 = call <4 x float> @llvm.arm.neon.vrsqrte.v4f32(<4 x float> %0) nounwind ; <<4 x float>> [#uses=1]
+ %2 = fmul <4 x float> %1, undef ; <<4 x float>> [#uses=1]
+ %3 = fmul <4 x float> undef, %2 ; <<4 x float>> [#uses=1]
+ %tmp26.i = bitcast <4 x float> %3 to <2 x double> ; <<2 x double>> [#uses=1]
+ %4 = extractelement <2 x double> %tmp26.i, i32 0 ; [#uses=1]
+ %5 = bitcast double %4 to <2 x float> ; <<2 x float>> [#uses=1]
+ %6 = extractelement <2 x float> %5, i32 1 ; [#uses=1]
+ store float %6, float* undef, align 4
+ br i1 undef, label %bb6, label %bb.i25
+
+bb6: ; preds = %bb.i25
+ br i1 undef, label %bb7, label %bb14
+
+bb7: ; preds = %bb6
+ br label %bb.i49
+
+bb.i49: ; preds = %bb.i49, %bb7
+ br i1 undef, label %bb.i19, label %bb.i49
+
+bb.i19: ; preds = %bb.i19, %bb.i49
+ br i1 undef, label %exit, label %bb.i19
+
+exit: ; preds = %bb.i19
+ unreachable
+
+bb14: ; preds = %bb6
+ ret i32 0
+}
+
declare <4 x i32> @llvm.arm.neon.vld1.v4i32(i8*) nounwind readonly
declare <8 x i16> @llvm.arm.neon.vld1.v8i16(i8*) nounwind readonly
@@ -209,4 +253,6 @@
declare void @llvm.arm.neon.vst2.v4i32(i8*, <4 x i32>, <4 x i32>) nounwind
+declare <4 x float> @llvm.arm.neon.vrsqrte.v4f32(<4 x float>) nounwind readnone
+
declare void @llvm.trap() nounwind
From echristo at apple.com Mon May 17 17:53:55 2010
From: echristo at apple.com (Eric Christopher)
Date: Mon, 17 May 2010 22:53:55 -0000
Subject: [llvm-commits] [llvm] r103985 - in /llvm/trunk:
include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
include/llvm/MC/MCSectionMachO.h
lib/CodeGen/TargetLoweringObjectFileImpl.cpp lib/MC/MCParser/AsmParser.cpp
test/MC/AsmParser/directive_tbss.s test/MC/AsmParser/directive_tdata.s
test/MC/AsmParser/directive_thread_init_func.s
test/MC/AsmParser/directive_tlv.s
Message-ID: <20100517225355.90D2F312800A@llvm.org>
Author: echristo
Date: Mon May 17 17:53:55 2010
New Revision: 103985
URL: http://llvm.org/viewvc/llvm-project?rev=103985&view=rev
Log:
More data/parsing support for tls directives. Add a few more testcases
and cleanup comments as well.
Added:
llvm/trunk/test/MC/AsmParser/directive_tdata.s
llvm/trunk/test/MC/AsmParser/directive_thread_init_func.s
llvm/trunk/test/MC/AsmParser/directive_tlv.s
Modified:
llvm/trunk/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
llvm/trunk/include/llvm/MC/MCSectionMachO.h
llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/test/MC/AsmParser/directive_tbss.s
Modified: llvm/trunk/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h?rev=103985&r1=103984&r2=103985&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h (original)
+++ llvm/trunk/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h Mon May 17 17:53:55 2010
@@ -84,19 +84,23 @@
class TargetLoweringObjectFileMachO : public TargetLoweringObjectFile {
- /// TLSDataSection - Section directive for Thread Local data.
+ /// TLSDataSection - Section for thread local data.
///
const MCSection *TLSDataSection; // Defaults to ".tdata".
- /// TLSBSSSection - Section directive for Thread Local uninitialized data.
+ /// TLSBSSSection - Section for thread local uninitialized data.
///
const MCSection *TLSBSSSection; // Defaults to ".tbss".
- /// TLSTLVSection - Section directive for Thread Local structure infomation.
+ /// TLSTLVSection - Section for thread local structure infomation.
/// Contains the source code name of the variable, visibility and a pointer
/// to the initial value (.tdata or .tbss).
const MCSection *TLSTLVSection; // Defaults to ".tlv".
+ /// TLSThreadInitSection - Section for thread local data initialization
+ /// functions.
+ const MCSection *TLSThreadInitSection; // Defaults to ".thread_init_func".
+
const MCSection *CStringSection;
const MCSection *UStringSection;
const MCSection *TextCoalSection;
Modified: llvm/trunk/include/llvm/MC/MCSectionMachO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionMachO.h?rev=103985&r1=103984&r2=103985&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSectionMachO.h (original)
+++ llvm/trunk/include/llvm/MC/MCSectionMachO.h Mon May 17 17:53:55 2010
@@ -98,7 +98,7 @@
S_THREAD_LOCAL_VARIABLE_POINTERS = 0x14U,
/// S_THREAD_LOCAL_INIT_FUNCTION_POINTERS - Section with thread local
/// variable initialization pointers to functions.
- S_THREAD_LOCAL_INIT_FUNCTION_POINTERS = 0x15,
+ S_THREAD_LOCAL_INIT_FUNCTION_POINTERS = 0x15U,
LAST_KNOWN_SECTION_TYPE = S_THREAD_LOCAL_INIT_FUNCTION_POINTERS,
Modified: llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp?rev=103985&r1=103984&r2=103985&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Mon May 17 17:53:55 2010
@@ -475,6 +475,12 @@
= getContext().getMachOSection("__DATA", "__thread_vars",
MCSectionMachO::S_THREAD_LOCAL_VARIABLES,
SectionKind::getDataRel());
+
+ TLSThreadInitSection
+ = getContext().getMachOSection("__DATA", "__thread_init",
+ MCSectionMachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS,
+ SectionKind::getDataRel());
+
CStringSection // .cstring
= getContext().getMachOSection("__TEXT", "__cstring",
MCSectionMachO::S_CSTRING_LITERALS,
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=103985&r1=103984&r2=103985&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Mon May 17 17:53:55 2010
@@ -623,6 +623,16 @@
return ParseDirectiveSectionSwitch("__OBJC", "__selector_strs",
MCSectionMachO::S_CSTRING_LITERALS);
+ if (IDVal == ".tdata")
+ return ParseDirectiveSectionSwitch("__DATA", "__thread_data",
+ MCSectionMachO::S_THREAD_LOCAL_REGULAR);
+ if (IDVal == ".tlv")
+ return ParseDirectiveSectionSwitch("__DATA", "__thread_vars",
+ MCSectionMachO::S_THREAD_LOCAL_VARIABLES);
+ if (IDVal == ".thread_init_func")
+ return ParseDirectiveSectionSwitch("__DATA", "__thread_init",
+ MCSectionMachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS);
+
// Assembler features
if (IDVal == ".set")
return ParseDirectiveSet();
Modified: llvm/trunk/test/MC/AsmParser/directive_tbss.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_tbss.s?rev=103985&r1=103984&r2=103985&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_tbss.s (original)
+++ llvm/trunk/test/MC/AsmParser/directive_tbss.s Mon May 17 17:53:55 2010
@@ -1,4 +1,4 @@
-# RUN: llvm-mc -triple i386-unknown-darwin %s | FileCheck %s
+# RUN: llvm-mc -triple x86_64-unknown-darwin %s | FileCheck %s
# CHECK: .tbss _a$tlv$init, 4
# CHECK: .tbss _b$tlv$init, 4, 3
Added: llvm/trunk/test/MC/AsmParser/directive_tdata.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_tdata.s?rev=103985&view=auto
==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_tdata.s (added)
+++ llvm/trunk/test/MC/AsmParser/directive_tdata.s Mon May 17 17:53:55 2010
@@ -0,0 +1,9 @@
+# RUN: llvm-mc -triple x86_64-unknown-darwin %s | FileCheck %s
+
+# CHECK: __DATA,__thread_data,thread_local_regular
+# CHECK: _a$tlv$init:
+# CHECK: .quad 4
+
+ .tdata
+_a$tlv$init:
+ .quad 4
Added: llvm/trunk/test/MC/AsmParser/directive_thread_init_func.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_thread_init_func.s?rev=103985&view=auto
==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_thread_init_func.s (added)
+++ llvm/trunk/test/MC/AsmParser/directive_thread_init_func.s Mon May 17 17:53:55 2010
@@ -0,0 +1,7 @@
+# RUN: llvm-mc -triple x86_64-unknown-darwin %s | FileCheck %s
+
+# CHECK: __DATA,__thread_init,thread_local_init_function_pointers
+# CHECK: .quad 0
+
+.thread_init_func
+ .quad 0
Added: llvm/trunk/test/MC/AsmParser/directive_tlv.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_tlv.s?rev=103985&view=auto
==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_tlv.s (added)
+++ llvm/trunk/test/MC/AsmParser/directive_tlv.s Mon May 17 17:53:55 2010
@@ -0,0 +1,13 @@
+# RUN: llvm-mc -triple x86_64-unknown-darwin %s | FileCheck %s
+
+# CHECK: __DATA,__thread_vars,thread_local_variables
+# CHECK: .globl _a
+# CHECK: _a:
+# CHECK: .quad 0
+
+ .tlv
+.globl _a
+_a:
+ .quad 0
+ .quad 0
+ .quad 0
From isanbard at gmail.com Mon May 17 18:07:04 2010
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 17 May 2010 23:07:04 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r103988 - in
/llvm-gcc-4.2/trunk/gcc/config/i386: i386.c i386.h
Message-ID: <20100517230704.38E17312800A@llvm.org>
Author: void
Date: Mon May 17 18:07:03 2010
New Revision: 103988
URL: http://llvm.org/viewvc/llvm-project?rev=103988&view=rev
Log:
Set "flag_omit_frame_pointer" to 3 if -momit-leaf-frame-pointer is
specified. This is to make its value unique from any other -fomit-frame-pointer
value.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/i386.c
llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.c?rev=103988&r1=103987&r2=103988&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/i386.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Mon May 17 18:07:03 2010
@@ -2081,7 +2081,7 @@
if (flag_omit_frame_pointer)
target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER;
else if (TARGET_OMIT_LEAF_FRAME_POINTER)
- flag_omit_frame_pointer = 1;
+ flag_omit_frame_pointer = 3;
/* If we're doing fast math, we don't care about comparison order
wrt NaNs. This lets us use a shorter comparison sequence. */
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h?rev=103988&r1=103987&r2=103988&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/i386.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Mon May 17 18:07:03 2010
@@ -3955,7 +3955,7 @@
argvec.push_back("--code-model=default"); \
break; \
} \
- if (TARGET_OMIT_LEAF_FRAME_POINTER) \
+ if (flag_omit_frame_pointer == 3) \
argvec.push_back("--disable-non-leaf-fp-elim"); \
} while (0)
#endif /* ENABLE_LLVM */
From enderby at apple.com Mon May 17 18:08:19 2010
From: enderby at apple.com (Kevin Enderby)
Date: Mon, 17 May 2010 23:08:19 -0000
Subject: [llvm-commits] [llvm] r103989 - in /llvm/trunk:
include/llvm/MC/MCContext.h include/llvm/MC/MCLabel.h lib/MC/CMakeLists.txt
lib/MC/MCContext.cpp lib/MC/MCLabel.cpp lib/MC/MCParser/AsmLexer.cpp
lib/MC/MCParser/AsmParser.cpp test/MC/MachO/direction_labels.s
Message-ID: <20100517230819.C9FF1312800A@llvm.org>
Author: enderby
Date: Mon May 17 18:08:19 2010
New Revision: 103989
URL: http://llvm.org/viewvc/llvm-project?rev=103989&view=rev
Log:
Added support in MC for Directional Local Labels.
Added:
llvm/trunk/include/llvm/MC/MCLabel.h
llvm/trunk/lib/MC/MCLabel.cpp
llvm/trunk/test/MC/MachO/direction_labels.s
Modified:
llvm/trunk/include/llvm/MC/MCContext.h
llvm/trunk/lib/MC/CMakeLists.txt
llvm/trunk/lib/MC/MCContext.cpp
llvm/trunk/lib/MC/MCParser/AsmLexer.cpp
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
Modified: llvm/trunk/include/llvm/MC/MCContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCContext.h?rev=103989&r1=103988&r2=103989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCContext.h (original)
+++ llvm/trunk/include/llvm/MC/MCContext.h Mon May 17 18:08:19 2010
@@ -20,6 +20,7 @@
class MCExpr;
class MCSection;
class MCSymbol;
+ class MCLabel;
class StringRef;
class Twine;
class MCSectionMachO;
@@ -43,6 +44,15 @@
/// NextUniqueID - The next ID to dole out to an unnamed assembler temporary
/// symbol.
unsigned NextUniqueID;
+
+ /// Instances of directional local labels.
+ DenseMap Instances;
+ /// NextInstance() creates the next instance of the directional local label
+ /// for the LocalLabelVal and adds it to the map if needed.
+ unsigned NextInstance(int64_t LocalLabelVal);
+ /// GetInstance() gets the current instance of the directional local label
+ /// for the LocalLabelVal and adds it to the map if needed.
+ unsigned GetInstance(int64_t LocalLabelVal);
/// Allocator - Allocator object used for creating machine code objects.
///
@@ -64,6 +74,14 @@
/// with a unique but unspecified name.
MCSymbol *CreateTempSymbol();
+ /// CreateDirectionalLocalSymbol - Create the defintion of a directional
+ /// local symbol for numbered label (used for "1:" defintions).
+ MCSymbol *CreateDirectionalLocalSymbol(int64_t LocalLabelVal);
+
+ /// GetDirectionalLocalSymbol - Create and return a directional local
+ /// symbol for numbered label (used for "1b" or 1f" references).
+ MCSymbol *GetDirectionalLocalSymbol(int64_t LocalLabelVal, int bORf);
+
/// GetOrCreateSymbol - Lookup the symbol inside with the specified
/// @p Name. If it exists, return it. If not, create a forward
/// reference and return it.
Added: llvm/trunk/include/llvm/MC/MCLabel.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCLabel.h?rev=103989&view=auto
==============================================================================
--- llvm/trunk/include/llvm/MC/MCLabel.h (added)
+++ llvm/trunk/include/llvm/MC/MCLabel.h Mon May 17 18:08:19 2010
@@ -0,0 +1,56 @@
+//===- MCLabel.h - Machine Code Directional Local Labels --------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains the declaration of the MCLabel class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_MC_MCLABEL_H
+#define LLVM_MC_MCLABEL_H
+
+namespace llvm {
+ class MCContext;
+ class raw_ostream;
+
+ /// MCLabel - Instances of this class represent a label name in the MC file,
+ /// and MCLabel are created and unique'd by the MCContext class. MCLabel
+ /// should only be constructed for valid instances in the object file.
+ class MCLabel {
+ // Instance - the instance number of this Directional Local Label
+ unsigned Instance;
+
+ private: // MCContext creates and uniques these.
+ friend class MCContext;
+ MCLabel(unsigned instance)
+ : Instance(instance) {}
+
+ MCLabel(const MCLabel&); // DO NOT IMPLEMENT
+ void operator=(const MCLabel&); // DO NOT IMPLEMENT
+ public:
+ /// getInstance - Get the current instance of this Directional Local Label.
+ unsigned getInstance() const { return Instance; }
+
+ /// incInstance - Increment the current instance of this Directional Local
+ /// Label.
+ unsigned incInstance() { return ++Instance; }
+
+ /// print - Print the value to the stream \arg OS.
+ void print(raw_ostream &OS) const;
+
+ /// dump - Print the value to stderr.
+ void dump() const;
+ };
+
+ inline raw_ostream &operator<<(raw_ostream &OS, const MCLabel &Label) {
+ Label.print(OS);
+ return OS;
+ }
+} // end namespace llvm
+
+#endif
Modified: llvm/trunk/lib/MC/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/CMakeLists.txt?rev=103989&r1=103988&r2=103989&view=diff
==============================================================================
--- llvm/trunk/lib/MC/CMakeLists.txt (original)
+++ llvm/trunk/lib/MC/CMakeLists.txt Mon May 17 18:08:19 2010
@@ -10,6 +10,7 @@
MCExpr.cpp
MCInst.cpp
MCInstPrinter.cpp
+ MCLabel.cpp
MCMachOStreamer.cpp
MCNullStreamer.cpp
MCObjectWriter.cpp
Modified: llvm/trunk/lib/MC/MCContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCContext.cpp?rev=103989&r1=103988&r2=103989&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCContext.cpp (original)
+++ llvm/trunk/lib/MC/MCContext.cpp Mon May 17 18:08:19 2010
@@ -13,6 +13,7 @@
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSectionCOFF.h"
#include "llvm/MC/MCSymbol.h"
+#include "llvm/MC/MCLabel.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Twine.h"
using namespace llvm;
@@ -71,6 +72,50 @@
"tmp" + Twine(NextUniqueID++));
}
+unsigned MCContext::NextInstance(int64_t LocalLabelVal) {
+ unsigned Instance;
+ MCLabel *Label;
+ Label = Instances[LocalLabelVal];
+ if (Label) {
+ Instance = Label->incInstance();
+ }
+ else {
+ Instance = 1;
+ Label = new MCLabel(Instance);
+ Instances[LocalLabelVal] = Label;
+ }
+ return Instance;
+}
+
+unsigned MCContext::GetInstance(int64_t LocalLabelVal) {
+ int Instance;
+ MCLabel *Label;
+ Label = Instances[LocalLabelVal];
+ if (Label) {
+ Instance = Label->getInstance();
+ }
+ else {
+ Instance = 0;
+ Label = new MCLabel(Instance);
+ Instances[LocalLabelVal] = Label;
+ }
+ return Instance;
+}
+
+MCSymbol *MCContext::CreateDirectionalLocalSymbol(int64_t LocalLabelVal) {
+ return GetOrCreateSymbol(Twine(MAI.getPrivateGlobalPrefix()) +
+ Twine(LocalLabelVal) +
+ "\2" +
+ Twine(NextInstance(LocalLabelVal)));
+}
+MCSymbol *MCContext::GetDirectionalLocalSymbol(int64_t LocalLabelVal,
+ int bORf) {
+ return GetOrCreateSymbol(Twine(MAI.getPrivateGlobalPrefix()) +
+ Twine(LocalLabelVal) +
+ "\2" +
+ Twine(GetInstance(LocalLabelVal) + bORf));
+}
+
MCSymbol *MCContext::LookupSymbol(StringRef Name) const {
return Symbols.lookup(Name);
}
Added: llvm/trunk/lib/MC/MCLabel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCLabel.cpp?rev=103989&view=auto
==============================================================================
--- llvm/trunk/lib/MC/MCLabel.cpp (added)
+++ llvm/trunk/lib/MC/MCLabel.cpp Mon May 17 18:08:19 2010
@@ -0,0 +1,21 @@
+//===- lib/MC/MCLabel.cpp - MCLabel implementation ----------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/MC/MCLabel.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
+using namespace llvm;
+
+void MCLabel::print(raw_ostream &OS) const {
+ OS << '"' << getInstance() << '"';
+}
+
+void MCLabel::dump() const {
+ print(dbgs());
+}
Modified: llvm/trunk/lib/MC/MCParser/AsmLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmLexer.cpp?rev=103989&r1=103988&r2=103989&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmLexer.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmLexer.cpp Mon May 17 18:08:19 2010
@@ -132,11 +132,6 @@
/// Decimal integer: [1-9][0-9]*
/// TODO: FP literal.
AsmToken AsmLexer::LexDigit() {
- if (*CurPtr == ':')
- return ReturnError(TokStart, "FIXME: local label not implemented");
- if (*CurPtr == 'f' || *CurPtr == 'b')
- return ReturnError(TokStart, "FIXME: directional label not implemented");
-
// Decimal integer: [1-9][0-9]*
if (CurPtr[-1] != '0') {
while (isdigit(*CurPtr))
@@ -158,6 +153,13 @@
if (*CurPtr == 'b') {
++CurPtr;
+ // See if we actually have "0b" as part of something like "jmp 0b\n"
+ if (CurPtr[0] == '\n') {
+ --CurPtr;
+ StringRef Result(TokStart, CurPtr - TokStart);
+ ++CurPtr;
+ return AsmToken(AsmToken::Integer, Result, 0);
+ }
const char *NumStart = CurPtr;
while (CurPtr[0] == '0' || CurPtr[0] == '1')
++CurPtr;
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=103989&r1=103988&r2=103989&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Mon May 17 18:08:19 2010
@@ -214,11 +214,28 @@
Res = MCSymbolRefExpr::Create(Sym, Variant, getContext());
return false;
}
- case AsmToken::Integer:
- Res = MCConstantExpr::Create(getTok().getIntVal(), getContext());
+ case AsmToken::Integer: {
+ SMLoc Loc = getTok().getLoc();
+ int64_t IntVal = getTok().getIntVal();
+ Res = MCConstantExpr::Create(IntVal, getContext());
EndLoc = Lexer.getLoc();
Lex(); // Eat token.
+ // Look for 'b' or 'f' following an Integer as a directional label
+ if (Lexer.getKind() == AsmToken::Identifier) {
+ StringRef IDVal = getTok().getString();
+ if (IDVal == "f" || IDVal == "b"){
+ MCSymbol *Sym = Ctx.GetDirectionalLocalSymbol(IntVal,
+ IDVal == "f" ? 1 : 0);
+ Res = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None,
+ getContext());
+ if(IDVal == "b" && Sym->isUndefined())
+ return Error(Loc, "invalid reference to undefined symbol");
+ EndLoc = Lexer.getLoc();
+ Lex(); // Eat identifier.
+ }
+ }
return false;
+ }
case AsmToken::Dot: {
// This is a '.' reference, which references the current PC. Emit a
// temporary label to the streamer and refer to it.
@@ -422,7 +439,25 @@
AsmToken ID = getTok();
SMLoc IDLoc = ID.getLoc();
StringRef IDVal;
- if (ParseIdentifier(IDVal)) {
+ int64_t LocalLabelVal = -1;
+ // GUESS allow an integer followed by a ':' as a directional local label
+ if (Lexer.is(AsmToken::Integer)) {
+ LocalLabelVal = getTok().getIntVal();
+ if (LocalLabelVal < 0) {
+ if (!TheCondState.Ignore)
+ return TokError("unexpected token at start of statement");
+ IDVal = "";
+ }
+ else {
+ IDVal = getTok().getString();
+ Lex(); // Consume the integer token to be used as an identifier token.
+ if (Lexer.getKind() != AsmToken::Colon) {
+ if (!TheCondState.Ignore)
+ return TokError("unexpected token at start of statement");
+ }
+ }
+ }
+ else if (ParseIdentifier(IDVal)) {
if (!TheCondState.Ignore)
return TokError("unexpected token at start of statement");
IDVal = "";
@@ -459,7 +494,11 @@
// FIXME: Diagnostics. Note the location of the definition as a label.
// FIXME: This doesn't diagnose assignment to a symbol which has been
// implicitly marked as external.
- MCSymbol *Sym = CreateSymbol(IDVal);
+ MCSymbol *Sym;
+ if (LocalLabelVal == -1)
+ Sym = CreateSymbol(IDVal);
+ else
+ Sym = Ctx.CreateDirectionalLocalSymbol(LocalLabelVal);
if (!Sym->isUndefined() || Sym->isVariable())
return Error(IDLoc, "invalid symbol redefinition");
Added: llvm/trunk/test/MC/MachO/direction_labels.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/direction_labels.s?rev=103989&view=auto
==============================================================================
--- llvm/trunk/test/MC/MachO/direction_labels.s (added)
+++ llvm/trunk/test/MC/MachO/direction_labels.s Mon May 17 18:08:19 2010
@@ -0,0 +1,92 @@
+// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+
+direction_labels:
+10: nop
+ jmp 10b
+ nop
+ jmp 11f
+11: nop
+ ret
+
+// CHECK: ('cputype', 7)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 228)
+// CHECK: ('flag', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 1)
+// CHECK: ('size', 124)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 8)
+// CHECK: ('file_offset', 256)
+// CHECK: ('file_size', 8)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 1)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 8)
+// CHECK: ('offset', 256)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x80000400)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '\x90\xeb\xfd\x90\xeb\x00\x90\xc3')
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 1
+// CHECK: (('command', 2)
+// CHECK: ('size', 24)
+// CHECK: ('symoff', 264)
+// CHECK: ('nsyms', 1)
+// CHECK: ('stroff', 276)
+// CHECK: ('strsize', 20)
+// CHECK: ('_string_data', '\x00direction_labels\x00\x00\x00')
+// CHECK: ('_symbols', [
+// CHECK: # Symbol 0
+// CHECK: (('n_strx', 1)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 1)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', 'direction_labels')
+// CHECK: ),
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 2
+// CHECK: (('command', 11)
+// CHECK: ('size', 80)
+// CHECK: ('ilocalsym', 0)
+// CHECK: ('nlocalsym', 1)
+// CHECK: ('iextdefsym', 1)
+// CHECK: ('nextdefsym', 0)
+// CHECK: ('iundefsym', 1)
+// CHECK: ('nundefsym', 0)
+// CHECK: ('tocoff', 0)
+// CHECK: ('ntoc', 0)
+// CHECK: ('modtaboff', 0)
+// CHECK: ('nmodtab', 0)
+// CHECK: ('extrefsymoff', 0)
+// CHECK: ('nextrefsyms', 0)
+// CHECK: ('indirectsymoff', 0)
+// CHECK: ('nindirectsyms', 0)
+// CHECK: ('extreloff', 0)
+// CHECK: ('nextrel', 0)
+// CHECK: ('locreloff', 0)
+// CHECK: ('nlocrel', 0)
+// CHECK: ('_indirect_symbols', [
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
From isanbard at gmail.com Mon May 17 18:09:50 2010
From: isanbard at gmail.com (Bill Wendling)
Date: Mon, 17 May 2010 23:09:50 -0000
Subject: [llvm-commits] [llvm] r103990 - in /llvm/trunk/lib:
CodeGen/SelectionDAG/SelectionDAGISel.cpp Target/TargetMachine.cpp
Message-ID: <20100517230950.8C5DA312800A@llvm.org>
Author: void
Date: Mon May 17 18:09:50 2010
New Revision: 103990
URL: http://llvm.org/viewvc/llvm-project?rev=103990&view=rev
Log:
- Set the "HasCalls" flag after instruction selection is finished.
- Change the logic DisableFramePointerElim() to check for the
-disable-non-leaf-fp-elim before -disable-fp-elim.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/trunk/lib/Target/TargetMachine.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=103990&r1=103989&r2=103990&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon May 17 18:09:50 2010
@@ -233,6 +233,24 @@
}
}
+ // Determine if there are any calls in this machine function.
+ MachineFrameInfo *MFI = MF->getFrameInfo();
+ if (!MFI->hasCalls()) {
+ for (MachineFunction::const_iterator
+ I = MF->begin(), E = MF->end(); I != E; ++I) {
+ const MachineBasicBlock *MBB = I;
+ for (MachineBasicBlock::const_iterator
+ II = MBB->begin(), IE = MBB->end(); II != IE; ++II) {
+ const TargetInstrDesc &TID = TM.getInstrInfo()->get(II->getOpcode());
+ if (II->isInlineAsm() || (TID.isCall() && !TID.isReturn())) {
+ MFI->setHasCalls(true);
+ goto done;
+ }
+ }
+ }
+ done:;
+ }
+
// Release function-specific state. SDB and CurDAG are already cleared
// at this point.
FuncInfo->clear();
@@ -606,19 +624,6 @@
delete Scheduler;
}
- // Determine if there are any calls in this machine function.
- MachineFrameInfo *MFI = MF->getFrameInfo();
- if (!MFI->hasCalls()) {
- for (MachineBasicBlock::iterator
- I = BB->begin(), E = BB->end(); I != E; ++I) {
- const TargetInstrDesc &TID = TM.getInstrInfo()->get(I->getOpcode());
- if (I->isInlineAsm() || (TID.isCall() && !TID.isReturn())) {
- MFI->setHasCalls(true);
- break;
- }
- }
- }
-
// Free the SelectionDAG state, now that we're finished with it.
CurDAG->clear();
@@ -676,6 +681,7 @@
CurDAG->setRoot(Dummy.getValue());
}
+
DEBUG(errs() << "===== Instruction selection ends:\n");
PostprocessISelDAG();
Modified: llvm/trunk/lib/Target/TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=103990&r1=103989&r2=103990&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/TargetMachine.cpp Mon May 17 18:09:50 2010
@@ -273,13 +273,14 @@
/// DisableFramePointerElim - This returns true if frame pointer elimination
/// optimization should be disabled for the given machine function.
bool DisableFramePointerElim(const MachineFunction &MF) {
- if (NoFramePointerElim)
- return true;
+ // Check to see if we should eliminate non-leaf frame pointers and then
+ // check to see if we should eliminate all frame pointers.
if (NoFramePointerElimNonLeaf) {
const MachineFrameInfo *MFI = MF.getFrameInfo();
return MFI->hasCalls();
}
- return false;
+
+ return NoFramePointerElim;
}
/// LessPreciseFPMAD - This flag return true when -enable-fp-mad option
From evan.cheng at apple.com Mon May 17 18:24:12 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 17 May 2010 23:24:12 -0000
Subject: [llvm-commits] [llvm] r103994 - in /llvm/trunk:
lib/CodeGen/TwoAddressInstructionPass.cpp test/CodeGen/ARM/reg_sequence.ll
Message-ID: <20100517232412.BEFD4312800A@llvm.org>
Author: evancheng
Date: Mon May 17 18:24:12 2010
New Revision: 103994
URL: http://llvm.org/viewvc/llvm-project?rev=103994&view=rev
Log:
Fix PR7175. Insert copies of a REG_SEQUENCE source if it is used by other REG_SEQUENCE instructions.
Modified:
llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
llvm/trunk/test/CodeGen/ARM/reg_sequence.ll
Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=103994&r1=103993&r2=103994&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon May 17 18:24:12 2010
@@ -134,6 +134,7 @@
/// of the de-ssa process. This replaces sources of REG_SEQUENCE as
/// sub-register references of the register defined by REG_SEQUENCE.
bool EliminateRegSequences();
+
public:
static char ID; // Pass identification, replacement for typeid
TwoAddressInstructionPass() : MachineFunctionPass(&ID) {}
@@ -1216,6 +1217,17 @@
}
}
+static bool HasOtherRegSequenceUses(unsigned Reg, MachineInstr *RegSeq,
+ MachineRegisterInfo *MRI) {
+ for (MachineRegisterInfo::use_iterator UI = MRI->use_begin(Reg),
+ UE = MRI->use_end(); UI != UE; ++UI) {
+ MachineInstr *UseMI = &*UI;
+ if (UseMI != RegSeq && UseMI->isRegSequence())
+ return true;
+ }
+ return false;
+}
+
/// EliminateRegSequences - Eliminate REG_SEQUENCE instructions as part
/// of the de-ssa process. This replaces sources of REG_SEQUENCE as
/// sub-register references of the register defined by REG_SEQUENCE. e.g.
@@ -1261,7 +1273,9 @@
if (DefMI->isExtractSubreg())
RealSrcs.push_back(DefMI->getOperand(1).getReg());
- if (!Seen.insert(SrcReg) || MI->getParent() != DefMI->getParent()) {
+ if (!Seen.insert(SrcReg) ||
+ MI->getParent() != DefMI->getParent() ||
+ HasOtherRegSequenceUses(SrcReg, MI, MRI)) {
// REG_SEQUENCE cannot have duplicated operands, add a copy.
// Also add an copy if the source if live-in the block. We don't want
// to end up with a partial-redef of a livein, e.g.
Modified: llvm/trunk/test/CodeGen/ARM/reg_sequence.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/reg_sequence.ll?rev=103994&r1=103993&r2=103994&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/reg_sequence.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/reg_sequence.ll Mon May 17 18:24:12 2010
@@ -229,6 +229,41 @@
ret i32 0
}
+%0 = type { %1, %1, %1, %1 }
+%1 = type { %2 }
+%2 = type { <4 x float> }
+%3 = type { %0, %1 }
+
+; PR7157
+define arm_aapcs_vfpcc float @t9(%0* nocapture, %3* nocapture) nounwind {
+; CHECK: t9:
+; CHECK: vldr.64
+; CHECK-NEXT: vstmia r0, {d0,d1}
+; CHECK-NEXT: vmov.i8 d1
+; CHECK-NEXT: vstmia r0, {d0,d1}
+ %3 = bitcast double 0.000000e+00 to <2 x float> ; <<2 x float>> [#uses=2]
+ %4 = shufflevector <2 x float> %3, <2 x float> undef, <4 x i32> ; <<4 x float>> [#uses=1]
+ store <4 x float> %4, <4 x float>* undef, align 16
+ %5 = shufflevector <2 x float> %3, <2 x float> zeroinitializer, <4 x i32> ; <<4 x float>> [#uses=1]
+ store <4 x float> %5, <4 x float>* undef, align 16
+ br label %8
+
+; :6 ; preds = %8
+ br i1 undef, label %7, label %10
+
+; :7 ; preds = %6
+ br label %8
+
+; :8 ; preds = %7, %2
+ br i1 undef, label %6, label %9
+
+; :9 ; preds = %8
+ ret float undef
+
+; :10 ; preds = %6
+ ret float 9.990000e+02
+}
+
declare <4 x i32> @llvm.arm.neon.vld1.v4i32(i8*) nounwind readonly
declare <8 x i16> @llvm.arm.neon.vld1.v8i16(i8*) nounwind readonly
From daniel at zuster.org Mon May 17 18:27:07 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Mon, 17 May 2010 16:27:07 -0700
Subject: [llvm-commits] New ScriptedBuilder patch
In-Reply-To:
References:
Message-ID:
Hi Galina,
This seems more complicated than necessary. Since both sides are
Python code, there is no need for the assorted logic to handle import,
you could just pass the step to instantiate directly, instead of
passing the name of it. That is, have type just be the class to
instantiate, and call it like:
{'name' : 'test_llvm',
'type' :
zorg.buildbot.commands.ClangTestCommand.ClangTestCommand,
...
- Daniel
On Fri, May 14, 2010 at 5:06 PM, Galina Kistanova wrote:
> Hello,
>
> Please review patch to update one of existing builders and increase
> number of max_builds to 2 for the slave.
>
> Thanks
>
> Galina
>
>
> On Fri, May 14, 2010 at 4:47 PM, Galina Kistanova wrote:
>> Hello everyone,
>>
>> Please review the patch for buildbot ScriptedBuilder.
>> It adds ability to specify type of command for build steps (for
>> example to use ClangTestCommand). By default steps are
>> WarningCountingShellCommand.
>>
>> I am going to send follow up patch for update builders to use this.
>>
>> Please review.
>>
>> Thanks
>>
>> Galina
>>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
From stoklund at 2pi.dk Mon May 17 18:29:24 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Mon, 17 May 2010 23:29:24 -0000
Subject: [llvm-commits] [llvm] r103995 -
/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Message-ID: <20100517232924.1DEF5312800A@llvm.org>
Author: stoklund
Date: Mon May 17 18:29:23 2010
New Revision: 103995
URL: http://llvm.org/viewvc/llvm-project?rev=103995&view=rev
Log:
ARMBaseRegisterInfo::estimateRSStackSizeLimit() could return prematurely with a
too large limit.
The function would return immediately when finding an addrmode 3/5 instruction.
It needs to keep scanning in case there is an addrmode 6 instruction which drops
the limit to 0.
A test case is very difficult to produce because it will only fail when the
scavenger is used.
rdar://problem/7894847
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=103995&r1=103994&r2=103995&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Mon May 17 18:29:23 2010
@@ -724,24 +724,25 @@
I != E; ++I) {
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
if (!I->getOperand(i).isFI()) continue;
-
- const TargetInstrDesc &Desc = TII.get(I->getOpcode());
- unsigned AddrMode = (Desc.TSFlags & ARMII::AddrModeMask);
- if (AddrMode == ARMII::AddrMode3 ||
- AddrMode == ARMII::AddrModeT2_i8)
- return (1 << 8) - 1;
-
- if (AddrMode == ARMII::AddrMode5 ||
- AddrMode == ARMII::AddrModeT2_i8s4)
+ switch (I->getDesc().TSFlags & ARMII::AddrModeMask) {
+ case ARMII::AddrMode3:
+ case ARMII::AddrModeT2_i8:
+ Limit = std::min(Limit, (1U << 8) - 1);
+ break;
+ case ARMII::AddrMode5:
+ case ARMII::AddrModeT2_i8s4:
Limit = std::min(Limit, ((1U << 8) - 1) * 4);
-
- if (AddrMode == ARMII::AddrModeT2_i12 && hasFP(MF))
- // When the stack offset is negative, we will end up using
- // the i8 instructions instead.
- return (1 << 8) - 1;
-
- if (AddrMode == ARMII::AddrMode6)
+ break;
+ case ARMII::AddrModeT2_i12:
+ if (hasFP(MF)) Limit = std::min(Limit, (1U << 8) - 1);
+ break;
+ case ARMII::AddrMode6:
+ // Addressing mode 6 (load/store) instructions can't encode an
+ // immediate offset for stack references.
return 0;
+ default:
+ break;
+ }
break; // At most one FI per instruction
}
}
From bob.wilson at apple.com Mon May 17 18:37:16 2010
From: bob.wilson at apple.com (Bob Wilson)
Date: Mon, 17 May 2010 23:37:16 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r103997 -
/llvm-gcc-4.2/trunk/gcc/cp/mangle.c
Message-ID: <20100517233716.CEC54312800A@llvm.org>
Author: bwilson
Date: Mon May 17 18:37:16 2010
New Revision: 103997
URL: http://llvm.org/viewvc/llvm-project?rev=103997&view=rev
Log:
Look through typedefs when mangling NEON vector types. The new arm_mangle_type
implementation that looks for the builtin NEON types requires this.
Modified:
llvm-gcc-4.2/trunk/gcc/cp/mangle.c
Modified: llvm-gcc-4.2/trunk/gcc/cp/mangle.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/mangle.c?rev=103997&r1=103996&r2=103997&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/mangle.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/mangle.c Mon May 17 18:37:16 2010
@@ -1591,7 +1591,7 @@
else
{
/* APPLE LOCAL begin mangle_type 7105099 */
- tree type_orig = type;
+ /* LLVM LOCAL removed copy to type_orig */
/* See through any typedefs. */
type = TYPE_MAIN_VARIANT (type);
@@ -1602,7 +1602,8 @@
{
/* Handle any target-specific fundamental types. */
const char *target_mangling
- = targetm.mangle_type (type_orig);
+ /* LLVM LOCAL mangle based on TYPE_MAIN_VARIANT, not type_orig */
+ = targetm.mangle_type (type);
if (target_mangling)
{
From dalej at apple.com Mon May 17 18:42:20 2010
From: dalej at apple.com (Dale Johannesen)
Date: Mon, 17 May 2010 16:42:20 -0700
Subject: [llvm-commits] [llvm-gcc-4.2] r103997 -
/llvm-gcc-4.2/trunk/gcc/cp/mangle.c
In-Reply-To: <20100517233716.CEC54312800A@llvm.org>
References: <20100517233716.CEC54312800A@llvm.org>
Message-ID: <5F421327-348D-4D12-96F2-C77E69A361B9@apple.com>
On May 17, 2010, at 4:37 PMPDT, Bob Wilson wrote:
> Author: bwilson
> Date: Mon May 17 18:37:16 2010
> New Revision: 103997
>
> URL: http://llvm.org/viewvc/llvm-project?rev=103997&view=rev
> Log:
> Look through typedefs when mangling NEON vector types. The new arm_mangle_type
> implementation that looks for the builtin NEON types requires this.
Is this really safe in general? I don't see anything limiting the effect to NEON vector types.
> Modified:
> llvm-gcc-4.2/trunk/gcc/cp/mangle.c
>
> Modified: llvm-gcc-4.2/trunk/gcc/cp/mangle.c
> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/mangle.c?rev=103997&r1=103996&r2=103997&view=diff
> ==============================================================================
> --- llvm-gcc-4.2/trunk/gcc/cp/mangle.c (original)
> +++ llvm-gcc-4.2/trunk/gcc/cp/mangle.c Mon May 17 18:37:16 2010
> @@ -1591,7 +1591,7 @@
> else
> {
> /* APPLE LOCAL begin mangle_type 7105099 */
> - tree type_orig = type;
> + /* LLVM LOCAL removed copy to type_orig */
>
> /* See through any typedefs. */
> type = TYPE_MAIN_VARIANT (type);
> @@ -1602,7 +1602,8 @@
> {
> /* Handle any target-specific fundamental types. */
> const char *target_mangling
> - = targetm.mangle_type (type_orig);
> + /* LLVM LOCAL mangle based on TYPE_MAIN_VARIANT, not type_orig */
> + = targetm.mangle_type (type);
>
> if (target_mangling)
> {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From evan.cheng at apple.com Mon May 17 19:03:40 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 18 May 2010 00:03:40 -0000
Subject: [llvm-commits] [llvm] r104004 - in /llvm/trunk:
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/ARM/2010-05-17-DAGCombineAssert.ll
Message-ID: <20100518000340.3B073312800A@llvm.org>
Author: evancheng
Date: Mon May 17 19:03:40 2010
New Revision: 104004
URL: http://llvm.org/viewvc/llvm-project?rev=104004&view=rev
Log:
FIX PR7158. SimplifyVBinOp was asserting when it fails to constant fold (op (build_vector), (build_vector)).
Added:
llvm/trunk/test/CodeGen/ARM/2010-05-17-DAGCombineAssert.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=104004&r1=104003&r2=104004&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon May 17 19:03:40 2010
@@ -6344,13 +6344,14 @@
break;
}
- Ops.push_back(DAG.getNode(N->getOpcode(), LHS.getDebugLoc(),
- EltType, LHSOp, RHSOp));
- AddToWorkList(Ops.back().getNode());
- assert((Ops.back().getOpcode() == ISD::UNDEF ||
- Ops.back().getOpcode() == ISD::Constant ||
- Ops.back().getOpcode() == ISD::ConstantFP) &&
- "Scalar binop didn't fold!");
+ SDValue FoldOp = DAG.getNode(N->getOpcode(), LHS.getDebugLoc(), EltType,
+ LHSOp, RHSOp);
+ if (FoldOp.getOpcode() != ISD::UNDEF &&
+ FoldOp.getOpcode() != ISD::Constant &&
+ FoldOp.getOpcode() != ISD::ConstantFP)
+ break;
+ Ops.push_back(FoldOp);
+ AddToWorkList(FoldOp.getNode());
}
if (Ops.size() == LHS.getNumOperands()) {
Added: llvm/trunk/test/CodeGen/ARM/2010-05-17-DAGCombineAssert.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2010-05-17-DAGCombineAssert.ll?rev=104004&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2010-05-17-DAGCombineAssert.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/2010-05-17-DAGCombineAssert.ll Mon May 17 19:03:40 2010
@@ -0,0 +1,17 @@
+; RUN: llc < %s -mtriple=armv7-eabi -mcpu=cortex-a8
+; PR7158
+
+define arm_aapcs_vfpcc i32 @main() nounwind {
+bb.nph55.bb.nph55.split_crit_edge:
+ br label %bb3
+
+bb3: ; preds = %bb3, %bb.nph55.bb.nph55.split_crit_edge
+ br i1 undef, label %bb.i19, label %bb3
+
+bb.i19: ; preds = %bb.i19, %bb3
+ %0 = insertelement <4 x float> undef, float undef, i32 3 ; <<4 x float>> [#uses=3]
+ %1 = fmul <4 x float> %0, %0 ; <<4 x float>> [#uses=1]
+ %2 = bitcast <4 x float> %1 to <2 x double> ; <<2 x double>> [#uses=0]
+ %3 = fmul <4 x float> %0, undef ; <<4 x float>> [#uses=0]
+ br label %bb.i19
+}
From bob.wilson at apple.com Mon May 17 19:18:56 2010
From: bob.wilson at apple.com (Bob Wilson)
Date: Mon, 17 May 2010 17:18:56 -0700
Subject: [llvm-commits] [llvm-gcc-4.2] r103997 -
/llvm-gcc-4.2/trunk/gcc/cp/mangle.c
In-Reply-To: <5F421327-348D-4D12-96F2-C77E69A361B9@apple.com>
References: <20100517233716.CEC54312800A@llvm.org>
<5F421327-348D-4D12-96F2-C77E69A361B9@apple.com>
Message-ID:
On May 17, 2010, at 4:42 PM, Dale Johannesen wrote:
>
> On May 17, 2010, at 4:37 PMPDT, Bob Wilson wrote:
>
>> Author: bwilson
>> Date: Mon May 17 18:37:16 2010
>> New Revision: 103997
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=103997&view=rev
>> Log:
>> Look through typedefs when mangling NEON vector types. The new arm_mangle_type
>> implementation that looks for the builtin NEON types requires this.
>
> Is this really safe in general? I don't see anything limiting the effect to NEON vector types.
It should be safe because all of the other target-specific mangling functions in the llvm-gcc sources already follow the TYPE_MAIN_VARIANT. But, since you raised the question, I looked again and it seems like it would be more consistent to move that into the arm_mangle_type function. Then if some other target ever wants to look at the original type, it has the option to do so.
From bob.wilson at apple.com Mon May 17 19:37:36 2010
From: bob.wilson at apple.com (Bob Wilson)
Date: Tue, 18 May 2010 00:37:36 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r104009 - in /llvm-gcc-4.2/trunk/gcc:
config/arm/arm.c cp/mangle.c
Message-ID: <20100518003736.B6A8C312800A@llvm.org>
Author: bwilson
Date: Mon May 17 19:37:36 2010
New Revision: 104009
URL: http://llvm.org/viewvc/llvm-project?rev=104009&view=rev
Log:
Revert r103997 and instead change arm_mangle_type to look through typedefs.
Modified:
llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
llvm-gcc-4.2/trunk/gcc/cp/mangle.c
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.c?rev=104009&r1=104008&r2=104009&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/arm.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.c Mon May 17 19:37:36 2010
@@ -24037,6 +24037,9 @@
/* LLVM LOCAL */
unsigned pos;
+ /* LLVM LOCAL look through typedefs */
+ type = TYPE_MAIN_VARIANT (type);
+
/* LLVM LOCAL begin half-float */
if (arm_is_fp16(type))
return "Dh";
Modified: llvm-gcc-4.2/trunk/gcc/cp/mangle.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/mangle.c?rev=104009&r1=104008&r2=104009&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/mangle.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/mangle.c Mon May 17 19:37:36 2010
@@ -1591,7 +1591,7 @@
else
{
/* APPLE LOCAL begin mangle_type 7105099 */
- /* LLVM LOCAL removed copy to type_orig */
+ tree type_orig = type;
/* See through any typedefs. */
type = TYPE_MAIN_VARIANT (type);
@@ -1602,8 +1602,7 @@
{
/* Handle any target-specific fundamental types. */
const char *target_mangling
- /* LLVM LOCAL mangle based on TYPE_MAIN_VARIANT, not type_orig */
- = targetm.mangle_type (type);
+ = targetm.mangle_type (type_orig);
if (target_mangling)
{
From gkistanova at gmail.com Mon May 17 20:46:44 2010
From: gkistanova at gmail.com (Galina Kistanova)
Date: Mon, 17 May 2010 18:46:44 -0700
Subject: [llvm-commits] New ScriptedBuilder patch
In-Reply-To:
References:
Message-ID:
Hello,
I corrected the patch (patch06.diff for all changes now).
Also I tried to make ScriptedBuilder not specific to llvm-gcc builds.
Please review.
Thanks
Galina
On Mon, May 17, 2010 at 4:27 PM, Daniel Dunbar wrote:
> Hi Galina,
>
> This seems more complicated than necessary. Since both sides are
> Python code, there is no need for the assorted logic to handle import,
> you could just pass the step to instantiate directly, instead of
> passing the name of it. That is, have type just be the class to
> instantiate, and call it like:
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{'name' ? ? ? ? ?: 'test_llvm',
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'type' ? ? ? ? ?:
> zorg.buildbot.commands.ClangTestCommand.ClangTestCommand,
> ...
>
> ?- Daniel
>
>
> On Fri, May 14, 2010 at 5:06 PM, Galina Kistanova wrote:
>> Hello,
>>
>> Please review patch to update one of existing builders and increase
>> number of max_builds to 2 for the slave.
>>
>> Thanks
>>
>> Galina
>>
>>
>> On Fri, May 14, 2010 at 4:47 PM, Galina Kistanova wrote:
>>> Hello everyone,
>>>
>>> Please review the patch for buildbot ScriptedBuilder.
>>> It adds ability to specify type of command for build steps (for
>>> example to use ClangTestCommand). By default steps are
>>> WarningCountingShellCommand.
>>>
>>> I am going to send follow up patch for update builders to use this.
>>>
>>> Please review.
>>>
>>> Thanks
>>>
>>> Galina
>>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch06.diff
Type: text/x-patch
Size: 6516 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100517/331d5e08/attachment.bin
From mikem.llvm at gmail.com Mon May 17 21:53:34 2010
From: mikem.llvm at gmail.com (mike-m)
Date: Mon, 17 May 2010 22:53:34 -0400
Subject: [llvm-commits] [Request for approval] array bounds regression
Message-ID: <6EF9FC3C-DE5F-489D-A753-4DC17E172675@gmail.com>
Ok to apply? fixes the following:
lib/CodeGen/SelectionDAG/TargetLowering.cpp:637: warning: array subscript is above array bounds
--mike-m
-------------- next part --------------
A non-text attachment was scrubbed...
Name: valtypes_bounds.patch
Type: application/octet-stream
Size: 589 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100517/83d9517e/attachment.obj
From bob.wilson at apple.com Tue May 18 00:54:29 2010
From: bob.wilson at apple.com (Bob Wilson)
Date: Tue, 18 May 2010 05:54:29 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r104016 -
/llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
Message-ID: <20100518055429.33C44312800A@llvm.org>
Author: bwilson
Date: Tue May 18 00:54:29 2010
New Revision: 104016
URL: http://llvm.org/viewvc/llvm-project?rev=104016&view=rev
Log:
For vectors with 64-bit elements, vldN_dup is equivalent to vldN (and there
are no Neon instructions for vldN_dup with 64-bit elements), so translate
those builtins to the vldN intrinsics. Radar 7985191.
Modified:
llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp?rev=104016&r1=104015&r2=104016&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp Tue May 18 00:54:29 2010
@@ -2093,6 +2093,23 @@
assert(STy && "expected a struct type");
const VectorType *VTy = dyn_cast(STy->getElementType(0));
assert(VTy && "expected a vector type");
+ intOpTypes[0] = VTy;
+
+ // Handle 64-bit elements as a special-case. There is no "dup" needed.
+ if (VTy->getElementType()->getPrimitiveSizeInBits() == 64) {
+ switch (neon_code) {
+ case NEON_BUILTIN_vld2_dup: intID = Intrinsic::arm_neon_vld2; break;
+ case NEON_BUILTIN_vld3_dup: intID = Intrinsic::arm_neon_vld3; break;
+ case NEON_BUILTIN_vld4_dup: intID = Intrinsic::arm_neon_vld4; break;
+ default: assert(false);
+ }
+ intFn = Intrinsic::getDeclaration(TheModule, intID, intOpTypes, 1);
+ Type *VPTy = PointerType::getUnqual(Type::getInt8Ty(Context));
+ Result = Builder.CreateCall(intFn, BitCastToType(Ops[0], VPTy));
+ Builder.CreateStore(Result, DestLoc->Ptr);
+ Result = 0;
+ break;
+ }
// First use a vldN_lane intrinsic to load into lane 0 of undef vectors.
switch (neon_code) {
@@ -2101,7 +2118,6 @@
case NEON_BUILTIN_vld4_dup: intID = Intrinsic::arm_neon_vld4lane; break;
default: assert(false);
}
- intOpTypes[0] = VTy;
intFn = Intrinsic::getDeclaration(TheModule, intID, intOpTypes, 1);
unsigned NumVecs = 0;
switch (neon_code) {
From rideau3 at gmail.com Tue May 18 01:22:50 2010
From: rideau3 at gmail.com (Sean Hunt)
Date: Tue, 18 May 2010 06:22:50 -0000
Subject: [llvm-commits] [llvm] r104018 -
/llvm/trunk/utils/TableGen/ClangASTNodesEmitter.cpp
Message-ID: <20100518062250.5541E312800A@llvm.org>
Author: coppro
Date: Tue May 18 01:22:50 2010
New Revision: 104018
URL: http://llvm.org/viewvc/llvm-project?rev=104018&view=rev
Log:
Replace FIRST_* and LAST_* macros with a generic STMT_RANGE macro
Also rename ABSTRACT to ABSTRACT_STMT
Modified:
llvm/trunk/utils/TableGen/ClangASTNodesEmitter.cpp
Modified: llvm/trunk/utils/TableGen/ClangASTNodesEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/ClangASTNodesEmitter.cpp?rev=104018&r1=104017&r2=104018&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/ClangASTNodesEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/ClangASTNodesEmitter.cpp Tue May 18 01:22:50 2010
@@ -37,7 +37,8 @@
// Called recursively to ensure that nodes remain contiguous
static std::pair EmitStmtNode(const ChildMap &Tree,
raw_ostream &OS,
- Record *Base) {
+ Record *Base,
+ bool Root = true) {
std::string BaseName = macroName(Base->getName());
ChildIterator i = Tree.lower_bound(Base), e = Tree.upper_bound(Base);
@@ -59,14 +60,15 @@
OS << "#endif\n";
if (Abstract)
- OS << "ABSTRACT(" << NodeName << "(" << R->getName() << ", "
+ OS << "ABSTRACT_STMT(" << NodeName << "(" << R->getName() << ", "
<< Base->getName() << "))\n";
else
OS << NodeName << "(" << R->getName() << ", "
<< Base->getName() << ")\n";
if (Tree.find(R) != Tree.end()) {
- const std::pair &Result = EmitStmtNode(Tree, OS, R);
+ const std::pair &Result
+ = EmitStmtNode(Tree, OS, R, false);
if (!First && Result.first)
First = Result.first;
if (Result.second)
@@ -83,32 +85,35 @@
OS << "#undef " << NodeName << "\n\n";
}
- assert(!First == !Last && "Got a first or last node, but not the other");
-
if (First) {
- OS << "#ifndef FIRST_" << BaseName << "\n";
- OS << "# define FIRST_" << BaseName << "(CLASS)\n";
- OS << "#endif\n";
- OS << "#ifndef LAST_" << BaseName << "\n";
- OS << "# define LAST_" << BaseName << "(CLASS)\n";
- OS << "#endif\n\n";
-
- OS << "FIRST_" << BaseName << "(" << First->getName() << ")\n";
- OS << "LAST_" << BaseName << "(" << Last->getName() << ")\n\n";
+ assert (Last && "Got a first node but not a last node for a range!");
+ if (Root)
+ OS << "LAST_STMT_RANGE(";
+ else
+ OS << "STMT_RANGE(";
+
+ OS << Base->getName() << ", " << First->getName() << ", "
+ << Last->getName() << ")\n\n";
}
- OS << "#undef FIRST_" << BaseName << "\n";
- OS << "#undef LAST_" << BaseName << "\n\n";
-
return std::make_pair(First, Last);
}
void ClangStmtNodesEmitter::run(raw_ostream &OS) {
// Write the preamble
- OS << "#ifndef ABSTRACT\n";
- OS << "# define ABSTRACT(Stmt) Stmt\n";
+ OS << "#ifndef ABSTRACT_STMT\n";
+ OS << "# define ABSTRACT_STMT(Stmt) Stmt\n";
+ OS << "#endif\n";
+
+ OS << "#ifndef STMT_RANGE\n";
+ OS << "# define STMT_RANGE(Base, First, Last)\n";
OS << "#endif\n\n";
+ OS << "#ifndef LAST_STMT_RANGE\n";
+ OS << "# define LAST_STMT_RANGE(Base, First, Last) "
+ "STMT_RANGE(Base, First, Last)\n";
+ OS << "#endif\n\n";
+
// Emit statements
const std::vector Stmts = Records.getAllDerivedDefinitions("Stmt");
@@ -130,5 +135,7 @@
EmitStmtNode(Tree, OS, &Stmt);
OS << "#undef STMT\n";
- OS << "#undef ABSTRACT\n";
+ OS << "#undef STMT_RANGE\n";
+ OS << "#undef LAST_STMT_RANGE\n";
+ OS << "#undef ABSTRACT_STMT\n";
}
From clattner at apple.com Tue May 18 01:31:15 2010
From: clattner at apple.com (Chris Lattner)
Date: Mon, 17 May 2010 23:31:15 -0700
Subject: [llvm-commits] [Request for approval] array bounds regression
In-Reply-To: <6EF9FC3C-DE5F-489D-A753-4DC17E172675@gmail.com>
References: <6EF9FC3C-DE5F-489D-A753-4DC17E172675@gmail.com>
Message-ID: <2EBB780D-7DF8-461F-8F13-3FE97BBCE586@apple.com>
looks good to me, please apply. Thanks!
On May 17, 2010, at 7:53 PM, mike-m wrote:
> Ok to apply? fixes the following:
>
> lib/CodeGen/SelectionDAG/TargetLowering.cpp:637: warning: array subscript is above array bounds
>
> --mike-m
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From baldrick at free.fr Tue May 18 01:38:11 2010
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 18 May 2010 08:38:11 +0200
Subject: [llvm-commits] [llvm-gcc-4.2] r103976
- /llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
In-Reply-To: <20100517210604.B2B51312800A@llvm.org>
References: <20100517210604.B2B51312800A@llvm.org>
Message-ID: <4BF235D3.60206@free.fr>
Hi Bill,
> Turn on "--disable-non-leaf-fp-elim" if -momit-leaf-frame-pointer is specified.
if -fomit-frame-pointer and -momit-leaf-frame-pointer are both specified,
then the frame pointer should be omitted for all functions. Will your
patch do this? Also, if -fomit-frame-pointer is not specified, but
-momit-leaf-frame-pointer is, I hope -disable-fp-elim is not passed to
llc. How does that work? Presumably due to how gcc is setting up the
various flags. Can you please add some comments.
Thanks,
Duncan.
From baldrick at free.fr Tue May 18 01:42:15 2010
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 18 May 2010 08:42:15 +0200
Subject: [llvm-commits] [llvm] r103990 - in /llvm/trunk/lib:
CodeGen/SelectionDAG/SelectionDAGISel.cpp Target/TargetMachine.cpp
In-Reply-To: <20100517230950.8C5DA312800A@llvm.org>
References: <20100517230950.8C5DA312800A@llvm.org>
Message-ID: <4BF236C7.6040408@free.fr>
Hi Bill,
> - Change the logic DisableFramePointerElim() to check for the
> -disable-non-leaf-fp-elim before -disable-fp-elim.
doesn't this mean that if you specify both -disable-non-leaf-fp-elim
and -disable-fp-elim, then the frame pointer is eliminated for leaf
functions? That's surely wrong since the user set -disable-fp-elim.
Ciao,
Duncan.
> bool DisableFramePointerElim(const MachineFunction&MF) {
> - if (NoFramePointerElim)
> - return true;
> + // Check to see if we should eliminate non-leaf frame pointers and then
> + // check to see if we should eliminate all frame pointers.
> if (NoFramePointerElimNonLeaf) {
> const MachineFrameInfo *MFI = MF.getFrameInfo();
> return MFI->hasCalls();
> }
> - return false;
> +
> + return NoFramePointerElim;
> }
From benny.kra at googlemail.com Tue May 18 07:15:34 2010
From: benny.kra at googlemail.com (Benjamin Kramer)
Date: Tue, 18 May 2010 12:15:34 -0000
Subject: [llvm-commits] [llvm] r104020 - /llvm/trunk/lib/MC/MCContext.cpp
Message-ID: <20100518121534.D6214312800A@llvm.org>
Author: d0k
Date: Tue May 18 07:15:34 2010
New Revision: 104020
URL: http://llvm.org/viewvc/llvm-project?rev=104020&view=rev
Log:
Simplify MCContext::(Next|Get)Instance
- Allocate MCLabels in the context so they don't leak.
- Avoid duplicated densemap lookup.
Modified:
llvm/trunk/lib/MC/MCContext.cpp
Modified: llvm/trunk/lib/MC/MCContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCContext.cpp?rev=104020&r1=104019&r2=104020&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCContext.cpp (original)
+++ llvm/trunk/lib/MC/MCContext.cpp Tue May 18 07:15:34 2010
@@ -73,33 +73,17 @@
}
unsigned MCContext::NextInstance(int64_t LocalLabelVal) {
- unsigned Instance;
- MCLabel *Label;
- Label = Instances[LocalLabelVal];
- if (Label) {
- Instance = Label->incInstance();
- }
- else {
- Instance = 1;
- Label = new MCLabel(Instance);
- Instances[LocalLabelVal] = Label;
- }
- return Instance;
+ MCLabel *&Label = Instances[LocalLabelVal];
+ if (!Label)
+ Label = new (*this) MCLabel(0);
+ return Label->incInstance();
}
unsigned MCContext::GetInstance(int64_t LocalLabelVal) {
- int Instance;
- MCLabel *Label;
- Label = Instances[LocalLabelVal];
- if (Label) {
- Instance = Label->getInstance();
- }
- else {
- Instance = 0;
- Label = new MCLabel(Instance);
- Instances[LocalLabelVal] = Label;
- }
- return Instance;
+ MCLabel *&Label = Instances[LocalLabelVal];
+ if (!Label)
+ Label = new (*this) MCLabel(0);
+ return Label->getInstance();
}
MCSymbol *MCContext::CreateDirectionalLocalSymbol(int64_t LocalLabelVal) {
From daniel at zuster.org Tue May 18 08:59:57 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Tue, 18 May 2010 06:59:57 -0700
Subject: [llvm-commits] New ScriptedBuilder patch
In-Reply-To:
References:
Message-ID:
Hi Galina,
Looks fine to me!
- Daniel
On Mon, May 17, 2010 at 6:46 PM, Galina Kistanova wrote:
> Hello,
>
> I corrected the patch (patch06.diff for all changes now).
> Also I tried to make ScriptedBuilder not specific to llvm-gcc builds.
> Please review.
>
> Thanks
>
> Galina
>
>
> On Mon, May 17, 2010 at 4:27 PM, Daniel Dunbar wrote:
>> Hi Galina,
>>
>> This seems more complicated than necessary. Since both sides are
>> Python code, there is no need for the assorted logic to handle import,
>> you could just pass the step to instantiate directly, instead of
>> passing the name of it. That is, have type just be the class to
>> instantiate, and call it like:
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{'name' ? ? ? ? ?: 'test_llvm',
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'type' ? ? ? ? ?:
>> zorg.buildbot.commands.ClangTestCommand.ClangTestCommand,
>> ...
>>
>> ?- Daniel
>>
>>
>> On Fri, May 14, 2010 at 5:06 PM, Galina Kistanova wrote:
>>> Hello,
>>>
>>> Please review patch to update one of existing builders and increase
>>> number of max_builds to 2 for the slave.
>>>
>>> Thanks
>>>
>>> Galina
>>>
>>>
>>> On Fri, May 14, 2010 at 4:47 PM, Galina Kistanova wrote:
>>>> Hello everyone,
>>>>
>>>> Please review the patch for buildbot ScriptedBuilder.
>>>> It adds ability to specify type of command for build steps (for
>>>> example to use ClangTestCommand). By default steps are
>>>> WarningCountingShellCommand.
>>>>
>>>> I am going to send follow up patch for update builders to use this.
>>>>
>>>> Please review.
>>>>
>>>> Thanks
>>>>
>>>> Galina
>>>>
>>>
>>> _______________________________________________
>>> 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 May 18 10:25:15 2010
From: gohman at apple.com (Dan Gohman)
Date: Tue, 18 May 2010 15:25:15 -0000
Subject: [llvm-commits] [llvm] r104021 -
/llvm/trunk/lib/Support/raw_ostream.cpp
Message-ID: <20100518152515.0D5A6312800A@llvm.org>
Author: djg
Date: Tue May 18 10:25:14 2010
New Revision: 104021
URL: http://llvm.org/viewvc/llvm-project?rev=104021&view=rev
Log:
Usage of O_NONBLOCK in bjam is now confirmed as a bug and fixed upstream.
Update the comment.
Modified:
llvm/trunk/lib/Support/raw_ostream.cpp
Modified: llvm/trunk/lib/Support/raw_ostream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=104021&r1=104020&r2=104021&view=diff
==============================================================================
--- llvm/trunk/lib/Support/raw_ostream.cpp (original)
+++ llvm/trunk/lib/Support/raw_ostream.cpp Tue May 18 10:25:14 2010
@@ -434,10 +434,13 @@
if (ret < 0) {
// If it's a recoverable error, swallow it and retry the write.
- // EAGAIN and EWOULDBLOCK are not unambiguously recoverable, but
- // some programs, such as bjam, assume that their child processes
- // will treat them as if they are. If you don't want this code to
- // spin, don't use O_NONBLOCK file descriptors with raw_ostream.
+ //
+ // Ideally we wouldn't ever see EAGAIN or EWOULDBLOCK here, since
+ // raw_ostream isn't designed to do non-blocking I/O. However, some
+ // programs, such as old versions of bjam, have mistakenly used
+ // O_NONBLOCK. For compatibility, emulate blocking semantics by
+ // spinning until the write succeeds. If you don't want spinning,
+ // don't use O_NONBLOCK file descriptors with raw_ostream.
if (errno == EINTR || errno == EAGAIN
#ifdef EWOULDBLOCK
|| errno == EWOULDBLOCK
From simmon12 at illinois.edu Tue May 18 11:42:58 2010
From: simmon12 at illinois.edu (Patrick Simmons)
Date: Tue, 18 May 2010 16:42:58 -0000
Subject: [llvm-commits] [poolalloc] r104024 - in
/poolalloc/branches/release_26: lib/PoolAllocate/TransformFunctionBody.cpp
runtime/FL2Allocator/PoolAllocator.cpp
Message-ID: <20100518164258.E8727312800A@llvm.org>
Author: psimmons
Date: Tue May 18 11:42:58 2010
New Revision: 104024
URL: http://llvm.org/viewvc/llvm-project?rev=104024&view=rev
Log:
bug fixes for experimental pool allocation thread support
Modified:
poolalloc/branches/release_26/lib/PoolAllocate/TransformFunctionBody.cpp
poolalloc/branches/release_26/runtime/FL2Allocator/PoolAllocator.cpp
Modified: poolalloc/branches/release_26/lib/PoolAllocate/TransformFunctionBody.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/release_26/lib/PoolAllocate/TransformFunctionBody.cpp?rev=104024&r1=104023&r2=104024&view=diff
==============================================================================
--- poolalloc/branches/release_26/lib/PoolAllocate/TransformFunctionBody.cpp (original)
+++ poolalloc/branches/release_26/lib/PoolAllocate/TransformFunctionBody.cpp Tue May 18 11:42:58 2010
@@ -586,13 +586,12 @@
abort();
} else if (CF->getName() == "pthread_create") {
thread_creation_point = true;
- //Get DSNode representing the void* passed to the callee
- DSNodeHandle passed_dsnode_handle = G->getNodeForValue(CS.getArgument(3));
//Get DSNode representing the DSNode of the function pointer Value of the pthread_create call
DSNode* thread_callee_node = G->getNodeForValue(CS.getArgument(2)).getNode();
if(!thread_callee_node)
{
+ assert(0 && "apparently you need this code");
FuncInfo *CFI = PAInfo.getFuncInfo(*CF);
thread_callee_node = G->getNodeForValue(CFI->MapValueToOriginal(CS.getArgument(2))).getNode();
}
@@ -710,7 +709,7 @@
}
Function::const_arg_iterator FAI = CF->arg_begin(), E = CF->arg_end();
- CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end();
+ CallSite::arg_iterator AI = CS.arg_begin() + (thread_creation_point ? 3 : 0), AE = CS.arg_end();
for ( ; FAI != E && AI != AE; ++FAI, ++AI)
if (!isa(*AI))
DSGraph::computeNodeMapping(CalleeGraph->getNodeForValue(FAI),
Modified: poolalloc/branches/release_26/runtime/FL2Allocator/PoolAllocator.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/release_26/runtime/FL2Allocator/PoolAllocator.cpp?rev=104024&r1=104023&r2=104024&view=diff
==============================================================================
--- poolalloc/branches/release_26/runtime/FL2Allocator/PoolAllocator.cpp (original)
+++ poolalloc/branches/release_26/runtime/FL2Allocator/PoolAllocator.cpp Tue May 18 11:42:58 2010
@@ -914,6 +914,7 @@
dcArgPointer(callVM,arg[2+i]);
void* to_return = dcCallPointer(callVM,arg[0]);
dcFree(callVM);
+ free(arg_);
return to_return;
}
@@ -921,7 +922,7 @@
const pthread_attr_t* attr,
void *(*start_routine)(void*), int num_pools, ...)
{
- void** arg_array = (void**)malloc(sizeof(void*)*(2+num_pools));
+ void** arg_array = (void**)malloc(sizeof(void*)*(3+num_pools));
arg_array[0] = (void*)start_routine;
arg_array[1] = (void*)num_pools;
va_list argpools;
From gkistanova at gmail.com Tue May 18 12:07:50 2010
From: gkistanova at gmail.com (Galina Kistanova)
Date: Tue, 18 May 2010 17:07:50 -0000
Subject: [llvm-commits] [zorg] r104028 - in /zorg/trunk:
buildbot/osuosl/master/config/builders.py
buildbot/osuosl/master/config/slaves.py
zorg/buildbot/builders/ScriptedBuilder.py
Message-ID: <20100518170750.5E370312800A@llvm.org>
Author: gkistanova
Date: Tue May 18 12:07:50 2010
New Revision: 104028
URL: http://llvm.org/viewvc/llvm-project?rev=104028&view=rev
Log:
Changed to support different types of build steps; changed to use source code directories from checkout steps; changed kistanova1 configuration to do 2 builds simultaneously.
Modified:
zorg/trunk/buildbot/osuosl/master/config/builders.py
zorg/trunk/buildbot/osuosl/master/config/slaves.py
zorg/trunk/zorg/buildbot/builders/ScriptedBuilder.py
Modified: zorg/trunk/buildbot/osuosl/master/config/builders.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/osuosl/master/config/builders.py?rev=104028&r1=104027&r2=104028&view=diff
==============================================================================
--- zorg/trunk/buildbot/osuosl/master/config/builders.py (original)
+++ zorg/trunk/buildbot/osuosl/master/config/builders.py Tue May 18 12:07:50 2010
@@ -23,6 +23,7 @@
from zorg.buildbot.builders import ScriptedBuilder
from buildbot.steps.source import SVN
+from zorg.buildbot.commands.ClangTestCommand import ClangTestCommand
# Plain LLVM builders.
def _get_llvm_builders():
@@ -309,6 +310,7 @@
'extra_args' : ['-j8'], # Extra step-specific properties
'haltOnFailure' : True },
{'name' : 'test_llvm',
+ 'type' : ClangTestCommand,
'description' : 'Test LLVM',
'haltOnFailure' : False },
{'name' : 'cross_tools',
Modified: zorg/trunk/buildbot/osuosl/master/config/slaves.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/osuosl/master/config/slaves.py?rev=104028&r1=104027&r2=104028&view=diff
==============================================================================
--- zorg/trunk/buildbot/osuosl/master/config/slaves.py (original)
+++ zorg/trunk/buildbot/osuosl/master/config/slaves.py Tue May 18 12:07:50 2010
@@ -40,7 +40,7 @@
create_slave("ranby1"),
# Quad Core Mac Pro running Leopard.
- create_slave("kistanova1", properties={'jobs' : 1}, max_builds=1),
+ create_slave("kistanova1", properties={'jobs' : 1}, max_builds=2),
# Quad Core x86_64, Solaris / AurorAUX
create_slave("evocallaghan", properties={'jobs' : 4}, max_builds=1),
Modified: zorg/trunk/zorg/buildbot/builders/ScriptedBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ScriptedBuilder.py?rev=104028&r1=104027&r2=104028&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/ScriptedBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/ScriptedBuilder.py Tue May 18 12:07:50 2010
@@ -1,5 +1,5 @@
import buildbot
-from buildbot.steps.shell import ShellCommand, SetProperty
+from buildbot.steps.shell import WarningCountingShellCommand, SetProperty
from buildbot.process.properties import WithProperties
def getScriptedBuildFactory(
@@ -13,8 +13,6 @@
# Validate input parameters
if not launcher:
raise ValueError,"Must specify launcher."
- if not build_script:
- raise ValueError,"Must specify build_script."
f = buildbot.process.factory.BuildFactory()
@@ -27,22 +25,25 @@
description = "set build dir",
workdir = "."))
- # Get all the source code we need for this build
- for checkout in source_code:
+ # Common for all steps arguments
+ scripted_step_common_args = list()
+ # build_script is optional but must go first if given.
+ if build_script:
+ scripted_step_common_args.append(WithProperties(build_script))
- # Figure out from the source code check out commands where
- # llvm and llvm-gcc source code directories are.
- if checkout.name == 'svn-llvm':
- llvm_src_dir = checkout.args.get('workdir', None)
- elif checkout.name == 'svn-llvm-gcc':
- llvm_gcc_src_dir = checkout.args.get('workdir', None)
+ # Get all the source code directories we need for this build.
+ for checkout in source_code:
+ # Store the list of source code directories in the original order for later use.
+ # Note: We require all spaces and special characters already escaped.
+ src_dir = checkout.args.get('workdir', None)
+ if src_dir:
+ scripted_step_common_args.append(WithProperties(src_dir))
+ # Get the source code from version control system
f.addStep(checkout)
- assert llvm_src_dir, \
- "Cannot retrieve where llvm source code gets checked out to."
- assert llvm_gcc_src_dir, \
- "Cannot retrieve where llvm-gcc source code gets checked out to."
+ # The last common arg is build directory
+ scripted_step_common_args.append(WithProperties("%(builddir)s"))
# Run build script for each requested step
for step_params in build_steps:
@@ -50,6 +51,7 @@
# Handle some of the parameters here.
scripted_step_name = step_params.pop('name', None)
+ scripted_step_type = step_params.pop('type', WarningCountingShellCommand)
scripted_step_description = step_params.pop('description', None)
scripted_step_descriptionDone = step_params.pop('descriptionDone', None)
scripted_step_extra_args = step_params.pop('extra_args', [])
@@ -67,16 +69,13 @@
step_params['env'] = scripted_step_env
f.addStep(
- ShellCommand(
+ scripted_step_type(
name = "run.build.step." + scripted_step_name,
description = scripted_step_description,
descriptionDone = scripted_step_descriptionDone,
command = (
[WithProperties("%(builddir)s/" + launcher)] +
- [WithProperties(build_script)] + # Build script to launch
- [WithProperties(llvm_src_dir)] + # TODO: Escape spaces and special charactes
- [WithProperties(llvm_gcc_src_dir)] + # TODO: Escape spaces and special charactes
- [WithProperties("%(builddir)s")] + # TODO: Escape spaces and special charactes
+ scripted_step_common_args + # Common args
[WithProperties(scripted_step_name)] + # The requested step name
scripted_step_extra_args + # Step-specific extra args
extra_args # Common extra args
@@ -87,15 +86,12 @@
# Run the build_script once
f.addStep(
- ShellCommand(
+ WarningCountingShellCommand(
name="run.build.script",
command=(
[WithProperties("%(builddir)s/" + launcher)] +
- [WithProperties(build_script)] + # Build script to launch
- [WithProperties(llvm_src_dir)] + # TODO: Escape spaces and special charactes
- [WithProperties(llvm_gcc_src_dir)] + # TODO: Escape spaces and special charactes
- [WithProperties("%(builddir)s")] + # TODO: Escape spaces and special charactes
- extra_args # Common extra args
+ scripted_step_common_args + # Common args
+ extra_args # Common extra args
),
haltOnFailure = True,
description = "Run build script",
From daniel at zuster.org Tue May 18 12:22:20 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Tue, 18 May 2010 17:22:20 -0000
Subject: [llvm-commits] [llvm] r104029 -
/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
Message-ID: <20100518172220.27B32312800A@llvm.org>
Author: ddunbar
Date: Tue May 18 12:22:19 2010
New Revision: 104029
URL: http://llvm.org/viewvc/llvm-project?rev=104029&view=rev
Log:
llc (et al): Add support for --show-encoding and --show-inst.
Modified:
llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=104029&r1=104028&r2=104029&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Tue May 18 12:22:19 2010
@@ -65,6 +65,10 @@
cl::desc("Print LLVM IR input to isel pass"));
static cl::opt PrintGCInfo("print-gc", cl::Hidden,
cl::desc("Dump garbage collector data"));
+static cl::opt ShowMCEncoding("show-mc-encoding", cl::Hidden,
+ cl::desc("Show encoding in .s output"));
+static cl::opt ShowMCInst("show-mc-inst", cl::Hidden,
+ cl::desc("Show instruction structure in .s output"));
static cl::opt VerifyMachineCode("verify-machineinstrs", cl::Hidden,
cl::desc("Verify generated machine code"),
cl::init(getenv("LLVM_VERIFY_MACHINEINSTRS")!=NULL));
@@ -131,10 +135,18 @@
case CGFT_AssemblyFile: {
MCInstPrinter *InstPrinter =
getTarget().createMCInstPrinter(MAI.getAssemblerDialect(), MAI);
+
+ // Create a code emitter if asked to show the encoding.
+ //
+ // FIXME: These are currently leaked.
+ MCCodeEmitter *MCE = 0;
+ if (ShowMCEncoding)
+ MCE = getTarget().createCodeEmitter(*this, *Context);
+
AsmStreamer.reset(createAsmStreamer(*Context, Out,
getTargetData()->isLittleEndian(),
getVerboseAsm(), InstPrinter,
- /*codeemitter*/0));
+ MCE, ShowMCInst));
break;
}
case CGFT_ObjectFile: {
From daniel at zuster.org Tue May 18 12:22:24 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Tue, 18 May 2010 17:22:24 -0000
Subject: [llvm-commits] [llvm] r104030 - in /llvm/trunk:
lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
test/CodeGen/X86/mcinst-lowering.ll
Message-ID: <20100518172224.6435C3128018@llvm.org>
Author: ddunbar
Date: Tue May 18 12:22:24 2010
New Revision: 104030
URL: http://llvm.org/viewvc/llvm-project?rev=104030&view=rev
Log:
MC/X86: Implement custom lowering to make sure we match things like
X86::ADC32ri $0, %eax
to
X86::ADC32i32 $0
Added:
llvm/trunk/test/CodeGen/X86/mcinst-lowering.ll
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=104030&r1=104029&r2=104030&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Tue May 18 12:22:24 2010
@@ -224,6 +224,26 @@
OutMI.addOperand(OutMI.getOperand(0));
}
+/// \brief Simplify FOO $imm, %{al,ax,eax,rax} to FOO $imm, for instruction with
+/// a short fixed-register form.
+static void SimplifyShortImmForm(MCInst &Inst, unsigned Opcode) {
+ unsigned ImmOp = Inst.getNumOperands() - 1;
+ assert(Inst.getOperand(0).isReg() && Inst.getOperand(ImmOp).isImm() &&
+ ((Inst.getNumOperands() == 3 && Inst.getOperand(1).isReg() &&
+ Inst.getOperand(0).getReg() == Inst.getOperand(1).getReg()) ||
+ Inst.getNumOperands() == 2) && "Unexpected instruction!");
+
+ // Check whether the destination register can be fixed.
+ unsigned Reg = Inst.getOperand(0).getReg();
+ if (Reg != X86::AL && Reg != X86::AX && Reg != X86::EAX && Reg != X86::RAX)
+ return;
+
+ // If so, rewrite the instruction.
+ MCInst New;
+ New.setOpcode(Opcode);
+ New.addOperand(Inst.getOperand(ImmOp));
+ Inst = New;
+}
void X86MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
OutMI.setOpcode(MI->getOpcode());
@@ -332,6 +352,54 @@
case X86::JGE_4: OutMI.setOpcode(X86::JGE_1); break;
case X86::JLE_4: OutMI.setOpcode(X86::JLE_1); break;
case X86::JG_4: OutMI.setOpcode(X86::JG_1); break;
+
+ // We don't currently select the correct instruction form for instructions
+ // which have a short %eax, etc. form. Handle this by custom lowering, for
+ // now.
+ //
+ // Note, we are currently not handling the following instructions:
+ // MOV8ao8, MOV8o8a
+ // MOV16ao16, MOV16o16a
+ // MOV32ao32, MOV32o32a
+ // MOV64ao64, MOV64ao8
+ // MOV64o64a, MOV64o8a
+ // XCHG16ar, XCHG32ar, XCHG64ar
+ case X86::ADC8ri: SimplifyShortImmForm(OutMI, X86::ADC8i8); break;
+ case X86::ADC16ri: SimplifyShortImmForm(OutMI, X86::ADC16i16); break;
+ case X86::ADC32ri: SimplifyShortImmForm(OutMI, X86::ADC32i32); break;
+ case X86::ADC64ri32: SimplifyShortImmForm(OutMI, X86::ADC64i32); break;
+ case X86::ADD8ri: SimplifyShortImmForm(OutMI, X86::ADD8i8); break;
+ case X86::ADD16ri: SimplifyShortImmForm(OutMI, X86::ADD16i16); break;
+ case X86::ADD32ri: SimplifyShortImmForm(OutMI, X86::ADD32i32); break;
+ case X86::ADD64ri32: SimplifyShortImmForm(OutMI, X86::ADD64i32); break;
+ case X86::AND8ri: SimplifyShortImmForm(OutMI, X86::AND8i8); break;
+ case X86::AND16ri: SimplifyShortImmForm(OutMI, X86::AND16i16); break;
+ case X86::AND32ri: SimplifyShortImmForm(OutMI, X86::AND32i32); break;
+ case X86::AND64ri32: SimplifyShortImmForm(OutMI, X86::AND64i32); break;
+ case X86::CMP8ri: SimplifyShortImmForm(OutMI, X86::CMP8i8); break;
+ case X86::CMP16ri: SimplifyShortImmForm(OutMI, X86::CMP16i16); break;
+ case X86::CMP32ri: SimplifyShortImmForm(OutMI, X86::CMP32i32); break;
+ case X86::CMP64ri32: SimplifyShortImmForm(OutMI, X86::CMP64i32); break;
+ case X86::OR8ri: SimplifyShortImmForm(OutMI, X86::OR8i8); break;
+ case X86::OR16ri: SimplifyShortImmForm(OutMI, X86::OR16i16); break;
+ case X86::OR32ri: SimplifyShortImmForm(OutMI, X86::OR32i32); break;
+ case X86::OR64ri32: SimplifyShortImmForm(OutMI, X86::OR64i32); break;
+ case X86::SBB8ri: SimplifyShortImmForm(OutMI, X86::SBB8i8); break;
+ case X86::SBB16ri: SimplifyShortImmForm(OutMI, X86::SBB16i16); break;
+ case X86::SBB32ri: SimplifyShortImmForm(OutMI, X86::SBB32i32); break;
+ case X86::SBB64ri32: SimplifyShortImmForm(OutMI, X86::SBB64i32); break;
+ case X86::SUB8ri: SimplifyShortImmForm(OutMI, X86::SUB8i8); break;
+ case X86::SUB16ri: SimplifyShortImmForm(OutMI, X86::SUB16i16); break;
+ case X86::SUB32ri: SimplifyShortImmForm(OutMI, X86::SUB32i32); break;
+ case X86::SUB64ri32: SimplifyShortImmForm(OutMI, X86::SUB64i32); break;
+ case X86::TEST8ri: SimplifyShortImmForm(OutMI, X86::TEST8i8); break;
+ case X86::TEST16ri: SimplifyShortImmForm(OutMI, X86::TEST16i16); break;
+ case X86::TEST32ri: SimplifyShortImmForm(OutMI, X86::TEST32i32); break;
+ case X86::TEST64ri32: SimplifyShortImmForm(OutMI, X86::TEST64i32); break;
+ case X86::XOR8ri: SimplifyShortImmForm(OutMI, X86::XOR8i8); break;
+ case X86::XOR16ri: SimplifyShortImmForm(OutMI, X86::XOR16i16); break;
+ case X86::XOR32ri: SimplifyShortImmForm(OutMI, X86::XOR32i32); break;
+ case X86::XOR64ri32: SimplifyShortImmForm(OutMI, X86::XOR64i32); break;
}
}
Added: llvm/trunk/test/CodeGen/X86/mcinst-lowering.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/mcinst-lowering.ll?rev=104030&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/mcinst-lowering.ll (added)
+++ llvm/trunk/test/CodeGen/X86/mcinst-lowering.ll Tue May 18 12:22:24 2010
@@ -0,0 +1,26 @@
+; RUN: llc --show-mc-encoding < %s | FileCheck %s
+
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-apple-darwin10.0.0"
+
+define i32 @f0(i32* nocapture %x) nounwind readonly ssp {
+entry:
+ %tmp1 = load i32* %x ; [#uses=2]
+ %tobool = icmp eq i32 %tmp1, 0 ; [#uses=1]
+ br i1 %tobool, label %if.end, label %return
+
+if.end: ; preds = %entry
+
+; Check that we lower to the short form of cmpl, which has a fixed %eax
+; register.
+;
+; CHECK: cmpl $16777216, %eax
+; CHECK: # encoding: [0x3d,0x00,0x00,0x00,0x01]
+ %cmp = icmp eq i32 %tmp1, 16777216 ; [#uses=1]
+
+ %conv = zext i1 %cmp to i32 ; [#uses=1]
+ ret i32 %conv
+
+return: ; preds = %entry
+ ret i32 0
+}
From daniel at zuster.org Tue May 18 12:28:18 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Tue, 18 May 2010 17:28:18 -0000
Subject: [llvm-commits] [llvm] r104031 -
/llvm/trunk/lib/MC/MCMachOStreamer.cpp
Message-ID: <20100518172818.0E245312800A@llvm.org>
Author: ddunbar
Date: Tue May 18 12:28:17 2010
New Revision: 104031
URL: http://llvm.org/viewvc/llvm-project?rev=104031&view=rev
Log:
MC/Mach-O: Fail faster/harder when we see .file, which isn't yet supported.
Modified:
llvm/trunk/lib/MC/MCMachOStreamer.cpp
Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=104031&r1=104030&r2=104031&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Tue May 18 12:28:17 2010
@@ -142,10 +142,10 @@
unsigned char Value = 0);
virtual void EmitFileDirective(StringRef Filename) {
- errs() << "FIXME: MCMachoStreamer:EmitFileDirective not implemented\n";
+ report_fatal_error("unsupported directive: '.file'");
}
virtual void EmitDwarfFileDirective(unsigned FileNo, StringRef Filename) {
- errs() << "FIXME: MCMachoStreamer:EmitDwarfFileDirective not implemented\n";
+ report_fatal_error("unsupported directive: '.file'");
}
virtual void EmitInstruction(const MCInst &Inst);
From daniel at zuster.org Tue May 18 12:28:20 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Tue, 18 May 2010 17:28:20 -0000
Subject: [llvm-commits] [llvm] r104032 -
/llvm/trunk/lib/MC/MachObjectWriter.cpp
Message-ID: <20100518172820.A07DA3128018@llvm.org>
Author: ddunbar
Date: Tue May 18 12:28:20 2010
New Revision: 104032
URL: http://llvm.org/viewvc/llvm-project?rev=104032&view=rev
Log:
MC/Mach-O: Remove some FIXMEs.
Modified:
llvm/trunk/lib/MC/MachObjectWriter.cpp
Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MachObjectWriter.cpp?rev=104032&r1=104031&r2=104032&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MachObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/MachObjectWriter.cpp Tue May 18 12:28:20 2010
@@ -304,9 +304,7 @@
uint64_t Start = OS.tell();
(void) Start;
- // FIXME: cast<> support!
- const MCSectionMachO &Section =
- static_cast(SD.getSection());
+ const MCSectionMachO &Section = cast(SD.getSection());
WriteBytes(Section.getSectionName(), 16);
WriteBytes(Section.getSegmentName(), 16);
if (Is64Bit) {
@@ -819,9 +817,8 @@
// Bind non lazy symbol pointers first.
for (MCAssembler::indirect_symbol_iterator it = Asm.indirect_symbol_begin(),
ie = Asm.indirect_symbol_end(); it != ie; ++it) {
- // FIXME: cast<> support!
const MCSectionMachO &Section =
- static_cast(it->SectionData->getSection());
+ cast(it->SectionData->getSection());
if (Section.getType() != MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS)
continue;
@@ -832,9 +829,8 @@
// Then lazy symbol pointers and symbol stubs.
for (MCAssembler::indirect_symbol_iterator it = Asm.indirect_symbol_begin(),
ie = Asm.indirect_symbol_end(); it != ie; ++it) {
- // FIXME: cast<> support!
const MCSectionMachO &Section =
- static_cast(it->SectionData->getSection());
+ cast(it->SectionData->getSection());
if (Section.getType() != MCSectionMachO::S_LAZY_SYMBOL_POINTERS &&
Section.getType() != MCSectionMachO::S_SYMBOL_STUBS)
From daniel at zuster.org Tue May 18 12:28:24 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Tue, 18 May 2010 17:28:24 -0000
Subject: [llvm-commits] [llvm] r104033 - in /llvm/trunk:
lib/MC/MCMachOStreamer.cpp lib/MC/MachObjectWriter.cpp
test/MC/MachO/indirect-symbols.s
Message-ID: <20100518172824.DA0F8312800A@llvm.org>
Author: ddunbar
Date: Tue May 18 12:28:24 2010
New Revision: 104033
URL: http://llvm.org/viewvc/llvm-project?rev=104033&view=rev
Log:
MC/Mach-O: Implement support for setting indirect symbol table offset in section header.
Also, create symbol data for LHS of assignment, to match 'as' symbol ordering better.
Added:
llvm/trunk/test/MC/MachO/indirect-symbols.s
Modified:
llvm/trunk/lib/MC/MCMachOStreamer.cpp
llvm/trunk/lib/MC/MachObjectWriter.cpp
Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=104033&r1=104032&r2=104033&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Tue May 18 12:28:24 2010
@@ -216,6 +216,7 @@
void MCMachOStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
// FIXME: Lift context changes into super class.
+ Assembler.getOrCreateSymbolData(*Symbol);
Symbol->setVariableValue(AddValueSymbols(Value));
}
Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MachObjectWriter.cpp?rev=104033&r1=104032&r2=104033&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MachObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/MachObjectWriter.cpp Tue May 18 12:28:24 2010
@@ -185,6 +185,7 @@
llvm::DenseMap > Relocations;
+ llvm::DenseMap IndirectSymBase;
/// @}
/// @name Symbol Table Data
@@ -325,7 +326,7 @@
Write32(NumRelocations ? RelocationsStart : 0);
Write32(NumRelocations);
Write32(Flags);
- Write32(0); // reserved1
+ Write32(IndirectSymBase.lookup(&SD)); // reserved1
Write32(Section.getStubSize()); // reserved2
if (Is64Bit)
Write32(0); // reserved3
@@ -815,20 +816,26 @@
// FIXME: Revisit this when the dust settles.
// Bind non lazy symbol pointers first.
+ unsigned IndirectIndex = 0;
for (MCAssembler::indirect_symbol_iterator it = Asm.indirect_symbol_begin(),
- ie = Asm.indirect_symbol_end(); it != ie; ++it) {
+ ie = Asm.indirect_symbol_end(); it != ie; ++it, ++IndirectIndex) {
const MCSectionMachO &Section =
cast(it->SectionData->getSection());
if (Section.getType() != MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS)
continue;
+ // Initialize the section indirect symbol base, if necessary.
+ if (!IndirectSymBase.count(it->SectionData))
+ IndirectSymBase[it->SectionData] = IndirectIndex;
+
Asm.getOrCreateSymbolData(*it->Symbol);
}
// Then lazy symbol pointers and symbol stubs.
+ IndirectIndex = 0;
for (MCAssembler::indirect_symbol_iterator it = Asm.indirect_symbol_begin(),
- ie = Asm.indirect_symbol_end(); it != ie; ++it) {
+ ie = Asm.indirect_symbol_end(); it != ie; ++it, ++IndirectIndex) {
const MCSectionMachO &Section =
cast(it->SectionData->getSection());
@@ -836,6 +843,10 @@
Section.getType() != MCSectionMachO::S_SYMBOL_STUBS)
continue;
+ // Initialize the section indirect symbol base, if necessary.
+ if (!IndirectSymBase.count(it->SectionData))
+ IndirectSymBase[it->SectionData] = IndirectIndex;
+
// Set the symbol type to undefined lazy, but only on construction.
//
// FIXME: Do not hardcode.
Added: llvm/trunk/test/MC/MachO/indirect-symbols.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/indirect-symbols.s?rev=104033&view=auto
==============================================================================
--- llvm/trunk/test/MC/MachO/indirect-symbols.s (added)
+++ llvm/trunk/test/MC/MachO/indirect-symbols.s Tue May 18 12:28:24 2010
@@ -0,0 +1,188 @@
+// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+
+_b:
+ _c = 0
+_e:
+ _f = 0
+
+ .section __IMPORT,__jump_table,symbol_stubs,pure_instructions+self_modifying_code,5
+.indirect_symbol _a
+ .ascii "\364\364\364\364\364"
+.indirect_symbol _b
+ .ascii "\364\364\364\364\364"
+.indirect_symbol _c
+ .ascii "\364\364\364\364\364"
+ .section __IMPORT,__pointers,non_lazy_symbol_pointers
+.indirect_symbol _d
+ .long 0
+.indirect_symbol _e
+ .long 0
+.indirect_symbol _f
+ .long 0
+
+// CHECK: ('cputype', 7)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 364)
+// CHECK: ('flag', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 1)
+// CHECK: ('size', 260)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 27)
+// CHECK: ('file_offset', 392)
+// CHECK: ('file_size', 27)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 3)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 0)
+// CHECK: ('offset', 392)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x80000000)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '')
+// CHECK: # Section 1
+// CHECK: (('section_name', '__jump_table\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__IMPORT\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 15)
+// CHECK: ('offset', 392)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x84000008)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 5)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4')
+// CHECK: # Section 2
+// CHECK: (('section_name', '__pointers\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__IMPORT\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 15)
+// CHECK: ('size', 12)
+// CHECK: ('offset', 407)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x6)
+// CHECK: ('reserved1', 3)
+// CHECK: ('reserved2', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 1
+// CHECK: (('command', 2)
+// CHECK: ('size', 24)
+// CHECK: ('symoff', 444)
+// CHECK: ('nsyms', 6)
+// CHECK: ('stroff', 516)
+// CHECK: ('strsize', 20)
+// CHECK: ('_string_data', '\x00_d\x00_a\x00_b\x00_c\x00_e\x00_f\x00\x00')
+// CHECK: ('_symbols', [
+// CHECK: # Symbol 0
+// CHECK: (('n_strx', 7)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 1)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_b')
+// CHECK: ),
+// CHECK: # Symbol 1
+// CHECK: (('n_strx', 10)
+// CHECK: ('n_type', 0x2)
+// CHECK: ('n_sect', 0)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_c')
+// CHECK: ),
+// CHECK: # Symbol 2
+// CHECK: (('n_strx', 13)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 1)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_e')
+// CHECK: ),
+// CHECK: # Symbol 3
+// CHECK: (('n_strx', 16)
+// CHECK: ('n_type', 0x2)
+// CHECK: ('n_sect', 0)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_f')
+// CHECK: ),
+// CHECK: # Symbol 4
+// CHECK: (('n_strx', 4)
+// CHECK: ('n_type', 0x1)
+// CHECK: ('n_sect', 0)
+// CHECK: ('n_desc', 1)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_a')
+// CHECK: ),
+// CHECK: # Symbol 5
+// CHECK: (('n_strx', 1)
+// CHECK: ('n_type', 0x1)
+// CHECK: ('n_sect', 0)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_d')
+// CHECK: ),
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 2
+// CHECK: (('command', 11)
+// CHECK: ('size', 80)
+// CHECK: ('ilocalsym', 0)
+// CHECK: ('nlocalsym', 4)
+// CHECK: ('iextdefsym', 4)
+// CHECK: ('nextdefsym', 0)
+// CHECK: ('iundefsym', 4)
+// CHECK: ('nundefsym', 2)
+// CHECK: ('tocoff', 0)
+// CHECK: ('ntoc', 0)
+// CHECK: ('modtaboff', 0)
+// CHECK: ('nmodtab', 0)
+// CHECK: ('extrefsymoff', 0)
+// CHECK: ('nextrefsyms', 0)
+// CHECK: ('indirectsymoff', 420)
+// CHECK: ('nindirectsyms', 6)
+// CHECK: ('extreloff', 0)
+// CHECK: ('nextrel', 0)
+// CHECK: ('locreloff', 0)
+// CHECK: ('nlocrel', 0)
+// CHECK: ('_indirect_symbols', [
+// CHECK: # Indirect Symbol 0
+// CHECK: (('symbol_index', 0x4),),
+// CHECK: # Indirect Symbol 1
+// CHECK: (('symbol_index', 0x0),),
+// CHECK: # Indirect Symbol 2
+// CHECK: (('symbol_index', 0x1),),
+// CHECK: # Indirect Symbol 3
+// CHECK: (('symbol_index', 0x5),),
+// CHECK: # Indirect Symbol 4
+// CHECK: (('symbol_index', 0x80000000),),
+// CHECK: # Indirect Symbol 5
+// CHECK: (('symbol_index', 0xc0000000),),
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
From stoklund at 2pi.dk Tue May 18 12:31:12 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Tue, 18 May 2010 17:31:12 -0000
Subject: [llvm-commits] [llvm] r104034 -
/llvm/trunk/lib/CodeGen/MachineVerifier.cpp
Message-ID: <20100518173112.45EC6312800A@llvm.org>
Author: stoklund
Date: Tue May 18 12:31:12 2010
New Revision: 104034
URL: http://llvm.org/viewvc/llvm-project?rev=104034&view=rev
Log:
Teach the machine code verifier to use getSubRegisterRegClass().
The old approach was wrong. It had an off-by-one error.
Modified:
llvm/trunk/lib/CodeGen/MachineVerifier.cpp
Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=104034&r1=104033&r2=104034&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Tue May 18 12:31:12 2010
@@ -635,11 +635,14 @@
// Virtual register.
const TargetRegisterClass *RC = MRI->getRegClass(Reg);
if (SubIdx) {
- if (RC->subregclasses_begin()+SubIdx >= RC->subregclasses_end()) {
+ const TargetRegisterClass *SRC = RC->getSubRegisterRegClass(SubIdx);
+ if (!SRC) {
report("Invalid subregister index for virtual register", MO, MONum);
+ *OS << "Register class " << RC->getName()
+ << " does not support subreg index " << SubIdx << "\n";
return;
}
- RC = *(RC->subregclasses_begin()+SubIdx);
+ RC = SRC;
}
if (const TargetRegisterClass *DRC = TOI.getRegClass(TRI)) {
if (RC != DRC && !RC->hasSuperClass(DRC)) {
From baldrick at free.fr Tue May 18 12:36:06 2010
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 18 May 2010 17:36:06 -0000
Subject: [llvm-commits] [dragonegg] r104036 - in /dragonegg/trunk:
llvm-convert.cpp llvm-debug.cpp
Message-ID: <20100518173606.9F096312800A@llvm.org>
Author: baldrick
Date: Tue May 18 12:36:06 2010
New Revision: 104036
URL: http://llvm.org/viewvc/llvm-project?rev=104036&view=rev
Log:
Port commit 101302 (dpatel) from llvm-gcc:
Enable local variable debug info at -O1+. Take2.
The additional mucking around in llvm-convert.cpp is explained
in the comment there. The fact that phi node population probably
needs to happen after the return value is computed is what is
stopping the simple solution of moving phi node population earlier.
Modified:
dragonegg/trunk/llvm-convert.cpp
dragonegg/trunk/llvm-debug.cpp
Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=104036&r1=104035&r2=104036&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Tue May 18 12:36:06 2010
@@ -954,10 +954,6 @@
}
}
}
- if (EmitDebugInfo()) {
- TheDebugInfo->EmitStopPoint(Fn, Builder.GetInsertBlock(), Builder);
- TheDebugInfo->EmitFunctionEnd(Builder.GetInsertBlock(), true);
- }
if (RetVals.empty())
Builder.CreateRetVoid();
else if (RetVals.size() == 1 && RetVals[0]->getType() == Fn->getReturnType()){
@@ -976,6 +972,16 @@
EmitFailureBlocks();
EmitRewindBlock();
+ if (EmitDebugInfo()) {
+ // FIXME: This should be output just before the return call generated above.
+ // But because EmitFunctionEnd pops the region stack, that means that if the
+ // call to PopulatePhiNodes (for example) generates complicated debug info,
+ // then the debug info logic barfs. Testcases showing this are 20011126-2.c
+ // or pr42221.c from the gcc testsuite compiled with -g -O3.
+ TheDebugInfo->EmitStopPoint(Fn, ReturnBB, Builder);
+ TheDebugInfo->EmitFunctionEnd(ReturnBB, true);
+ }
+
#ifndef NDEBUG
if (!errorcount && !sorrycount)
for (DenseMap >::const_iterator I = SSANames.begin(),
Modified: dragonegg/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.cpp?rev=104036&r1=104035&r2=104036&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Tue May 18 12:36:06 2010
@@ -389,10 +389,6 @@
void DebugInfo::EmitDeclare(tree decl, unsigned Tag, const char *Name,
tree type, Value *AI, LLVMBuilder &Builder) {
- // Do not emit variable declaration info, for now.
- if (optimize)
- return;
-
// Ignore compiler generated temporaries.
if (DECL_IGNORED_P(decl))
return;
From enderby at apple.com Tue May 18 12:51:35 2010
From: enderby at apple.com (Kevin Enderby)
Date: Tue, 18 May 2010 17:51:35 -0000
Subject: [llvm-commits] [llvm] r104038 - in /llvm/trunk:
lib/MC/MCParser/AsmLexer.cpp test/MC/MachO/direction_labels.s
Message-ID: <20100518175135.DC08C312800A@llvm.org>
Author: enderby
Date: Tue May 18 12:51:35 2010
New Revision: 104038
URL: http://llvm.org/viewvc/llvm-project?rev=104038&view=rev
Log:
Fixed the problem with a branch to "0b" that was not parsed by llvm-mc
correctly. The Lexer was incorrectly eating the newline casusing it to branch
to address 0. Updated the test case to use a "0:" label and a branch to "0b".
Modified:
llvm/trunk/lib/MC/MCParser/AsmLexer.cpp
llvm/trunk/test/MC/MachO/direction_labels.s
Modified: llvm/trunk/lib/MC/MCParser/AsmLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmLexer.cpp?rev=104038&r1=104037&r2=104038&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmLexer.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmLexer.cpp Tue May 18 12:51:35 2010
@@ -157,7 +157,6 @@
if (CurPtr[0] == '\n') {
--CurPtr;
StringRef Result(TokStart, CurPtr - TokStart);
- ++CurPtr;
return AsmToken(AsmToken::Integer, Result, 0);
}
const char *NumStart = CurPtr;
Modified: llvm/trunk/test/MC/MachO/direction_labels.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/direction_labels.s?rev=104038&r1=104037&r2=104038&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/direction_labels.s (original)
+++ llvm/trunk/test/MC/MachO/direction_labels.s Tue May 18 12:51:35 2010
@@ -1,12 +1,15 @@
// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
direction_labels:
-10: nop
- jmp 10b
- nop
- jmp 11f
-11: nop
- ret
+10: nop
+ jmp 10b
+ nop
+ jne 0f
+0: nop
+ jne 0b
+ jmp 11f
+11: nop
+ ret
// CHECK: ('cputype', 7)
// CHECK: ('cpusubtype', 3)
@@ -20,9 +23,9 @@
// CHECK: ('size', 124)
// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('vm_addr', 0)
-// CHECK: ('vm_size', 8)
+// CHECK: ('vm_size', 13)
// CHECK: ('file_offset', 256)
-// CHECK: ('file_size', 8)
+// CHECK: ('file_size', 13)
// CHECK: ('maxprot', 7)
// CHECK: ('initprot', 7)
// CHECK: ('num_sections', 1)
@@ -32,7 +35,7 @@
// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('address', 0)
-// CHECK: ('size', 8)
+// CHECK: ('size', 13)
// CHECK: ('offset', 256)
// CHECK: ('alignment', 0)
// CHECK: ('reloc_offset', 0)
@@ -43,15 +46,15 @@
// CHECK: ),
// CHECK: ('_relocations', [
// CHECK: ])
-// CHECK: ('_section_data', '\x90\xeb\xfd\x90\xeb\x00\x90\xc3')
+// CHECK: ('_section_data', '\x90\xeb\xfd\x90u\x00\x90u\xfd\xeb\x00\x90\xc3')
// CHECK: ])
// CHECK: ),
// CHECK: # Load Command 1
// CHECK: (('command', 2)
// CHECK: ('size', 24)
-// CHECK: ('symoff', 264)
+// CHECK: ('symoff', 272)
// CHECK: ('nsyms', 1)
-// CHECK: ('stroff', 276)
+// CHECK: ('stroff', 284)
// CHECK: ('strsize', 20)
// CHECK: ('_string_data', '\x00direction_labels\x00\x00\x00')
// CHECK: ('_symbols', [
From enderby at apple.com Tue May 18 13:09:21 2010
From: enderby at apple.com (Kevin Enderby)
Date: Tue, 18 May 2010 18:09:21 -0000
Subject: [llvm-commits] [llvm] r104039 -
/llvm/trunk/lib/MC/MCParser/AsmLexer.cpp
Message-ID: <20100518180921.1C43F312800A@llvm.org>
Author: enderby
Date: Tue May 18 13:09:20 2010
New Revision: 104039
URL: http://llvm.org/viewvc/llvm-project?rev=104039&view=rev
Log:
Incorporate Daniel's suggestion and use !isdigit(CurPtr[0]) and not
CurPtr[0] == '\n' when testing the character after a "0b" when looking
to see if it part of a something like "jmp 0b".
Modified:
llvm/trunk/lib/MC/MCParser/AsmLexer.cpp
Modified: llvm/trunk/lib/MC/MCParser/AsmLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmLexer.cpp?rev=104039&r1=104038&r2=104039&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmLexer.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmLexer.cpp Tue May 18 13:09:20 2010
@@ -154,7 +154,7 @@
if (*CurPtr == 'b') {
++CurPtr;
// See if we actually have "0b" as part of something like "jmp 0b\n"
- if (CurPtr[0] == '\n') {
+ if (!isdigit(CurPtr[0])) {
--CurPtr;
StringRef Result(TokStart, CurPtr - TokStart);
return AsmToken(AsmToken::Integer, Result, 0);
From baldrick at free.fr Tue May 18 13:13:30 2010
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 18 May 2010 18:13:30 -0000
Subject: [llvm-commits] [dragonegg] r104040 - in /dragonegg/trunk:
llvm-abi-default.cpp llvm-abi.h llvm-backend.cpp llvm-convert.cpp
llvm-debug.cpp llvm-debug.h llvm-types.cpp x86/llvm-target.cpp
x86/llvm-target.h
Message-ID: <20100518181330.CEE44312800A@llvm.org>
Author: baldrick
Date: Tue May 18 13:13:30 2010
New Revision: 104040
URL: http://llvm.org/viewvc/llvm-project?rev=104040&view=rev
Log:
Strip trailing white-space, turn tabs into spaces.
Modified:
dragonegg/trunk/llvm-abi-default.cpp
dragonegg/trunk/llvm-abi.h
dragonegg/trunk/llvm-backend.cpp
dragonegg/trunk/llvm-convert.cpp
dragonegg/trunk/llvm-debug.cpp
dragonegg/trunk/llvm-debug.h
dragonegg/trunk/llvm-types.cpp
dragonegg/trunk/x86/llvm-target.cpp
dragonegg/trunk/x86/llvm-target.h
Modified: dragonegg/trunk/llvm-abi-default.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-abi-default.cpp?rev=104040&r1=104039&r2=104040&view=diff
==============================================================================
--- dragonegg/trunk/llvm-abi-default.cpp (original)
+++ dragonegg/trunk/llvm-abi-default.cpp Tue May 18 13:13:30 2010
@@ -96,7 +96,7 @@
ScalarElts.push_back(Ty);
}
} else if (LLVM_TRY_PASS_AGGREGATE_CUSTOM(type, ScalarElts,
- C.getCallingConv(), &C)) {
+ C.getCallingConv(), &C)) {
// Nothing to do.
} else if (Ty->isSingleValueType()) {
C.HandleScalarArgument(Ty, type);
Modified: dragonegg/trunk/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-abi.h?rev=104040&r1=104039&r2=104040&view=diff
==============================================================================
--- dragonegg/trunk/llvm-abi.h (original)
+++ dragonegg/trunk/llvm-abi.h Tue May 18 13:13:30 2010
@@ -47,7 +47,7 @@
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
-}
+}
// Plugin headers
#include "llvm-internal.h"
@@ -95,7 +95,7 @@
/// HandleScalarArgument - This is the primary callback that specifies an
/// LLVM argument to pass. It is only used for first class types.
/// If RealSize is non Zero then it specifies number of bytes to access
- /// from LLVMTy.
+ /// from LLVMTy.
virtual void HandleScalarArgument(const llvm::Type *LLVMTy, tree type,
unsigned RealSize = 0) {}
@@ -135,8 +135,8 @@
false
#endif
-// doNotUseShadowReturn - Return true if the specified GCC type
-// should not be returned using a pointer to struct parameter.
+// doNotUseShadowReturn - Return true if the specified GCC type
+// should not be returned using a pointer to struct parameter.
static inline bool doNotUseShadowReturn(tree type, tree fndecl,
CallingConv::ID CC) {
if (!TYPE_SIZE(type))
@@ -156,7 +156,7 @@
/// isSingleElementStructOrArray - If this is (recursively) a structure with one
/// field or an array with one element, return the field type, otherwise return
/// null. If ignoreZeroLength, the struct (recursively) may include zero-length
-/// fields in addition to the single element that has data. If
+/// fields in addition to the single element that has data. If
/// rejectFatBitField, and the single element is a bitfield of a type that's
/// bigger than the struct, return null anyway.
static inline
@@ -180,7 +180,7 @@
for (tree Field = TYPE_FIELDS(type); Field; Field = TREE_CHAIN(Field))
if (TREE_CODE(Field) == FIELD_DECL) {
if (ignoreZeroLength) {
- if (DECL_SIZE(Field) &&
+ if (DECL_SIZE(Field) &&
TREE_CODE(DECL_SIZE(Field)) == INTEGER_CST &&
TREE_INT_CST_LOW(DECL_SIZE(Field)) == 0)
continue;
@@ -188,7 +188,7 @@
if (!FoundField) {
if (rejectFatBitfield &&
TREE_CODE(TYPE_SIZE(type)) == INTEGER_CST &&
- TREE_INT_CST_LOW(TYPE_SIZE(TREE_TYPE(Field))) >
+ TREE_INT_CST_LOW(TYPE_SIZE(TREE_TYPE(Field))) >
TREE_INT_CST_LOW(TYPE_SIZE(type)))
return 0;
FoundField = TREE_TYPE(Field);
@@ -196,7 +196,7 @@
return 0; // More than one field.
}
}
- return FoundField ? isSingleElementStructOrArray(FoundField,
+ return FoundField ? isSingleElementStructOrArray(FoundField,
ignoreZeroLength, false)
: 0;
case ARRAY_TYPE:
@@ -207,7 +207,7 @@
}
}
-/// isZeroSizedStructOrUnion - Returns true if this is a struct or union
+/// isZeroSizedStructOrUnion - Returns true if this is a struct or union
/// which is zero bits wide.
static inline bool isZeroSizedStructOrUnion(tree type) {
if (TREE_CODE(type) != RECORD_TYPE &&
@@ -217,7 +217,7 @@
return int_size_in_bytes(type) == 0;
}
-// getLLVMScalarTypeForStructReturn - Return LLVM Type if TY can be
+// getLLVMScalarTypeForStructReturn - Return LLVM Type if TY can be
// returned as a scalar, otherwise return NULL. This is the default
// target independent implementation.
static inline
@@ -251,7 +251,7 @@
}
#ifndef LLVM_TRY_PASS_AGGREGATE_CUSTOM
-#define LLVM_TRY_PASS_AGGREGATE_CUSTOM(T, E, CC, C) \
+#define LLVM_TRY_PASS_AGGREGATE_CUSTOM(T, E, CC, C) \
false
#endif
@@ -326,7 +326,7 @@
#endif
// LLVM_SHOULD_RETURN_SELT_STRUCT_AS_SCALAR - Return a TYPE tree if this single
-// element struct should be returned using the convention for that scalar TYPE,
+// element struct should be returned using the convention for that scalar TYPE,
// 0 otherwise.
// The returned TYPE must be the same size as X for this to work; that is
// checked elsewhere. (Structs where this is not the case can be constructed
@@ -350,14 +350,14 @@
#define LLVM_SHOULD_RETURN_VECTOR_AS_SHADOW(X,Y) 0
#endif
-// LLVM_SCALAR_TYPE_FOR_STRUCT_RETURN - Return LLVM Type if X can be
+// LLVM_SCALAR_TYPE_FOR_STRUCT_RETURN - Return LLVM Type if X can be
// returned as a scalar, otherwise return NULL.
#ifndef LLVM_SCALAR_TYPE_FOR_STRUCT_RETURN
#define LLVM_SCALAR_TYPE_FOR_STRUCT_RETURN(X, Y) \
getLLVMScalarTypeForStructReturn((X), (Y))
#endif
-// LLVM_AGGR_TYPE_FOR_STRUCT_RETURN - Return LLVM Type if X can be
+// LLVM_AGGR_TYPE_FOR_STRUCT_RETURN - Return LLVM Type if X can be
// returned as an aggregate, otherwise return NULL.
#ifndef LLVM_AGGR_TYPE_FOR_STRUCT_RETURN
#define LLVM_AGGR_TYPE_FOR_STRUCT_RETURN(X, CC) \
Modified: dragonegg/trunk/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-backend.cpp?rev=104040&r1=104039&r2=104040&view=diff
==============================================================================
--- dragonegg/trunk/llvm-backend.cpp (original)
+++ dragonegg/trunk/llvm-backend.cpp Tue May 18 13:13:30 2010
@@ -1,4 +1,4 @@
-/* High-level LLVM backend interface
+/* High-level LLVM backend interface
Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Chris Lattner (sabre at nondot.org)
@@ -131,7 +131,7 @@
std::vector AttributeAnnotateGlobals;
/// PerFunctionPasses - This is the list of cleanup passes run per-function
-/// as each is compiled. In cases where we are not doing IPO, it includes the
+/// as each is compiled. In cases where we are not doing IPO, it includes the
/// code generator.
static FunctionPassManager *PerFunctionPasses = 0;
static PassManager *PerModulePasses = 0;
@@ -289,7 +289,7 @@
if (optimize_size)
// Reduce inline limit.
return 75;
-
+
if (optimize >= 3)
return 275;
return 225;
@@ -645,7 +645,7 @@
//TODO flag_llvm_pch_read = 1;
//TODO}
//TODO
-//TODO/// llvm_pch_write_init - Initialize PCH writing.
+//TODO/// llvm_pch_write_init - Initialize PCH writing.
//TODOvoid llvm_pch_write_init(void) {
//TODO timevar_push(TV_LLVM_INIT);
//TODO AsmOutStream = new oFILEstream(asm_out_file);
@@ -664,7 +664,7 @@
//TODO // Emit an LLVM .bc file to the output. This is used when passed
//TODO // -emit-llvm -c to the GCC driver.
//TODO PerModulePasses->add(createBitcodeWriterPass(*AsmOutStream));
-//TODO
+//TODO
//TODO // Disable emission of .ident into the output file... which is completely
//TODO // wrong for llvm/.bc emission cases.
//TODO flag_no_ident = 1;
@@ -685,7 +685,7 @@
//TODO}
static void createPerFunctionOptimizationPasses() {
- if (PerFunctionPasses)
+ if (PerFunctionPasses)
return;
// Create and set up the per-function pass manager.
@@ -718,7 +718,7 @@
// FIXME: This is disabled right now until bugs can be worked out. Reenable
// this for fast -O0 compiles!
if (!EmitIR && 0) {
- FunctionPassManager *PM = PerFunctionPasses;
+ FunctionPassManager *PM = PerFunctionPasses;
HasPerFunctionPasses = true;
CodeGenOpt::Level OptLevel = CodeGenOpt::Default; // -O2, -Os, and -Oz
@@ -748,7 +748,7 @@
exit(1);
}
}
-
+
if (HasPerFunctionPasses) {
PerFunctionPasses->doInitialization();
} else {
@@ -802,7 +802,7 @@
PerModulePasses->add(createBitcodeWriterPass(*OutStream));
HasPerModulePasses = true;
} else if (EmitIR) {
- // Emit an LLVM .ll file to the output. This is used when passed
+ // Emit an LLVM .ll file to the output. This is used when passed
// -emit-llvm -S to the GCC driver.
InitializeOutputStreams(false);
PerModulePasses->add(createPrintModulePass(OutStream));
@@ -885,17 +885,17 @@
std::vector InitList;
std::vector StructInit;
StructInit.resize(2);
-
+
LLVMContext &Context = getGlobalContext();
-
+
const Type *FPTy =
FunctionType::get(Type::getVoidTy(Context),
std::vector(), false);
FPTy = FPTy->getPointerTo();
-
+
for (unsigned i = 0, e = Tors.size(); i != e; ++i) {
StructInit[0] = ConstantInt::get(Type::getInt32Ty(Context), Tors[i].second);
-
+
// __attribute__(constructor) can be on a function with any type. Make sure
// the pointer is void()*.
StructInit[1] = TheFolder->CreateBitCast(Tors[i].first, FPTy);
@@ -911,14 +911,14 @@
/// ConvertMetadataStringToGV - Convert string to global value. Use existing
/// global if possible.
Constant* ConvertMetadataStringToGV(const char *str) {
-
+
Constant *Init = ConstantArray::get(getGlobalContext(), std::string(str));
// Use cached string if it exists.
static std::map StringCSTCache;
GlobalVariable *&Slot = StringCSTCache[Init];
if (Slot) return Slot;
-
+
// Create a new string global.
GlobalVariable *GV = new GlobalVariable(*TheModule, Init->getType(), true,
GlobalVariable::PrivateLinkage,
@@ -926,42 +926,42 @@
GV->setSection("llvm.metadata");
Slot = GV;
return GV;
-
+
}
/// AddAnnotateAttrsToGlobal - Adds decls that have a annotate attribute to a
/// vector to be emitted later.
void AddAnnotateAttrsToGlobal(GlobalValue *GV, tree decl) {
LLVMContext &Context = getGlobalContext();
-
+
// Handle annotate attribute on global.
tree annotateAttr = lookup_attribute("annotate", DECL_ATTRIBUTES (decl));
if (annotateAttr == 0)
return;
-
+
// Get file and line number
Constant *lineNo = ConstantInt::get(Type::getInt32Ty(Context),
DECL_SOURCE_LINE(decl));
Constant *file = ConvertMetadataStringToGV(DECL_SOURCE_FILE(decl));
const Type *SBP = Type::getInt8PtrTy(Context);
file = TheFolder->CreateBitCast(file, SBP);
-
- // There may be multiple annotate attributes. Pass return of lookup_attr
+
+ // There may be multiple annotate attributes. Pass return of lookup_attr
// to successive lookups.
while (annotateAttr) {
-
+
// Each annotate attribute is a tree list.
// Get value of list which is our linked list of args.
tree args = TREE_VALUE(annotateAttr);
-
+
// Each annotate attribute may have multiple args.
// Treat each arg as if it were a separate annotate attribute.
for (tree a = args; a; a = TREE_CHAIN(a)) {
// Each element of the arg list is a tree list, so get value
tree val = TREE_VALUE(a);
-
+
// Assert its a string, and then get that string.
- assert(TREE_CODE(val) == STRING_CST &&
+ assert(TREE_CODE(val) == STRING_CST &&
"Annotate attribute arg should always be a string");
Constant *strGV = TreeConstantToLLVM::EmitLV_STRING_CST(val);
Constant *Element[4] = {
@@ -970,11 +970,11 @@
file,
lineNo
};
-
+
AttributeAnnotateGlobals.push_back(
ConstantStruct::get(Context, Element, 4, false));
}
-
+
// Get next annotate attribute.
annotateAttr = TREE_CHAIN(annotateAttr);
if (annotateAttr)
@@ -993,7 +993,7 @@
return;
// If tree nodes says defer output then do not emit global yet.
- if (CODE_CONTAINS_STRUCT (TREE_CODE (decl), TS_DECL_WITH_VIS)
+ if (CODE_CONTAINS_STRUCT (TREE_CODE (decl), TS_DECL_WITH_VIS)
&& (DECL_DEFER_OUTPUT(decl)))
return;
@@ -1005,7 +1005,7 @@
// Get or create the global variable now.
GlobalVariable *GV = cast(DECL_LLVM(decl));
-
+
// Convert the initializer over.
Constant *Init;
if (DECL_INITIAL(decl) == 0 || DECL_INITIAL(decl) == error_mark_node) {
@@ -1018,10 +1018,10 @@
else
Init = UndefValue::get(Ty);
} else {
- assert((TREE_CONSTANT(DECL_INITIAL(decl)) ||
+ assert((TREE_CONSTANT(DECL_INITIAL(decl)) ||
TREE_CODE(DECL_INITIAL(decl)) == STRING_CST) &&
"Global initializer should be constant!");
-
+
// Temporarily set an initializer for the global, so we don't infinitely
// recurse. If we don't do this, we can hit cases where we see "oh a global
// with an initializer hasn't been initialized yet, call emit_global on it".
@@ -1047,7 +1047,7 @@
SET_DECL_LLVM(decl, NGV);
GV = NGV;
}
-
+
// Set the initializer.
GV->setInitializer(Init);
@@ -1105,12 +1105,12 @@
if (DECL_SECTION_NAME(decl)) {
GV->setSection(TREE_STRING_POINTER(DECL_SECTION_NAME(decl)));
#ifdef LLVM_IMPLICIT_TARGET_GLOBAL_VAR_SECTION
- } else if (const char *Section =
+ } else if (const char *Section =
LLVM_IMPLICIT_TARGET_GLOBAL_VAR_SECTION(decl)) {
GV->setSection(Section);
#endif
}
-
+
// Set the alignment for the global if one of the following condition is met
// 1) DECL_ALIGN is better than the alignment as per ABI specification
// 2) DECL_ALIGN is set by user.
@@ -1137,14 +1137,14 @@
else
AttributeUsedGlobals.insert(GV);
}
-
+
// Add annotate attributes for globals
if (DECL_ATTRIBUTES(decl))
AddAnnotateAttrsToGlobal(GV, decl);
-
+
#ifdef LLVM_IMPLICIT_TARGET_GLOBAL_VAR_SECTION
} else if (TREE_CODE(decl) == CONST_DECL) {
- if (const char *Section =
+ if (const char *Section =
LLVM_IMPLICIT_TARGET_GLOBAL_VAR_SECTION(decl)) {
GV->setSection(Section);
@@ -1235,7 +1235,7 @@
if (errorcount || sorrycount)
return NULL; // Do not process broken code.
-
+
LLVMContext &Context = getGlobalContext();
// Global register variable with asm name, e.g.:
@@ -1246,7 +1246,7 @@
ValidateRegisterVariable(decl);
return NULL;
}
-
+
//TODO timevar_push(TV_LLVM_GLOBALS);
std::string Name;
@@ -1264,17 +1264,17 @@
}
#endif
}
-
+
// Specifying a section attribute on a variable forces it into a
// non-.bss section, and thus it cannot be common.
if (TREE_CODE(decl) == VAR_DECL && DECL_SECTION_NAME(decl) != NULL_TREE &&
DECL_INITIAL(decl) == NULL_TREE && DECL_COMMON(decl))
DECL_COMMON(decl) = 0;
-
+
// Variables can't be both common and weak.
if (TREE_CODE(decl) == VAR_DECL && DECL_WEAK(decl))
DECL_COMMON(decl) = 0;
-
+
// Okay, now we need to create an LLVM global variable or function for this
// object. Note that this is quite possibly a forward reference to the
// object, so its type may change later.
@@ -1286,7 +1286,7 @@
if (FnEntry == 0) {
CallingConv::ID CC;
AttrListPtr PAL;
- const FunctionType *Ty =
+ const FunctionType *Ty =
TheTypeConverter->ConvertFunctionType(TREE_TYPE(decl), decl, NULL,
CC, PAL);
FnEntry = Function::Create(Ty, Function::ExternalLinkage, Name, TheModule);
@@ -1319,7 +1319,7 @@
// Now we can give GV the proper name.
FnEntry->takeName(G);
-
+
// G is now dead, nuke it.
G->eraseFromParent();
}
@@ -1337,7 +1337,7 @@
Ty = StructType::get(Context);
if (Name.empty()) { // Global has no name.
- GV = new GlobalVariable(*TheModule, Ty, false,
+ GV = new GlobalVariable(*TheModule, Ty, false,
GlobalValue::ExternalLinkage, 0, "");
// Check for external weak linkage.
@@ -1353,7 +1353,7 @@
// If the global has a name, prevent multiple vars with the same name from
// being created.
GlobalVariable *GVE = TheModule->getGlobalVariable(Name, true);
-
+
if (GVE == 0) {
GV = new GlobalVariable(*TheModule, Ty, false,
GlobalValue::ExternalLinkage, 0, Name);
@@ -1374,7 +1374,7 @@
if (GV->getName() != Name) {
Function *F = TheModule->getFunction(Name);
assert(F && F->isDeclaration() && "A function turned into a global?");
-
+
// Replace any uses of "F" with uses of GV.
Constant *FInNewType = TheFolder->CreateBitCast(GV, F->getType());
F->replaceAllUsesWith(FInNewType);
@@ -1384,11 +1384,11 @@
// Now we can give GV the proper name.
GV->takeName(F);
-
+
// F is now dead, nuke it.
F->eraseFromParent();
}
-
+
} else {
GV = GVE; // Global already created, reuse it.
}
@@ -1474,7 +1474,7 @@
//FIXMEvoid print_llvm_type(FILE *file, void *LLVM) {
//FIXME oFILEstream FS(file);
//FIXME FS << "LLVM: ";
-//FIXME
+//FIXME
//FIXME // FIXME: oFILEstream can probably be removed in favor of a new raw_ostream
//FIXME // adaptor which would be simpler and more efficient. In the meantime, just
//FIXME // adapt the adaptor.
@@ -2160,7 +2160,7 @@
//TODO // Emit intermediate file before module level optimization passes are run.
//TODO if (flag_debug_llvm_module_opt) {
-//TODO
+//TODO
//TODO static PassManager *IntermediatePM = new PassManager();
//TODO IntermediatePM->add(new TargetData(*TheTarget->getTargetData()));
//TODO
@@ -2169,7 +2169,7 @@
//TODO strcat(&asm_intermediate_out_filename[0],".0");
//TODO FILE *asm_intermediate_out_file = fopen(asm_intermediate_out_filename, "w+b");
//TODO AsmIntermediateOutStream = new oFILEstream(asm_intermediate_out_file);
-//TODO raw_ostream *AsmIntermediateRawOutStream =
+//TODO raw_ostream *AsmIntermediateRawOutStream =
//TODO new raw_os_ostream(*AsmIntermediateOutStream);
//TODO if (EmitIR && 0)
//TODO IntermediatePM->add(createBitcodeWriterPass(*AsmIntermediateOutStream));
@@ -2189,7 +2189,7 @@
createPerModuleOptimizationPasses();
if (PerModulePasses)
PerModulePasses->run(*TheModule);
-
+
// Run the code generator, if present.
if (CodeGenPasses) {
CodeGenPasses->doInitialization();
Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=104040&r1=104039&r2=104040&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Tue May 18 13:13:30 2010
@@ -223,7 +223,7 @@
return *TheTarget->getTargetData();
}
-/// EmitDebugInfo - Return true if debug info is to be emitted for current
+/// EmitDebugInfo - Return true if debug info is to be emitted for current
/// function.
bool TreeToLLVM::EmitDebugInfo() {
if (TheDebugInfo && !DECL_IGNORED_P(getFUNCTION_DECL()))
@@ -3690,15 +3690,15 @@
// LLVM doesn't handle type 1 or type 3. Deal with that here.
Value *Tmp = EmitMemory(gimple_call_arg(stmt, 1));
-
+
ConstantInt *CI = cast(Tmp);
-
+
// Clear the bottom bit since we only handle whole objects and shift to turn
// the second bit into our boolean.
uint64_t val = (CI->getZExtValue() & 0x2) >> 1;
-
+
Value *NewTy = ConstantInt::get(Tmp->getType(), val);
-
+
Value* Args[] = {
EmitMemory(gimple_call_arg(stmt, 0)),
NewTy
Modified: dragonegg/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.cpp?rev=104040&r1=104039&r2=104040&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Tue May 18 13:13:30 2010
@@ -1,4 +1,4 @@
-/* High-level LLVM backend interface
+/* High-level LLVM backend interface
Copyright (C) 2005 Free Software Foundation, Inc.
Contributed by Jim Laskey (jlaskey at apple.com)
@@ -74,7 +74,7 @@
std::string &Directory, std::string &FileName) {
// Look for the directory slash.
size_t Slash = FullPath.rfind('/');
-
+
// If no slash
if (Slash == std::string::npos) {
// The entire path is the file name.
@@ -85,7 +85,7 @@
Directory = FullPath.substr(0, Slash);
FileName = FullPath.substr(Slash + 1);
}
-
+
// If no directory present then use source working directory.
if (Directory.empty() || Directory[0] != '/') {
Directory = std::string(get_src_pwd()) + "/" + Directory;
@@ -112,7 +112,7 @@
else
return DECL_ALIGN(Node);
}
-
+
return 0;
}
@@ -137,7 +137,7 @@
/// node is a TYPE or DECL.
static StringRef GetNodeName(tree Node) {
tree Name = NULL;
-
+
if (DECL_P(Node)) {
Name = DECL_NAME(Node);
} else if (TYPE_P(Node)) {
@@ -152,7 +152,7 @@
return StringRef(IDENTIFIER_POINTER(DECL_NAME(Name)));
}
}
-
+
return StringRef();
}
@@ -166,13 +166,13 @@
return Location;
tree Name = NULL;
-
+
if (DECL_P(Node)) {
Name = DECL_NAME(Node);
} else if (TYPE_P(Node)) {
Name = TYPE_NAME(Node);
}
-
+
if (Name) {
if (TYPE_STUB_DECL(Name)) {
tree Stub = TYPE_STUB_DECL(Name);
@@ -181,7 +181,7 @@
Location = expand_location(DECL_SOURCE_LOCATION(Name));
}
}
-
+
if (!Location.line) {
if (UseStub && TYPE_STUB_DECL(Node)) {
tree Stub = TYPE_STUB_DECL(Node);
@@ -190,7 +190,7 @@
Location = expand_location(DECL_SOURCE_LOCATION(Node));
}
}
-
+
return Location;
}
@@ -205,10 +205,10 @@
tree decl_name = DECL_NAME(Node);
if (decl_name != NULL && IDENTIFIER_POINTER (decl_name) != NULL) {
if (TREE_PUBLIC(Node) &&
- DECL_ASSEMBLER_NAME(Node) != DECL_NAME(Node) &&
+ DECL_ASSEMBLER_NAME(Node) != DECL_NAME(Node) &&
!DECL_ABSTRACT(Node)) {
return StringRef(IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(Node)));
- }
+ }
}
return StringRef();
}
@@ -236,7 +236,7 @@
if (FnNodeName.equals(FnName))
return FnNodeName;
- // Use name returned by dwarf_name. It is in a temp. storage so make a
+ // Use name returned by dwarf_name. It is in a temp. storage so make a
// copy first.
char *StrPtr = FunctionNames.Allocate(FnName.size() + 1);
strncpy(StrPtr, FnName.data(), FnName.size());
@@ -254,7 +254,7 @@
std::map::iterator I = SPCache.find(FnDecl);
if (I != SPCache.end()) {
DISubprogram SPDecl(cast(I->second));
- DISubprogram SP =
+ DISubprogram SP =
DebugFactory.CreateSubprogramDefinition(SPDecl);
SPDecl->replaceAllUsesWith(SP);
@@ -262,7 +262,7 @@
RegionStack.push_back(WeakVH(SP));
RegionMap[FnDecl] = WeakVH(SP);
return;
- }
+ }
bool ArtificialFnWithAbstractOrigin = false;
// If this artificial function has abstract origin then put this function
@@ -281,7 +281,7 @@
I = SPCache.find(FnDecl);
if (I != SPCache.end()) {
DISubprogram SPDecl(cast(I->second));
- DISubprogram SP =
+ DISubprogram SP =
DebugFactory.CreateSubprogramDefinition(SPDecl);
SPDecl->replaceAllUsesWith(SP);
@@ -289,7 +289,7 @@
RegionStack.push_back(WeakVH(SP));
RegionMap[FnDecl] = WeakVH(SP);
return;
- }
+ }
// Gather location information.
expanded_location Loc = GetNodeLocation(FnDecl, false);
@@ -310,7 +310,7 @@
StringRef FnName = getFunctionName(FnDecl);
- DISubprogram SP =
+ DISubprogram SP =
DebugFactory.CreateSubprogram(SPContext,
FnName, FnName,
LinkageName,
@@ -319,7 +319,7 @@
Fn->hasInternalLinkage(),
true /*definition*/,
Virtuality, VIndex, ContainingType);
-
+
SPCache[FnDecl] = WeakVH(SP);
@@ -330,7 +330,7 @@
/// getOrCreateNameSpace - Get name space descriptor for the tree node.
DINameSpace DebugInfo::getOrCreateNameSpace(tree Node, DIDescriptor Context) {
- std::map::iterator I =
+ std::map::iterator I =
NameSpaceCache.find(Node);
if (I != NameSpaceCache.end())
return DINameSpace(cast(I->second));
@@ -408,12 +408,12 @@
Loc.line, Ty);
// Insert an llvm.dbg.declare into the current block.
- Instruction *Call = DebugFactory.InsertDeclare(AI, D,
+ Instruction *Call = DebugFactory.InsertDeclare(AI, D,
Builder.GetInsertBlock());
Call->setDebugLoc(DebugLoc::get(CurLineNo, 0, VarScope));
}
-/// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of
+/// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of
/// source line - "llvm.dbg.stoppoint." Now enabled at -O.
void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB,
LLVMBuilder &Builder) {
@@ -423,7 +423,7 @@
(PrevFullPath == CurFullPath ||
!strcmp(PrevFullPath, CurFullPath))) return;
if (!CurFullPath[0] || CurLineNo == 0) return;
-
+
// Update last state.
PrevFullPath = CurFullPath;
PrevLineNo = CurLineNo;
@@ -468,7 +468,7 @@
uint64_t Align = NodeAlignInBits(type);
unsigned Encoding = 0;
-
+
switch (TREE_CODE(type)) {
case INTEGER_TYPE:
if (TYPE_STRING_FLAG (type)) {
@@ -492,7 +492,7 @@
case BOOLEAN_TYPE:
Encoding = DW_ATE_boolean;
break;
- default: {
+ default: {
DEBUGASSERT(0 && "Basic type case missing");
Encoding = DW_ATE_signed;
Size = BITS_PER_WORD;
@@ -501,9 +501,9 @@
}
}
- return
+ return
DebugFactory.CreateBasicType(getOrCreateFile(main_input_filename),
- TypeName,
+ TypeName,
getOrCreateFile(main_input_filename),
0, Size, Align,
0, 0, Encoding);
@@ -531,7 +531,7 @@
// for the argument types.
char *FwdTypeName = (char *)alloca(65);
sprintf(FwdTypeName, "fwd.type.%d", FwdTypeCount++);
- llvm::DIType FwdType =
+ llvm::DIType FwdType =
DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_subroutine_type,
getOrCreateFile(main_input_filename),
FwdTypeName,
@@ -544,12 +544,12 @@
// Push the struct on region stack.
RegionStack.push_back(WeakVH(FwdType));
RegionMap[type] = WeakVH(FwdType);
-
+
llvm::SmallVector EltTys;
-
+
// Add the result type at least.
EltTys.push_back(getOrCreateType(TREE_TYPE(type)));
-
+
// Set up remainder of arguments.
bool ProcessedFirstArg = false;
for (tree arg = TYPE_ARG_TYPES(type); arg; arg = TREE_CHAIN(arg)) {
@@ -564,7 +564,7 @@
if (!ProcessedFirstArg)
ProcessedFirstArg = true;
}
-
+
llvm::DIArray EltTypeArray =
DebugFactory.GetOrCreateArray(EltTys.data(), EltTys.size());
@@ -575,7 +575,7 @@
llvm::DIType RealType =
DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_subroutine_type,
- findRegion(TYPE_CONTEXT(type)),
+ findRegion(TYPE_CONTEXT(type)),
StringRef(),
getOrCreateFile(main_input_filename),
0, 0, 0, 0, 0,
@@ -600,34 +600,34 @@
unsigned Flags = 0;
// Check if this pointer type has a name.
- if (tree TyName = TYPE_NAME(type))
+ if (tree TyName = TYPE_NAME(type))
if (TREE_CODE(TyName) == TYPE_DECL && !DECL_ORIGINAL_TYPE(TyName)) {
expanded_location TypeNameLoc = GetNodeLocation(TyName);
- DIType Ty =
+ DIType Ty =
DebugFactory.CreateDerivedType(Tag, findRegion(DECL_CONTEXT(TyName)),
- GetNodeName(TyName),
+ GetNodeName(TyName),
getOrCreateFile(TypeNameLoc.file),
TypeNameLoc.line,
0 /*size*/,
0 /*align*/,
- 0 /*offset */,
- 0 /*flags*/,
+ 0 /*offset */,
+ 0 /*flags*/,
FromTy);
TypeCache[TyName] = WeakVH(Ty);
return Ty;
}
-
+
StringRef PName = FromTy.getName();
- DIType PTy =
- DebugFactory.CreateDerivedType(Tag, findRegion(TYPE_CONTEXT(type)),
- Tag == DW_TAG_pointer_type ?
+ DIType PTy =
+ DebugFactory.CreateDerivedType(Tag, findRegion(TYPE_CONTEXT(type)),
+ Tag == DW_TAG_pointer_type ?
StringRef() : PName,
getOrCreateFile(main_input_filename),
- 0 /*line no*/,
+ 0 /*line no*/,
NodeSizeInBits(type),
NodeAlignInBits(type),
- 0 /*offset */,
- Flags,
+ 0 /*offset */,
+ Flags,
FromTy);
return PTy;
}
@@ -641,26 +641,26 @@
DEBUGASSERT(0 && "Don't support pascal strings");
return DIType();
}
-
+
unsigned Tag = 0;
-
+
if (TREE_CODE(type) == VECTOR_TYPE) {
Tag = DW_TAG_vector_type;
type = TREE_TYPE (TYPE_FIELDS (TYPE_DEBUG_REPRESENTATION_TYPE (type)));
}
else
Tag = DW_TAG_array_type;
-
+
// Add the dimensions of the array. FIXME: This loses CV qualifiers from
// interior arrays, do we care? Why aren't nested arrays represented the
// obvious/recursive way?
llvm::SmallVector Subscripts;
-
+
// There will be ARRAY_TYPE nodes for each rank. Followed by the derived
// type.
tree atype = type;
tree EltTy = TREE_TYPE(atype);
- for (; TREE_CODE(atype) == ARRAY_TYPE;
+ for (; TREE_CODE(atype) == ARRAY_TYPE;
atype = TREE_TYPE(atype)) {
tree Domain = TYPE_DOMAIN(atype);
if (Domain) {
@@ -677,15 +677,15 @@
}
EltTy = TREE_TYPE(atype);
}
-
+
llvm::DIArray SubscriptArray =
DebugFactory.GetOrCreateArray(Subscripts.data(), Subscripts.size());
expanded_location Loc = GetNodeLocation(type);
return DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_array_type,
- findRegion(TYPE_CONTEXT(type)),
+ findRegion(TYPE_CONTEXT(type)),
StringRef(),
- getOrCreateFile(Loc.file), 0,
- NodeSizeInBits(type),
+ getOrCreateFile(Loc.file), 0,
+ NodeSizeInBits(type),
NodeAlignInBits(type), 0, 0,
getOrCreateType(EltTy),
SubscriptArray);
@@ -695,7 +695,7 @@
DIType DebugInfo::createEnumType(tree type) {
// enum { a, b, ..., z };
llvm::SmallVector Elements;
-
+
if (TYPE_SIZE(type)) {
for (tree Link = TYPE_VALUES(type); Link; Link = TREE_CHAIN(Link)) {
tree EnumValue = TREE_VALUE(Link);
@@ -706,21 +706,21 @@
Elements.push_back(DebugFactory.CreateEnumerator(EnumName, Value));
}
}
-
+
llvm::DIArray EltArray =
DebugFactory.GetOrCreateArray(Elements.data(), Elements.size());
-
+
expanded_location Loc = { NULL, 0 };
- if (TYPE_SIZE(type))
+ if (TYPE_SIZE(type))
// Incomplete enums do not have any location info.
Loc = GetNodeLocation(TREE_CHAIN(type), false);
return DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_enumeration_type,
- findRegion(TYPE_CONTEXT(type)),
- GetNodeName(type),
- getOrCreateFile(Loc.file),
+ findRegion(TYPE_CONTEXT(type)),
+ GetNodeName(type),
+ getOrCreateFile(Loc.file),
Loc.line,
- NodeSizeInBits(type),
+ NodeSizeInBits(type),
NodeAlignInBits(type), 0, 0,
llvm::DIType(), EltArray);
}
@@ -731,7 +731,7 @@
// struct { a; b; ... z; }; | union { a; b; ... z; };
unsigned Tag = TREE_CODE(type) == RECORD_TYPE ? DW_TAG_structure_type :
DW_TAG_union_type;
-
+
unsigned RunTimeLang = 0;
//TODO if (TYPE_LANG_SPECIFIC (type)
//TODO && lang_hooks.types.is_runtime_specific_type (type))
@@ -751,14 +751,14 @@
//TODO break;
//TODO }
//TODO }
-
+
// Records and classes and unions can all be recursive. To handle them,
- // we first generate a debug descriptor for the struct as a forward
- // declaration. Then (if it is a definition) we go through and get debug
+ // we first generate a debug descriptor for the struct as a forward
+ // declaration. Then (if it is a definition) we go through and get debug
// info for all of its members. Finally, we create a descriptor for the
- // complete type (which may refer to the forward decl if the struct is
- // recursive) and replace all uses of the forward declaration with the
- // final definition.
+ // complete type (which may refer to the forward decl if the struct is
+ // recursive) and replace all uses of the forward declaration with the
+ // final definition.
expanded_location Loc = GetNodeLocation(TREE_CHAIN(type), false);
// FIXME: findRegion() is not able to find context all the time. This
// means when type names in different context match then FwdDecl is
@@ -776,27 +776,27 @@
unsigned SFlags = 0;
DIDescriptor TyContext = findRegion(TYPE_CONTEXT(type));
- // Check if this type is created while creating context information
- // descriptor.
+ // Check if this type is created while creating context information
+ // descriptor.
std::map::iterator I = TypeCache.find(type);
if (I != TypeCache.end())
if (MDNode *TN = dyn_cast_or_null(I->second))
return DIType(TN);
-
+
llvm::DICompositeType FwdDecl =
- DebugFactory.CreateCompositeType(Tag,
+ DebugFactory.CreateCompositeType(Tag,
TyContext,
FwdName.c_str(),
- getOrCreateFile(Loc.file),
- Loc.line,
+ getOrCreateFile(Loc.file),
+ Loc.line,
0, 0, 0, SFlags | llvm::DIType::FlagFwdDecl,
llvm::DIType(), llvm::DIArray(),
RunTimeLang);
-
- // forward declaration,
- if (TYPE_SIZE(type) == 0)
+
+ // forward declaration,
+ if (TYPE_SIZE(type) == 0)
return FwdDecl;
-
+
// Insert into the TypeCache so that recursive uses will find it.
llvm::MDNode *FDN = FwdDecl;
llvm::TrackingVH FwdDeclNode = FDN;
@@ -805,10 +805,10 @@
// Push the struct on region stack.
RegionStack.push_back(WeakVH(FwdDecl));
RegionMap[type] = WeakVH(FwdDecl);
-
+
// Convert all the elements.
llvm::SmallVector EltTys;
-
+
if (tree binfo = TYPE_BINFO(type)) {
VEC(tree,gc) *accesses = BINFO_BASE_ACCESSES (binfo);
@@ -827,24 +827,24 @@
BFlags |= llvm::DIType::FlagPrivate;
}
- // Check for zero BINFO_OFFSET.
+ // Check for zero BINFO_OFFSET.
// FIXME : Is this correct ?
- unsigned Offset = BINFO_OFFSET(BInfo) ?
- getINTEGER_CSTVal(BINFO_OFFSET(BInfo))*8 : 0;
+ unsigned Offset = BINFO_OFFSET(BInfo) ?
+ getINTEGER_CSTVal(BINFO_OFFSET(BInfo))*8 : 0;
if (BINFO_VIRTUAL_P (BInfo))
Offset = 0 - getINTEGER_CSTVal(BINFO_VPTR_FIELD (BInfo));
// FIXME : name, size, align etc...
- DIType DTy =
- DebugFactory.CreateDerivedType(DW_TAG_inheritance,
+ DIType DTy =
+ DebugFactory.CreateDerivedType(DW_TAG_inheritance,
findRegion(TYPE_CONTEXT(type)), StringRef(),
- llvm::DIFile(), 0,0,0,
+ llvm::DIFile(), 0,0,0,
Offset,
BFlags, BaseClass);
EltTys.push_back(DTy);
}
}
-
+
// Now add members of this class.
for (tree Member = TYPE_FIELDS(type); Member;
Member = TREE_CHAIN(Member)) {
@@ -858,18 +858,18 @@
// otherwise is a static variable, whose debug info is emitted
// when through EmitGlobalVariable().
continue;
-
+
if (!OffsetIsLLVMCompatible(Member))
// FIXME: field with variable or humongous offset.
// Skip it for now.
continue;
-
+
/* Ignore nameless fields. */
if (DECL_NAME (Member) == NULL_TREE
&& !(TREE_CODE (TREE_TYPE (Member)) == UNION_TYPE
|| TREE_CODE (TREE_TYPE (Member)) == RECORD_TYPE))
continue;
-
+
// Field type is the declared type of the field.
tree FieldNodeType = FieldType(Member);
DIType MemberType = getOrCreateType(FieldNodeType);
@@ -879,22 +879,22 @@
MFlags = llvm::DIType::FlagProtected;
else if (TREE_PRIVATE(Member))
MFlags = llvm::DIType::FlagPrivate;
-
+
DIType DTy =
- DebugFactory.CreateDerivedType(DW_TAG_member,
+ DebugFactory.CreateDerivedType(DW_TAG_member,
findRegion(DECL_CONTEXT(Member)),
- MemberName,
+ MemberName,
getOrCreateFile(MemLoc.file),
MemLoc.line, NodeSizeInBits(Member),
NodeAlignInBits(FieldNodeType),
- int_bit_position(Member),
+ int_bit_position(Member),
MFlags, MemberType);
EltTys.push_back(DTy);
}
-
+
for (tree Member = TYPE_METHODS(type); Member;
Member = TREE_CHAIN(Member)) {
-
+
if (DECL_ABSTRACT_ORIGIN (Member)) continue;
// Ignore unused aritificial members.
if (DECL_ARTIFICIAL (Member) && !TREE_USED (Member)) continue;
@@ -919,10 +919,10 @@
Virtuality = dwarf::DW_VIRTUALITY_virtual;
ContainingType = getOrCreateType(DECL_CONTEXT(Member));
}
- DISubprogram SP =
- DebugFactory.CreateSubprogram(findRegion(DECL_CONTEXT(Member)),
+ DISubprogram SP =
+ DebugFactory.CreateSubprogram(findRegion(DECL_CONTEXT(Member)),
MemberName, MemberName,
- LinkageName,
+ LinkageName,
getOrCreateFile(MemLoc.file),
MemLoc.line, SPTy, false, false,
Virtuality, VIndex, ContainingType,
@@ -931,7 +931,7 @@
SPCache[Member] = WeakVH(SP);
}
}
-
+
llvm::DIArray Elements =
DebugFactory.GetOrCreateArray(EltTys.data(), EltTys.size());
@@ -949,7 +949,7 @@
DebugFactory.CreateCompositeType(Tag, findRegion(TYPE_CONTEXT(type)),
GetNodeName(type),
getOrCreateFile(Loc.file),
- Loc.line,
+ Loc.line,
NodeSizeInBits(type), NodeAlignInBits(type),
0, SFlags, llvm::DIType(), Elements,
RunTimeLang, ContainingType);
@@ -964,7 +964,7 @@
/// createVarinatType - Create variant type or return MainTy.
DIType DebugInfo::createVariantType(tree type, DIType MainTy) {
-
+
DIType Ty;
if (tree TyDef = TYPE_NAME(type)) {
std::map::iterator I = TypeCache.find(TyDef);
@@ -973,15 +973,15 @@
return DIType(cast(M));
if (TREE_CODE(TyDef) == TYPE_DECL && DECL_ORIGINAL_TYPE(TyDef)) {
expanded_location TypeDefLoc = GetNodeLocation(TyDef);
- Ty = DebugFactory.CreateDerivedType(DW_TAG_typedef,
+ Ty = DebugFactory.CreateDerivedType(DW_TAG_typedef,
findRegion(DECL_CONTEXT(TyDef)),
- GetNodeName(TyDef),
+ GetNodeName(TyDef),
getOrCreateFile(TypeDefLoc.file),
TypeDefLoc.line,
0 /*size*/,
0 /*align*/,
- 0 /*offset */,
- 0 /*flags*/,
+ 0 /*offset */,
+ 0 /*flags*/,
MainTy);
TypeCache[TyDef] = WeakVH(Ty);
return Ty;
@@ -989,31 +989,31 @@
}
if (TYPE_VOLATILE(type)) {
- Ty = DebugFactory.CreateDerivedType(DW_TAG_volatile_type,
- findRegion(TYPE_CONTEXT(type)),
+ Ty = DebugFactory.CreateDerivedType(DW_TAG_volatile_type,
+ findRegion(TYPE_CONTEXT(type)),
StringRef(),
getOrCreateFile(main_input_filename),
- 0 /*line no*/,
+ 0 /*line no*/,
NodeSizeInBits(type),
NodeAlignInBits(type),
- 0 /*offset */,
- 0 /* flags */,
+ 0 /*offset */,
+ 0 /* flags */,
MainTy);
MainTy = Ty;
}
- if (TYPE_READONLY(type))
- Ty = DebugFactory.CreateDerivedType(DW_TAG_const_type,
- findRegion(TYPE_CONTEXT(type)),
+ if (TYPE_READONLY(type))
+ Ty = DebugFactory.CreateDerivedType(DW_TAG_const_type,
+ findRegion(TYPE_CONTEXT(type)),
StringRef(),
getOrCreateFile(main_input_filename),
- 0 /*line no*/,
+ 0 /*line no*/,
NodeSizeInBits(type),
NodeAlignInBits(type),
- 0 /*offset */,
- 0 /* flags */,
+ 0 /*offset */,
+ 0 /* flags */,
MainTy);
-
+
if (TYPE_VOLATILE(type) || TYPE_READONLY(type)) {
TypeCache[type] = WeakVH(Ty);
return Ty;
@@ -1033,7 +1033,7 @@
// Should only be void if a pointer/reference/return type. Returning NULL
// allows the caller to produce a non-derived type.
if (TREE_CODE(type) == VOID_TYPE) return DIType();
-
+
// Check to see if the compile unit already has created this type.
std::map::iterator I = TypeCache.find(type);
if (I != TypeCache.end())
@@ -1057,7 +1057,7 @@
DEBUGASSERT(0 && "Unsupported type");
return DIType();
}
-
+
case POINTER_TYPE:
case REFERENCE_TYPE:
// Do not cache pointer type. The pointer may point to forward declared
@@ -1073,27 +1073,27 @@
}
case FUNCTION_TYPE:
- case METHOD_TYPE:
+ case METHOD_TYPE:
Ty = createMethodType(type);
break;
-
+
case VECTOR_TYPE:
- case ARRAY_TYPE:
+ case ARRAY_TYPE:
Ty = createArrayType(type);
break;
-
- case ENUMERAL_TYPE:
+
+ case ENUMERAL_TYPE:
Ty = createEnumType(type);
break;
-
+
case RECORD_TYPE:
case QUAL_UNION_TYPE:
- case UNION_TYPE:
+ case UNION_TYPE:
return createStructType(type);
break;
case INTEGER_TYPE:
- case REAL_TYPE:
+ case REAL_TYPE:
case COMPLEX_TYPE:
case BOOLEAN_TYPE:
Ty = createBasicType(type);
@@ -1110,11 +1110,11 @@
// Each input file is encoded as a separate compile unit in LLVM
// debugging information output. However, many target specific tool chains
- // prefer to encode only one compile unit in an object file. In this
+ // prefer to encode only one compile unit in an object file. In this
// situation, the LLVM code generator will include debugging information
- // entities in the compile unit that is marked as main compile unit. The
+ // entities in the compile unit that is marked as main compile unit. The
// code generator accepts maximum one main compile unit per module. If a
- // module does not contain any main compile unit then the code generator
+ // module does not contain any main compile unit then the code generator
// will emit multiple compile units in the output object file.
if (!strcmp (main_input_filename, ""))
TheCU = getOrCreateCompileUnit("", true);
@@ -1122,7 +1122,7 @@
TheCU = getOrCreateCompileUnit(main_input_filename, true);
}
-/// getOrCreateCompileUnit - Get the compile unit from the cache or
+/// getOrCreateCompileUnit - Get the compile unit from the cache or
/// create a new one if necessary.
DICompileUnit DebugInfo::getOrCreateCompileUnit(const char *FullPath,
bool isMain) {
@@ -1137,7 +1137,7 @@
std::string Directory;
std::string FileName;
DirectoryAndFile(FullPath, Directory, FileName);
-
+
// Set up Language number.
unsigned LangTag;
const std::string LanguageName(lang_hooks.name);
@@ -1155,13 +1155,13 @@
LangTag = DW_LANG_Java;
else if (LanguageName == "GNU Objective-C")
LangTag = DW_LANG_ObjC;
- else if (LanguageName == "GNU Objective-C++")
+ else if (LanguageName == "GNU Objective-C++")
LangTag = DW_LANG_ObjC_plus_plus;
else
LangTag = DW_LANG_C89;
StringRef Flags;
-
+
// flag_objc_abi represents Objective-C runtime version number. It is zero
// for all other language.
unsigned ObjcRunTimeVer = 0;
Modified: dragonegg/trunk/llvm-debug.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.h?rev=104040&r1=104039&r2=104040&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.h (original)
+++ dragonegg/trunk/llvm-debug.h Tue May 18 13:13:30 2010
@@ -51,7 +51,7 @@
class DebugInfo {
private:
Module *M; // The current module.
- DIFactory DebugFactory;
+ DIFactory DebugFactory;
const char *CurFullPath; // Previous location file encountered.
int CurLineNo; // Previous location line# encountered.
const char *PrevFullPath; // Previous location file encountered.
@@ -61,23 +61,23 @@
DICompileUnit TheCU; // The compile unit.
// This counter counts debug info for forward referenced subroutine types.
- // This counter is used to create unique name for such types so that their
+ // This counter is used to create unique name for such types so that their
// debug info (through MDNodes) is not shared accidently.
unsigned FwdTypeCount;
std::map TypeCache;
- // Cache of previously constructed
+ // Cache of previously constructed
// Types.
std::map SPCache;
- // Cache of previously constructed
+ // Cache of previously constructed
// Subprograms.
std::map NameSpaceCache;
- // Cache of previously constructed name
+ // Cache of previously constructed name
// spaces.
SmallVector RegionStack;
// Stack to track declarative scopes.
-
+
std::map RegionMap;
/// FunctionNames - This is a storage for function names that are
@@ -95,7 +95,7 @@
// Accessors.
void setLocationFile(const char *FullPath) { CurFullPath = FullPath; }
void setLocationLine(int LineNo) { CurLineNo = LineNo; }
-
+
/// EmitFunctionStart - Constructs the debug code for entering a function -
/// "llvm.dbg.func.start."
void EmitFunctionStart(tree_node *FnDecl, Function *Fn, BasicBlock *CurBB);
@@ -109,10 +109,10 @@
void EmitDeclare(tree_node *decl, unsigned Tag, const char *Name,
tree_node *type, Value *AI, LLVMBuilder &Builder);
- /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of
+ /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of
/// source line.
void EmitStopPoint(Function *Fn, BasicBlock *CurBB, LLVMBuilder &Builder);
-
+
/// EmitGlobalVariable - Emit information about a global variable.
///
void EmitGlobalVariable(GlobalVariable *GV, tree_node *decl);
@@ -151,7 +151,7 @@
/// findRegion - Find tree_node N's region.
DIDescriptor findRegion(tree_node *n);
-
+
/// getOrCreateNameSpace - Get name space descriptor for the tree node.
DINameSpace getOrCreateNameSpace(tree_node *Node, DIDescriptor Context);
Modified: dragonegg/trunk/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-types.cpp?rev=104040&r1=104039&r2=104040&view=diff
==============================================================================
--- dragonegg/trunk/llvm-types.cpp (original)
+++ dragonegg/trunk/llvm-types.cpp Tue May 18 13:13:30 2010
@@ -1,4 +1,4 @@
-/* Tree type to LLVM type converter
+/* Tree type to LLVM type converter
Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Chris Lattner (sabre at nondot.org)
@@ -110,13 +110,13 @@
//TODO for (unsigned i = 0; i < LTypesNames->getNumOperands(); ++i) {
//TODO const Type *Ty = NULL;
//TODO
-//TODO if (ConstantArray *CA =
+//TODO if (ConstantArray *CA =
//TODO dyn_cast(LTypesNames->getOperand(i))) {
//TODO std::string Str = CA->getAsString();
//TODO Ty = TheModule->getTypeByName(Str);
//TODO assert (Ty != NULL && "Invalid Type in LTypes string table");
-//TODO }
-//TODO // If V is not a string then it is empty. Insert NULL to represent
+//TODO }
+//TODO // If V is not a string then it is empty. Insert NULL to represent
//TODO // empty entries.
//TODO LTypes.push_back(Ty);
//TODO }
@@ -131,8 +131,8 @@
//TODO// Create a string table to hold these LLVM types' names. This string
//TODO// table will be used to recreate LTypes vector after loading PCH.
//TODOvoid writeLLVMTypesStringTable() {
-//TODO
-//TODO if (LTypes.empty())
+//TODO
+//TODO if (LTypes.empty())
//TODO return;
//TODO
//TODO std::vector LTypesNames;
@@ -166,9 +166,9 @@
//TODO Constant *LTypesNameTable = ConstantStruct::get(Context, LTypesNames, false);
//TODO
//TODO // Create variable to hold this string table.
-//TODO GlobalVariable *GV = new GlobalVariable(*TheModule,
+//TODO GlobalVariable *GV = new GlobalVariable(*TheModule,
//TODO LTypesNameTable->getType(), true,
-//TODO GlobalValue::ExternalLinkage,
+//TODO GlobalValue::ExternalLinkage,
//TODO LTypesNameTable,
//TODO "llvm.pch.types");
//TODO}
@@ -193,7 +193,7 @@
ArgTysP.reserve(ArgTys.size());
for (unsigned i = 0, e = ArgTys.size(); i != e; ++i)
ArgTysP.push_back(ArgTys[i]);
-
+
return FunctionType::get(Res, ArgTysP, isVarArg);
}
@@ -336,7 +336,7 @@
virtual void refineAbstractType(const DerivedType *OldTy,
const Type *NewTy);
virtual void typeBecameConcrete(const DerivedType *AbsTy);
-
+
// TypeUsers - For each abstract LLVM type, we keep track of all of the GCC
// types that point to it.
std::map > TypeUsers;
@@ -359,7 +359,7 @@
void RemoveTypeFromTable(tree type);
void dump() const;
};
-
+
/// TypeDB - The main global type database.
TypeRefinementDatabase TypeDB;
}
@@ -371,7 +371,7 @@
if (!Ty->isAbstract()) return;
std::map >::iterator I = TypeUsers.find(Ty);
assert(I != TypeUsers.end() && "Using an abstract type but not in table?");
-
+
bool FoundIt = false;
for (unsigned i = 0, e = I->second.size(); i != e; ++i)
if (I->second[i] == type) {
@@ -381,7 +381,7 @@
break;
}
assert(FoundIt && "Using an abstract type but not in table?");
-
+
// If the type plane is now empty, nuke it.
if (I->second.empty()) {
TypeUsers.erase(I);
@@ -396,7 +396,7 @@
void TypeRefinementDatabase::refineAbstractType(const DerivedType *OldTy,
const Type *NewTy) {
if (OldTy == NewTy && OldTy->isAbstract()) return; // Nothing to do.
-
+
std::map >::iterator I = TypeUsers.find(OldTy);
assert(I != TypeUsers.end() && "Using an abstract type but not in table?");
@@ -411,7 +411,7 @@
// everything over and stop monitoring OldTy.
std::vector &NewSlot = TypeUsers[NewTy];
if (NewSlot.empty()) NewTy->addAbstractTypeUser(this);
-
+
for (unsigned i = 0, e = I->second.size(); i != e; ++i) {
NewSlot.push_back(I->second[i]);
SET_TYPE_LLVM(I->second[i], NewTy);
@@ -419,11 +419,11 @@
}
TypeUsers.erase(I);
-
+
// Next, remove OldTy's entry in the TargetData object if it has one.
if (const StructType *STy = dyn_cast(OldTy))
getTargetData().InvalidateStructLayoutInfo(STy);
-
+
OldTy->removeAbstractTypeUser(this);
}
@@ -534,7 +534,7 @@
FindLLVMTypePadding(ATy->getElementType(), 0, BitOffset+i*EltSize,
Padding);
}
-
+
// primitive and vector types have no padding.
}
@@ -644,13 +644,13 @@
}
}
-bool TypeConverter::GCCTypeOverlapsWithLLVMTypePadding(tree type,
+bool TypeConverter::GCCTypeOverlapsWithLLVMTypePadding(tree type,
const Type *Ty) {
-
+
// Start by finding all of the padding in the LLVM Type.
SmallVector, 16> StructPadding;
FindLLVMTypePadding(Ty, type, 0, StructPadding);
-
+
for (unsigned i = 0, e = StructPadding.size(); i != e; ++i)
if (GCCTypeOverlapsWithPadding(type, StructPadding[i].first,
StructPadding[i].second))
@@ -1000,7 +1000,7 @@
if (TREE_CODE(ArgTy) == BOOLEAN_TYPE) {
if (TREE_INT_CST_LOW(TYPE_SIZE(ArgTy)) < INT_TYPE_SIZE)
return Attribute::ZExt;
- } else if (TREE_CODE(ArgTy) == INTEGER_TYPE &&
+ } else if (TREE_CODE(ArgTy) == INTEGER_TYPE &&
TREE_INT_CST_LOW(TYPE_SIZE(ArgTy)) < INT_TYPE_SIZE) {
if (TYPE_UNSIGNED(ArgTy))
return Attribute::ZExt;
@@ -1030,7 +1030,7 @@
#ifdef TARGET_ADJUST_LLVM_CC
TARGET_ADJUST_LLVM_CC(CallingConv, type);
#endif
-
+
// Builtins are always prototyped, so this isn't one.
ABIConverter.HandleReturnType(ReturnType, current_function_decl, false);
@@ -1097,7 +1097,7 @@
ABIConverter.HandleReturnType(TREE_TYPE(type), current_function_decl,
decl ? DECL_BUILT_IN(decl) : false);
-
+
// Compute attributes for return type (and function attributes).
SmallVector Attrs;
Attributes FnAttributes = Attribute::None;
@@ -1177,10 +1177,10 @@
#ifdef LLVM_TARGET_ENABLE_REGPARM
LLVM_TARGET_INIT_REGPARM(local_regparam, local_fp_regparam, type);
#endif // LLVM_TARGET_ENABLE_REGPARM
-
+
// Keep track of whether we see a byval argument.
bool HasByVal = false;
-
+
// Check if we have a corresponding decl to inspect.
tree DeclArgs = (decl) ? DECL_ARGUMENTS(decl) : NULL;
// Loop over all of the arguments, adding them as we go.
@@ -1198,14 +1198,14 @@
// Don't nuke last argument.
ArgTypes.erase(ArgTypes.begin()+1, ArgTypes.end());
Args = 0;
- break;
+ break;
}
-
+
// Determine if there are any attributes for this param.
Attributes PAttributes = Attribute::None;
unsigned OldSize = ArgTypes.size();
-
+
ABIConverter.HandleArgument(ArgTy, ScalarArgs, &PAttributes);
// Compute zext/sext attributes.
@@ -1220,7 +1220,7 @@
if (TYPE_RESTRICT(RestrictArgTy))
PAttributes |= Attribute::NoAlias;
}
-
+
#ifdef LLVM_TARGET_ENABLE_REGPARM
// Allow the target to mark this as inreg.
if (INTEGRAL_TYPE_P(ArgTy) || POINTER_TYPE_P(ArgTy) ||
@@ -1229,7 +1229,7 @@
TREE_INT_CST_LOW(TYPE_SIZE(ArgTy)),
local_regparam, local_fp_regparam);
#endif // LLVM_TARGET_ENABLE_REGPARM
-
+
if (PAttributes != Attribute::None) {
HasByVal |= PAttributes & Attribute::ByVal;
@@ -1239,11 +1239,11 @@
Attrs.push_back(AttributeWithIndex::get(i, PAttributes));
}
}
-
+
if (DeclArgs)
DeclArgs = TREE_CHAIN(DeclArgs);
}
-
+
// If there is a byval argument then it is not safe to mark the function
// 'readnone' or 'readonly': gcc permits a 'const' or 'pure' function to
// write to struct arguments passed by value, but in LLVM this becomes a
@@ -1285,7 +1285,7 @@
StructTypeConversionInfo(TargetMachine &TM, unsigned GCCAlign, bool P)
: TD(*TM.getTargetData()), GCCStructAlignmentInBytes(GCCAlign),
- Packed(P), AllBitFields(true), LastFieldStartsAtNonByteBoundry(false),
+ Packed(P), AllBitFields(true), LastFieldStartsAtNonByteBoundry(false),
ExtraBitsAvailable(0) {}
void lastFieldStartsAtNonByteBoundry(bool value) {
@@ -1311,19 +1311,19 @@
unsigned getGCCStructAlignmentInBytes() const {
return GCCStructAlignmentInBytes;
}
-
+
/// getTypeAlignment - Return the alignment of the specified type in bytes.
///
unsigned getTypeAlignment(const Type *Ty) const {
return Packed ? 1 : TD.getABITypeAlignment(Ty);
}
-
+
/// getTypeSize - Return the size of the specified type in bytes.
///
uint64_t getTypeSize(const Type *Ty) const {
return TD.getTypeAllocSize(Ty);
}
-
+
/// getLLVMType - Return the LLVM type for the specified object.
///
const Type *getLLVMType() const {
@@ -1332,7 +1332,7 @@
return StructType::get(Context, Elements,
Packed || (!Elements.empty() && AllBitFields));
}
-
+
/// getAlignmentAsLLVMStruct - Return the alignment of this struct if it were
/// converted to an LLVM type.
uint64_t getAlignmentAsLLVMStruct() const {
@@ -1358,7 +1358,7 @@
void RemoveExtraBytes () {
unsigned NoOfBytesToRemove = ExtraBitsAvailable/8;
-
+
if (!Packed && !AllBitFields)
return;
@@ -1429,22 +1429,22 @@
// declared type, not the shrunk-to-fit type that GCC gives us in TREE_TYPE.
unsigned ByteAlignment = getTypeAlignment(Ty);
uint64_t NextByteOffset = getNewElementByteOffset(ByteAlignment);
- if (NextByteOffset > ByteOffset ||
+ if (NextByteOffset > ByteOffset ||
ByteAlignment > getGCCStructAlignmentInBytes()) {
// LLVM disagrees as to where this field should go in the natural field
// ordering. Therefore convert to a packed struct and try again.
return false;
}
-
+
// If alignment won't round us up to the right boundary, insert explicit
// padding.
if (NextByteOffset < ByteOffset) {
uint64_t CurOffset = getNewElementByteOffset(1);
const Type *Pad = Type::getInt8Ty(Context);
- if (SavedTy && LastFieldStartsAtNonByteBoundry)
+ if (SavedTy && LastFieldStartsAtNonByteBoundry)
// We want to reuse SavedType to access this bit field.
- // e.g. struct __attribute__((packed)) {
- // unsigned int A,
+ // e.g. struct __attribute__((packed)) {
+ // unsigned int A,
// unsigned short B : 6,
// C : 15;
// char D; };
@@ -1456,29 +1456,29 @@
}
return true;
}
-
+
/// FieldNo - Remove the specified field and all of the fields that come after
/// it.
void RemoveFieldsAfter(unsigned FieldNo) {
Elements.erase(Elements.begin()+FieldNo, Elements.end());
- ElementOffsetInBytes.erase(ElementOffsetInBytes.begin()+FieldNo,
+ ElementOffsetInBytes.erase(ElementOffsetInBytes.begin()+FieldNo,
ElementOffsetInBytes.end());
ElementSizeInBytes.erase(ElementSizeInBytes.begin()+FieldNo,
ElementSizeInBytes.end());
- PaddingElement.erase(PaddingElement.begin()+FieldNo,
+ PaddingElement.erase(PaddingElement.begin()+FieldNo,
PaddingElement.end());
}
-
+
/// getNewElementByteOffset - If we add a new element with the specified
/// alignment, what byte offset will it land at?
uint64_t getNewElementByteOffset(unsigned ByteAlignment) {
if (Elements.empty()) return 0;
- uint64_t LastElementEnd =
+ uint64_t LastElementEnd =
ElementOffsetInBytes.back() + ElementSizeInBytes.back();
-
+
return (LastElementEnd+ByteAlignment-1) & ~(ByteAlignment-1);
}
-
+
/// addElement - Add an element to the structure with the specified type,
/// offset and size.
void addElement(const Type *Ty, uint64_t Offset, uint64_t Size,
@@ -1490,7 +1490,7 @@
lastFieldStartsAtNonByteBoundry(false);
ExtraBitsAvailable = 0;
}
-
+
/// getFieldEndOffsetInBytes - Return the byte offset of the byte immediately
/// after the specified field. For example, if FieldNo is 0 and the field
/// is 4 bytes in size, this will return 4.
@@ -1498,7 +1498,7 @@
assert(FieldNo < ElementOffsetInBytes.size() && "Invalid field #!");
return ElementOffsetInBytes[FieldNo]+ElementSizeInBytes[FieldNo];
}
-
+
/// getEndUnallocatedByte - Return the first byte that isn't allocated at the
/// end of a structure. For example, for {}, it's 0, for {int} it is 4, for
/// {int,short}, it is 6.
@@ -1562,7 +1562,7 @@
// Instead of inserting a nice whole field, insert a small array of ubytes.
NewFieldTy = ArrayType::get(Type::getInt8Ty(Context), (Size+7)/8);
}
-
+
// Finally, add the new field.
addElement(NewFieldTy, FirstUnallocatedByte, getTypeSize(NewFieldTy));
ExtraBitsAvailable = NewFieldTy->getPrimitiveSizeInBits() - Size;
@@ -1586,7 +1586,7 @@
/// Return true if and only if field no. N from struct type T is a padding
/// element added to match llvm struct type size and gcc struct type size.
bool isPaddingElement(tree type, unsigned index) {
-
+
StructTypeConversionInfo *Info = StructTypeInfoMap[type];
// If info is not available then be conservative and return false.
@@ -1595,7 +1595,7 @@
assert ( Info->Elements.size() == Info->PaddingElement.size()
&& "Invalid StructTypeConversionInfo");
- assert ( index < Info->PaddingElement.size()
+ assert ( index < Info->PaddingElement.size()
&& "Invalid PaddingElement index");
return Info->PaddingElement[index];
}
@@ -1674,7 +1674,7 @@
// LLVM disagrees as to where this field should go in the natural field
// ordering. Therefore convert to a packed struct and try again.
return false;
- }
+ }
else if (TYPE_USER_ALIGN(TREE_TYPE(Field))
&& (unsigned)DECL_ALIGN(Field) != 8 * Info.getTypeAlignment(Ty)
&& !Info.isPacked()) {
@@ -1697,7 +1697,7 @@
/// (potentially multiple) integer fields of integer type. This ensures that
/// initialized globals with bitfields can have the initializers for the
/// bitfields specified.
-void TypeConverter::DecodeStructBitField(tree_node *Field,
+void TypeConverter::DecodeStructBitField(tree_node *Field,
StructTypeConversionInfo &Info) {
unsigned FieldSizeInBits = TREE_INT_CST_LOW(DECL_SIZE(Field));
@@ -1707,7 +1707,7 @@
// Get the starting offset in the record.
uint64_t StartOffsetInBits = getFieldOffsetInBits(Field);
uint64_t EndBitOffset = FieldSizeInBits+StartOffsetInBits;
-
+
// If the last inserted LLVM field completely contains this bitfield, just
// ignore this field.
if (!Info.Elements.empty()) {
@@ -1720,10 +1720,10 @@
// Already contained in previous field. Update remaining extra bits that
// are available.
Info.extraBitsAvailable(Info.getEndUnallocatedByte()*8 - EndBitOffset);
- return;
+ return;
}
}
-
+
// Otherwise, this bitfield lives (potentially) partially in the preceeding
// field and in fields that exist after it. Add integer-typed fields to the
// LLVM struct such that there are no holes in the struct where the bitfield
@@ -1774,13 +1774,13 @@
return;
}
- // Otherwise, this field's starting point is inside previously used byte.
+ // Otherwise, this field's starting point is inside previously used byte.
// This happens with Packed bit fields. In this case one LLVM Field is
// used to access previous field and current field.
- unsigned prevFieldTypeSizeInBits =
+ unsigned prevFieldTypeSizeInBits =
Info.ElementSizeInBytes[Info.Elements.size() - 1] * 8;
- unsigned NumBitsRequired = prevFieldTypeSizeInBits
+ unsigned NumBitsRequired = prevFieldTypeSizeInBits
+ (FieldSizeInBits - AvailableBits);
if (NumBitsRequired > 64) {
@@ -1792,13 +1792,13 @@
// hold both fields.
Info.RemoveFieldsAfter(Info.Elements.size() - 1);
for (unsigned idx = 0; idx < (prevFieldTypeSizeInBits/8); ++idx)
- FirstUnallocatedByte--;
+ FirstUnallocatedByte--;
}
Info.addNewBitField(NumBitsRequired, ExtraSizeInBits, FirstUnallocatedByte);
// Do this after adding Field.
Info.lastFieldStartsAtNonByteBoundry(true);
return;
- }
+ }
if (StartOffsetInBits > FirstUnallocatedByte*8) {
// If there is padding between the last field and the struct, insert
@@ -1806,7 +1806,7 @@
unsigned PadBytes = 0;
unsigned PadBits = 0;
if (StartOffsetFromByteBoundry != 0) {
- // New field does not start at byte boundry.
+ // New field does not start at byte boundry.
PadBits = StartOffsetInBits - (FirstUnallocatedByte*8);
PadBytes = PadBits/8;
PadBits = PadBits - PadBytes*8;
@@ -1924,21 +1924,21 @@
//
// The TYPE nodes gcc builds for classes represent that class as it looks
// standing alone. Thus B is size 12 and looks like { vptr; i2; baseclass A; }
-// However, this is not the layout used when that class is a base class for
+// However, this is not the layout used when that class is a base class for
// some other class, yet the same TYPE node is still used. D in the above has
// both a BINFO list entry and a FIELD that reference type B, but the virtual
// base class A within B is not allocated in that case; B-within-D is only
// size 8. The correct size is in the FIELD node (does not match the size
// in its child TYPE node.) The fields to be omitted from the child TYPE,
-// as far as I can tell, are always the last ones; but also, there is a
-// TYPE_DECL node sitting in the middle of the FIELD list separating virtual
+// as far as I can tell, are always the last ones; but also, there is a
+// TYPE_DECL node sitting in the middle of the FIELD list separating virtual
// base classes from everything else.
//
// Similarly, a nonvirtual base class which has virtual base classes might
// not contain those virtual base classes when used as a nonvirtual base class.
// There is seemingly no way to detect this except for the size differential.
//
-// For LLVM purposes, we build a new type for B-within-D that
+// For LLVM purposes, we build a new type for B-within-D that
// has the correct size and layout for that usage.
const Type *TypeConverter::ConvertRECORD(tree type) {
@@ -1970,7 +1970,7 @@
for (unsigned j = i; j && Fields[j].second < Fields[j-1].second; j--)
std::swap(Fields[j], Fields[j-1]);
- StructTypeConversionInfo *Info =
+ StructTypeConversionInfo *Info =
new StructTypeConversionInfo(*TheTarget, TYPE_ALIGN(type) / 8,
TYPE_PACKED(type));
Modified: dragonegg/trunk/x86/llvm-target.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/x86/llvm-target.cpp?rev=104040&r1=104039&r2=104040&view=diff
==============================================================================
--- dragonegg/trunk/x86/llvm-target.cpp (original)
+++ dragonegg/trunk/x86/llvm-target.cpp Tue May 18 13:13:30 2010
@@ -1,4 +1,4 @@
-/* High-level LLVM backend interface
+/* High-level LLVM backend interface
Copyright (C) 2005 Free Software Foundation, Inc.
Contributed by Evan Cheng (evan.cheng at apple.com)
@@ -911,7 +911,7 @@
error_at(gimple_location(stmt), "mask must be an immediate");
Result = Ops[0];
}
-
+
return true;
IX86_BUILTIN_PUNPCKHBW:
Result = BuildVectorShuffle(Ops[0], Ops[1], 4, 12, 5, 13,
@@ -1262,7 +1262,7 @@
Value *Ptr = CreateTemporary(Type::getInt32Ty(Context));
Value *BPtr = Builder.CreateBitCast(Ptr, Type::getInt8PtrTy(Context));
Builder.CreateCall(stmxcsr, BPtr);
-
+
Result = Builder.CreateLoad(Ptr);
return true;
}
@@ -1271,43 +1271,43 @@
// In the header we multiply by 8, correct that back now.
unsigned shiftVal = (cast(Ops[2])->getZExtValue())/8;
-
+
// If palignr is shifting the pair of input vectors less than 9 bytes,
// emit a shuffle instruction.
if (shiftVal <= 8) {
const llvm::Type *IntTy = Type::getInt32Ty(Context);
const llvm::Type *EltTy = Type::getInt8Ty(Context);
const llvm::Type *VecTy = VectorType::get(EltTy, 8);
-
+
Ops[1] = Builder.CreateBitCast(Ops[1], VecTy);
Ops[0] = Builder.CreateBitCast(Ops[0], VecTy);
SmallVector Indices;
for (unsigned i = 0; i != 8; ++i)
Indices.push_back(ConstantInt::get(IntTy, shiftVal + i));
-
+
Value* SV = ConstantVector::get(Indices.begin(), Indices.size());
Result = Builder.CreateShuffleVector(Ops[1], Ops[0], SV, "palignr");
return true;
}
-
+
// If palignr is shifting the pair of input vectors more than 8 but less
// than 16 bytes, emit a logical right shift of the destination.
if (shiftVal < 16) {
// MMX has these as 1 x i64 vectors for some odd optimization reasons.
const llvm::Type *EltTy = Type::getInt64Ty(Context);
const llvm::Type *VecTy = VectorType::get(EltTy, 1);
-
+
Ops[0] = Builder.CreateBitCast(Ops[0], VecTy, "cast");
Ops[1] = ConstantInt::get(VecTy, (shiftVal-8) * 8);
-
+
// create i32 constant
Function *F = Intrinsic::getDeclaration(TheModule,
Intrinsic::x86_mmx_psrl_q);
Result = Builder.CreateCall(F, &Ops[0], &Ops[0] + 2, "palignr");
return true;
}
-
+
// If palignr is shifting the pair of vectors more than 32 bytes,
// emit zero.
Result = Constant::getNullValue(ResultType);
@@ -1328,7 +1328,7 @@
const llvm::Type *IntTy = Type::getInt32Ty(Context);
const llvm::Type *EltTy = Type::getInt8Ty(Context);
const llvm::Type *VecTy = VectorType::get(EltTy, 16);
-
+
Ops[1] = Builder.CreateBitCast(Ops[1], VecTy);
Ops[0] = Builder.CreateBitCast(Ops[0], VecTy);
@@ -1353,7 +1353,7 @@
// create i32 constant
llvm::Function *F = Intrinsic::getDeclaration(TheModule,
- Intrinsic::x86_sse2_psrl_dq);
+ Intrinsic::x86_sse2_psrl_dq);
Result = Builder.CreateCall(F, &Ops[0], &Ops[0] + 2, "palignr");
return true;
}
@@ -1426,26 +1426,26 @@
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
const Type *EltTy = STy->getElementType(i);
// 32 and 64-bit integers are fine, as are float and double. Long double
- // (which can be picked as the type for a union of 16 bytes) is not fine,
+ // (which can be picked as the type for a union of 16 bytes) is not fine,
// as loads and stores of it get only 10 bytes.
if (EltTy == Type::getInt32Ty(Context) ||
- EltTy == Type::getInt64Ty(Context) ||
+ EltTy == Type::getInt64Ty(Context) ||
EltTy == Type::getFloatTy(Context) ||
EltTy == Type::getDoubleTy(Context) ||
EltTy->isPointerTy()) {
Elts.push_back(EltTy);
continue;
}
-
+
// TODO: Vectors are also ok to pass if they don't require extra alignment.
// TODO: We can also pass structs like {i8, i32}.
-
+
Elts.clear();
return false;
}
-
+
return true;
-}
+}
/* It returns true if an aggregate of the specified type should be passed as a
first class aggregate. */
@@ -1528,7 +1528,7 @@
// Counting number of GPRs and XMMs used so far. According to AMD64 ABI
// document: "If there are no registers available for any eightbyte of an
// argument, the whole argument is passed on the stack." X86-64 uses 6
- // integer
+ // integer
// For example, if two GPRs are required but only one is available, then
// both parts will be in memory.
// FIXME: This is a temporary solution. To be removed when llvm has first
@@ -1697,7 +1697,7 @@
return !totallyEmpty;
}
-/* On Darwin x86-32, vectors which are not MMX nor SSE should be passed as
+/* On Darwin x86-32, vectors which are not MMX nor SSE should be passed as
integers. On Darwin x86-64, such vectors bigger than 128 bits should be
passed in memory (byval). */
bool llvm_x86_should_pass_vector_in_integer_regs(tree type) {
@@ -1734,8 +1734,8 @@
/* The MMX vector v1i64 is returned in EAX and EDX on Darwin. Communicate
this by returning i64 here. Likewise, (generic) vectors such as v2i16
- are returned in EAX.
- On Darwin x86-64, v1i64 is returned in RAX and other MMX vectors are
+ are returned in EAX.
+ On Darwin x86-64, v1i64 is returned in RAX and other MMX vectors are
returned in XMM0. Judging from comments, this would not be right for
Win64. Don't know about Linux. */
tree llvm_x86_should_return_vector_as_scalar(tree type, bool isBuiltin) {
@@ -1789,7 +1789,7 @@
return false;
}
-// llvm_x86_should_not_return_complex_in_memory - Return true if TYPE
+// llvm_x86_should_not_return_complex_in_memory - Return true if TYPE
// should be returned using multiple value return instruction.
bool llvm_x86_should_not_return_complex_in_memory(tree type) {
@@ -1803,7 +1803,7 @@
return false;
}
-// llvm_suitable_multiple_ret_value_type - Return TRUE if return value
+// llvm_suitable_multiple_ret_value_type - Return TRUE if return value
// of type TY should be returned using multiple value return instruction.
static bool llvm_suitable_multiple_ret_value_type(const Type *Ty,
tree TreeType) {
@@ -1825,7 +1825,7 @@
if (NumClasses == 0)
return false;
- if (NumClasses == 1 &&
+ if (NumClasses == 1 &&
(Class[0] == X86_64_INTEGERSI_CLASS || Class[0] == X86_64_INTEGER_CLASS))
// This will fit in one i64 register.
return false;
@@ -1873,7 +1873,7 @@
Class[0] == X86_64_INTEGER_CLASS) {
// one int register
HOST_WIDE_INT Bytes =
- (Mode == BLKmode) ? int_size_in_bytes(type) :
+ (Mode == BLKmode) ? int_size_in_bytes(type) :
(int) GET_MODE_SIZE(Mode);
if (Bytes>4)
return Type::getInt64Ty(Context);
@@ -1884,11 +1884,11 @@
else
return Type::getInt8Ty(Context);
}
- assert(0 && "Unexpected type!");
+ assert(0 && "Unexpected type!");
}
if (NumClasses == 2) {
if (Class[1] == X86_64_NO_CLASS) {
- if (Class[0] == X86_64_INTEGER_CLASS ||
+ if (Class[0] == X86_64_INTEGER_CLASS ||
Class[0] == X86_64_NO_CLASS ||
Class[0] == X86_64_INTEGERSI_CLASS)
return Type::getInt64Ty(Context);
@@ -1907,7 +1907,7 @@
return Type::getDoubleTy(Context);
else if (Class[1] == X86_64_SSESF_CLASS)
return Type::getFloatTy(Context);
- assert(0 && "Unexpected type!");
+ assert(0 && "Unexpected type!");
}
assert(0 && "Unexpected type!");
}
@@ -1926,7 +1926,7 @@
/// llvm_x86_64_get_multiple_return_reg_classes - Find register classes used
/// to return Ty. It is expected that Ty requires multiple return values.
/// This routine uses GCC implementation to find required register classes.
-/// The original implementation of this routine is based on
+/// The original implementation of this routine is based on
/// llvm_x86_64_should_pass_aggregate_in_mixed_regs code.
void
llvm_x86_64_get_multiple_return_reg_classes(tree TreeType, const Type *Ty,
@@ -2053,7 +2053,7 @@
}
}
-// Return LLVM Type if TYPE can be returned as an aggregate,
+// Return LLVM Type if TYPE can be returned as an aggregate,
// otherwise return NULL.
const Type *llvm_x86_aggr_type_for_struct_return(tree type) {
const Type *Ty = ConvertType(type);
@@ -2068,24 +2068,24 @@
ElementTypes.push_back(Type::getX86_FP80Ty(Context));
ElementTypes.push_back(Type::getX86_FP80Ty(Context));
return StructType::get(Context, ElementTypes, STy->isPacked());
- }
+ }
std::vector GCCElts;
llvm_x86_64_get_multiple_return_reg_classes(type, Ty, GCCElts);
return StructType::get(Context, GCCElts, false);
}
-// llvm_x86_extract_mrv_array_element - Helper function that help extract
+// llvm_x86_extract_mrv_array_element - Helper function that help extract
// an array element from multiple return value.
//
// Here, SRC is returning multiple values. DEST's DESTFIELNO field is an array.
-// Extract SRCFIELDNO's ELEMENO value and store it in DEST's FIELDNO field's
+// Extract SRCFIELDNO's ELEMENO value and store it in DEST's FIELDNO field's
// ELEMENTNO.
//
static void llvm_x86_extract_mrv_array_element(Value *Src, Value *Dest,
- unsigned SrcFieldNo,
+ unsigned SrcFieldNo,
unsigned SrcElemNo,
- unsigned DestFieldNo,
+ unsigned DestFieldNo,
unsigned DestElemNo,
LLVMBuilder &Builder,
bool isVolatile) {
@@ -2111,7 +2111,7 @@
void llvm_x86_extract_multiple_return_value(Value *Src, Value *Dest,
bool isVolatile,
LLVMBuilder &Builder) {
-
+
const StructType *STy = cast(Src->getType());
unsigned NumElements = STy->getNumElements();
@@ -2157,7 +2157,7 @@
Builder.CreateStore(EVI, GEP, isVolatile);
++DNO; ++SNO;
continue;
- }
+ }
// Special treatement for _Complex.
if (DestElemType->isStructTy()) {
@@ -2178,7 +2178,7 @@
++DNO; ++SNO;
continue;
}
-
+
// Access array elements individually. Note, Src and Dest type may
// not match. For example { <2 x float>, float } and { float[3]; }
const ArrayType *ATy = cast(DestElemType);
@@ -2187,8 +2187,8 @@
while (DElemNo < ArraySize) {
unsigned i = 0;
unsigned Size = 1;
-
- if (const VectorType *SElemTy =
+
+ if (const VectorType *SElemTy =
dyn_cast(STy->getElementType(SNO))) {
Size = SElemTy->getNumElements();
if (SElemTy->getElementType()->getTypeID() == Type::FloatTyID
@@ -2197,14 +2197,14 @@
Size = 2;
}
while (i < Size) {
- llvm_x86_extract_mrv_array_element(Src, Dest, SNO, i++,
- DNO, DElemNo++,
+ llvm_x86_extract_mrv_array_element(Src, Dest, SNO, i++,
+ DNO, DElemNo++,
Builder, isVolatile);
}
// Consumed this src field. Try next one.
++SNO;
}
- // Finished building current dest field.
+ // Finished building current dest field.
++DNO;
}
}
@@ -2250,8 +2250,8 @@
return true;
}
}
- return false;
+ return false;
}
- else
+ else
return !isSingleElementStructOrArray(type, false, true);
}
Modified: dragonegg/trunk/x86/llvm-target.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/x86/llvm-target.h?rev=104040&r1=104039&r2=104040&view=diff
==============================================================================
--- dragonegg/trunk/x86/llvm-target.h (original)
+++ dragonegg/trunk/x86/llvm-target.h Tue May 18 13:13:30 2010
@@ -353,7 +353,7 @@
* macro should call the target TreeToLLVM::TargetIntrinsicLower method and
* return true.This macro is invoked from a method in the TreeToLLVM class.
*/
-#define LLVM_TARGET_INTRINSIC_LOWER(STMT, FNDECL, DESTLOC, RESULT, DESTTY, OPS) \
+#define LLVM_TARGET_INTRINSIC_LOWER(STMT, FNDECL, DESTLOC, RESULT, DESTTY, OPS) \
TargetIntrinsicLower(STMT, FNDECL, DESTLOC, RESULT, DESTTY, OPS);
/* LLVM_GET_REG_NAME - When extracting a register name for a constraint, use
From dalej at apple.com Tue May 18 14:02:52 2010
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 18 May 2010 19:02:52 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r104042 -
/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Message-ID: <20100518190252.B29E9312800A@llvm.org>
Author: johannes
Date: Tue May 18 14:02:52 2010
New Revision: 104042
URL: http://llvm.org/viewvc/llvm-project?rev=104042&view=rev
Log:
Mark reads from register variables as sideeffect. The
point of this is to create an order dependency when there
are multiple uses of the same register; the scheduler could
screw them up (see testcase, which is next checkin). 7993104.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=104042&r1=104041&r2=104042&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue May 18 14:02:52 2010
@@ -4200,7 +4200,7 @@
int RegNum = decode_reg_name(Name);
Name = LLVM_GET_REG_NAME(Name, RegNum);
- InlineAsm *IA = InlineAsm::get(FTy, "", "={"+std::string(Name)+"}", false);
+ InlineAsm *IA = InlineAsm::get(FTy, "", "={"+std::string(Name)+"}", true);
CallInst *Call = Builder.CreateCall(IA);
Call->setDoesNotThrow();
return Call;
From dalej at apple.com Tue May 18 14:03:51 2010
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 18 May 2010 19:03:51 -0000
Subject: [llvm-commits] [llvm] r104043 -
/llvm/trunk/test/FrontendC/2010-05-18-asmsched.c
Message-ID: <20100518190351.AA88E312800A@llvm.org>
Author: johannes
Date: Tue May 18 14:03:51 2010
New Revision: 104043
URL: http://llvm.org/viewvc/llvm-project?rev=104043&view=rev
Log:
Testcase for llvm-gcc checkin 104042.
Added:
llvm/trunk/test/FrontendC/2010-05-18-asmsched.c
Added: llvm/trunk/test/FrontendC/2010-05-18-asmsched.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2010-05-18-asmsched.c?rev=104043&view=auto
==============================================================================
--- llvm/trunk/test/FrontendC/2010-05-18-asmsched.c (added)
+++ llvm/trunk/test/FrontendC/2010-05-18-asmsched.c Tue May 18 14:03:51 2010
@@ -0,0 +1,19 @@
+// RUN: %llvmgcc %s -c -O3 -m64 -emit-llvm -o - | llc -march=x86-64 -mtriple=x86_64-apple-darwin | FileCheck %s
+// XFAIL: *
+// XTARGET: x86,i386,i686
+// r9 used to be clobbered before its value was moved to r10. 7993104.
+
+void foo(int x, int y) {
+// CHECK: bar
+// CHECK: movq %r9, %r10
+// CHECK: movq %rdi, %r9
+// CHECK: bar
+ register int lr9 asm("r9") = x;
+ register int lr10 asm("r10") = y;
+ int foo;
+ asm volatile("bar" : "=r"(lr9) : "r"(lr9), "r"(lr10));
+ foo = lr9;
+ lr9 = x;
+ lr10 = foo;
+ asm volatile("bar" : "=r"(lr9) : "r"(lr9), "r"(lr10));
+}
\ No newline at end of file
From dpatel at apple.com Tue May 18 14:35:46 2010
From: dpatel at apple.com (Devang Patel)
Date: Tue, 18 May 2010 19:35:46 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r104048 - in /llvm-gcc-4.2/trunk/gcc:
llvm-backend.cpp llvm-debug.cpp llvm-debug.h testsuite/gcc.dg/pch/valid-1.c
Message-ID: <20100518193546.75AD0312800A@llvm.org>
Author: dpatel
Date: Tue May 18 14:35:46 2010
New Revision: 104048
URL: http://llvm.org/viewvc/llvm-project?rev=104048&view=rev
Log:
Update debug info read from PCH file to match current source file info.
This fixes many failures in llvmgcc's pch test suite.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
llvm-gcc-4.2/trunk/gcc/llvm-debug.h
llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pch/valid-1.c
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=104048&r1=104047&r2=104048&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue May 18 14:35:46 2010
@@ -265,6 +265,17 @@
// Now, llvm.pch.values is not required so remove it from the symbol table.
GV->eraseFromParent();
+
+ if (TheDebugInfo) {
+ // Replace compile unit received from the PCH file.
+ NamedMDNode *NMD = TheModule->getOrInsertNamedMetadata("llvm.dbg.pch.cu");
+ if (NMD->getNumOperands() == 1) {
+ MDNode *HeaderCUNode = NMD->getOperand(0);
+ Value *CUNode = TheDebugInfo->getCU();
+ HeaderCUNode->replaceAllUsesWith(CUNode);
+ }
+ TheDebugInfo->replaceBasicTypesFromPCH();
+ }
}
/// writeLLVMValues - GCC tree's uses LLVMValues vector's index to reach LLVM
@@ -295,6 +306,11 @@
GlobalValue::ExternalLinkage,
LLVMValuesTable,
"llvm.pch.values");
+
+ if (TheDebugInfo && TheDebugInfo->getCU().Verify()) {
+ NamedMDNode *NMD = TheModule->getOrInsertNamedMetadata("llvm.dbg.pch.cu");
+ NMD->addOperand(TheDebugInfo->getCU());
+ }
}
/// eraseLocalLLVMValues - drop all non-global values from the LLVM values map.
@@ -513,9 +529,7 @@
else
RegisterRegAlloc::setDefault(createLocalRegisterAllocator);
- // FIXME - Do not disable debug info while writing pch.
- if (!flag_pch_file &&
- debug_info_level > DINFO_LEVEL_NONE)
+ if (debug_info_level > DINFO_LEVEL_NONE)
TheDebugInfo = new DebugInfo(TheModule);
}
@@ -560,8 +574,7 @@
TheModule = ParseBitcodeFile(MB, getGlobalContext(), &ErrMsg);
delete MB;
- // FIXME - Do not disable debug info while writing pch.
- if (!flag_pch_file && debug_info_level > DINFO_LEVEL_NONE) {
+ if (debug_info_level > DINFO_LEVEL_NONE) {
TheDebugInfo = new DebugInfo(TheModule);
TheDebugInfo->Initialize();
}
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=104048&r1=104047&r2=104048&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Tue May 18 14:35:46 2010
@@ -41,6 +41,7 @@
extern "C" {
#include "langhooks.h"
#include "toplev.h"
+#include "flags.h"
#include "tree.h"
#include "version.h"
#include "function.h"
@@ -540,7 +541,12 @@
if (DECL_CONTEXT (decl))
if (TREE_CODE (DECL_CONTEXT (decl)) != FUNCTION_DECL)
LinkageName = GV->getName();
- DebugFactory.CreateGlobalVariable(findRegion(DECL_CONTEXT(decl)),
+ DIDescriptor Context;
+ if (DECL_CONTEXT(decl))
+ Context = findRegion(DECL_CONTEXT(decl));
+ else
+ Context = getOrCreateFile(Loc.file);
+ DebugFactory.CreateGlobalVariable(Context,
DispName, DispName, LinkageName,
getOrCreateFile(Loc.file), Loc.line,
TyD, GV->hasInternalLinkage(),
@@ -588,12 +594,37 @@
}
}
- return
+ DIBasicType BTy =
DebugFactory.CreateBasicType(getOrCreateFile(main_input_filename),
TypeName,
getOrCreateFile(main_input_filename),
0, Size, Align,
0, 0, Encoding);
+
+ if (TheDebugInfo && flag_pch_file) {
+ NamedMDNode *NMD = TheModule->getOrInsertNamedMetadata("llvm.dbg.pch.bt");
+ NMD->addOperand(BTy);
+ }
+
+ return BTy;
+}
+
+/// replaceBasicTypesFromPCH - Replace basic type debug info received
+/// from PCH file.
+void DebugInfo::replaceBasicTypesFromPCH() {
+ NamedMDNode *NMD = TheModule->getOrInsertNamedMetadata("llvm.dbg.pch.bt");
+ for (int i = 0, e = NMD->getNumOperands(); i != e; ++i) {
+ DIBasicType HeaderBTy(NMD->getOperand(i));
+ MDNode *NewBTy = NULL;
+ NewBTy = DebugFactory.CreateBasicType(getOrCreateFile(main_input_filename),
+ HeaderBTy.getName(),
+ getOrCreateFile(main_input_filename),
+ 0, HeaderBTy.getSizeInBits(),
+ HeaderBTy.getAlignInBits(),
+ 0, 0, HeaderBTy.getEncoding());
+ MDNode *HBTyNode = HeaderBTy;
+ HBTyNode->replaceAllUsesWith(NewBTy);
+ }
}
/// isArtificialArgumentType - Return true if arg_type represents artificial,
@@ -1063,8 +1094,13 @@
return DIType(cast(M));
if (TREE_CODE(TyDef) == TYPE_DECL && DECL_ORIGINAL_TYPE(TyDef)) {
expanded_location TypeDefLoc = GetNodeLocation(TyDef);
+ DIDescriptor Context;
+ if (DECL_CONTEXT(TyDef))
+ Context = findRegion(DECL_CONTEXT(TyDef));
+ else
+ Context = getOrCreateFile(TypeDefLoc.file);
Ty = DebugFactory.CreateDerivedType(DW_TAG_typedef,
- findRegion(DECL_CONTEXT(TyDef)),
+ Context,
GetNodeName(TyDef),
getOrCreateFile(TypeDefLoc.file),
TypeDefLoc.line,
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.h?rev=104048&r1=104047&r2=104048&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.h Tue May 18 14:35:46 2010
@@ -181,6 +181,13 @@
/// name is constructred on demand (e.g. C++ destructor) then the name
/// is stored on the side.
StringRef getFunctionName(tree_node *FnDecl);
+
+ /// getCU - Get Compile Unit.
+ DICompileUnit getCU() { return TheCU;}
+
+ /// replaceBasicTypesFromPCH - Replace basic type debug info received
+ /// from PCH file.
+ void replaceBasicTypesFromPCH();
};
} // end namespace llvm
Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pch/valid-1.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pch/valid-1.c?rev=104048&r1=104047&r2=104048&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pch/valid-1.c (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/pch/valid-1.c Tue May 18 14:35:46 2010
@@ -1,5 +1,6 @@
/* { dg-options "-I. -Winvalid-pch -g" } */
-#include "valid-1.h"/* { dg-error "created with -gnone, but used with -g|No such file|they were invalid" } */
+/* LLVM LOCAL - Ignore -g mismatch. */
+#include "valid-1.h"
int x;
From evan.cheng at apple.com Tue May 18 15:03:28 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 18 May 2010 20:03:28 -0000
Subject: [llvm-commits] [llvm] r104050 - in /llvm/trunk:
lib/CodeGen/SelectionDAG/InstrEmitter.cpp test/CodeGen/ARM/reg_sequence.ll
Message-ID: <20100518200328.942DA312800A@llvm.org>
Author: evancheng
Date: Tue May 18 15:03:28 2010
New Revision: 104050
URL: http://llvm.org/viewvc/llvm-project?rev=104050&view=rev
Log:
Fix PR7162: Use source register classes and sub-indices to determine the correct register class of the definitions of REG_SEQUENCE.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
llvm/trunk/test/CodeGen/ARM/reg_sequence.ll
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp?rev=104050&r1=104049&r2=104050&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Tue May 18 15:03:28 2010
@@ -545,16 +545,18 @@
const TargetInstrDesc &II = TII->get(TargetOpcode::REG_SEQUENCE);
for (unsigned i = 0; i != NumOps; ++i) {
SDValue Op = Node->getOperand(i);
-#ifndef NDEBUG
if (i & 1) {
unsigned SubIdx = cast(Op)->getZExtValue();
unsigned SubReg = getVR(Node->getOperand(i-1), VRBaseMap);
const TargetRegisterClass *TRC = MRI->getRegClass(SubReg);
const TargetRegisterClass *SRC =
- getSuperRegisterRegClass(TRC, SubIdx, Node->getValueType(0));
- assert(SRC == RC && "Invalid subregister index in REG_SEQUENCE");
+ TRI->getMatchingSuperRegClass(RC, TRC, SubIdx);
+ //getSuperRegisterRegClass(TRC, SubIdx, Node->getValueType(0));
+ if (!SRC)
+ llvm_unreachable("Invalid subregister index in REG_SEQUENCE");
+ if (SRC != RC)
+ MRI->setRegClass(NewVReg, SRC);
}
-#endif
AddOperand(MI, Op, i+1, &II, VRBaseMap, /*IsDebug=*/false,
IsClone, IsCloned);
}
Modified: llvm/trunk/test/CodeGen/ARM/reg_sequence.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/reg_sequence.ll?rev=104050&r1=104049&r2=104050&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/reg_sequence.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/reg_sequence.ll Tue May 18 15:03:28 2010
@@ -264,6 +264,44 @@
ret float 9.990000e+02
}
+; PR7162
+define arm_aapcs_vfpcc i32 @t10() nounwind {
+entry:
+; CHECK: t10:
+; CHECK: vmov.i32 q1, #0x3F000000
+; CHECK: vdup.32 q0, d0[0]
+; CHECK: vmov d0, d1
+; CHECK: vmla.f32 q0, q0, d0[0]
+ %0 = shufflevector <4 x float> zeroinitializer, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>> [#uses=1]
+ %1 = insertelement <4 x float> %0, float undef, i32 1 ; <<4 x float>> [#uses=1]
+ %2 = insertelement <4 x float> %1, float undef, i32 2 ; <<4 x float>> [#uses=1]
+ %3 = insertelement <4 x float> %2, float undef, i32 3 ; <<4 x float>> [#uses=1]
+ %tmp54.i = bitcast <4 x float> %3 to <2 x double> ; <<2 x double>> [#uses=1]
+ %4 = extractelement <2 x double> %tmp54.i, i32 1 ; [#uses=1]
+ %5 = bitcast double %4 to <2 x float> ; <<2 x float>> [#uses=1]
+ %6 = shufflevector <2 x float> %5, <2 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>> [#uses=1]
+ %7 = fmul <4 x float> undef, %6 ; <<4 x float>> [#uses=1]
+ %8 = fadd <4 x float> %7, undef ; <<4 x float>> [#uses=1]
+ %9 = fadd <4 x float> %8, undef ; <<4 x float>> [#uses=1]
+ %10 = shufflevector <4 x float> undef, <4 x float> %9, <4 x i32> ; <<4 x float>> [#uses=1]
+ %11 = fmul <4 x float> %10, ; <<4 x float>> [#uses=1]
+ %12 = shufflevector <4 x float> %11, <4 x float> undef, <4 x i32> ; <<4 x float>> [#uses=1]
+ %13 = shufflevector <4 x float> %12, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>> [#uses=1]
+ %14 = fmul <4 x float> %13, undef ; <<4 x float>> [#uses=1]
+ %15 = fadd <4 x float> undef, %14 ; <<4 x float>> [#uses=1]
+ %16 = shufflevector <4 x float> undef, <4 x float> %15, <4 x i32> ; <<4 x float>> [#uses=1]
+ %17 = fmul <4 x float> %16, undef ; <<4 x float>> [#uses=1]
+ %18 = extractelement <4 x float> %17, i32 2 ; [#uses=1]
+ store float %18, float* undef, align 4
+ br i1 undef, label %exit, label %bb14
+
+exit: ; preds = %bb.i19
+ unreachable
+
+bb14: ; preds = %bb6
+ ret i32 0
+}
+
declare <4 x i32> @llvm.arm.neon.vld1.v4i32(i8*) nounwind readonly
declare <8 x i16> @llvm.arm.neon.vld1.v8i16(i8*) nounwind readonly
From evan.cheng at apple.com Tue May 18 15:07:47 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 18 May 2010 20:07:47 -0000
Subject: [llvm-commits] [llvm] r104051 -
/llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
Message-ID: <20100518200747.367DB312800A@llvm.org>
Author: evancheng
Date: Tue May 18 15:07:47 2010
New Revision: 104051
URL: http://llvm.org/viewvc/llvm-project?rev=104051&view=rev
Log:
Continuously refine the register class of REG_SEQUENCE def with all the source registers and sub-register indices.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp?rev=104051&r1=104050&r2=104051&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Tue May 18 15:07:47 2010
@@ -551,11 +551,12 @@
const TargetRegisterClass *TRC = MRI->getRegClass(SubReg);
const TargetRegisterClass *SRC =
TRI->getMatchingSuperRegClass(RC, TRC, SubIdx);
- //getSuperRegisterRegClass(TRC, SubIdx, Node->getValueType(0));
if (!SRC)
llvm_unreachable("Invalid subregister index in REG_SEQUENCE");
- if (SRC != RC)
+ if (SRC != RC) {
MRI->setRegClass(NewVReg, SRC);
+ RC = SRC;
+ }
}
AddOperand(MI, Op, i+1, &II, VRBaseMap, /*IsDebug=*/false,
IsClone, IsCloned);
From dalej at apple.com Tue May 18 15:47:04 2010
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 18 May 2010 20:47:04 -0000
Subject: [llvm-commits] [llvm] r104053 -
/llvm/trunk/test/FrontendC/2010-05-18-asmsched.c
Message-ID: <20100518204704.982D3312800A@llvm.org>
Author: johannes
Date: Tue May 18 15:47:04 2010
New Revision: 104053
URL: http://llvm.org/viewvc/llvm-project?rev=104053&view=rev
Log:
Test passed on ppc, to my surprise; if it worked
there it may work everywhere...
Modified:
llvm/trunk/test/FrontendC/2010-05-18-asmsched.c
Modified: llvm/trunk/test/FrontendC/2010-05-18-asmsched.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2010-05-18-asmsched.c?rev=104053&r1=104052&r2=104053&view=diff
==============================================================================
--- llvm/trunk/test/FrontendC/2010-05-18-asmsched.c (original)
+++ llvm/trunk/test/FrontendC/2010-05-18-asmsched.c Tue May 18 15:47:04 2010
@@ -1,6 +1,4 @@
// RUN: %llvmgcc %s -c -O3 -m64 -emit-llvm -o - | llc -march=x86-64 -mtriple=x86_64-apple-darwin | FileCheck %s
-// XFAIL: *
-// XTARGET: x86,i386,i686
// r9 used to be clobbered before its value was moved to r10. 7993104.
void foo(int x, int y) {
From baldrick at free.fr Tue May 18 16:06:05 2010
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 18 May 2010 21:06:05 -0000
Subject: [llvm-commits] [dragonegg] r104054 - in /dragonegg/trunk:
bits_and_bobs.cpp x86/llvm-target.h
Message-ID: <20100518210605.A0056312800A@llvm.org>
Author: baldrick
Date: Tue May 18 16:06:05 2010
New Revision: 104054
URL: http://llvm.org/viewvc/llvm-project?rev=104054&view=rev
Log:
Rather than aborting because contains_aligned_value_p is not
yet implemented, use the type alignment as the byval alignment.
This should get fixed up later when the ABI stuff is reworked.
Modified:
dragonegg/trunk/bits_and_bobs.cpp
dragonegg/trunk/x86/llvm-target.h
Modified: dragonegg/trunk/bits_and_bobs.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/bits_and_bobs.cpp?rev=104054&r1=104053&r2=104054&view=diff
==============================================================================
--- dragonegg/trunk/bits_and_bobs.cpp (original)
+++ dragonegg/trunk/bits_and_bobs.cpp Tue May 18 16:06:05 2010
@@ -3,7 +3,3 @@
int ix86_regparm;
union tree_node;
-
-extern "C" bool contains_aligned_value_p (union tree_node *type) {
- abort();
-}
Modified: dragonegg/trunk/x86/llvm-target.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/x86/llvm-target.h?rev=104054&r1=104053&r2=104054&view=diff
==============================================================================
--- dragonegg/trunk/x86/llvm-target.h (original)
+++ dragonegg/trunk/x86/llvm-target.h Tue May 18 16:06:05 2010
@@ -99,10 +99,8 @@
/* On x86-32 objects containing SSE vectors are 16 byte aligned, everything
else 4. On x86-64 vectors are 8-byte aligned, everything else can
be figured out by the back end. */
-extern "C" bool contains_aligned_value_p(tree);
#define LLVM_BYVAL_ALIGNMENT(T) \
- (TARGET_64BIT ? (TREE_CODE(T)==VECTOR_TYPE ? 8 : 0) : \
- TARGET_SSE && contains_aligned_value_p(T) ? 16 : 4)
+ (TYPE_ALIGN(T) / 8)
extern tree llvm_x86_should_return_selt_struct_as_scalar(tree);
From stoklund at 2pi.dk Tue May 18 16:10:50 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Tue, 18 May 2010 21:10:50 -0000
Subject: [llvm-commits] [llvm] r104056 -
/llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Message-ID: <20100518211050.736D6312800A@llvm.org>
Author: stoklund
Date: Tue May 18 16:10:50 2010
New Revision: 104056
URL: http://llvm.org/viewvc/llvm-project?rev=104056&view=rev
Log:
Properly handle multiple definitions of a virtual register in the same
instruction.
This can happen on ARM:
>> %reg1035:5, %reg1035:6 = VLD1q16 %reg1028, 0, pred:14, pred:%reg0
Regs: Q0=%reg1032* R0=%reg1028* R1=%reg1029* R2 R3=%reg1031*
Killing last use: %reg1028
Allocating %reg1035 from QPR
Assigning %reg1035 to Q1
<< %D2, %D3 = VLD1q16 %R0, 0, pred:14, pred:%reg0, %Q1
Modified:
llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=104056&r1=104055&r2=104056&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Tue May 18 16:10:50 2010
@@ -154,7 +154,7 @@
LiveRegMap::iterator reloadVirtReg(MachineInstr *MI, unsigned OpNum,
unsigned VirtReg, unsigned Hint);
void spillAll(MachineInstr *MI);
- bool setPhysReg(MachineOperand &MO, unsigned PhysReg);
+ bool setPhysReg(MachineInstr *MI, unsigned OpNum, unsigned PhysReg);
};
char RAFast::ID = 0;
}
@@ -200,10 +200,17 @@
void RAFast::addKillFlag(const LiveReg &LR) {
if (!LR.LastUse) return;
MachineOperand &MO = LR.LastUse->getOperand(LR.LastOpNum);
- if (MO.isDef())
- MO.setIsDead();
- else if (!LR.LastUse->isRegTiedToDefOperand(LR.LastOpNum))
- MO.setIsKill();
+ if (MO.getReg() == LR.PhysReg) {
+ if (MO.isDef())
+ MO.setIsDead();
+ else if (!LR.LastUse->isRegTiedToDefOperand(LR.LastOpNum))
+ MO.setIsKill();
+ } else {
+ if (MO.isDef())
+ LR.LastUse->addRegisterDead(LR.PhysReg, TRI, true);
+ else
+ LR.LastUse->addRegisterKilled(LR.PhysReg, TRI, true);
+ }
}
/// killVirtReg - Mark virtreg as no longer available.
@@ -517,8 +524,12 @@
Hint = DstReg;
}
allocVirtReg(MI, *LRI, Hint);
- } else
- addKillFlag(LR); // Kill before redefine.
+ } else if (LR.LastUse) {
+ // Redefining a live register - kill at the last use, unless it is this
+ // instruction defining VirtReg multiple times.
+ if (LR.LastUse != MI || LR.LastUse->getOperand(LR.LastOpNum).isUse())
+ addKillFlag(LR);
+ }
assert(LR.PhysReg && "Register not assigned");
LR.LastUse = MI;
LR.LastOpNum = OpNum;
@@ -569,11 +580,11 @@
return LRI;
}
-// setPhysReg - Change MO the refer the PhysReg, considering subregs.
-// This may invalidate MO if it is necessary to add implicit kills for a
-// superregister.
-// Return tru if MO kills its register.
-bool RAFast::setPhysReg(MachineOperand &MO, unsigned PhysReg) {
+// setPhysReg - Change operand OpNum in MI the refer the PhysReg, considering
+// subregs. This may invalidate any operand pointers.
+// Return true if the operand kills its register.
+bool RAFast::setPhysReg(MachineInstr *MI, unsigned OpNum, unsigned PhysReg) {
+ MachineOperand &MO = MI->getOperand(OpNum);
if (!MO.getSubReg()) {
MO.setReg(PhysReg);
return MO.isKill() || MO.isDead();
@@ -584,17 +595,17 @@
MO.setSubReg(0);
if (MO.isUse()) {
if (MO.isKill()) {
- MO.getParent()->addRegisterKilled(PhysReg, TRI, true);
+ MI->addRegisterKilled(PhysReg, TRI, true);
return true;
}
return false;
}
// A subregister def implicitly defines the whole physreg.
if (MO.isDead()) {
- MO.getParent()->addRegisterDead(PhysReg, TRI, true);
+ MI->addRegisterDead(PhysReg, TRI, true);
return true;
}
- MO.getParent()->addRegisterDefined(PhysReg, TRI);
+ MI->addRegisterDefined(PhysReg, TRI);
return false;
}
@@ -611,7 +622,7 @@
E = MBB->livein_end(); I != E; ++I)
definePhysReg(MII, *I, regReserved);
- SmallVector PhysECs;
+ SmallVector PhysECs, VirtDead;
SmallVector Coalesced;
// Otherwise, sequentially allocate each instruction in the MBB.
@@ -660,7 +671,7 @@
if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg)) continue;
LiveRegMap::iterator LRI = LiveVirtRegs.find(Reg);
if (LRI != LiveVirtRegs.end())
- setPhysReg(MO, LRI->second.PhysReg);
+ setPhysReg(MI, i, LRI->second.PhysReg);
else
MO.setReg(0); // We can't allocate a physreg for a DebugValue, sorry!
}
@@ -711,12 +722,13 @@
LiveRegMap::iterator LRI = reloadVirtReg(MI, i, Reg, CopyDst);
unsigned PhysReg = LRI->second.PhysReg;
CopySrc = (CopySrc == Reg || CopySrc == PhysReg) ? PhysReg : 0;
- if (setPhysReg(MO, PhysReg))
+ if (setPhysReg(MI, i, PhysReg))
killVirtReg(LRI);
} else if (MO.isEarlyClobber()) {
+ // Note: defineVirtReg may invalidate MO.
LiveRegMap::iterator LRI = defineVirtReg(MI, i, Reg, 0);
unsigned PhysReg = LRI->second.PhysReg;
- setPhysReg(MO, PhysReg);
+ setPhysReg(MI, i, PhysReg);
PhysECs.push_back(PhysReg);
}
}
@@ -759,13 +771,21 @@
}
LiveRegMap::iterator LRI = defineVirtReg(MI, i, Reg, CopySrc);
unsigned PhysReg = LRI->second.PhysReg;
- if (setPhysReg(MO, PhysReg)) {
- killVirtReg(LRI);
+ if (setPhysReg(MI, i, PhysReg)) {
+ VirtDead.push_back(Reg);
CopyDst = 0; // cancel coalescing;
} else
CopyDst = (CopyDst == Reg || CopyDst == PhysReg) ? PhysReg : 0;
}
+ // Kill dead defs after the scan to ensure that multiple defs of the same
+ // register are allocated identically. We didn't need to do this for uses
+ // because we are crerating our own kill flags, and they are always at the
+ // last use.
+ for (unsigned i = 0, e = VirtDead.size(); i != e; ++i)
+ killVirtReg(VirtDead[i]);
+ VirtDead.clear();
+
MRI->addPhysRegsUsed(UsedInInstr);
if (CopyDst && CopyDst == CopySrc && CopyDstSub == CopySrcSub) {
From echristo at apple.com Tue May 18 16:16:04 2010
From: echristo at apple.com (Eric Christopher)
Date: Tue, 18 May 2010 21:16:04 -0000
Subject: [llvm-commits] [llvm] r104057 - in /llvm/trunk:
include/llvm/MC/MCStreamer.h lib/MC/MCAsmStreamer.cpp
lib/MC/MCNullStreamer.cpp lib/MC/MCParser/AsmParser.cpp
Message-ID: <20100518211604.BF1DB312800A@llvm.org>
Author: echristo
Date: Tue May 18 16:16:04 2010
New Revision: 104057
URL: http://llvm.org/viewvc/llvm-project?rev=104057&view=rev
Log:
Make EmitTBSSSymbol take a section argument so that we can find it later.
Fix up callers and users.
Modified:
llvm/trunk/include/llvm/MC/MCStreamer.h
llvm/trunk/lib/MC/MCAsmStreamer.cpp
llvm/trunk/lib/MC/MCNullStreamer.cpp
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
Modified: llvm/trunk/include/llvm/MC/MCStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=104057&r1=104056&r2=104057&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCStreamer.h Tue May 18 16:16:04 2010
@@ -190,12 +190,13 @@
/// EmitTBSSSymbol - Emit a thread local bss (.tbss) symbol.
///
+ /// @param Section - The thread local common section.
/// @param Symbol - The thread local common symbol to emit.
/// @param Size - The size of the symbol.
/// @param ByteAlignment - The alignment of the thread local common symbol
/// if non-zero. This must be a power of 2 on some targets.
- virtual void EmitTBSSSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment = 0) = 0;
+ virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
+ uint64_t Size, unsigned ByteAlignment = 0) = 0;
/// @}
/// @name Generating Data
/// @{
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=104057&r1=104056&r2=104057&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Tue May 18 16:16:04 2010
@@ -126,8 +126,8 @@
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
unsigned Size = 0, unsigned ByteAlignment = 0);
- virtual void EmitTBSSSymbol (MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment = 0);
+ virtual void EmitTBSSSymbol (const MCSection *Section, MCSymbol *Symbol,
+ uint64_t Size, unsigned ByteAlignment = 0);
virtual void EmitBytes(StringRef Data, unsigned AddrSpace);
@@ -366,13 +366,16 @@
// .tbss sym, size, align
// This depends that the symbol has already been mangled from the original,
// e.g. _a.
-void MCAsmStreamer::EmitTBSSSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) {
+void MCAsmStreamer::EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
+ uint64_t Size, unsigned ByteAlignment) {
assert(Symbol != NULL && "Symbol shouldn't be NULL!");
+ // Instead of using the Section we'll just use the shortcut.
+ // This is a mach-o specific directive and section.
OS << ".tbss " << *Symbol << ", " << Size;
- // Output align if we have it.
- if (ByteAlignment != 0) OS << ", " << Log2_32(ByteAlignment);
+ // Output align if we have it. We default to 1 so don't bother printing
+ // that.
+ if (ByteAlignment > 1) OS << ", " << Log2_32(ByteAlignment);
EmitEOL();
}
Modified: llvm/trunk/lib/MC/MCNullStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCNullStreamer.cpp?rev=104057&r1=104056&r2=104057&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCNullStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCNullStreamer.cpp Tue May 18 16:16:04 2010
@@ -55,8 +55,8 @@
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
unsigned Size = 0, unsigned ByteAlignment = 0) {}
- virtual void EmitTBSSSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) {}
+ virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
+ uint64_t Size, unsigned ByteAlignment) {}
virtual void EmitBytes(StringRef Data, unsigned AddrSpace) {}
virtual void EmitValue(const MCExpr *Value, unsigned Size,
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=104057&r1=104056&r2=104057&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Tue May 18 16:16:04 2010
@@ -1536,7 +1536,10 @@
if (!Sym->isUndefined())
return Error(IDLoc, "invalid symbol redefinition");
- Out.EmitTBSSSymbol(Sym, Size, Pow2Alignment ? 1 << Pow2Alignment : 0);
+ Out.EmitTBSSSymbol(Ctx.getMachOSection("__DATA", "__thread_bss",
+ MCSectionMachO::S_THREAD_LOCAL_ZEROFILL,
+ 0, SectionKind::getThreadBSS()),
+ Sym, Size, 1 << Pow2Alignment);
return false;
}
From mikem.llvm at gmail.com Tue May 18 16:22:12 2010
From: mikem.llvm at gmail.com (mike-m)
Date: Tue, 18 May 2010 21:22:12 -0000
Subject: [llvm-commits] [llvm] r104058 -
/llvm/trunk/include/llvm/CodeGen/ValueTypes.h
Message-ID: <20100518212212.B04C3312800A@llvm.org>
Author: mikem
Date: Tue May 18 16:22:12 2010
New Revision: 104058
URL: http://llvm.org/viewvc/llvm-project?rev=104058&view=rev
Log:
Fix enum to address array bounds regression.
Modified:
llvm/trunk/include/llvm/CodeGen/ValueTypes.h
Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.h?rev=104058&r1=104057&r2=104058&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Tue May 18 16:22:12 2010
@@ -78,7 +78,7 @@
isVoid = 34, // This has no value
- LAST_VALUETYPE = 34, // This always remains at the end of the list.
+ LAST_VALUETYPE = 35, // This always remains at the end of the list.
// This is the current maximum for LAST_VALUETYPE.
// EVT::MAX_ALLOWED_VALUETYPE is used for asserts and to size bit vectors
From echristo at apple.com Tue May 18 16:26:41 2010
From: echristo at apple.com (Eric Christopher)
Date: Tue, 18 May 2010 21:26:41 -0000
Subject: [llvm-commits] [llvm] r104059 -
/llvm/trunk/lib/MC/MCMachOStreamer.cpp
Message-ID: <20100518212641.CFFCC312800A@llvm.org>
Author: echristo
Date: Tue May 18 16:26:41 2010
New Revision: 104059
URL: http://llvm.org/viewvc/llvm-project?rev=104059&view=rev
Log:
Implement EmitTBSSSymbol for MachOStreamer.
Fixes build failure as well.
Modified:
llvm/trunk/lib/MC/MCMachOStreamer.cpp
Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=104059&r1=104058&r2=104059&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Tue May 18 16:26:41 2010
@@ -126,8 +126,8 @@
}
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
unsigned Size = 0, unsigned ByteAlignment = 0);
- virtual void EmitTBSSSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment = 0);
+ virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
+ uint64_t Size, unsigned ByteAlignment = 0);
virtual void EmitBytes(StringRef Data, unsigned AddrSpace);
virtual void EmitValue(const MCExpr *Value, unsigned Size,unsigned AddrSpace);
virtual void EmitGPRel32Value(const MCExpr *Value) {
@@ -353,9 +353,11 @@
SectData.setAlignment(ByteAlignment);
}
-void MCMachOStreamer::EmitTBSSSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) {
- assert(false && "Implement me!");
+// This should always be called with the thread local bss section.
+void MCMachOStreamer::EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
+ uint64_t Size, unsigned ByteAlignment) {
+ EmitZerofill(Section, Symbol, Size, ByteAlignment);
+ return;
}
void MCMachOStreamer::EmitBytes(StringRef Data, unsigned AddrSpace) {
From evan.cheng at apple.com Tue May 18 16:31:17 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 18 May 2010 21:31:17 -0000
Subject: [llvm-commits] [llvm] r104060 - in /llvm/trunk:
lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/2010-05-18-PostIndexBug.ll
Message-ID: <20100518213117.B2785312800A@llvm.org>
Author: evancheng
Date: Tue May 18 16:31:17 2010
New Revision: 104060
URL: http://llvm.org/viewvc/llvm-project?rev=104060&view=rev
Log:
Sink dag combine's post index load / store code that swap base ptr and index into the target hook. Only the target knows whether the swap is safe. In Thumb2 mode, the offset must be an immediate. rdar://7998649
Added:
llvm/trunk/test/CodeGen/ARM/2010-05-18-PostIndexBug.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=104060&r1=104059&r2=104060&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue May 18 16:31:17 2010
@@ -5284,10 +5284,6 @@
SDValue Offset;
ISD::MemIndexedMode AM = ISD::UNINDEXED;
if (TLI.getPostIndexedAddressParts(N, Op, BasePtr, Offset, AM, DAG)) {
- if (Ptr == Offset && Op->getOpcode() == ISD::ADD)
- std::swap(BasePtr, Offset);
- if (Ptr != BasePtr)
- continue;
// Don't create a indexed load / store with zero offset.
if (isa(Offset) &&
cast(Offset)->isNullValue())
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=104060&r1=104059&r2=104060&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue May 18 16:31:17 2010
@@ -4407,9 +4407,11 @@
bool isSEXTLoad = false;
if (LoadSDNode *LD = dyn_cast(N)) {
VT = LD->getMemoryVT();
+ Ptr = LD->getBasePtr();
isSEXTLoad = LD->getExtensionType() == ISD::SEXTLOAD;
} else if (StoreSDNode *ST = dyn_cast(N)) {
VT = ST->getMemoryVT();
+ Ptr = ST->getBasePtr();
} else
return false;
@@ -4417,13 +4419,25 @@
bool isLegal = false;
if (Subtarget->isThumb2())
isLegal = getT2IndexedAddressParts(Op, VT, isSEXTLoad, Base, Offset,
- isInc, DAG);
+ isInc, DAG);
else
isLegal = getARMIndexedAddressParts(Op, VT, isSEXTLoad, Base, Offset,
isInc, DAG);
if (!isLegal)
return false;
+ if (Ptr != Base) {
+ // Swap base ptr and offset to catch more post-index load / store when
+ // it's legal. In Thumb2 mode, offset must be an immediate.
+ if (Ptr == Offset && Op->getOpcode() == ISD::ADD &&
+ !Subtarget->isThumb2())
+ std::swap(Base, Offset);
+
+ // Post-indexed load / store update the base pointer.
+ if (Ptr != Base)
+ return false;
+ }
+
AM = isInc ? ISD::POST_INC : ISD::POST_DEC;
return true;
}
Added: llvm/trunk/test/CodeGen/ARM/2010-05-18-PostIndexBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2010-05-18-PostIndexBug.ll?rev=104060&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2010-05-18-PostIndexBug.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/2010-05-18-PostIndexBug.ll Tue May 18 16:31:17 2010
@@ -0,0 +1,25 @@
+; RUN: llc < %s -mtriple=armv7-apple-darwin | FileCheck %s -check-prefix=ARM
+; RUN: llc < %s -mtriple=thumbv7-apple-darwin | FileCheck %s -check-prefix=THUMB
+; rdar://7998649
+
+%struct.foo = type { i64, i64 }
+
+define arm_apcscc zeroext i8 @t(%struct.foo* %this) noreturn optsize {
+entry:
+; ARM: t:
+; ARM: str r0, [r1], r0
+
+; THUMB: t:
+; THUMB-NOT: str r0, [r1], r0
+; THUMB: str r0, [r1]
+ %0 = getelementptr inbounds %struct.foo* %this, i32 0, i32 1 ; [#uses=1]
+ store i32 undef, i32* inttoptr (i32 8 to i32*), align 8
+ br i1 undef, label %bb.nph96, label %bb3
+
+bb3: ; preds = %entry
+ %1 = load i64* %0, align 4 ; [#uses=0]
+ unreachable
+
+bb.nph96: ; preds = %entry
+ unreachable
+}
From sabre at nondot.org Tue May 18 16:40:18 2010
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 18 May 2010 21:40:18 -0000
Subject: [llvm-commits] [llvm] r104062 -
/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Message-ID: <20100518214018.E3990312800A@llvm.org>
Author: lattner
Date: Tue May 18 16:40:18 2010
New Revision: 104062
URL: http://llvm.org/viewvc/llvm-project?rev=104062&view=rev
Log:
make mcinstlower remove all but the first operand to CALL64pcrel32.
The register use operands (e.g. the first argument is passed in a
register) is currently being modeled as a normal register use,
instead of correctly being an implicit use. This causes the operand
to get propagated onto the mcinst, which was causing the encoder to
emit a rex prefix byte, which generates an invalid call.
This fixes rdar://7998435
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=104062&r1=104061&r2=104062&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Tue May 18 16:40:18 2010
@@ -329,7 +329,17 @@
LowerSubReg32_Op0(OutMI, X86::MOV32r0); // MOV64r0 -> MOV32r0
LowerUnaryToTwoAddr(OutMI, X86::XOR32rr); // MOV32r0 -> XOR32rr
break;
-
+
+ // CALL64pcrel32 - This instruction has register inputs modeled as normal
+ // uses instead of implicit uses. As such, truncate off all but the first
+ // operand (the callee). FIXME: Change isel.
+ case X86::CALL64pcrel32: {
+ MCOperand Saved = OutMI.getOperand(0);
+ OutMI = MCInst();
+ OutMI.setOpcode(X86::CALL64pcrel32);
+ OutMI.addOperand(Saved);
+ break;
+ }
// The assembler backend wants to see branches in their small form and relax
// them to their large form. The JIT can only handle the large form because
From echristo at apple.com Tue May 18 16:40:20 2010
From: echristo at apple.com (Eric Christopher)
Date: Tue, 18 May 2010 21:40:20 -0000
Subject: [llvm-commits] [llvm] r104063 - /llvm/trunk/test/MC/MachO/tbss.s
Message-ID: <20100518214020.D05253128018@llvm.org>
Author: echristo
Date: Tue May 18 16:40:20 2010
New Revision: 104063
URL: http://llvm.org/viewvc/llvm-project?rev=104063&view=rev
Log:
Quick test to make sure we're emitting the tbss section correctly.
Added:
llvm/trunk/test/MC/MachO/tbss.s
Added: llvm/trunk/test/MC/MachO/tbss.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/tbss.s?rev=104063&view=auto
==============================================================================
--- llvm/trunk/test/MC/MachO/tbss.s (added)
+++ llvm/trunk/test/MC/MachO/tbss.s Tue May 18 16:40:20 2010
@@ -0,0 +1,114 @@
+// RUN: llvm-mc -triple x86_64-apple-darwin %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+
+.tbss _a$tlv$init, 4
+.tbss _b$tlv$init, 4, 3
+
+// CHECK: ('cputype', 16777223)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 336)
+// CHECK: ('flag', 0)
+// CHECK: ('reserved', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 25)
+// CHECK: ('size', 232)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 12)
+// CHECK: ('file_offset', 368)
+// CHECK: ('file_size', 0)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 2)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 0)
+// CHECK: ('offset', 368)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x80000000)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '')
+// CHECK: # Section 1
+// CHECK: (('section_name', '__thread_bss\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 12)
+// CHECK: ('offset', 0)
+// CHECK: ('alignment', 3)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x12)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '\xcf\xfa\xed\xfe\x07\x00\x00\x01\x03\x00\x00\x00')
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 1
+// CHECK: (('command', 2)
+// CHECK: ('size', 24)
+// CHECK: ('symoff', 368)
+// CHECK: ('nsyms', 2)
+// CHECK: ('stroff', 400)
+// CHECK: ('strsize', 28)
+// CHECK: ('_string_data', '\x00_a$tlv$init\x00_b$tlv$init\x00\x00\x00\x00')
+// CHECK: ('_symbols', [
+// CHECK: # Symbol 0
+// CHECK: (('n_strx', 1)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_a$tlv$init')
+// CHECK: ),
+// CHECK: # Symbol 1
+// CHECK: (('n_strx', 13)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 8)
+// CHECK: ('_string', '_b$tlv$init')
+// CHECK: ),
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 2
+// CHECK: (('command', 11)
+// CHECK: ('size', 80)
+// CHECK: ('ilocalsym', 0)
+// CHECK: ('nlocalsym', 2)
+// CHECK: ('iextdefsym', 2)
+// CHECK: ('nextdefsym', 0)
+// CHECK: ('iundefsym', 2)
+// CHECK: ('nundefsym', 0)
+// CHECK: ('tocoff', 0)
+// CHECK: ('ntoc', 0)
+// CHECK: ('modtaboff', 0)
+// CHECK: ('nmodtab', 0)
+// CHECK: ('extrefsymoff', 0)
+// CHECK: ('nextrefsyms', 0)
+// CHECK: ('indirectsymoff', 0)
+// CHECK: ('nindirectsyms', 0)
+// CHECK: ('extreloff', 0)
+// CHECK: ('nextrel', 0)
+// CHECK: ('locreloff', 0)
+// CHECK: ('nlocrel', 0)
+// CHECK: ('_indirect_symbols', [
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
From wendling at apple.com Tue May 18 16:42:18 2010
From: wendling at apple.com (Bill Wendling)
Date: Tue, 18 May 2010 14:42:18 -0700
Subject: [llvm-commits] [llvm-gcc-4.2] r103976 -
/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
In-Reply-To: <4BF235D3.60206@free.fr>
References: <20100517210604.B2B51312800A@llvm.org> <4BF235D3.60206@free.fr>
Message-ID:
On May 17, 2010, at 11:38 PM, Duncan Sands wrote:
> Hi Bill,
>
>> Turn on "--disable-non-leaf-fp-elim" if -momit-leaf-frame-pointer is specified.
>
> if -fomit-frame-pointer and -momit-leaf-frame-pointer are both specified,
> then the frame pointer should be omitted for all functions. Will your
> patch do this?
Of course.
> Also, if -fomit-frame-pointer is not specified, but
> -momit-leaf-frame-pointer is, I hope -disable-fp-elim is not passed to
> llc. How does that work?
The "flag_frame_pointer" is set to 3 in this case. So --disable-fp-elim isn't passed to llc.
> Presumably due to how gcc is setting up the
> various flags. Can you please add some comments.
>
That would involve documenting all of the effects that the "flag_frame_pointer" variable has. That's beyond the scope of this patch. And I think that the code is clear enough (certainly enough for GCC-derived code).
-bw
From gohman at apple.com Tue May 18 16:42:03 2010
From: gohman at apple.com (Dan Gohman)
Date: Tue, 18 May 2010 21:42:03 -0000
Subject: [llvm-commits] [llvm] r104064 - in /llvm/trunk:
lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/mcinst-lowering-cmp0.ll
Message-ID: <20100518214203.4DBCF312800A@llvm.org>
Author: djg
Date: Tue May 18 16:42:03 2010
New Revision: 104064
URL: http://llvm.org/viewvc/llvm-project?rev=104064&view=rev
Log:
When converting a test to a cmp to fold a load, use the cmp that has an
8-bit immediate field rather than one with a wider immediate field.
Added:
llvm/trunk/test/CodeGen/X86/mcinst-lowering-cmp0.ll
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=104064&r1=104063&r2=104064&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue May 18 16:42:03 2010
@@ -2529,9 +2529,9 @@
switch (MI->getOpcode()) {
default: return NULL;
case X86::TEST8rr: NewOpc = X86::CMP8ri; RCSize = 1; break;
- case X86::TEST16rr: NewOpc = X86::CMP16ri; RCSize = 2; break;
- case X86::TEST32rr: NewOpc = X86::CMP32ri; RCSize = 4; break;
- case X86::TEST64rr: NewOpc = X86::CMP64ri32; RCSize = 8; break;
+ case X86::TEST16rr: NewOpc = X86::CMP16ri8; RCSize = 2; break;
+ case X86::TEST32rr: NewOpc = X86::CMP32ri8; RCSize = 4; break;
+ case X86::TEST64rr: NewOpc = X86::CMP64ri8; RCSize = 8; break;
}
// Check if it's safe to fold the load. If the size of the object is
// narrower than the load width, then it's not.
Added: llvm/trunk/test/CodeGen/X86/mcinst-lowering-cmp0.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/mcinst-lowering-cmp0.ll?rev=104064&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/mcinst-lowering-cmp0.ll (added)
+++ llvm/trunk/test/CodeGen/X86/mcinst-lowering-cmp0.ll Tue May 18 16:42:03 2010
@@ -0,0 +1,68 @@
+; RUN: llc --show-mc-encoding -relocation-model=pic -disable-fp-elim -O3 < %s | FileCheck %s
+
+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-n8:16:32"
+target triple = "i386-apple-darwin10.0.0"
+
+%struct.NSConstantString = type { i32*, i32, i8*, i32 }
+%struct._objc_module = type { i32, i32, i8*, %struct._objc_symtab* }
+%struct._objc_symtab = type { i32, i8*, i16, i16, [0 x i8*] }
+
+@"\01L_OBJC_IMAGE_INFO" = internal constant [2 x i32] [i32 0, i32 16], section "__OBJC, __image_info,regular" ; <[2 x i32]*> [#uses=1]
+@"\01L_OBJC_METH_VAR_NAME_" = internal global [4 x i8] c"foo\00", section "__TEXT,__cstring,cstring_literals", align 1 ; <[4 x i8]*> [#uses=1]
+@"\01L_OBJC_SELECTOR_REFERENCES_" = internal global i8* getelementptr inbounds ([4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), section "__OBJC,__message_refs,literal_pointers,no_dead_strip", align 4 ; [#uses=3]
+ at __CFConstantStringClassReference = external global [0 x i32] ; <[0 x i32]*> [#uses=1]
+ at .str = private constant [3 x i8] c"||\00" ; <[3 x i8]*> [#uses=1]
+ at _unnamed_cfstring_ = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([3 x i8]* @.str, i32 0, i32 0), i32 2 }, section "__DATA,__cfstring" ; <%struct.NSConstantString*> [#uses=1]
+@"\01L_OBJC_METH_VAR_NAME_1" = internal global [5 x i8] c"baz:\00", section "__TEXT,__cstring,cstring_literals", align 1 ; <[5 x i8]*> [#uses=1]
+@"\01L_OBJC_SELECTOR_REFERENCES_2" = internal global i8* getelementptr inbounds ([5 x i8]* @"\01L_OBJC_METH_VAR_NAME_1", i32 0, i32 0), section "__OBJC,__message_refs,literal_pointers,no_dead_strip", align 4 ; [#uses=2]
+@"\01L_OBJC_METH_VAR_NAME_3" = internal global [4 x i8] c"bar\00", section "__TEXT,__cstring,cstring_literals", align 1 ; <[4 x i8]*> [#uses=1]
+@"\01L_OBJC_SELECTOR_REFERENCES_4" = internal global i8* getelementptr inbounds ([4 x i8]* @"\01L_OBJC_METH_VAR_NAME_3", i32 0, i32 0), section "__OBJC,__message_refs,literal_pointers,no_dead_strip", align 4 ; [#uses=2]
+@"\01L_OBJC_CLASS_NAME_" = internal global [1 x i8] zeroinitializer, section "__TEXT,__cstring,cstring_literals", align 1 ; <[1 x i8]*> [#uses=1]
+@"\01L_OBJC_MODULES" = internal global %struct._objc_module { i32 7, i32 16, i8* getelementptr inbounds ([1 x i8]* @"\01L_OBJC_CLASS_NAME_", i32 0, i32 0), %struct._objc_symtab* null }, section "__OBJC,__module_info,regular,no_dead_strip", align 4 ; <%struct._objc_module*> [#uses=1]
+ at llvm.used = appending global [9 x i8*] [i8* bitcast ([2 x i32]* @"\01L_OBJC_IMAGE_INFO" to i8*), i8* getelementptr inbounds ([4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_" to i8*), i8* getelementptr inbounds ([5 x i8]* @"\01L_OBJC_METH_VAR_NAME_1", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_2" to i8*), i8* getelementptr inbounds ([4 x i8]* @"\01L_OBJC_METH_VAR_NAME_3", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_4" to i8*), i8* getelementptr inbounds ([1 x i8]* @"\01L_OBJC_CLASS_NAME_", i32 0, i32 0), i8* bitcast (%struct._objc_module* @"\01L_OBJC_MODULES" to i8*)], section "llvm.metadata" ; <[9 x i8*]*> [#uses=0]
+
+define void @f0(i8* nocapture %a, i8* nocapture %b) nounwind optsize ssp {
+entry:
+ %call = tail call i32 (...)* @get_name() nounwind optsize ; [#uses=2]
+ %conv = inttoptr i32 %call to i8* ; [#uses=1]
+ %call1 = tail call i32 (...)* @get_dict() nounwind optsize ; [#uses=2]
+ %conv2 = inttoptr i32 %call1 to i8* ; [#uses=2]
+
+; Check that we lower to the short form of cmpl, which has an 8-bit immediate.
+;
+; CHECK: cmpl $0, -16(%ebp) ## 4-byte Folded Reload
+; CHECK: ## encoding: [0x83,0x7d,0xf0,0x00]
+; rdar://7999130
+ %cmp = icmp eq i32 %call1, 0 ; [#uses=1]
+ br i1 %cmp, label %if.end, label %if.then
+
+if.then: ; preds = %entry
+ %tmp5 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_" ; [#uses=1]
+ %call6 = tail call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %conv2, i8* %tmp5) nounwind optsize ; [#uses=1]
+ %tmp7 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_2" ; [#uses=1]
+ %call820 = tail call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call6, i8* %tmp7, i8* bitcast (%struct.NSConstantString* @_unnamed_cfstring_ to i8*)) nounwind optsize ; [#uses=0]
+ br label %if.end
+
+if.end: ; preds = %entry, %if.then
+ %tmp10 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_" ; [#uses=1]
+ %call11 = tail call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %conv2, i8* %tmp10) nounwind optsize ; [#uses=1]
+ %tmp12 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_4" ; [#uses=1]
+ %call13 = tail call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call11, i8* %tmp12) nounwind optsize ; [#uses=0]
+ %cmp15 = icmp eq i32 %call, 0 ; [#uses=1]
+ br i1 %cmp15, label %if.end19, label %if.then17
+
+if.then17: ; preds = %if.end
+ tail call void (...)* @f1(i8* %conv) nounwind optsize
+ ret void
+
+if.end19: ; preds = %if.end
+ ret void
+}
+
+declare i32 @get_name(...) optsize
+
+declare i32 @get_dict(...) optsize
+
+declare i8* @objc_msgSend(i8*, i8*, ...)
+
+declare void @f1(...) optsize
From baldrick at free.fr Tue May 18 16:47:48 2010
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 18 May 2010 23:47:48 +0200
Subject: [llvm-commits] [llvm-gcc-4.2] r103976 -
/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
In-Reply-To:
References: <20100517210604.B2B51312800A@llvm.org> <4BF235D3.60206@free.fr>
Message-ID: <4BF30B04.2020000@free.fr>
Hi Bill,
>> Presumably due to how gcc is setting up the
>> various flags. Can you please add some comments.
>>
>
> That would involve documenting all of the effects that the "flag_frame_pointer" variable has. That's beyond the scope of this patch. And I think that the code is clear enough (certainly enough for GCC-derived code).
your patch did have me scratching my head, maybe because I hadn't
seen your later patches at that point.
Ciao,
Duncan.
From isanbard at gmail.com Tue May 18 16:47:08 2010
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 18 May 2010 21:47:08 -0000
Subject: [llvm-commits] [llvm] r104066 -
/llvm/trunk/lib/Target/TargetMachine.cpp
Message-ID: <20100518214708.8470D312800A@llvm.org>
Author: void
Date: Tue May 18 16:47:08 2010
New Revision: 104066
URL: http://llvm.org/viewvc/llvm-project?rev=104066&view=rev
Log:
Don't eliminate frame pointers from leaf functions if "--disable-fp-elim" is
specified.
Modified:
llvm/trunk/lib/Target/TargetMachine.cpp
Modified: llvm/trunk/lib/Target/TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=104066&r1=104065&r2=104066&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/TargetMachine.cpp Tue May 18 16:47:08 2010
@@ -275,7 +275,7 @@
bool DisableFramePointerElim(const MachineFunction &MF) {
// Check to see if we should eliminate non-leaf frame pointers and then
// check to see if we should eliminate all frame pointers.
- if (NoFramePointerElimNonLeaf) {
+ if (NoFramePointerElimNonLeaf && !NoFramePointerElim) {
const MachineFrameInfo *MFI = MF.getFrameInfo();
return MFI->hasCalls();
}
From wendling at apple.com Tue May 18 16:48:44 2010
From: wendling at apple.com (Bill Wendling)
Date: Tue, 18 May 2010 14:48:44 -0700
Subject: [llvm-commits] [llvm] r103990 - in /llvm/trunk/lib:
CodeGen/SelectionDAG/SelectionDAGISel.cpp Target/TargetMachine.cpp
In-Reply-To: <4BF236C7.6040408@free.fr>
References: <20100517230950.8C5DA312800A@llvm.org> <4BF236C7.6040408@free.fr>
Message-ID:
Good point. Fixed in r104066.
Thanks!
-bw
On May 17, 2010, at 11:42 PM, Duncan Sands wrote:
> Hi Bill,
>
>> - Change the logic DisableFramePointerElim() to check for the
>> -disable-non-leaf-fp-elim before -disable-fp-elim.
>
> doesn't this mean that if you specify both -disable-non-leaf-fp-elim
> and -disable-fp-elim, then the frame pointer is eliminated for leaf
> functions? That's surely wrong since the user set -disable-fp-elim.
>
> Ciao,
>
> Duncan.
>
>> bool DisableFramePointerElim(const MachineFunction&MF) {
>> - if (NoFramePointerElim)
>> - return true;
>> + // Check to see if we should eliminate non-leaf frame pointers and then
>> + // check to see if we should eliminate all frame pointers.
>> if (NoFramePointerElimNonLeaf) {
>> const MachineFrameInfo *MFI = MF.getFrameInfo();
>> return MFI->hasCalls();
>> }
>> - return false;
>> +
>> + return NoFramePointerElim;
>> }
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From wendling at apple.com Tue May 18 16:51:04 2010
From: wendling at apple.com (Bill Wendling)
Date: Tue, 18 May 2010 14:51:04 -0700
Subject: [llvm-commits] [llvm-gcc-4.2] r103976 -
/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
In-Reply-To: <4BF30B04.2020000@free.fr>
References: <20100517210604.B2B51312800A@llvm.org> <4BF235D3.60206@free.fr>
<4BF30B04.2020000@free.fr>
Message-ID: <049CD887-7E9C-4321-B2BB-1C1EB8C81425@apple.com>
On May 18, 2010, at 2:47 PM, Duncan Sands wrote:
> Hi Bill,
>
>>> Presumably due to how gcc is setting up the
>>> various flags. Can you please add some comments.
>>>
>>
>> That would involve documenting all of the effects that the "flag_frame_pointer" variable has. That's beyond the scope of this patch. And I think that the code is clear enough (certainly enough for GCC-derived code).
>
> your patch did have me scratching my head, maybe because I hadn't
> seen your later patches at that point.
>
It's hard to defend the use of 'magic numbers' in this case. :-) But GCC is already using them all over for this flag. I'm hoping that someone who's interested in understanding why "3" is important here will look at the rest of the code. flag_frame_pointer is mercifully used in only a few places. I can add a few simple comments to help this along, though.
-bw
From isanbard at gmail.com Tue May 18 16:52:42 2010
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 18 May 2010 21:52:42 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r104067 - in
/llvm-gcc-4.2/trunk/gcc/config/i386: i386.c i386.h
Message-ID: <20100518215242.9CC2F312800A@llvm.org>
Author: void
Date: Tue May 18 16:52:42 2010
New Revision: 104067
URL: http://llvm.org/viewvc/llvm-project?rev=104067&view=rev
Log:
Comment the use of the magic value '3' for the flag_omit_frame_pointer variable.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/i386.c
llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.c?rev=104067&r1=104066&r2=104067&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/i386.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Tue May 18 16:52:42 2010
@@ -2081,6 +2081,7 @@
if (flag_omit_frame_pointer)
target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER;
else if (TARGET_OMIT_LEAF_FRAME_POINTER)
+ /* LLVM LOCAL - Use '3' to indicate omitting leaf FPs only */
flag_omit_frame_pointer = 3;
/* If we're doing fast math, we don't care about comparison order
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h?rev=104067&r1=104066&r2=104067&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/i386.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Tue May 18 16:52:42 2010
@@ -3955,6 +3955,8 @@
argvec.push_back("--code-model=default"); \
break; \
} \
+ /* A value of 3 in flag_omit_frame_pointer implies \
+ omitting leaf frame pointers only. */ \
if (flag_omit_frame_pointer == 3) \
argvec.push_back("--disable-non-leaf-fp-elim"); \
} while (0)
From gohman at apple.com Tue May 18 16:54:15 2010
From: gohman at apple.com (Dan Gohman)
Date: Tue, 18 May 2010 21:54:15 -0000
Subject: [llvm-commits] [llvm] r104068 -
/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Message-ID: <20100518215415.812C9312800A@llvm.org>
Author: djg
Date: Tue May 18 16:54:15 2010
New Revision: 104068
URL: http://llvm.org/viewvc/llvm-project?rev=104068&view=rev
Log:
Teach mode load folding and unfolding code about CMP32ri8 and friends.
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=104068&r1=104067&r2=104068&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue May 18 16:54:15 2010
@@ -2598,9 +2598,9 @@
switch (MI->getOpcode()) {
default: return NULL;
case X86::TEST8rr: NewOpc = X86::CMP8ri; break;
- case X86::TEST16rr: NewOpc = X86::CMP16ri; break;
- case X86::TEST32rr: NewOpc = X86::CMP32ri; break;
- case X86::TEST64rr: NewOpc = X86::CMP64ri32; break;
+ case X86::TEST16rr: NewOpc = X86::CMP16ri8; break;
+ case X86::TEST32rr: NewOpc = X86::CMP32ri8; break;
+ case X86::TEST64rr: NewOpc = X86::CMP64ri8; break;
}
// Change to CMPXXri r, 0 first.
MI->setDesc(get(NewOpc));
@@ -2808,16 +2808,22 @@
switch (DataMI->getOpcode()) {
default: break;
case X86::CMP64ri32:
+ case X86::CMP64ri8:
case X86::CMP32ri:
+ case X86::CMP32ri8:
case X86::CMP16ri:
+ case X86::CMP16ri8:
case X86::CMP8ri: {
MachineOperand &MO0 = DataMI->getOperand(0);
MachineOperand &MO1 = DataMI->getOperand(1);
if (MO1.getImm() == 0) {
switch (DataMI->getOpcode()) {
default: break;
+ case X86::CMP64ri8:
case X86::CMP64ri32: NewOpc = X86::TEST64rr; break;
+ case X86::CMP32ri8:
case X86::CMP32ri: NewOpc = X86::TEST32rr; break;
+ case X86::CMP16ri8:
case X86::CMP16ri: NewOpc = X86::TEST16rr; break;
case X86::CMP8ri: NewOpc = X86::TEST8rr; break;
}
From clattner at apple.com Tue May 18 17:11:39 2010
From: clattner at apple.com (Chris Lattner)
Date: Tue, 18 May 2010 15:11:39 -0700
Subject: [llvm-commits] [llvm] r104057 - in /llvm/trunk:
include/llvm/MC/MCStreamer.h lib/MC/MCAsmStreamer.cpp
lib/MC/MCNullStreamer.cpp lib/MC/MCParser/AsmParser.cpp
In-Reply-To: <20100518211604.BF1DB312800A@llvm.org>
References: <20100518211604.BF1DB312800A@llvm.org>
Message-ID: <4324D4AB-4DC3-4BE8-98F6-63C6881B4064@apple.com>
On May 18, 2010, at 2:16 PM, Eric Christopher wrote:
> Author: echristo
> Date: Tue May 18 16:16:04 2010
> New Revision: 104057
>
> URL: http://llvm.org/viewvc/llvm-project?rev=104057&view=rev
> Log:
> Make EmitTBSSSymbol take a section argument so that we can find it later.
> Fix up callers and users.
Should the syntax in the .s file also allow this to be specified (like .zerofill)? If not, it seems strange for the EmitTBSSSymbol hook to take a section.
-Chris
>
> Modified:
> llvm/trunk/include/llvm/MC/MCStreamer.h
> llvm/trunk/lib/MC/MCAsmStreamer.cpp
> llvm/trunk/lib/MC/MCNullStreamer.cpp
> llvm/trunk/lib/MC/MCParser/AsmParser.cpp
>
> Modified: llvm/trunk/include/llvm/MC/MCStreamer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=104057&r1=104056&r2=104057&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/MC/MCStreamer.h (original)
> +++ llvm/trunk/include/llvm/MC/MCStreamer.h Tue May 18 16:16:04 2010
> @@ -190,12 +190,13 @@
>
> /// EmitTBSSSymbol - Emit a thread local bss (.tbss) symbol.
> ///
> + /// @param Section - The thread local common section.
> /// @param Symbol - The thread local common symbol to emit.
> /// @param Size - The size of the symbol.
> /// @param ByteAlignment - The alignment of the thread local common symbol
> /// if non-zero. This must be a power of 2 on some targets.
> - virtual void EmitTBSSSymbol(MCSymbol *Symbol, uint64_t Size,
> - unsigned ByteAlignment = 0) = 0;
> + virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
> + uint64_t Size, unsigned ByteAlignment = 0) = 0;
> /// @}
> /// @name Generating Data
> /// @{
>
> Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=104057&r1=104056&r2=104057&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
> +++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Tue May 18 16:16:04 2010
> @@ -126,8 +126,8 @@
> virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
> unsigned Size = 0, unsigned ByteAlignment = 0);
>
> - virtual void EmitTBSSSymbol (MCSymbol *Symbol, uint64_t Size,
> - unsigned ByteAlignment = 0);
> + virtual void EmitTBSSSymbol (const MCSection *Section, MCSymbol *Symbol,
> + uint64_t Size, unsigned ByteAlignment = 0);
>
> virtual void EmitBytes(StringRef Data, unsigned AddrSpace);
>
> @@ -366,13 +366,16 @@
> // .tbss sym, size, align
> // This depends that the symbol has already been mangled from the original,
> // e.g. _a.
> -void MCAsmStreamer::EmitTBSSSymbol(MCSymbol *Symbol, uint64_t Size,
> - unsigned ByteAlignment) {
> +void MCAsmStreamer::EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
> + uint64_t Size, unsigned ByteAlignment) {
> assert(Symbol != NULL && "Symbol shouldn't be NULL!");
> + // Instead of using the Section we'll just use the shortcut.
> + // This is a mach-o specific directive and section.
> OS << ".tbss " << *Symbol << ", " << Size;
>
> - // Output align if we have it.
> - if (ByteAlignment != 0) OS << ", " << Log2_32(ByteAlignment);
> + // Output align if we have it. We default to 1 so don't bother printing
> + // that.
> + if (ByteAlignment > 1) OS << ", " << Log2_32(ByteAlignment);
>
> EmitEOL();
> }
>
> Modified: llvm/trunk/lib/MC/MCNullStreamer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCNullStreamer.cpp?rev=104057&r1=104056&r2=104057&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCNullStreamer.cpp (original)
> +++ llvm/trunk/lib/MC/MCNullStreamer.cpp Tue May 18 16:16:04 2010
> @@ -55,8 +55,8 @@
>
> virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
> unsigned Size = 0, unsigned ByteAlignment = 0) {}
> - virtual void EmitTBSSSymbol(MCSymbol *Symbol, uint64_t Size,
> - unsigned ByteAlignment) {}
> + virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
> + uint64_t Size, unsigned ByteAlignment) {}
> virtual void EmitBytes(StringRef Data, unsigned AddrSpace) {}
>
> virtual void EmitValue(const MCExpr *Value, unsigned Size,
>
> Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=104057&r1=104056&r2=104057&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
> +++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Tue May 18 16:16:04 2010
> @@ -1536,7 +1536,10 @@
> if (!Sym->isUndefined())
> return Error(IDLoc, "invalid symbol redefinition");
>
> - Out.EmitTBSSSymbol(Sym, Size, Pow2Alignment ? 1 << Pow2Alignment : 0);
> + Out.EmitTBSSSymbol(Ctx.getMachOSection("__DATA", "__thread_bss",
> + MCSectionMachO::S_THREAD_LOCAL_ZEROFILL,
> + 0, SectionKind::getThreadBSS()),
> + Sym, Size, 1 << Pow2Alignment);
>
> return false;
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From echristo at apple.com Tue May 18 17:18:43 2010
From: echristo at apple.com (Eric Christopher)
Date: Tue, 18 May 2010 15:18:43 -0700
Subject: [llvm-commits] [llvm] r104057 - in /llvm/trunk:
include/llvm/MC/MCStreamer.h lib/MC/MCAsmStreamer.cpp
lib/MC/MCNullStreamer.cpp lib/MC/MCParser/AsmParser.cpp
In-Reply-To: <4324D4AB-4DC3-4BE8-98F6-63C6881B4064@apple.com>
References: <20100518211604.BF1DB312800A@llvm.org>
<4324D4AB-4DC3-4BE8-98F6-63C6881B4064@apple.com>
Message-ID:
On May 18, 2010, at 3:11 PM, Chris Lattner wrote:
>
> On May 18, 2010, at 2:16 PM, Eric Christopher wrote:
>
>> Author: echristo
>> Date: Tue May 18 16:16:04 2010
>> New Revision: 104057
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=104057&view=rev
>> Log:
>> Make EmitTBSSSymbol take a section argument so that we can find it later.
>> Fix up callers and users.
>
> Should the syntax in the .s file also allow this to be specified (like .zerofill)? If not, it seems strange for the EmitTBSSSymbol hook to take a section.
I agree, but I needed it for the object file out bits since as far as I can tell I don't have access to the named sections in other places. Maybe a new type of symbol data instead?
And no, it probably shouldn't be specified, it's just a shortcut like .bss or .comm.
-eric
From stoklund at 2pi.dk Tue May 18 17:20:09 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Tue, 18 May 2010 22:20:09 -0000
Subject: [llvm-commits] [llvm] r104074 - in /llvm/trunk:
lib/CodeGen/RegAllocLocal.cpp
test/CodeGen/ARM/2010-05-18-LocalAllocCrash.ll
Message-ID: <20100518222009.C3202312800A@llvm.org>
Author: stoklund
Date: Tue May 18 17:20:09 2010
New Revision: 104074
URL: http://llvm.org/viewvc/llvm-project?rev=104074&view=rev
Log:
Remember to update VirtRegLastUse when spilling without killing before a call.
Added:
llvm/trunk/test/CodeGen/ARM/2010-05-18-LocalAllocCrash.ll
Modified:
llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLocal.cpp?rev=104074&r1=104073&r2=104074&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocLocal.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocLocal.cpp Tue May 18 17:20:09 2010
@@ -301,6 +301,16 @@
DEBUG(dbgs() << " to stack slot #" << FrameIndex);
TII->storeRegToStackSlot(MBB, I, PhysReg, isKill, FrameIndex, RC, TRI);
++NumStores; // Update statistics
+
+ // Mark the spill instruction as last use if we're not killing the register.
+ if (!isKill) {
+ MachineInstr *Spill = llvm::prior(I);
+ int OpNum = Spill->findRegisterUseOperandIdx(PhysReg);
+ if (OpNum < 0)
+ getVirtRegLastUse(VirtReg) = std::make_pair((MachineInstr*)0, 0);
+ else
+ getVirtRegLastUse(VirtReg) = std::make_pair(Spill, OpNum);
+ }
}
/// spillVirtReg - This method spills the value specified by PhysReg into the
Added: llvm/trunk/test/CodeGen/ARM/2010-05-18-LocalAllocCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2010-05-18-LocalAllocCrash.ll?rev=104074&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2010-05-18-LocalAllocCrash.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/2010-05-18-LocalAllocCrash.ll Tue May 18 17:20:09 2010
@@ -0,0 +1,37 @@
+; RUN: llc < %s -O0 -verify-machineinstrs -regalloc=local
+; RUN: llc < %s -O0 -verify-machineinstrs -regalloc=fast
+; rdar://problem/7948106
+;; This test would spill %R4 before the call to zz, but it forgot to move the
+; 'last use' marker to the spill.
+
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64-n32"
+target triple = "armv6-apple-darwin"
+
+%struct.q = type { i32, i32 }
+
+ at .str = external constant [1 x i8] ; <[1 x i8]*> [#uses=1]
+
+define arm_apcscc void @yy(%struct.q* %qq) nounwind {
+entry:
+ %vla6 = alloca i8, i32 undef, align 1 ; [#uses=1]
+ %vla10 = alloca i8, i32 undef, align 1 ; [#uses=1]
+ %vla14 = alloca i8, i32 undef, align 1 ; [#uses=1]
+ %vla18 = alloca i8, i32 undef, align 1 ; [#uses=1]
+ %tmp21 = load i32* undef ; [#uses=1]
+ %0 = mul i32 1, %tmp21 ; [#uses=1]
+ %vla22 = alloca i8, i32 %0, align 1 ; [#uses=1]
+ call arm_apcscc void (...)* @zz(i8* getelementptr inbounds ([1 x i8]* @.str, i32 0, i32 0), i32 2, i32 1)
+ br i1 undef, label %if.then, label %if.end36
+
+if.then: ; preds = %entry
+ %call = call arm_apcscc i32 (...)* @x(%struct.q* undef, i8* undef, i8* %vla6, i8* %vla10, i32 undef) ; [#uses=0]
+ %call35 = call arm_apcscc i32 (...)* @x(%struct.q* undef, i8* %vla14, i8* %vla18, i8* %vla22, i32 undef) ; [#uses=0]
+ unreachable
+
+if.end36: ; preds = %entry
+ ret void
+}
+
+declare arm_apcscc void @zz(...)
+
+declare arm_apcscc i32 @x(...)
From gohman at apple.com Tue May 18 17:33:00 2010
From: gohman at apple.com (Dan Gohman)
Date: Tue, 18 May 2010 22:33:00 -0000
Subject: [llvm-commits] [llvm] r104076 -
/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Message-ID: <20100518223300.6AB97312800A@llvm.org>
Author: djg
Date: Tue May 18 17:33:00 2010
New Revision: 104076
URL: http://llvm.org/viewvc/llvm-project?rev=104076&view=rev
Log:
Rename RegUseTracker's RegUses member to RegUsesMap to avoid
confusion with LSRInstance's RegUses member.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=104076&r1=104075&r2=104076&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue May 18 17:33:00 2010
@@ -107,7 +107,7 @@
class RegUseTracker {
typedef DenseMap RegUsesTy;
- RegUsesTy RegUses;
+ RegUsesTy RegUsesMap;
SmallVector RegSequence;
public:
@@ -132,7 +132,7 @@
void
RegUseTracker::CountRegister(const SCEV *Reg, size_t LUIdx) {
std::pair Pair =
- RegUses.insert(std::make_pair(Reg, RegSortData()));
+ RegUsesMap.insert(std::make_pair(Reg, RegSortData()));
RegSortData &RSD = Pair.first->second;
if (Pair.second)
RegSequence.push_back(Reg);
@@ -142,9 +142,9 @@
bool
RegUseTracker::isRegUsedByUsesOtherThan(const SCEV *Reg, size_t LUIdx) const {
- if (!RegUses.count(Reg)) return false;
+ if (!RegUsesMap.count(Reg)) return false;
const SmallBitVector &UsedByIndices =
- RegUses.find(Reg)->second.UsedByIndices;
+ RegUsesMap.find(Reg)->second.UsedByIndices;
int i = UsedByIndices.find_first();
if (i == -1) return false;
if ((size_t)i != LUIdx) return true;
@@ -152,13 +152,13 @@
}
const SmallBitVector &RegUseTracker::getUsedByIndices(const SCEV *Reg) const {
- RegUsesTy::const_iterator I = RegUses.find(Reg);
- assert(I != RegUses.end() && "Unknown register!");
+ RegUsesTy::const_iterator I = RegUsesMap.find(Reg);
+ assert(I != RegUsesMap.end() && "Unknown register!");
return I->second.UsedByIndices;
}
void RegUseTracker::clear() {
- RegUses.clear();
+ RegUsesMap.clear();
RegSequence.clear();
}
From gohman at apple.com Tue May 18 17:35:55 2010
From: gohman at apple.com (Dan Gohman)
Date: Tue, 18 May 2010 22:35:55 -0000
Subject: [llvm-commits] [llvm] r104077 -
/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Message-ID: <20100518223555.ABC87312800A@llvm.org>
Author: djg
Date: Tue May 18 17:35:55 2010
New Revision: 104077
URL: http://llvm.org/viewvc/llvm-project?rev=104077&view=rev
Log:
Print an error message in Formula::print if the HasBaseReg flag
is inconsistent with the BaseRegs field. It's not print's job to
assert on an invalid condition, but it can make one more obvious.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=104077&r1=104076&r2=104077&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue May 18 17:35:55 2010
@@ -326,6 +326,13 @@
if (!First) OS << " + "; else First = false;
OS << "reg(" << **I << ')';
}
+ if (AM.HasBaseReg && BaseRegs.empty()) {
+ if (!First) OS << " + "; else First = false;
+ OS << "**error: HasBaseReg**";
+ } else if (!AM.HasBaseReg && !BaseRegs.empty()) {
+ if (!First) OS << " + "; else First = false;
+ OS << "**error: !HasBaseReg**";
+ }
if (AM.Scale != 0) {
if (!First) OS << " + "; else First = false;
OS << AM.Scale << "*reg(";
From gohman at apple.com Tue May 18 17:37:37 2010
From: gohman at apple.com (Dan Gohman)
Date: Tue, 18 May 2010 22:37:37 -0000
Subject: [llvm-commits] [llvm] r104078 -
/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Message-ID: <20100518223737.C29C7312800A@llvm.org>
Author: djg
Date: Tue May 18 17:37:37 2010
New Revision: 104078
URL: http://llvm.org/viewvc/llvm-project?rev=104078&view=rev
Log:
Make some debug output more informative.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=104078&r1=104077&r2=104078&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue May 18 17:37:37 2010
@@ -2598,6 +2598,7 @@
for (size_t LUIdx = 0, NumUses = Uses.size(); LUIdx != NumUses; ++LUIdx) {
LSRUse &LU = Uses[LUIdx];
FormulaSorter Sorter(L, LU, SE, DT);
+ DEBUG(dbgs() << "Filtering for use "; LU.print(dbgs()); dbgs() << "\n");
for (size_t FIdx = 0, NumForms = LU.Formulae.size();
FIdx != NumForms; ++FIdx) {
@@ -2623,9 +2624,9 @@
Formula &Best = LU.Formulae[P.first->second];
if (Sorter.operator()(F, Best))
std::swap(F, Best);
- DEBUG(dbgs() << "Filtering out "; F.print(dbgs());
+ DEBUG(dbgs() << " Filtering out formula "; F.print(dbgs());
dbgs() << "\n"
- " in favor of "; Best.print(dbgs());
+ " in favor of formula "; Best.print(dbgs());
dbgs() << '\n');
#ifndef NDEBUG
Changed = true;
From gohman at apple.com Tue May 18 17:39:15 2010
From: gohman at apple.com (Dan Gohman)
Date: Tue, 18 May 2010 22:39:15 -0000
Subject: [llvm-commits] [llvm] r104079 -
/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Message-ID: <20100518223915.90085312800A@llvm.org>
Author: djg
Date: Tue May 18 17:39:15 2010
New Revision: 104079
URL: http://llvm.org/viewvc/llvm-project?rev=104079&view=rev
Log:
Factor out the code for deleting a formula from an LSRUse into
a helper function.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=104079&r1=104078&r2=104079&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue May 18 17:39:15 2010
@@ -942,6 +942,7 @@
AllFixupsOutsideLoop(true) {}
bool InsertFormula(const Formula &F);
+ void DeleteFormula(Formula &F);
void check() const;
@@ -979,6 +980,12 @@
return true;
}
+/// DeleteFormula - Remove the given formula from this use's list.
+void LSRUse::DeleteFormula(Formula &F) {
+ std::swap(F, Formulae.back());
+ Formulae.pop_back();
+}
+
void LSRUse::print(raw_ostream &OS) const {
OS << "LSR Use: Kind=";
switch (Kind) {
@@ -2631,8 +2638,7 @@
#ifndef NDEBUG
Changed = true;
#endif
- std::swap(F, LU.Formulae.back());
- LU.Formulae.pop_back();
+ LU.DeleteFormula(F);
--FIdx;
--NumForms;
continue;
@@ -2728,8 +2734,7 @@
Formula &F = LU.Formulae[i];
if (!F.referencesReg(Best)) {
DEBUG(dbgs() << " Deleting "; F.print(dbgs()); dbgs() << '\n');
- std::swap(LU.Formulae.back(), F);
- LU.Formulae.pop_back();
+ LU.DeleteFormula(F);
--e;
--i;
assert(e != 0 && "Use has no formulae left! Is Regs inconsistent?");
From gohman at apple.com Tue May 18 17:41:32 2010
From: gohman at apple.com (Dan Gohman)
Date: Tue, 18 May 2010 22:41:32 -0000
Subject: [llvm-commits] [llvm] r104080 -
/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Message-ID: <20100518224132.A614B312800A@llvm.org>
Author: djg
Date: Tue May 18 17:41:32 2010
New Revision: 104080
URL: http://llvm.org/viewvc/llvm-project?rev=104080&view=rev
Log:
Add some more debug output.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=104080&r1=104079&r2=104080&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue May 18 17:41:32 2010
@@ -2695,6 +2695,7 @@
// Ok, we have too many of formulae on our hands to conveniently handle.
// Use a rough heuristic to thin out the list.
+ DEBUG(dbgs() << "The search space is too complex.\n");
// Pick the register which is used by the most LSRUses, which is likely
// to be a good reuse register candidate.
From gohman at apple.com Tue May 18 17:51:59 2010
From: gohman at apple.com (Dan Gohman)
Date: Tue, 18 May 2010 22:51:59 -0000
Subject: [llvm-commits] [llvm] r104082 -
/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Message-ID: <20100518225159.84DC0312800A@llvm.org>
Author: djg
Date: Tue May 18 17:51:59 2010
New Revision: 104082
URL: http://llvm.org/viewvc/llvm-project?rev=104082&view=rev
Log:
Factor out code for estimating search space complexity into a helper
function.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=104082&r1=104081&r2=104082&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue May 18 17:51:59 2010
@@ -1241,6 +1241,8 @@
void GenerateAllReuseFormulae();
void FilterOutUndesirableDedicatedRegisters();
+
+ size_t EstimateSearchSpaceComplexity() const;
void NarrowSearchSpaceUsingHeuristics();
void SolveRecurse(SmallVectorImpl &Solution,
@@ -2665,34 +2667,36 @@
});
}
+// This is a rough guess that seems to work fairly well.
+static const size_t ComplexityLimit = UINT16_MAX;
+
+/// EstimateSearchSpaceComplexity - Estimate the worst-case number of
+/// solutions the solver might have to consider. It almost never considers
+/// this many solutions because it prune the search space, but the pruning
+/// isn't always sufficient.
+size_t LSRInstance::EstimateSearchSpaceComplexity() const {
+ uint32_t Power = 1;
+ for (SmallVectorImpl::const_iterator I = Uses.begin(),
+ E = Uses.end(); I != E; ++I) {
+ size_t FSize = I->Formulae.size();
+ if (FSize >= ComplexityLimit) {
+ Power = ComplexityLimit;
+ break;
+ }
+ Power *= FSize;
+ if (Power >= ComplexityLimit)
+ break;
+ }
+ return Power;
+}
+
/// NarrowSearchSpaceUsingHeuristics - If there are an extraordinary number of
/// formulae to choose from, use some rough heuristics to prune down the number
/// of formulae. This keeps the main solver from taking an extraordinary amount
/// of time in some worst-case scenarios.
void LSRInstance::NarrowSearchSpaceUsingHeuristics() {
- // This is a rough guess that seems to work fairly well.
- const size_t Limit = UINT16_MAX;
-
SmallPtrSet Taken;
- for (;;) {
- // Estimate the worst-case number of solutions we might consider. We almost
- // never consider this many solutions because we prune the search space,
- // but the pruning isn't always sufficient.
- uint32_t Power = 1;
- for (SmallVectorImpl::const_iterator I = Uses.begin(),
- E = Uses.end(); I != E; ++I) {
- size_t FSize = I->Formulae.size();
- if (FSize >= Limit) {
- Power = Limit;
- break;
- }
- Power *= FSize;
- if (Power >= Limit)
- break;
- }
- if (Power < Limit)
- break;
-
+ while (EstimateSearchSpaceComplexity() >= ComplexityLimit) {
// Ok, we have too many of formulae on our hands to conveniently handle.
// Use a rough heuristic to thin out the list.
DEBUG(dbgs() << "The search space is too complex.\n");
From bob.wilson at apple.com Tue May 18 18:19:42 2010
From: bob.wilson at apple.com (Bob Wilson)
Date: Tue, 18 May 2010 23:19:42 -0000
Subject: [llvm-commits] [llvm] r104086 -
/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
Message-ID: <20100518231942.E3D50312800A@llvm.org>
Author: bwilson
Date: Tue May 18 18:19:42 2010
New Revision: 104086
URL: http://llvm.org/viewvc/llvm-project?rev=104086&view=rev
Log:
Fix a crash when debugging the coalescer. DebugValue instructions are not
in the coalescer's instruction map.
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=104086&r1=104085&r2=104086&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue May 18 18:19:42 2010
@@ -837,8 +837,13 @@
UseMI->isRegTiedToDefOperand(&O-&UseMI->getOperand(0))))
UseMI->addRegisterKilled(DstReg, tri_, true);
}
- DEBUG(dbgs() << "\t\tupdated: " << li_->getInstructionIndex(UseMI)
- << "\t" << *UseMI);
+
+ DEBUG({
+ dbgs() << "\t\tupdated: ";
+ if (!UseMI->isDebugValue())
+ dbgs() << li_->getInstructionIndex(UseMI) << "\t";
+ dbgs() << *UseMI;
+ });
continue;
}
@@ -853,8 +858,12 @@
O.setSubReg(SubIdx);
O.setReg(DstReg);
- DEBUG(dbgs() << "\t\tupdated: " << li_->getInstructionIndex(UseMI)
- << "\t" << *UseMI);
+ DEBUG({
+ dbgs() << "\t\tupdated: ";
+ if (!UseMI->isDebugValue())
+ dbgs() << li_->getInstructionIndex(UseMI) << "\t";
+ dbgs() << *UseMI;
+ });
// After updating the operand, check if the machine instruction has
// become a copy. If so, update its val# information.
From gohman at apple.com Tue May 18 18:42:37 2010
From: gohman at apple.com (Dan Gohman)
Date: Tue, 18 May 2010 23:42:37 -0000
Subject: [llvm-commits] [llvm] r104087 -
/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Message-ID: <20100518234237.338CB312800A@llvm.org>
Author: djg
Date: Tue May 18 18:42:37 2010
New Revision: 104087
URL: http://llvm.org/viewvc/llvm-project?rev=104087&view=rev
Log:
Factor out the code for recomputing an LSRUse's Regs set after some
of its formulae have been removed into a helper function, and also
teach it how to update the RegUseTracker.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=104087&r1=104086&r2=104087&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue May 18 18:42:37 2010
@@ -112,6 +112,7 @@
public:
void CountRegister(const SCEV *Reg, size_t LUIdx);
+ void DropRegister(const SCEV *Reg, size_t LUIdx);
bool isRegUsedByUsesOtherThan(const SCEV *Reg, size_t LUIdx) const;
@@ -140,6 +141,15 @@
RSD.UsedByIndices.set(LUIdx);
}
+void
+RegUseTracker::DropRegister(const SCEV *Reg, size_t LUIdx) {
+ RegUsesTy::iterator It = RegUsesMap.find(Reg);
+ assert(It != RegUsesMap.end());
+ RegSortData &RSD = It->second;
+ assert(RSD.UsedByIndices.size() > LUIdx);
+ RSD.UsedByIndices.reset(LUIdx);
+}
+
bool
RegUseTracker::isRegUsedByUsesOtherThan(const SCEV *Reg, size_t LUIdx) const {
if (!RegUsesMap.count(Reg)) return false;
@@ -943,6 +953,7 @@
bool InsertFormula(const Formula &F);
void DeleteFormula(Formula &F);
+ void RecomputeRegs(size_t LUIdx, RegUseTracker &Reguses);
void check() const;
@@ -986,6 +997,24 @@
Formulae.pop_back();
}
+/// RecomputeRegs - Recompute the Regs field, and update RegUses.
+void LSRUse::RecomputeRegs(size_t LUIdx, RegUseTracker &RegUses) {
+ // Now that we've filtered out some formulae, recompute the Regs set.
+ SmallPtrSet OldRegs = Regs;
+ Regs.clear();
+ for (size_t FIdx = 0, NumForms = Formulae.size(); FIdx != NumForms; ++FIdx) {
+ Formula &F = Formulae[FIdx];
+ if (F.ScaledReg) Regs.insert(F.ScaledReg);
+ Regs.insert(F.BaseRegs.begin(), F.BaseRegs.end());
+ }
+
+ // Update the RegTracker.
+ for (SmallPtrSet::iterator I = OldRegs.begin(),
+ E = OldRegs.end(); I != E; ++I)
+ if (!Regs.count(*I))
+ RegUses.DropRegister(*I, LUIdx);
+}
+
void LSRUse::print(raw_ostream &OS) const {
OS << "LSR Use: Kind=";
switch (Kind) {
@@ -2609,6 +2638,7 @@
FormulaSorter Sorter(L, LU, SE, DT);
DEBUG(dbgs() << "Filtering for use "; LU.print(dbgs()); dbgs() << "\n");
+ bool Any = false;
for (size_t FIdx = 0, NumForms = LU.Formulae.size();
FIdx != NumForms; ++FIdx) {
Formula &F = LU.Formulae[FIdx];
@@ -2643,18 +2673,13 @@
LU.DeleteFormula(F);
--FIdx;
--NumForms;
+ Any = true;
continue;
}
}
- // Now that we've filtered out some formulae, recompute the Regs set.
- LU.Regs.clear();
- for (size_t FIdx = 0, NumForms = LU.Formulae.size();
- FIdx != NumForms; ++FIdx) {
- Formula &F = LU.Formulae[FIdx];
- if (F.ScaledReg) LU.Regs.insert(F.ScaledReg);
- LU.Regs.insert(F.BaseRegs.begin(), F.BaseRegs.end());
- }
+ if (Any)
+ LU.RecomputeRegs(LUIdx, RegUses);
// Reset this to prepare for the next use.
BestFormulae.clear();
@@ -2727,14 +2752,11 @@
// In any use with formulae which references this register, delete formulae
// which don't reference it.
- for (SmallVectorImpl::iterator I = Uses.begin(),
- E = Uses.end(); I != E; ++I) {
- LSRUse &LU = *I;
+ for (size_t LUIdx = 0, NumUses = Uses.size(); LUIdx != NumUses; ++LUIdx) {
+ LSRUse &LU = Uses[LUIdx];
if (!LU.Regs.count(Best)) continue;
- // Clear out the set of used regs; it will be recomputed.
- LU.Regs.clear();
-
+ bool Any = false;
for (size_t i = 0, e = LU.Formulae.size(); i != e; ++i) {
Formula &F = LU.Formulae[i];
if (!F.referencesReg(Best)) {
@@ -2742,13 +2764,14 @@
LU.DeleteFormula(F);
--e;
--i;
+ Any = true;
assert(e != 0 && "Use has no formulae left! Is Regs inconsistent?");
continue;
}
-
- if (F.ScaledReg) LU.Regs.insert(F.ScaledReg);
- LU.Regs.insert(F.BaseRegs.begin(), F.BaseRegs.end());
}
+
+ if (Any)
+ LU.RecomputeRegs(LUIdx, RegUses);
}
DEBUG(dbgs() << "After pre-selection:\n";
From gohman at apple.com Tue May 18 18:48:08 2010
From: gohman at apple.com (Dan Gohman)
Date: Tue, 18 May 2010 23:48:08 -0000
Subject: [llvm-commits] [llvm] r104088 -
/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Message-ID: <20100518234808.3AFA1312800A@llvm.org>
Author: djg
Date: Tue May 18 18:48:08 2010
New Revision: 104088
URL: http://llvm.org/viewvc/llvm-project?rev=104088&view=rev
Log:
Fix the predicate which checks for non-sensical formulae which have
constants in registers which partially cancel out their immediate fields.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=104088&r1=104087&r2=104088&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue May 18 18:48:08 2010
@@ -2572,10 +2572,11 @@
J = NewF.BaseRegs.begin(), JE = NewF.BaseRegs.end();
J != JE; ++J)
if (const SCEVConstant *C = dyn_cast(*J))
- if (C->getValue()->getValue().isNegative() !=
- (NewF.AM.BaseOffs < 0) &&
- C->getValue()->getValue().abs()
- .ule(abs64(NewF.AM.BaseOffs)))
+ if ((C->getValue()->getValue() + NewF.AM.BaseOffs).abs().slt(
+ abs64(NewF.AM.BaseOffs)) &&
+ (C->getValue()->getValue() +
+ NewF.AM.BaseOffs).countTrailingZeros() >=
+ CountTrailingZeros_64(NewF.AM.BaseOffs))
goto skip_formula;
// Ok, looks good.
From gohman at apple.com Tue May 18 18:55:58 2010
From: gohman at apple.com (Dan Gohman)
Date: Tue, 18 May 2010 23:55:58 -0000
Subject: [llvm-commits] [llvm] r104089 -
/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Message-ID: <20100518235558.1369C312800A@llvm.org>
Author: djg
Date: Tue May 18 18:55:57 2010
New Revision: 104089
URL: http://llvm.org/viewvc/llvm-project?rev=104089&view=rev
Log:
Add a comment.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=104089&r1=104088&r2=104089&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue May 18 18:55:57 2010
@@ -2679,6 +2679,7 @@
}
}
+ // Now that we've filtered out some formulae, recompute the Regs set.
if (Any)
LU.RecomputeRegs(LUIdx, RegUses);
From zonr.xchg at gmail.com Tue May 18 14:19:54 2010
From: zonr.xchg at gmail.com (Zonr Chang)
Date: Wed, 19 May 2010 03:19:54 +0800
Subject: [llvm-commits] [PATCH] ARM JIT: Add support to MOVimm32 using
movt/movw for JIT
Message-ID:
The attached patch enables LLVM to materialize of movt/movw instructions
in ARM JIT. These allow you loading 32-bit immediate and addresses using 2
instructions instead of from the constant pool. This patch should resolve
the Bug #6265 (http://llvm.org/bugs/show_bug.cgi?id=6265).
Zonr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100519/3a080152/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm-jit-movt-and-movw.patch
Type: application/octet-stream
Size: 5824 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100519/3a080152/attachment.obj
From echristo at apple.com Tue May 18 19:22:04 2010
From: echristo at apple.com (Eric Christopher)
Date: Wed, 19 May 2010 00:22:04 -0000
Subject: [llvm-commits] [llvm] r104090 -
/llvm/trunk/test/FrontendC/2010-05-18-palignr.c
Message-ID: <20100519002204.834BA312800A@llvm.org>
Author: echristo
Date: Tue May 18 19:22:04 2010
New Revision: 104090
URL: http://llvm.org/viewvc/llvm-project?rev=104090&view=rev
Log:
Add a test to make sure that we're lowering the shift amount correctly.
Added:
llvm/trunk/test/FrontendC/2010-05-18-palignr.c
Added: llvm/trunk/test/FrontendC/2010-05-18-palignr.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2010-05-18-palignr.c?rev=104090&view=auto
==============================================================================
--- llvm/trunk/test/FrontendC/2010-05-18-palignr.c (added)
+++ llvm/trunk/test/FrontendC/2010-05-18-palignr.c Tue May 18 19:22:04 2010
@@ -0,0 +1,22 @@
+// RUN: %llvmgcc -mssse3 -S -o - %s | llc -mtriple=x86_64-apple-darwin | FileCheck %s
+
+#include
+
+int main ()
+{
+#if defined( __SSSE3__ )
+
+#define vec_rld_epi16( _a, _i ) ({ vSInt16 _t = _a; _t = _mm_alignr_epi8( _t, _t, _i ); /*return*/ _t; })
+ typedef int16_t vSInt16 __attribute__ ((__vector_size__ (16)));
+
+ short dtbl[] = {1,2,3,4,5,6,7,8};
+ vSInt16 *vdtbl = (vSInt16*) dtbl;
+
+ vSInt16 v0;
+ v0 = *vdtbl;
+ // CHECK: pshufd $57
+ v0 = vec_rld_epi16( v0, 4 );
+
+ return 0;
+#endif
+}
From gohman at apple.com Tue May 18 19:53:19 2010
From: gohman at apple.com (Dan Gohman)
Date: Wed, 19 May 2010 00:53:19 -0000
Subject: [llvm-commits] [llvm] r104091 -
/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
Message-ID: <20100519005319.6E9DF312800A@llvm.org>
Author: djg
Date: Tue May 18 19:53:19 2010
New Revision: 104091
URL: http://llvm.org/viewvc/llvm-project?rev=104091&view=rev
Log:
Factor out the code for picking integer arithmetic with immediate
opcodes into a helper function. This fixes a few places in the code
which were not properly selecting the 8-bit-immediate opcodes.
Modified:
llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=104091&r1=104090&r2=104091&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Tue May 18 19:53:19 2010
@@ -517,6 +517,30 @@
return Offset;
}
+static unsigned getSUBriOpcode(unsigned is64Bit, int64_t Imm) {
+ if (is64Bit) {
+ if (isInt<8>(Imm))
+ return X86::SUB64ri8;
+ return X86::SUB64ri32;
+ } else {
+ if (isInt<8>(Imm))
+ return X86::SUB32ri8;
+ return X86::SUB32ri;
+ }
+}
+
+static unsigned getADDriOpcode(unsigned is64Bit, int64_t Imm) {
+ if (is64Bit) {
+ if (isInt<8>(Imm))
+ return X86::ADD64ri8;
+ return X86::ADD64ri32;
+ } else {
+ if (isInt<8>(Imm))
+ return X86::ADD32ri8;
+ return X86::ADD32ri;
+ }
+}
+
void X86RegisterInfo::
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const {
@@ -536,7 +560,7 @@
MachineInstr *New = 0;
if (Old->getOpcode() == getCallFrameSetupOpcode()) {
New = BuildMI(MF, Old->getDebugLoc(),
- TII.get(Is64Bit ? X86::SUB64ri32 : X86::SUB32ri),
+ TII.get(getSUBriOpcode(Is64Bit, Amount)),
StackPtr)
.addReg(StackPtr)
.addImm(Amount);
@@ -548,9 +572,7 @@
Amount -= CalleeAmt;
if (Amount) {
- unsigned Opc = (Amount < 128) ?
- (Is64Bit ? X86::ADD64ri8 : X86::ADD32ri8) :
- (Is64Bit ? X86::ADD64ri32 : X86::ADD32ri);
+ unsigned Opc = getADDriOpcode(Is64Bit, Amount);
New = BuildMI(MF, Old->getDebugLoc(), TII.get(Opc), StackPtr)
.addReg(StackPtr)
.addImm(Amount);
@@ -570,9 +592,7 @@
// something off the stack pointer, add it back. We do this until we have
// more advanced stack pointer tracking ability.
if (uint64_t CalleeAmt = I->getOperand(1).getImm()) {
- unsigned Opc = (CalleeAmt < 128) ?
- (Is64Bit ? X86::SUB64ri8 : X86::SUB32ri8) :
- (Is64Bit ? X86::SUB64ri32 : X86::SUB32ri);
+ unsigned Opc = getSUBriOpcode(Is64Bit, CalleeAmt);
MachineInstr *Old = I;
MachineInstr *New =
BuildMI(MF, Old->getDebugLoc(), TII.get(Opc),
@@ -690,13 +710,9 @@
const TargetInstrInfo &TII) {
bool isSub = NumBytes < 0;
uint64_t Offset = isSub ? -NumBytes : NumBytes;
- unsigned Opc = isSub
- ? ((Offset < 128) ?
- (Is64Bit ? X86::SUB64ri8 : X86::SUB32ri8) :
- (Is64Bit ? X86::SUB64ri32 : X86::SUB32ri))
- : ((Offset < 128) ?
- (Is64Bit ? X86::ADD64ri8 : X86::ADD32ri8) :
- (Is64Bit ? X86::ADD64ri32 : X86::ADD32ri));
+ unsigned Opc = isSub ?
+ getSUBriOpcode(Is64Bit, Offset) :
+ getADDriOpcode(Is64Bit, Offset);
uint64_t Chunk = (1LL << 31) - 1;
DebugLoc DL = MBB.findDebugLoc(MBBI);
@@ -916,7 +932,8 @@
// size is bigger than the callers.
if (TailCallReturnAddrDelta < 0) {
MachineInstr *MI =
- BuildMI(MBB, MBBI, DL, TII.get(Is64Bit? X86::SUB64ri32 : X86::SUB32ri),
+ BuildMI(MBB, MBBI, DL,
+ TII.get(getSUBriOpcode(Is64Bit, -TailCallReturnAddrDelta)),
StackPtr)
.addReg(StackPtr)
.addImm(-TailCallReturnAddrDelta);
From evan.cheng at apple.com Tue May 18 20:08:17 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 19 May 2010 01:08:17 -0000
Subject: [llvm-commits] [llvm] r104094 - in /llvm/trunk:
lib/CodeGen/SelectionDAG/DAGCombiner.cpp test/CodeGen/ARM/vcgt.ll
Message-ID: <20100519010818.115B0312800A@llvm.org>
Author: evancheng
Date: Tue May 18 20:08:17 2010
New Revision: 104094
URL: http://llvm.org/viewvc/llvm-project?rev=104094&view=rev
Log:
Intrinsics which do a vector compare (results are all zero or all ones) are modeled as icmp / fcmp + sext. This is turned into a vsetcc by dag combine (yes, not a good long term solution). The targets can then isel the vsetcc to the appropriate instruction.
The trouble arises when the result of a vector cmp + sext is then and'ed with all ones. Instcombine will turn it into a vector cmp + zext, dag combiner will miss turning it into a vsetcc and hell breaks loose after that.
Teach dag combine to turn a vector cpm + zest into a vsetcc + and 1. This fixes rdar://7923010.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/trunk/test/CodeGen/ARM/vcgt.ll
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=104094&r1=104093&r2=104094&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue May 18 20:08:17 2010
@@ -3570,7 +3570,7 @@
DAG.getVSetCC(N->getDebugLoc(), MatchingVectorType, N0.getOperand(0),
N0.getOperand(1),
cast(N0.getOperand(2))->get());
- return DAG.getSExtOrTrunc(VsetCC, N->getDebugLoc(), VT);
+ return DAG.getSExtOrTrunc(VsetCC, N->getDebugLoc(), VT);
}
}
@@ -3591,9 +3591,7 @@
N0.getOperand(0), N0.getOperand(1),
cast(N0.getOperand(2))->get()),
NegOne, DAG.getConstant(0, VT));
- }
-
-
+ }
// fold (sext x) -> (zext x) if the sign bit is known zero.
if ((!LegalOperations || TLI.isOperationLegal(ISD::ZERO_EXTEND, VT)) &&
@@ -3732,8 +3730,48 @@
}
}
- // zext(setcc x,y,cc) -> select_cc x, y, 1, 0, cc
if (N0.getOpcode() == ISD::SETCC) {
+ if (!LegalOperations && VT.isVector()) {
+ // zext(setcc) -> (and (vsetcc), (1, 1, ...) for vectors.
+ // Only do this before legalize for now.
+ EVT N0VT = N0.getOperand(0).getValueType();
+ EVT EltVT = VT.getVectorElementType();
+ SmallVector OneOps(VT.getVectorNumElements(),
+ DAG.getConstant(1, EltVT));
+ if (VT.getSizeInBits() == N0VT.getSizeInBits()) {
+ // We know that the # elements of the results is the same as the
+ // # elements of the compare (and the # elements of the compare result
+ // for that matter). Check to see that they are the same size. If so,
+ // we know that the element size of the sext'd result matches the
+ // element size of the compare operands.
+ return DAG.getNode(ISD::AND, N->getDebugLoc(), VT,
+ DAG.getVSetCC(N->getDebugLoc(), VT, N0.getOperand(0),
+ N0.getOperand(1),
+ cast(N0.getOperand(2))->get()),
+ DAG.getNode(ISD::BUILD_VECTOR, N->getDebugLoc(), VT,
+ &OneOps[0], OneOps.size()));
+ } else {
+ // If the desired elements are smaller or larger than the source
+ // elements we can use a matching integer vector type and then
+ // truncate/sign extend
+ EVT MatchingElementType =
+ EVT::getIntegerVT(*DAG.getContext(),
+ N0VT.getScalarType().getSizeInBits());
+ EVT MatchingVectorType =
+ EVT::getVectorVT(*DAG.getContext(), MatchingElementType,
+ N0VT.getVectorNumElements());
+ SDValue VsetCC =
+ DAG.getVSetCC(N->getDebugLoc(), MatchingVectorType, N0.getOperand(0),
+ N0.getOperand(1),
+ cast(N0.getOperand(2))->get());
+ return DAG.getNode(ISD::AND, N->getDebugLoc(), VT,
+ DAG.getSExtOrTrunc(VsetCC, N->getDebugLoc(), VT),
+ DAG.getNode(ISD::BUILD_VECTOR, N->getDebugLoc(), VT,
+ &OneOps[0], OneOps.size()));
+ }
+ }
+
+ // zext(setcc x,y,cc) -> select_cc x, y, 1, 0, cc
SDValue SCC =
SimplifySelectCC(N->getDebugLoc(), N0.getOperand(0), N0.getOperand(1),
DAG.getConstant(1, VT), DAG.getConstant(0, VT),
@@ -3889,8 +3927,39 @@
return SDValue(N, 0); // Return N so it doesn't get rechecked!
}
- // aext(setcc x,y,cc) -> select_cc x, y, 1, 0, cc
if (N0.getOpcode() == ISD::SETCC) {
+ // aext(setcc) -> sext_in_reg(vsetcc) for vectors.
+ // Only do this before legalize for now.
+ if (VT.isVector() && !LegalOperations) {
+ EVT N0VT = N0.getOperand(0).getValueType();
+ // We know that the # elements of the results is the same as the
+ // # elements of the compare (and the # elements of the compare result
+ // for that matter). Check to see that they are the same size. If so,
+ // we know that the element size of the sext'd result matches the
+ // element size of the compare operands.
+ if (VT.getSizeInBits() == N0VT.getSizeInBits())
+ return DAG.getVSetCC(N->getDebugLoc(), VT, N0.getOperand(0),
+ N0.getOperand(1),
+ cast(N0.getOperand(2))->get());
+ // If the desired elements are smaller or larger than the source
+ // elements we can use a matching integer vector type and then
+ // truncate/sign extend
+ else {
+ EVT MatchingElementType =
+ EVT::getIntegerVT(*DAG.getContext(),
+ N0VT.getScalarType().getSizeInBits());
+ EVT MatchingVectorType =
+ EVT::getVectorVT(*DAG.getContext(), MatchingElementType,
+ N0VT.getVectorNumElements());
+ SDValue VsetCC =
+ DAG.getVSetCC(N->getDebugLoc(), MatchingVectorType, N0.getOperand(0),
+ N0.getOperand(1),
+ cast(N0.getOperand(2))->get());
+ return DAG.getSExtOrTrunc(VsetCC, N->getDebugLoc(), VT);
+ }
+ }
+
+ // aext(setcc x,y,cc) -> select_cc x, y, 1, 0, cc
SDValue SCC =
SimplifySelectCC(N->getDebugLoc(), N0.getOperand(0), N0.getOperand(1),
DAG.getConstant(1, VT), DAG.getConstant(0, VT),
Modified: llvm/trunk/test/CodeGen/ARM/vcgt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vcgt.ll?rev=104094&r1=104093&r2=104094&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/vcgt.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/vcgt.ll Tue May 18 20:08:17 2010
@@ -158,5 +158,18 @@
ret <4 x i32> %tmp3
}
+; rdar://7923010
+define <4 x i32> @vcgt_zext(<4 x float>* %A, <4 x float>* %B) nounwind {
+;CHECK: vcgt_zext:
+;CHECK: vcgt.f32 q0
+;CHECK: vmov.i32 q1, #0x1
+;CHECK: vand q0, q0, q1
+ %tmp1 = load <4 x float>* %A
+ %tmp2 = load <4 x float>* %B
+ %tmp3 = fcmp ogt <4 x float> %tmp1, %tmp2
+ %tmp4 = zext <4 x i1> %tmp3 to <4 x i32>
+ ret <4 x i32> %tmp4
+}
+
declare <2 x i32> @llvm.arm.neon.vacgtd(<2 x float>, <2 x float>) nounwind readnone
declare <4 x i32> @llvm.arm.neon.vacgtq(<4 x float>, <4 x float>) nounwind readnone
From gohman at apple.com Tue May 18 20:21:35 2010
From: gohman at apple.com (Dan Gohman)
Date: Wed, 19 May 2010 01:21:35 -0000
Subject: [llvm-commits] [llvm] r104095 - /llvm/trunk/lib/Support/Timer.cpp
Message-ID: <20100519012135.11CBB312800A@llvm.org>
Author: djg
Date: Tue May 18 20:21:34 2010
New Revision: 104095
URL: http://llvm.org/viewvc/llvm-project?rev=104095&view=rev
Log:
Add a comment explaining why this code uses Append mode.
Modified:
llvm/trunk/lib/Support/Timer.cpp
Modified: llvm/trunk/lib/Support/Timer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Timer.cpp?rev=104095&r1=104094&r2=104095&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Timer.cpp (original)
+++ llvm/trunk/lib/Support/Timer.cpp Tue May 18 20:21:34 2010
@@ -61,6 +61,10 @@
if (OutputFilename == "-")
return new raw_fd_ostream(1, false); // stdout.
+ // Append mode is used because the info output file is opened and closed
+ // each time -stats or -time-passes wants to print output to it. To
+ // compensate for this, the test-suite Makefiles have code to delete the
+ // info output file before running commands which write to it.
std::string Error;
raw_ostream *Result = new raw_fd_ostream(OutputFilename.c_str(),
Error, raw_fd_ostream::F_Append);
From evan.cheng at apple.com Tue May 18 20:52:25 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 19 May 2010 01:52:25 -0000
Subject: [llvm-commits] [llvm] r104102 - in /llvm/trunk/lib/Target/ARM:
ARMInstrInfo.td ARMInstrThumb.td ARMInstrThumb2.td
Message-ID: <20100519015226.005EF312800A@llvm.org>
Author: evancheng
Date: Tue May 18 20:52:25 2010
New Revision: 104102
URL: http://llvm.org/viewvc/llvm-project?rev=104102&view=rev
Log:
Mark a few more pattern-less instructions with neverHasSideEffects. This is especially important on instructions like t2LEApcreal which are prime candidate for machine LICM.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=104102&r1=104101&r2=104102&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue May 18 20:52:25 2010
@@ -848,6 +848,7 @@
// LEApcrel - Load a pc-relative address into a register without offending the
// assembler.
+let neverHasSideEffects = 1 in {
def LEApcrel : AXI1<0x0, (outs GPR:$dst), (ins i32imm:$label, pred:$p),
Pseudo, IIC_iALUi,
!strconcat(!strconcat(".set ${:private}PCRELV${:uid}, ($label-(",
@@ -867,6 +868,7 @@
[]> {
let Inst{25} = 1;
}
+} // neverHasSideEffects
//===----------------------------------------------------------------------===//
// Control Flow Instructions.
@@ -2203,6 +2205,7 @@
// Conditional moves
// FIXME: should be able to write a pattern for ARMcmov, but can't use
// a two-value operand where a dag node expects two operands. :(
+let neverHasSideEffects = 1 in {
def MOVCCr : AI1<0b1101, (outs GPR:$dst), (ins GPR:$false, GPR:$true), DPFrm,
IIC_iCMOVr, "mov", "\t$dst, $true",
[/*(set GPR:$dst, (ARMcmov GPR:$false, GPR:$true, imm:$cc, CCR:$ccr))*/]>,
@@ -2226,6 +2229,7 @@
RegConstraint<"$false = $dst">, UnaryDP {
let Inst{25} = 1;
}
+} // neverHasSideEffects
//===----------------------------------------------------------------------===//
// Atomic operations intrinsics
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb.td?rev=104102&r1=104101&r2=104102&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Tue May 18 20:52:25 2010
@@ -875,6 +875,7 @@
// 16-bit movcc in IT blocks for Thumb2.
+let neverHasSideEffects = 1 in {
def tMOVCCr : T1pIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs), IIC_iCMOVr,
"mov", "\t$dst, $rhs", []>,
T1Special<{1,0,?,?}>;
@@ -882,9 +883,11 @@
def tMOVCCi : T1pIt<(outs tGPR:$dst), (ins tGPR:$lhs, i32imm:$rhs), IIC_iCMOVi,
"mov", "\t$dst, $rhs", []>,
T1General<{1,0,0,?,?}>;
+} // neverHasSideEffects
// tLEApcrel - Load a pc-relative address into a register without offending the
// assembler.
+let neverHasSideEffects = 1 in {
def tLEApcrel : T1I<(outs tGPR:$dst), (ins i32imm:$label, pred:$p), IIC_iALUi,
"adr$p\t$dst, #$label", []>,
T1Encoding<{1,0,1,0,0,?}>; // A6.2 & A8.6.10
@@ -893,6 +896,7 @@
(ins i32imm:$label, nohash_imm:$id, pred:$p),
IIC_iALUi, "adr$p\t$dst, #${label}_${id}", []>,
T1Encoding<{1,0,1,0,0,?}>; // A6.2 & A8.6.10
+} // neverHasSideEffects
//===----------------------------------------------------------------------===//
// TLS Instructions
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=104102&r1=104101&r2=104102&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Tue May 18 20:52:25 2010
@@ -777,6 +777,7 @@
// LEApcrel - Load a pc-relative address into a register without offending the
// assembler.
+let neverHasSideEffects = 1 in {
def t2LEApcrel : T2XI<(outs GPR:$dst), (ins i32imm:$label, pred:$p), IIC_iALUi,
"adr$p.w\t$dst, #$label", []> {
let Inst{31-27} = 0b11110;
@@ -798,6 +799,7 @@
let Inst{19-16} = 0b1111; // Rn
let Inst{15} = 0;
}
+} // neverHasSideEffects
// ADD r, sp, {so_imm|i12}
def t2ADDrSPi : T2sI<(outs GPR:$dst), (ins GPR:$sp, t2_so_imm:$imm),
@@ -2143,6 +2145,7 @@
// Conditional moves
// FIXME: should be able to write a pattern for ARMcmov, but can't use
// a two-value operand where a dag node expects two operands. :(
+let neverHasSideEffects = 1 in {
def t2MOVCCr : T2I<(outs GPR:$dst), (ins GPR:$false, GPR:$true), IIC_iCMOVr,
"mov", ".w\t$dst, $true",
[/*(set GPR:$dst, (ARMcmov GPR:$false, GPR:$true, imm:$cc, CCR:$ccr))*/]>,
@@ -2194,6 +2197,7 @@
(ins GPR:$false, GPR:$true, i32imm:$rhs),
IIC_iCMOVsi, "ror", ".w\t$dst, $true, $rhs", []>,
RegConstraint<"$false = $dst">;
+} // neverHasSideEffects
//===----------------------------------------------------------------------===//
// Atomic operations intrinsics
From daniel at zuster.org Tue May 18 23:31:36 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Wed, 19 May 2010 04:31:36 -0000
Subject: [llvm-commits] [llvm] r104108 -
/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Message-ID: <20100519043136.77B54312800A@llvm.org>
Author: ddunbar
Date: Tue May 18 23:31:36 2010
New Revision: 104108
URL: http://llvm.org/viewvc/llvm-project?rev=104108&view=rev
Log:
MC/X86: Strip spurious operands from CALL64r as we do for CALL64pcrel32, to
avoid same prefix byte problem as in r104062.
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=104108&r1=104107&r2=104108&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Tue May 18 23:31:36 2010
@@ -329,18 +329,20 @@
LowerSubReg32_Op0(OutMI, X86::MOV32r0); // MOV64r0 -> MOV32r0
LowerUnaryToTwoAddr(OutMI, X86::XOR32rr); // MOV32r0 -> XOR32rr
break;
-
- // CALL64pcrel32 - This instruction has register inputs modeled as normal
- // uses instead of implicit uses. As such, truncate off all but the first
- // operand (the callee). FIXME: Change isel.
+
+ // CALL64r, CALL64pcrel32 - These instructions have register inputs modeled as
+ // normal uses instead of implicit uses. As such, truncate off all but the
+ // first operand (the callee). FIXME: Change isel.
+ case X86::CALL64r:
case X86::CALL64pcrel32: {
+ unsigned Opcode = OutMI.getOpcode();
MCOperand Saved = OutMI.getOperand(0);
OutMI = MCInst();
- OutMI.setOpcode(X86::CALL64pcrel32);
+ OutMI.setOpcode(Opcode);
OutMI.addOperand(Saved);
break;
}
-
+
// The assembler backend wants to see branches in their small form and relax
// them to their large form. The JIT can only handle the large form because
// it does not do relaxation. For now, translate the large form to the
From baldrick at free.fr Wed May 19 00:57:20 2010
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 19 May 2010 05:57:20 -0000
Subject: [llvm-commits] [dragonegg] r104109 - /dragonegg/trunk/llvm-debug.cpp
Message-ID: <20100519055720.11CAD312800A@llvm.org>
Author: baldrick
Date: Wed May 19 00:57:19 2010
New Revision: 104109
URL: http://llvm.org/viewvc/llvm-project?rev=104109&view=rev
Log:
Port commit 102745 (dpatel) from llvm-gcc:
Include isArtificial and isOoptimized flags in subprogram debug info.
Modified:
dragonegg/trunk/llvm-debug.cpp
Modified: dragonegg/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.cpp?rev=104109&r1=104108&r2=104109&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Wed May 19 00:57:19 2010
@@ -318,8 +318,8 @@
FNType,
Fn->hasInternalLinkage(),
true /*definition*/,
- Virtuality, VIndex, ContainingType);
-
+ Virtuality, VIndex, ContainingType,
+ DECL_ARTIFICIAL (FnDecl), optimize);
SPCache[FnDecl] = WeakVH(SP);
@@ -926,7 +926,7 @@
getOrCreateFile(MemLoc.file),
MemLoc.line, SPTy, false, false,
Virtuality, VIndex, ContainingType,
- DECL_ARTIFICIAL (Member));
+ DECL_ARTIFICIAL (Member), optimize);
EltTys.push_back(SP);
SPCache[Member] = WeakVH(SP);
}
From evan.cheng at apple.com Wed May 19 01:06:09 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 19 May 2010 06:06:09 -0000
Subject: [llvm-commits] [llvm] r104110 -
/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
Message-ID: <20100519060609.CCD60312800A@llvm.org>
Author: evancheng
Date: Wed May 19 01:06:09 2010
New Revision: 104110
URL: http://llvm.org/viewvc/llvm-project?rev=104110&view=rev
Log:
Target instruction selection should copy memoperands.
Modified:
llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=104110&r1=104109&r2=104110&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Wed May 19 01:06:09 2010
@@ -2050,8 +2050,12 @@
SDValue Pred = getAL(CurDAG);
SDValue PredReg = CurDAG->getRegister(0, MVT::i32);
SDValue Ops[] = { N->getOperand(1), AM5Opc, Pred, PredReg, Chain };
- return CurDAG->getMachineNode(ARM::VLDMQ, dl, MVT::v2f64, MVT::Other,
- Ops, 5);
+ MachineSDNode::mmo_iterator MemOp = MF->allocateMemRefsArray(1);
+ MemOp[0] = cast(N)->getMemOperand();
+ SDNode *Ret = CurDAG->getMachineNode(ARM::VLDMQ, dl,
+ MVT::v2f64, MVT::Other, Ops, 5);
+ cast(Ret)->setMemRefs(MemOp, MemOp + 1);
+ return Ret;
}
// Other cases are autogenerated.
break;
@@ -2067,7 +2071,11 @@
SDValue PredReg = CurDAG->getRegister(0, MVT::i32);
SDValue Ops[] = { N->getOperand(1), N->getOperand(2),
AM5Opc, Pred, PredReg, Chain };
- return CurDAG->getMachineNode(ARM::VSTMQ, dl, MVT::Other, Ops, 6);
+ MachineSDNode::mmo_iterator MemOp = MF->allocateMemRefsArray(1);
+ MemOp[0] = cast(N)->getMemOperand();
+ SDNode *Ret = CurDAG->getMachineNode(ARM::VSTMQ, dl, MVT::Other, Ops, 6);
+ cast(Ret)->setMemRefs(MemOp, MemOp + 1);
+ return Ret;
}
// Other cases are autogenerated.
break;
From evan.cheng at apple.com Wed May 19 01:07:03 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 19 May 2010 06:07:03 -0000
Subject: [llvm-commits] [llvm] r104111 - in /llvm/trunk/lib/Target/ARM:
ARMInstrInfo.td ARMInstrNEON.td ARMInstrThumb.td ARMInstrThumb2.td
ARMInstrVFP.td
Message-ID: <20100519060703.79BBE312800A@llvm.org>
Author: evancheng
Date: Wed May 19 01:07:03 2010
New Revision: 104111
URL: http://llvm.org/viewvc/llvm-project?rev=104111&view=rev
Log:
Mark pattern-less mayLoad / mayStore instructions neverHasSideEffects. These do not have other un-modeled side effects.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
llvm/trunk/lib/Target/ARM/ARMInstrNEON.td
llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=104111&r1=104110&r2=104111&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Wed May 19 01:07:03 2010
@@ -1141,7 +1141,8 @@
[(set GPR:$dst, (load addrmode2:$addr))]>;
// Special LDR for loads from non-pc-relative constpools.
-let canFoldAsLoad = 1, mayLoad = 1, isReMaterializable = 1 in
+let canFoldAsLoad = 1, mayLoad = 1, neverHasSideEffects = 1,
+ isReMaterializable = 1 in
def LDRcp : AI2ldw<(outs GPR:$dst), (ins addrmode2:$addr), LdFrm, IIC_iLoadr,
"ldr", "\t$dst, $addr", []>;
@@ -1163,7 +1164,7 @@
IIC_iLoadr, "ldrsb", "\t$dst, $addr",
[(set GPR:$dst, (sextloadi8 addrmode3:$addr))]>;
-let mayLoad = 1, hasExtraDefRegAllocReq = 1 in {
+let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
// Load doubleword
def LDRD : AI3ldd<(outs GPR:$dst1, GPR:$dst2), (ins addrmode3:$addr), LdMiscFrm,
IIC_iLoadr, "ldrd", "\t$dst1, $addr",
@@ -1222,7 +1223,7 @@
"ldrd", "\t$dst1, $dst2, [$base], $offset", "$base = $base_wb", []>,
Requires<[IsARM, HasV5TE]>;
-}
+} // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
// LDRT, LDRBT, LDRSBT, LDRHT, LDRSHT are for disassembly only.
@@ -1271,7 +1272,7 @@
[(truncstorei8 GPR:$src, addrmode2:$addr)]>;
// Store doubleword
-let mayStore = 1, hasExtraSrcRegAllocReq = 1 in
+let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in
def STRD : AI3std<(outs), (ins GPR:$src1, GPR:$src2, addrmode3:$addr),
StMiscFrm, IIC_iStorer,
"strd", "\t$src1, $addr", []>, Requires<[IsARM, HasV5TE]>;
@@ -1363,7 +1364,7 @@
// Load / store multiple Instructions.
//
-let mayLoad = 1, hasExtraDefRegAllocReq = 1 in {
+let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
def LDM : AXI4ld<(outs), (ins addrmode4:$addr, pred:$p,
reglist:$dsts, variable_ops),
IndexModeNone, LdStMulFrm, IIC_iLoadm,
@@ -1374,9 +1375,9 @@
IndexModeUpd, LdStMulFrm, IIC_iLoadm,
"ldm${addr:submode}${p}\t$addr!, $dsts",
"$addr.addr = $wb", []>;
-} // mayLoad, hasExtraDefRegAllocReq
+} // mayLoad, neverHasSideEffects, hasExtraDefRegAllocReq
-let mayStore = 1, hasExtraSrcRegAllocReq = 1 in {
+let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
def STM : AXI4st<(outs), (ins addrmode4:$addr, pred:$p,
reglist:$srcs, variable_ops),
IndexModeNone, LdStMulFrm, IIC_iStorem,
@@ -1387,7 +1388,7 @@
IndexModeUpd, LdStMulFrm, IIC_iStorem,
"stm${addr:submode}${p}\t$addr!, $srcs",
"$addr.addr = $wb", []>;
-} // mayStore, hasExtraSrcRegAllocReq
+} // mayStore, neverHasSideEffects, hasExtraSrcRegAllocReq
//===----------------------------------------------------------------------===//
// Move Instructions.
Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=104111&r1=104110&r2=104111&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Wed May 19 01:07:03 2010
@@ -115,7 +115,7 @@
// NEON load / store instructions
//===----------------------------------------------------------------------===//
-let mayLoad = 1 in {
+let mayLoad = 1, neverHasSideEffects = 1 in {
// Use vldmia to load a Q register as a D register pair.
// This is equivalent to VLDMD except that it has a Q register operand
// instead of a pair of D registers.
@@ -130,9 +130,9 @@
def VLD1q
: NLdSt<0,0b10,0b1010,0b1100, (outs QPR:$dst), (ins addrmode6:$addr),
IIC_VLD1, "vld1", "64", "${dst:dregpair}, $addr", "", []>;
-} // mayLoad = 1
+} // mayLoad = 1, neverHasSideEffects = 1
-let mayStore = 1 in {
+let mayStore = 1, neverHasSideEffects = 1 in {
// Use vstmia to store a Q register as a D register pair.
// This is equivalent to VSTMD except that it has a Q register operand
// instead of a pair of D registers.
@@ -147,9 +147,9 @@
def VST1q
: NLdSt<0,0b00,0b1010,0b1100, (outs), (ins addrmode6:$addr, QPR:$src),
IIC_VST, "vst1", "64", "${src:dregpair}, $addr", "", []>;
-} // mayStore = 1
+} // mayStore = 1, neverHasSideEffects = 1
-let mayLoad = 1, hasExtraDefRegAllocReq = 1 in {
+let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
// VLD1 : Vector Load (multiple single elements)
class VLD1D op7_4, string Dt>
@@ -473,9 +473,9 @@
// VLD3DUP : Vector Load (single 3-element structure to all lanes)
// VLD4DUP : Vector Load (single 4-element structure to all lanes)
// FIXME: Not yet implemented.
-} // mayLoad = 1, hasExtraDefRegAllocReq = 1
+} // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
-let mayStore = 1, hasExtraSrcRegAllocReq = 1 in {
+let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
// VST1 : Vector Store (multiple single elements)
class VST1D op7_4, string Dt>
@@ -788,7 +788,7 @@
def VST4LNq16_UPD : VST4LNWB<0b0111, {?,?,1,?}, "16">;
def VST4LNq32_UPD : VST4LNWB<0b1011, {?,1,?,?}, "32">;
-} // mayStore = 1, hasExtraSrcRegAllocReq = 1
+} // mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb.td?rev=104111&r1=104110&r2=104111&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Wed May 19 01:07:03 2010
@@ -480,7 +480,7 @@
// Special instruction for restore. It cannot clobber condition register
// when it's expanded by eliminateCallFramePseudoInstr().
-let canFoldAsLoad = 1, mayLoad = 1 in
+let canFoldAsLoad = 1, mayLoad = 1, neverHasSideEffects = 1 in
def tRestore : T1pIs<(outs tGPR:$dst), (ins t_addrmode_sp:$addr), IIC_iLoadi,
"ldr", "\t$dst, $addr", []>,
T1LdStSP<{1,?,?}>;
@@ -494,7 +494,8 @@
T1Encoding<{0,1,0,0,1,?}>; // A6.2 & A8.6.59
// Special LDR for loads from non-pc-relative constpools.
-let canFoldAsLoad = 1, mayLoad = 1, isReMaterializable = 1 in
+let canFoldAsLoad = 1, mayLoad = 1, neverHasSideEffects = 1,
+ isReMaterializable = 1 in
def tLDRcp : T1pIs<(outs tGPR:$dst), (ins i32imm:$addr), IIC_iLoadi,
"ldr", "\t$dst, $addr", []>,
T1LdStSP<{1,?,?}>;
@@ -531,7 +532,7 @@
[(store tGPR:$src, t_addrmode_sp:$addr)]>,
T1LdStSP<{0,?,?}>;
-let mayStore = 1 in {
+let mayStore = 1, neverHasSideEffects = 1 in {
// Special instruction for spill. It cannot clobber condition register
// when it's expanded by eliminateCallFramePseudoInstr().
def tSpill : T1pIs<(outs), (ins tGPR:$src, t_addrmode_sp:$addr), IIC_iStorei,
@@ -544,7 +545,7 @@
//
// These requires base address to be written back or one of the loaded regs.
-let mayLoad = 1, hasExtraDefRegAllocReq = 1 in {
+let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
def tLDM : T1I<(outs),
(ins addrmode4:$addr, pred:$p, reglist:$dsts, variable_ops),
IIC_iLoadm,
@@ -557,9 +558,9 @@
"ldm${addr:submode}${p}\t$addr!, $dsts",
"$addr.addr = $wb", []>,
T1Encoding<{1,1,0,0,1,?}>; // A6.2 & A8.6.53
-} // mayLoad, hasExtraDefRegAllocReq
+} // mayLoad, neverHasSideEffects = 1, hasExtraDefRegAllocReq
-let mayStore = 1, hasExtraSrcRegAllocReq = 1 in
+let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in
def tSTM_UPD : T1It<(outs tGPR:$wb),
(ins addrmode4:$addr, pred:$p, reglist:$srcs, variable_ops),
IIC_iStorem,
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=104111&r1=104110&r2=104111&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Wed May 19 01:07:03 2010
@@ -914,7 +914,7 @@
defm t2LDRSH : T2I_ld<1, 0b01, "ldrsh", UnOpFrag<(sextloadi16 node:$Src)>>;
defm t2LDRSB : T2I_ld<1, 0b00, "ldrsb", UnOpFrag<(sextloadi8 node:$Src)>>;
-let mayLoad = 1, hasExtraDefRegAllocReq = 1 in {
+let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
// Load doubleword
def t2LDRDi8 : T2Ii8s4<1, 0, 1, (outs GPR:$dst1, GPR:$dst2),
(ins t2addrmode_imm8s4:$addr),
@@ -924,7 +924,7 @@
"ldrd", "\t$dst1, $addr", []> {
let Inst{19-16} = 0b1111; // Rn
}
-}
+} // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
// zextload i1 -> zextload i8
def : T2Pat<(zextloadi1 t2addrmode_imm12:$addr),
@@ -967,7 +967,7 @@
(t2LDRHpci tconstpool:$addr)>;
// Indexed loads
-let mayLoad = 1 in {
+let mayLoad = 1, neverHasSideEffects = 1 in {
def t2LDR_PRE : T2Iidxldst<0, 0b10, 1, 1, (outs GPR:$dst, GPR:$base_wb),
(ins t2addrmode_imm8:$addr),
AddrModeT2_i8, IndexModePre, IIC_iLoadiu,
@@ -1023,7 +1023,7 @@
AddrModeT2_i8, IndexModePost, IIC_iLoadiu,
"ldrsh", "\t$dst, [$base], $offset", "$base = $base_wb",
[]>;
-}
+} // mayLoad = 1, neverHasSideEffects = 1
// LDRT, LDRBT, LDRHT, LDRSBT, LDRSHT all have offset mode (PUW=0b110) and are
// for disassembly only.
@@ -1053,7 +1053,7 @@
defm t2STRH:T2I_st<0b01,"strh",BinOpFrag<(truncstorei16 node:$LHS, node:$RHS)>>;
// Store doubleword
-let mayLoad = 1, hasExtraSrcRegAllocReq = 1 in
+let mayLoad = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in
def t2STRDi8 : T2Ii8s4<1, 0, 0, (outs),
(ins GPR:$src1, GPR:$src2, t2addrmode_imm8s4:$addr),
IIC_iStorer, "strd", "\t$src1, $addr", []>;
@@ -1216,7 +1216,7 @@
// Load / store multiple Instructions.
//
-let mayLoad = 1, hasExtraDefRegAllocReq = 1 in {
+let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
def t2LDM : T2XI<(outs), (ins addrmode4:$addr, pred:$p,
reglist:$dsts, variable_ops), IIC_iLoadm,
"ldm${addr:submode}${p}${addr:wide}\t$addr, $dsts", []> {
@@ -1239,9 +1239,9 @@
let Inst{21} = 1; // The W bit.
let Inst{20} = 1; // Load
}
-} // mayLoad, hasExtraDefRegAllocReq
+} // mayLoad, neverHasSideEffects, hasExtraDefRegAllocReq
-let mayStore = 1, hasExtraSrcRegAllocReq = 1 in {
+let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
def t2STM : T2XI<(outs), (ins addrmode4:$addr, pred:$p,
reglist:$srcs, variable_ops), IIC_iStorem,
"stm${addr:submode}${p}${addr:wide}\t$addr, $srcs", []> {
@@ -1265,7 +1265,7 @@
let Inst{21} = 1; // The W bit.
let Inst{20} = 0; // Store
}
-} // mayStore, hasExtraSrcRegAllocReq
+} // mayStore, neverHasSideEffects, hasExtraSrcRegAllocReq
//===----------------------------------------------------------------------===//
// Move Instructions.
Modified: llvm/trunk/lib/Target/ARM/ARMInstrVFP.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrVFP.td?rev=104111&r1=104110&r2=104111&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrVFP.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrVFP.td Wed May 19 01:07:03 2010
@@ -76,7 +76,7 @@
// Load / store multiple Instructions.
//
-let mayLoad = 1, hasExtraDefRegAllocReq = 1 in {
+let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
def VLDMD : AXDI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$dsts,
variable_ops), IndexModeNone, IIC_fpLoadm,
"vldm${addr:submode}${p}\t${addr:base}, $dsts", "", []> {
@@ -104,9 +104,9 @@
"$addr.base = $wb", []> {
let Inst{20} = 1;
}
-} // mayLoad, hasExtraDefRegAllocReq
+} // mayLoad, neverHasSideEffects, hasExtraDefRegAllocReq
-let mayStore = 1, hasExtraSrcRegAllocReq = 1 in {
+let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
def VSTMD : AXDI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$srcs,
variable_ops), IndexModeNone, IIC_fpStorem,
"vstm${addr:submode}${p}\t${addr:base}, $srcs", "", []> {
@@ -134,7 +134,7 @@
"$addr.base = $wb", []> {
let Inst{20} = 0;
}
-} // mayStore, hasExtraSrcRegAllocReq
+} // mayStore, neverHasSideEffects, hasExtraSrcRegAllocReq
// FLDMX, FSTMX - mixing S/D registers for pre-armv6 cores
From daniel at zuster.org Wed May 19 01:20:44 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Wed, 19 May 2010 06:20:44 -0000
Subject: [llvm-commits] [llvm] r104112 -
/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Message-ID: <20100519062044.40134312800A@llvm.org>
Author: ddunbar
Date: Wed May 19 01:20:44 2010
New Revision: 104112
URL: http://llvm.org/viewvc/llvm-project?rev=104112&view=rev
Log:
MC/X86: Lower MOV{8,16,32,64}{rm,mr} to fixed-register forms, as appropriate.
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=104112&r1=104111&r2=104112&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Wed May 19 01:20:44 2010
@@ -239,10 +239,44 @@
return;
// If so, rewrite the instruction.
- MCInst New;
- New.setOpcode(Opcode);
- New.addOperand(Inst.getOperand(ImmOp));
- Inst = New;
+ MCOperand Saved = Inst.getOperand(ImmOp);
+ Inst = MCInst();
+ Inst.setOpcode(Opcode);
+ Inst.addOperand(Saved);
+}
+
+/// \brief Simplify things like MOV32rm to MOV32o32a.
+static void SimplifyShortMoveForm(MCInst &Inst, unsigned Opcode) {
+ bool IsStore = Inst.getOperand(0).isReg() && Inst.getOperand(1).isReg();
+ unsigned AddrBase = IsStore;
+ unsigned RegOp = IsStore ? 0 : 5;
+ unsigned AddrOp = AddrBase + 3;
+ assert(Inst.getNumOperands() == 6 && Inst.getOperand(RegOp).isReg() &&
+ Inst.getOperand(AddrBase + 0).isReg() && // base
+ Inst.getOperand(AddrBase + 1).isImm() && // scale
+ Inst.getOperand(AddrBase + 2).isReg() && // index register
+ (Inst.getOperand(AddrOp).isExpr() || // address
+ Inst.getOperand(AddrOp).isImm())&&
+ Inst.getOperand(AddrBase + 4).isReg() && // segment
+ "Unexpected instruction!");
+
+ // Check whether the destination register can be fixed.
+ unsigned Reg = Inst.getOperand(RegOp).getReg();
+ if (Reg != X86::AL && Reg != X86::AX && Reg != X86::EAX && Reg != X86::RAX)
+ return;
+
+ // Check whether this is an absolute address.
+ if (Inst.getOperand(AddrBase + 0).getReg() != 0 ||
+ Inst.getOperand(AddrBase + 2).getReg() != 0 ||
+ Inst.getOperand(AddrBase + 4).getReg() != 0 ||
+ Inst.getOperand(AddrBase + 1).getImm() != 1)
+ return;
+
+ // If so, rewrite the instruction.
+ MCOperand Saved = Inst.getOperand(AddrOp);
+ Inst = MCInst();
+ Inst.setOpcode(Opcode);
+ Inst.addOperand(Saved);
}
void X86MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
@@ -370,12 +404,19 @@
// now.
//
// Note, we are currently not handling the following instructions:
- // MOV8ao8, MOV8o8a
- // MOV16ao16, MOV16o16a
- // MOV32ao32, MOV32o32a
- // MOV64ao64, MOV64ao8
- // MOV64o64a, MOV64o8a
+ // MOV64ao8, MOV64o8a
// XCHG16ar, XCHG32ar, XCHG64ar
+ case X86::MOV8mr_NOREX:
+ case X86::MOV8mr: SimplifyShortMoveForm(OutMI, X86::MOV8ao8); break;
+ case X86::MOV8rm_NOREX:
+ case X86::MOV8rm: SimplifyShortMoveForm(OutMI, X86::MOV8o8a); break;
+ case X86::MOV16mr: SimplifyShortMoveForm(OutMI, X86::MOV16ao16); break;
+ case X86::MOV16rm: SimplifyShortMoveForm(OutMI, X86::MOV16o16a); break;
+ case X86::MOV32mr: SimplifyShortMoveForm(OutMI, X86::MOV32ao32); break;
+ case X86::MOV32rm: SimplifyShortMoveForm(OutMI, X86::MOV32o32a); break;
+ case X86::MOV64mr: SimplifyShortMoveForm(OutMI, X86::MOV64ao64); break;
+ case X86::MOV64rm: SimplifyShortMoveForm(OutMI, X86::MOV64o64a); break;
+
case X86::ADC8ri: SimplifyShortImmForm(OutMI, X86::ADC8i8); break;
case X86::ADC16ri: SimplifyShortImmForm(OutMI, X86::ADC16i16); break;
case X86::ADC32ri: SimplifyShortImmForm(OutMI, X86::ADC32i32); break;
From grosser at fim.uni-passau.de Wed May 19 02:00:18 2010
From: grosser at fim.uni-passau.de (Tobias Grosser)
Date: Wed, 19 May 2010 07:00:18 -0000
Subject: [llvm-commits] [llvm] r104113 - /llvm/trunk/docs/GettingStarted.html
Message-ID: <20100519070018.20A00312800A@llvm.org>
Author: grosser
Date: Wed May 19 02:00:17 2010
New Revision: 104113
URL: http://llvm.org/viewvc/llvm-project?rev=104113&view=rev
Log:
Update autoconf/automake versions in the documentation to match the versions used in Autogen.sh
Modified:
llvm/trunk/docs/GettingStarted.html
Modified: llvm/trunk/docs/GettingStarted.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GettingStarted.html?rev=104113&r1=104112&r2=104113&view=diff
==============================================================================
--- llvm/trunk/docs/GettingStarted.html (original)
+++ llvm/trunk/docs/GettingStarted.html Wed May 19 02:00:17 2010
@@ -452,8 +452,8 @@
Only needed if you want to run the automated test
suite in the llvm/test directory.
If you want to make changes to the configure scripts,
- you will need GNU autoconf (2.59), and consequently, GNU M4 (version 1.4
- or higher). You will also need automake (1.9.2). We only use aclocal
+ you will need GNU autoconf (2.60), and consequently, GNU M4 (version 1.4
+ or higher). You will also need automake (1.9.6). We only use aclocal
from that package.
From evan.cheng at apple.com Wed May 19 02:26:50 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 19 May 2010 07:26:50 -0000
Subject: [llvm-commits] [llvm] r104114 -
/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
Message-ID: <20100519072650.A1CAB312800A@llvm.org>
Author: evancheng
Date: Wed May 19 02:26:50 2010
New Revision: 104114
URL: http://llvm.org/viewvc/llvm-project?rev=104114&view=rev
Log:
Use 'adr' for LEApcrel and LEApcrel. Mark LEApcrel re-materializable.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=104114&r1=104113&r2=104114&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Wed May 19 02:26:50 2010
@@ -849,23 +849,15 @@
// LEApcrel - Load a pc-relative address into a register without offending the
// assembler.
let neverHasSideEffects = 1 in {
+let isReMaterializable = 1 in
def LEApcrel : AXI1<0x0, (outs GPR:$dst), (ins i32imm:$label, pred:$p),
Pseudo, IIC_iALUi,
- !strconcat(!strconcat(".set ${:private}PCRELV${:uid}, ($label-(",
- "${:private}PCRELL${:uid}+8))\n"),
- !strconcat("${:private}PCRELL${:uid}:\n\t",
- "add$p\t$dst, pc, #${:private}PCRELV${:uid}")),
- []>;
+ "adr$p\t$dst, #$label", []>;
def LEApcrelJT : AXI1<0x0, (outs GPR:$dst),
(ins i32imm:$label, nohash_imm:$id, pred:$p),
- Pseudo, IIC_iALUi,
- !strconcat(!strconcat(".set ${:private}PCRELV${:uid}, "
- "(${label}_${id}-(",
- "${:private}PCRELL${:uid}+8))\n"),
- !strconcat("${:private}PCRELL${:uid}:\n\t",
- "add$p\t$dst, pc, #${:private}PCRELV${:uid}")),
- []> {
+ Pseudo, IIC_iALUi,
+ "adr$p\t$dst, #${label}_${id}", []> {
let Inst{25} = 1;
}
} // neverHasSideEffects
From evan.cheng at apple.com Wed May 19 02:28:01 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 19 May 2010 07:28:01 -0000
Subject: [llvm-commits] [llvm] r104115 - in /llvm/trunk:
lib/Target/ARM/ARMInstrThumb.td lib/Target/ARM/ARMInstrThumb2.td
test/CodeGen/Thumb2/machine-licm.ll
Message-ID: <20100519072801.C552C312800A@llvm.org>
Author: evancheng
Date: Wed May 19 02:28:01 2010
New Revision: 104115
URL: http://llvm.org/viewvc/llvm-project?rev=104115&view=rev
Log:
t2LEApcrel and tLEApcrel are re-materializable. This makes it possible to hoist more loads during machine LICM.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb.td?rev=104115&r1=104114&r2=104115&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Wed May 19 02:28:01 2010
@@ -889,6 +889,7 @@
// tLEApcrel - Load a pc-relative address into a register without offending the
// assembler.
let neverHasSideEffects = 1 in {
+let isReMaterializable = 1 in
def tLEApcrel : T1I<(outs tGPR:$dst), (ins i32imm:$label, pred:$p), IIC_iALUi,
"adr$p\t$dst, #$label", []>,
T1Encoding<{1,0,1,0,0,?}>; // A6.2 & A8.6.10
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=104115&r1=104114&r2=104115&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Wed May 19 02:28:01 2010
@@ -778,6 +778,7 @@
// LEApcrel - Load a pc-relative address into a register without offending the
// assembler.
let neverHasSideEffects = 1 in {
+let isReMaterializable = 1 in
def t2LEApcrel : T2XI<(outs GPR:$dst), (ins i32imm:$label, pred:$p), IIC_iALUi,
"adr$p.w\t$dst, #$label", []> {
let Inst{31-27} = 0b11110;
Modified: llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll?rev=104115&r1=104114&r2=104115&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll Wed May 19 02:28:01 2010
@@ -1,5 +1,5 @@
-; RUN: llc < %s -mtriple=thumbv7-apple-darwin -disable-fp-elim | FileCheck %s
-; RUN: llc < %s -mtriple=thumbv7-apple-darwin -relocation-model=pic -disable-fp-elim | FileCheck %s --check-prefix=PIC
+; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -disable-fp-elim | FileCheck %s
+; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -relocation-model=pic -disable-fp-elim | FileCheck %s --check-prefix=PIC
; rdar://7353541
; rdar://7354376
@@ -8,9 +8,9 @@
@GV = external global i32 ; [#uses=2]
-define arm_apcscc void @t(i32* nocapture %vals, i32 %c) nounwind {
+define arm_apcscc void @t1(i32* nocapture %vals, i32 %c) nounwind {
entry:
-; CHECK: t:
+; CHECK: t1:
; CHECK: cbz
%0 = icmp eq i32 %c, 0 ; [#uses=1]
br i1 %0, label %return, label %bb.nph
@@ -22,8 +22,7 @@
; CHECK: ldr r3, [r2]
; CHECK: LBB0_2
; CHECK: LCPI0_0:
-; CHECK-NOT: LCPI1_1:
-; CHECK: .section
+; CHECK-NOT: LCPI0_1:
; PIC: BB#1
; PIC: ldr.n r2, LCPI0_0
@@ -51,3 +50,37 @@
return: ; preds = %bb, %entry
ret void
}
+
+; rdar://8001136
+define arm_apcscc void @t2(i8* %ptr1, i8* %ptr2) nounwind {
+entry:
+; CHECK: t2:
+; CHECK: adr r{{.}}, #LCPI1_0
+; CHECK: vldmia r3, {d0,d1}
+ br i1 undef, label %bb1, label %bb2
+
+bb1:
+; CHECK-NEXT: %bb1
+ %indvar = phi i32 [ %indvar.next, %bb1 ], [ 0, %entry ]
+ %tmp1 = shl i32 %indvar, 2
+ %gep1 = getelementptr i8* %ptr1, i32 %tmp1
+ %tmp2 = call <4 x float> @llvm.arm.neon.vld1.v4f32(i8* %gep1)
+ %tmp3 = call <4 x float> @llvm.arm.neon.vmaxs.v4f32(<4 x float> , <4 x float> %tmp2)
+ %gep2 = getelementptr i8* %ptr2, i32 %tmp1
+ call void @llvm.arm.neon.vst1.v4f32(i8* %gep2, <4 x float> %tmp3)
+ %indvar.next = add i32 %indvar, 1
+ %cond = icmp eq i32 %indvar.next, 10
+ br i1 %cond, label %bb2, label %bb1
+
+bb2:
+ ret void
+}
+
+; CHECK: LCPI1_0:
+; CHECK: .section
+
+declare <4 x float> @llvm.arm.neon.vld1.v4f32(i8*) nounwind readonly
+
+declare void @llvm.arm.neon.vst1.v4f32(i8*, <4 x float>) nounwind
+
+declare <4 x float> @llvm.arm.neon.vmaxs.v4f32(<4 x float>, <4 x float>) nounwind readnone
From daniel at zuster.org Wed May 19 03:07:12 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Wed, 19 May 2010 08:07:12 -0000
Subject: [llvm-commits] [llvm] r104116 -
/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Message-ID: <20100519080712.DF831312800A@llvm.org>
Author: ddunbar
Date: Wed May 19 03:07:12 2010
New Revision: 104116
URL: http://llvm.org/viewvc/llvm-project?rev=104116&view=rev
Log:
MC/X86: Strip spurious operands from TAILJMPr64 as we do for CALL64r and
CALL64pcrel32, for the same reason.
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=104116&r1=104115&r2=104116&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Wed May 19 03:07:12 2010
@@ -364,9 +364,11 @@
LowerUnaryToTwoAddr(OutMI, X86::XOR32rr); // MOV32r0 -> XOR32rr
break;
- // CALL64r, CALL64pcrel32 - These instructions have register inputs modeled as
- // normal uses instead of implicit uses. As such, truncate off all but the
- // first operand (the callee). FIXME: Change isel.
+ // TAILJMPr, TAILJMPr64, CALL64r, CALL64pcrel32 - These instructions have
+ // register inputs modeled as normal uses instead of implicit uses. As such,
+ // truncate off all but the first operand (the callee). FIXME: Change isel.
+ case X86::TAILJMPr:
+ case X86::TAILJMPr64:
case X86::CALL64r:
case X86::CALL64pcrel32: {
unsigned Opcode = OutMI.getOpcode();
From matti.niemenmaa+llvm at iki.fi Wed May 19 07:07:28 2010
From: matti.niemenmaa+llvm at iki.fi (Matti Niemenmaa)
Date: Wed, 19 May 2010 15:07:28 +0300
Subject: [llvm-commits] [PATCH] InstCombine: remove malloc+free if
malloc's only uses are comparisons to null
In-Reply-To:
References: <4BF02485.2050508@iki.fi> <4BF1088E.30805@free.fr>
Message-ID:
On 2010-05-17 14:07, Matti Niemenmaa wrote:
> The code in InstCombineCompares.cpp makes me wonder whether we should be
> operating on the malloc call to begin with? That is, move this 'malloc +
> [icmps] + [free]' removal from visitFree and InstCombineCompares.cpp to
> a new InstCombiner::visitMalloc function which would be called like
> visitFree currently is, from InstCombiner::visitCallInst.
I did this and the other mentioned changes: replacing the icmps directly
instead of changing their operands and only working on icmp eq/ne
instead of all kinds of icmp.
Updated patch attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: instcombine-mallocs-only-null-compared-against.patch
Type: text/x-patch
Size: 6787 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100519/2e10eeb0/attachment.bin
From baldrick at free.fr Wed May 19 08:49:13 2010
From: baldrick at free.fr (Duncan Sands)
Date: Wed, 19 May 2010 13:49:13 -0000
Subject: [llvm-commits] [dragonegg] r104119 -
/dragonegg/trunk/extras/do_self_strap
Message-ID: <20100519134913.A69AC312800A@llvm.org>
Author: baldrick
Date: Wed May 19 08:49:13 2010
New Revision: 104119
URL: http://llvm.org/viewvc/llvm-project?rev=104119&view=rev
Log:
Installation of gcc seems to have a race. I think what might be happening
is that the installdirs, install-host and install-target targets are being
made in parallel, but the last one assumes that the first one has finished.
Try to work around all such problems by not doing a parallel make install.
Modified:
dragonegg/trunk/extras/do_self_strap
Modified: dragonegg/trunk/extras/do_self_strap
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/extras/do_self_strap?rev=104119&r1=104118&r2=104119&view=diff
==============================================================================
--- dragonegg/trunk/extras/do_self_strap (original)
+++ dragonegg/trunk/extras/do_self_strap Wed May 19 08:49:13 2010
@@ -58,6 +58,7 @@
COMPARE="cmp --ignore-initial=16" # How to compare object files
MAKE="nice -n 20 make -j -l3" # How to run make
+MAKE_INSTALL="nice -n 20 make install" # How to run make install
# Turn off plugin version checking, otherwise the check may fail if all stages
@@ -147,7 +148,7 @@
echo "Installing stage $STAGE GCC"
rm -fr $GCC_INSTALL $GCC_INSTALL_BASE
- $MAKE install
+ $MAKE_INSTALL
if [ "$GCC_INSTALL_BASE" != "$GCC_INSTALL" ] ; then
# Move the just built GCC to its definitive install directory.
mv $GCC_INSTALL_BASE $GCC_INSTALL
From daniel at zuster.org Wed May 19 10:26:43 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Wed, 19 May 2010 15:26:43 -0000
Subject: [llvm-commits] [llvm] r104120 - in /llvm/trunk/lib/Target/X86:
AsmPrinter/X86MCInstLower.cpp X86InstrInfo.td
Message-ID: <20100519152643.A2F32312800A@llvm.org>
Author: ddunbar
Date: Wed May 19 10:26:43 2010
New Revision: 104120
URL: http://llvm.org/viewvc/llvm-project?rev=104120&view=rev
Log:
MC/X86: Lower TAILCALLd[64] to JMP_1, to allow relaxation and to avoid same
prefix byte problem as in r104062.
- As a total hack to keep the TAILCALL markers in the output, which some tests depend on, this invents a new TAILJMP_1 instruction.
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
llvm/trunk/lib/Target/X86/X86InstrInfo.td
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=104120&r1=104119&r2=104120&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Wed May 19 10:26:43 2010
@@ -379,6 +379,16 @@
break;
}
+ // TAILJMPd, TAILJMPd64 - Lower to the correct jump instructions.
+ case X86::TAILJMPd:
+ case X86::TAILJMPd64: {
+ MCOperand Saved = OutMI.getOperand(0);
+ OutMI = MCInst();
+ OutMI.setOpcode(X86::TAILJMP_1);
+ OutMI.addOperand(Saved);
+ break;
+ }
+
// The assembler backend wants to see branches in their small form and relax
// them to their large form. The JIT can only handle the large form because
// it does not do relaxation. For now, translate the large form to the
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=104120&r1=104119&r2=104120&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Wed May 19 10:26:43 2010
@@ -712,6 +712,13 @@
let mayLoad = 1 in
def TAILJMPm : I<0xFF, MRM4m, (outs), (ins i32mem_TC:$dst, variable_ops),
"jmp{l}\t{*}$dst # TAILCALL", []>;
+
+ // FIXME: This is a hack so that MCInst lowering can preserve the TAILCALL
+ // marker on instructions, while still being able to relax.
+ let isCodeGenOnly = 1 in {
+ def TAILJMP_1 : Ii8PCRel<0xEB, RawFrm, (outs), (ins brtarget8:$dst),
+ "jmp\t$dst # TAILCALL", []>;
+ }
}
//===----------------------------------------------------------------------===//
From evan.cheng at apple.com Wed May 19 11:05:18 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 19 May 2010 09:05:18 -0700
Subject: [llvm-commits] [PATCH] Test NEON code generation and
calling convention
In-Reply-To: <89A528FE6DB0FA44877BB2F05B8467180BACA420@ZIPPY.Emea.Arm.com>
References: <89A528FE6DB0FA44877BB2F05B8467180BACA420@ZIPPY.Emea.Arm.com>
Message-ID: <2EDC6B54-0AEB-4E24-BAAA-AF230EB16419@apple.com>
On May 17, 2010, at 8:50 AM, Edmund Grimley-Evans wrote:
> Could this file (vadd2.ll) be added in test/CodeGen/ARM/?
Sure, you can commit it. Do you have more of these unit tests? It would be nice if there is a complete set rather than just adding tests only when they break.
>
> It broke in r103411 and was fixed again in r103854. It would be nice
> to keep it working.
>
> I'm not sure what if any official rules govern how vector quantities
> should be passed as arguments and returned. It appears that vectors of
> less than 64 bits (such as the <2 x i8> in the first example in
> vadd2.ll) currently get passed in R0-R3 rather than Q0-Q3, which leads
> to some ugly code. Is this a bug or a feature?
I think that's due to the Darwin ABI?
Evan
>
> --
> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From hkultala at iki.fi Wed May 19 06:29:17 2010
From: hkultala at iki.fi (Heikki Kultala)
Date: Wed, 19 May 2010 14:29:17 +0300 (EEST)
Subject: [llvm-commits] patch to make addCommonCodeGenPasses virtual
Message-ID:
Our backend(TCE) needs to add some custom passes in
addCommonCodeGenPasses, so we need our own version of that method in our
own TargetMachine implementation class.
However, as the addCommonCodeGenPasses was not virtual, it could not be called
by the addPassesToEmitFile of LLVMTargetMachine, and we had to copy
the implementation of AddPassesToEmitFile to our TargetMachine class,
just to be able to call the correct addCommonCodeGenPasses class.
This patch just adds virtual keyword to definition of addCommonCodeGenPasses,
which allows us to get rid of extra redundant code in our backend, and should
not harm anyone else in any way.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: makeAddCommonCodeGenPassesVirtual.patch
Type: text/x-diff
Size: 659 bytes
Desc:
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100519/c3548f6a/attachment.bin
From deeppatel1987 at gmail.com Wed May 19 11:51:22 2010
From: deeppatel1987 at gmail.com (Sandeep Patel)
Date: Wed, 19 May 2010 16:51:22 +0000
Subject: [llvm-commits] [PATCH] Test NEON code generation and calling
convention
In-Reply-To: <2EDC6B54-0AEB-4E24-BAAA-AF230EB16419@apple.com>
References: <89A528FE6DB0FA44877BB2F05B8467180BACA420@ZIPPY.Emea.Arm.com>
<2EDC6B54-0AEB-4E24-BAAA-AF230EB16419@apple.com>
Message-ID:
On Wed, May 19, 2010 at 4:05 PM, Evan Cheng wrote:
>
> On May 17, 2010, at 8:50 AM, Edmund Grimley-Evans wrote:
>
>> Could this file (vadd2.ll) be added in test/CodeGen/ARM/?
>
> Sure, you can commit it. Do you have more of these unit tests? It would be nice if there is a complete set rather than just adding tests only when they break.
>
>>
>> It broke in r103411 and was fixed again in r103854. It would be nice
>> to keep it working.
>>
>> I'm not sure what if any official rules govern how vector quantities
>> should be passed as arguments and returned. It appears that vectors of
>> less than 64 bits (such as the <2 x i8> in the first example in
>> vadd2.ll) currently get passed in R0-R3 rather than Q0-Q3, which leads
>> to some ugly code. Is this a bug or a feature?
>
> I think that's due to the Darwin ABI?
There's really no coverage in AAPCS of short vectors like this, nor
are they generated by Clang or llvm-gcc.
deep
From daniel at zuster.org Wed May 19 12:20:58 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Wed, 19 May 2010 17:20:58 -0000
Subject: [llvm-commits] [llvm] r104122 -
/llvm/trunk/lib/Target/X86/X86AsmBackend.cpp
Message-ID: <20100519172058.E90F6312800A@llvm.org>
Author: ddunbar
Date: Wed May 19 12:20:58 2010
New Revision: 104122
URL: http://llvm.org/viewvc/llvm-project?rev=104122&view=rev
Log:
MC/X86: Add missing entry for TAILJMP_1 to getRelaxedOpcode().
Modified:
llvm/trunk/lib/Target/X86/X86AsmBackend.cpp
Modified: llvm/trunk/lib/Target/X86/X86AsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmBackend.cpp?rev=104122&r1=104121&r2=104122&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86AsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86AsmBackend.cpp Wed May 19 12:20:58 2010
@@ -76,6 +76,7 @@
case X86::JG_1: return X86::JG_4;
case X86::JLE_1: return X86::JLE_4;
case X86::JL_1: return X86::JL_4;
+ case X86::TAILJMP_1:
case X86::JMP_1: return X86::JMP_4;
case X86::JNE_1: return X86::JNE_4;
case X86::JNO_1: return X86::JNO_4;
From bob.wilson at apple.com Wed May 19 13:48:32 2010
From: bob.wilson at apple.com (Bob Wilson)
Date: Wed, 19 May 2010 18:48:32 -0000
Subject: [llvm-commits] [llvm] r104141 -
/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Message-ID: <20100519184832.D8616312800A@llvm.org>
Author: bwilson
Date: Wed May 19 13:48:32 2010
New Revision: 104141
URL: http://llvm.org/viewvc/llvm-project?rev=104141&view=rev
Log:
When expanding a vector_shuffle, the element type may not be legal and may
need to be promoted. The BUILD_VECTOR and EXTRACT_VECTOR_ELT nodes generated
here already allow the promoted type to be used without further changes, so
just do the promotion. This fixes part of pr7167.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=104141&r1=104140&r2=104141&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed May 19 13:48:32 2010
@@ -2523,6 +2523,8 @@
EVT VT = Node->getValueType(0);
EVT EltVT = VT.getVectorElementType();
+ if (getTypeAction(EltVT) == Promote)
+ EltVT = TLI.getTypeToTransformTo(*DAG.getContext(), EltVT);
unsigned NumElems = VT.getVectorNumElements();
SmallVector Ops;
for (unsigned i = 0; i != NumElems; ++i) {
From bob.wilson at apple.com Wed May 19 13:58:37 2010
From: bob.wilson at apple.com (Bob Wilson)
Date: Wed, 19 May 2010 18:58:37 -0000
Subject: [llvm-commits] [llvm] r104142 -
/llvm/trunk/test/CodeGen/ARM/2010-05-19-Shuffles.ll
Message-ID: <20100519185837.3053D312800A@llvm.org>
Author: bwilson
Date: Wed May 19 13:58:37 2010
New Revision: 104142
URL: http://llvm.org/viewvc/llvm-project?rev=104142&view=rev
Log:
Testcase to go with 104141.
Added:
llvm/trunk/test/CodeGen/ARM/2010-05-19-Shuffles.ll
Added: llvm/trunk/test/CodeGen/ARM/2010-05-19-Shuffles.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2010-05-19-Shuffles.ll?rev=104142&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2010-05-19-Shuffles.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/2010-05-19-Shuffles.ll Wed May 19 13:58:37 2010
@@ -0,0 +1,14 @@
+; RUN: llc < %s -mtriple=armv7-eabi -mcpu=cortex-a8
+; pr7167
+
+define <8 x i8> @f1(<8 x i8> %x) nounwind {
+ %y = shufflevector <8 x i8> %x, <8 x i8> undef,
+ <8 x i32>
+ ret <8 x i8> %y
+}
+
+define <8 x i8> @f2(<8 x i8> %x) nounwind {
+ %y = shufflevector <8 x i8> %x, <8 x i8> undef,
+ <8 x i32>
+ ret <8 x i8> %y
+}
From echristo at apple.com Wed May 19 13:59:38 2010
From: echristo at apple.com (Eric Christopher)
Date: Wed, 19 May 2010 18:59:38 -0000
Subject: [llvm-commits] [llvm] r104143 -
/llvm/trunk/test/FrontendC/2010-05-18-palignr.c
Message-ID: <20100519185938.0A63B312800A@llvm.org>
Author: echristo
Date: Wed May 19 13:59:37 2010
New Revision: 104143
URL: http://llvm.org/viewvc/llvm-project?rev=104143&view=rev
Log:
Attempt to run this test on x86 only.
Modified:
llvm/trunk/test/FrontendC/2010-05-18-palignr.c
Modified: llvm/trunk/test/FrontendC/2010-05-18-palignr.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2010-05-18-palignr.c?rev=104143&r1=104142&r2=104143&view=diff
==============================================================================
--- llvm/trunk/test/FrontendC/2010-05-18-palignr.c (original)
+++ llvm/trunk/test/FrontendC/2010-05-18-palignr.c Wed May 19 13:59:37 2010
@@ -1,4 +1,5 @@
// RUN: %llvmgcc -mssse3 -S -o - %s | llc -mtriple=x86_64-apple-darwin | FileCheck %s
+// XTARGET: x86,i386,i686
#include
From matt at console-pimps.org Wed May 19 14:20:47 2010
From: matt at console-pimps.org (Matt Fleming)
Date: Wed, 19 May 2010 20:20:47 +0100
Subject: [llvm-commits] [PATCH] MC abstraction and stub patches
In-Reply-To: <871vdbspdz.fsf@linux-g6p1.site>
References: <871vdbspdz.fsf@linux-g6p1.site>
Message-ID: <87hbm33dgw.fsf@linux-g6p1.site>
Ping?
On Sun, 16 May 2010 18:55:04 +0100, Matt Fleming wrote:
> Hi,
>
> attached are some patches to try and de-MachO-ify some of the MC code
> and put in some stubs to help with adding ELF support. These general
> cleanups will make adding ELF support easier. I've tried to arrange them
> to take into account the feedback that Daniel gave to the last set of
> patches.
>
> I ran the DejaGNU tests and they still pass with these patches applied.
>
> 0001-type-asm-directive.patch:
> This patch adds support for the ELF .type directive.
>
> 0002-split-elfx86-asmbackend.patch:
> This splits the ELF X86 AsmBackend classes into 64Bit and 32Bit which
> will help when ELF support gets merged as the createObjectWriter
> implementations will differ for 64Bit and 32Bit.
>
> 0003-target-streamer.patch:
> Currently createMachOStreamer is invoked directly in llvm-mc which isn't
> a good idea if we want to be able to use another object file
> format. This patch adds a createStreamer() factory method to the correct
> object file streamer to be instantiated for a given target triple.
>
> 0004-section-abstraction.patch:
>
> Instead of calling getMachOSection() directly when parsing section
> directives we should be asking the streamer backend to create the
> correct section given a section name. One thing I didn't understand when
> writing this patch was exactly how MCAsmStreamer should behave, hence
> the FIXME in MCAsmStreamer::LookupSection(). I've left the current
> behaviour in place, e.g. creating a MachOSection because I couldn't
> think of what else to do. I'm guessing the type of Section doesn't
> really matter?
>
> Comments?
>
> Index: llvm/lib/MC/MCParser/AsmParser.cpp
> ===================================================================
> --- llvm.orig/lib/MC/MCParser/AsmParser.cpp
> +++ llvm/lib/MC/MCParser/AsmParser.cpp
> @@ -13,6 +13,7 @@
>
> #include "llvm/MC/MCParser/AsmParser.h"
> #include "llvm/ADT/SmallString.h"
> +#include "llvm/ADT/StringSwitch.h"
> #include "llvm/ADT/Twine.h"
> #include "llvm/MC/MCContext.h"
> #include "llvm/MC/MCExpr.h"
> @@ -686,6 +687,8 @@ bool AsmParser::ParseStatement() {
> return ParseDirectiveSymbolAttribute(MCSA_Protected);
> if (IDVal == ".reference")
> return ParseDirectiveSymbolAttribute(MCSA_Reference);
> + if (IDVal == ".type")
> + return ParseDirectiveELFType();
> if (IDVal == ".weak")
> return ParseDirectiveSymbolAttribute(MCSA_Weak);
> if (IDVal == ".weak_definition")
> @@ -1241,6 +1244,52 @@ bool AsmParser::ParseDirectiveSymbolAttr
> return false;
> }
>
> +/// ParseDirectiveELFType
> +/// ::= .type identifier , @attribute
> +bool AsmParser::ParseDirectiveELFType() {
> + StringRef Name;
> + if (ParseIdentifier(Name))
> + return TokError("expected identifier in directive");
> +
> + // Handle the identifier as the key symbol.
> + MCSymbol *Sym = CreateSymbol(Name);
> +
> + if (Lexer.isNot(AsmToken::Comma))
> + return TokError("unexpected token in '.type' directive");
> + Lex();
> +
> + if (Lexer.isNot(AsmToken::At))
> + return TokError("expected '@' before type");
> + Lex();
> +
> + StringRef Type;
> + SMLoc TypeLoc;
> +
> + TypeLoc = Lexer.getLoc();
> + if (ParseIdentifier(Type))
> + return TokError("expected symbol type in directive");
> +
> + MCSymbolAttr Attr = StringSwitch(Type)
> + .Case("function", MCSA_ELF_TypeFunction)
> + .Case("object", MCSA_ELF_TypeObject)
> + .Case("tls_object", MCSA_ELF_TypeTLS)
> + .Case("common", MCSA_ELF_TypeCommon)
> + .Case("notype", MCSA_ELF_TypeNoType)
> + .Default(MCSA_Invalid);
> +
> + if (Attr == MCSA_Invalid)
> + return Error(TypeLoc, "unsupported attribute in '.type' directive");
> +
> + if (Lexer.isNot(AsmToken::EndOfStatement))
> + return TokError("unexpected token in '.type' directive");
> +
> + Lex();
> +
> + Out.EmitSymbolAttribute(Sym, Attr);
> +
> + return false;
> +}
> +
> /// ParseDirectiveDarwinSymbolDesc
> /// ::= .desc identifier , expression
> bool AsmParser::ParseDirectiveDarwinSymbolDesc() {
> Index: llvm/include/llvm/MC/MCParser/AsmParser.h
> ===================================================================
> --- llvm.orig/include/llvm/MC/MCParser/AsmParser.h
> +++ llvm/include/llvm/MC/MCParser/AsmParser.h
> @@ -131,6 +131,7 @@ private:
> /// ParseDirectiveSymbolAttribute - Parse a directive like ".globl" which
> /// accepts a single symbol (which should be a label or an external).
> bool ParseDirectiveSymbolAttribute(MCSymbolAttr Attr);
> + bool ParseDirectiveELFType(); // ELF specific ".type"
> bool ParseDirectiveDarwinSymbolDesc(); // Darwin specific ".desc"
> bool ParseDirectiveDarwinLsym(); // Darwin specific ".lsym"
>
> Index: llvm/include/llvm/MC/MCParser/MCAsmLexer.h
> ===================================================================
> --- llvm.orig/include/llvm/MC/MCParser/MCAsmLexer.h
> +++ llvm/include/llvm/MC/MCParser/MCAsmLexer.h
> @@ -47,7 +47,7 @@ public:
> Pipe, PipePipe, Caret,
> Amp, AmpAmp, Exclaim, ExclaimEqual, Percent, Hash,
> Less, LessEqual, LessLess, LessGreater,
> - Greater, GreaterEqual, GreaterGreater
> + Greater, GreaterEqual, GreaterGreater, At
> };
>
> TokenKind Kind;
> Index: llvm/lib/MC/MCParser/AsmLexer.cpp
> ===================================================================
> --- llvm.orig/lib/MC/MCParser/AsmLexer.cpp
> +++ llvm/lib/MC/MCParser/AsmLexer.cpp
> @@ -280,6 +280,7 @@ AsmToken AsmLexer::LexToken() {
> case '*': return AsmToken(AsmToken::Star, StringRef(TokStart, 1));
> case ',': return AsmToken(AsmToken::Comma, StringRef(TokStart, 1));
> case '$': return AsmToken(AsmToken::Dollar, StringRef(TokStart, 1));
> + case '@': return AsmToken(AsmToken::At, StringRef(TokStart, 1));
> case '=':
> if (*CurPtr == '=')
> return ++CurPtr, AsmToken(AsmToken::EqualEqual, StringRef(TokStart, 2));
> Index: llvm/lib/Target/X86/X86AsmBackend.cpp
> ===================================================================
> --- llvm.orig/lib/Target/X86/X86AsmBackend.cpp
> +++ llvm/lib/Target/X86/X86AsmBackend.cpp
> @@ -211,6 +211,18 @@ public:
> }
> };
>
> +class ELFX86_32AsmBackend : public ELFX86AsmBackend {
> +public:
> + ELFX86_32AsmBackend(const Target &T)
> + : ELFX86AsmBackend(T) {}
> +};
> +
> +class ELFX86_64AsmBackend : public ELFX86AsmBackend {
> +public:
> + ELFX86_64AsmBackend(const Target &T)
> + : ELFX86AsmBackend(T) {}
> +};
> +
> class DarwinX86AsmBackend : public X86AsmBackend {
> public:
> DarwinX86AsmBackend(const Target &T)
> @@ -289,7 +301,7 @@ TargetAsmBackend *llvm::createX86_32AsmB
> case Triple::Darwin:
> return new DarwinX86_32AsmBackend(T);
> default:
> - return new ELFX86AsmBackend(T);
> + return new ELFX86_32AsmBackend(T);
> }
> }
>
> @@ -299,6 +311,6 @@ TargetAsmBackend *llvm::createX86_64AsmB
> case Triple::Darwin:
> return new DarwinX86_64AsmBackend(T);
> default:
> - return new ELFX86AsmBackend(T);
> + return new ELFX86_64AsmBackend(T);
> }
> }
> Index: llvm/include/llvm/Target/TargetRegistry.h
> ===================================================================
> --- llvm.orig/include/llvm/Target/TargetRegistry.h
> +++ llvm/include/llvm/Target/TargetRegistry.h
> @@ -73,6 +73,13 @@ namespace llvm {
> typedef MCCodeEmitter *(*CodeEmitterCtorTy)(const Target &T,
> TargetMachine &TM,
> MCContext &Ctx);
> + typedef MCStreamer *(*StreamerCtorTy)(const Target &T,
> + const std::string &TT,
> + MCContext &Ctx,
> + TargetAsmBackend &TAB,
> + raw_ostream &_OS,
> + MCCodeEmitter *_Emitter,
> + bool RelaxAll);
>
> private:
> /// Next - The next registered target in the linked list, maintained by the
> @@ -126,6 +133,10 @@ namespace llvm {
> /// if registered.
> CodeEmitterCtorTy CodeEmitterCtorFn;
>
> + /// StreamerCtorFn - Construction function for this target's Streamer,
> + /// if registered.
> + StreamerCtorTy StreamerCtorFn;
> +
> public:
> /// @name Target Information
> /// @{
> @@ -170,6 +181,9 @@ namespace llvm {
> /// hasCodeEmitter - Check if this target supports instruction encoding.
> bool hasCodeEmitter() const { return CodeEmitterCtorFn != 0; }
>
> + /// hasStreamer - Check if this target supports streaming to files.
> + bool hasStreamer() const { return StreamerCtorFn != 0; }
> +
> /// @}
> /// @name Feature Constructors
> /// @{
> @@ -258,6 +272,24 @@ namespace llvm {
> return CodeEmitterCtorFn(*this, TM, Ctx);
> }
>
> + /// createStreamer - Create a target specific MCStreamer.
> + ///
> + /// \arg TT - The target triple.
> + /// \arg Ctx - The target context.
> + /// \arg TAB - The target assembler backend object.
> + /// \arg _OS - The stream object.
> + /// \arg _Emitter - The target independent assembler object.
> + /// \arg RelaxAll - Relax all fixups?
> + MCStreamer *createStreamer(const std::string &TT, MCContext &Ctx,
> + TargetAsmBackend &TAB,
> + raw_ostream &_OS,
> + MCCodeEmitter *_Emitter,
> + bool RelaxAll) const {
> + if (!StreamerCtorFn)
> + return 0;
> + return StreamerCtorFn(*this, TT, Ctx, TAB, _OS, _Emitter, RelaxAll);
> + }
> +
> /// @}
> };
>
> @@ -479,6 +511,20 @@ namespace llvm {
> T.CodeEmitterCtorFn = Fn;
> }
>
> + /// RegisterStreamer - Register a MCStreamer implementation for the
> + /// given target.
> + ///
> + /// Clients are responsible for ensuring that registration doesn't occur
> + /// while another thread is attempting to access the registry. Typically
> + /// this is done by initializing all targets at program startup.
> + ///
> + /// @param T - The target being registered.
> + /// @param Fn - A function to construct an MCStreamer for the target.
> + static void RegisterStreamer(Target &T, Target::StreamerCtorTy Fn) {
> + if (!T.StreamerCtorFn)
> + T.StreamerCtorFn = Fn;
> + }
> +
> /// @}
> };
>
> Index: llvm/tools/llvm-mc/llvm-mc.cpp
> ===================================================================
> --- llvm.orig/tools/llvm-mc/llvm-mc.cpp
> +++ llvm/tools/llvm-mc/llvm-mc.cpp
> @@ -304,7 +304,8 @@ static int AssembleInput(const char *Pro
> assert(FileType == OFT_ObjectFile && "Invalid file type!");
> CE.reset(TheTarget->createCodeEmitter(*TM, Ctx));
> TAB.reset(TheTarget->createAsmBackend(TripleName));
> - Str.reset(createMachOStreamer(Ctx, *TAB, *Out, CE.get(), RelaxAll));
> + Str.reset(TheTarget->createStreamer(TripleName, Ctx, *TAB,
> + *Out, CE.get(), RelaxAll));
> }
>
> AsmParser Parser(SrcMgr, Ctx, *Str.get(), *MAI);
> Index: llvm/lib/Target/X86/X86TargetMachine.cpp
> ===================================================================
> --- llvm.orig/lib/Target/X86/X86TargetMachine.cpp
> +++ llvm/lib/Target/X86/X86TargetMachine.cpp
> @@ -17,6 +17,8 @@
> #include "llvm/PassManager.h"
> #include "llvm/CodeGen/MachineFunction.h"
> #include "llvm/CodeGen/Passes.h"
> +#include "llvm/MC/MCCodeEmitter.h"
> +#include "llvm/MC/MCStreamer.h"
> #include "llvm/Support/FormattedStream.h"
> #include "llvm/Target/TargetOptions.h"
> #include "llvm/Target/TargetRegistry.h"
> @@ -37,6 +39,18 @@ static MCAsmInfo *createMCAsmInfo(const
> }
> }
>
> +static MCStreamer *createMCStreamer(const Target &T, const std::string &TT,
> + MCContext &Ctx, TargetAsmBackend &TAB,
> + raw_ostream &_OS,
> + MCCodeEmitter *_Emitter,
> + bool RelaxAll) {
> + Triple TheTriple(TT);
> + switch (TheTriple.getOS()) {
> + default:
> + return createMachOStreamer(Ctx, TAB, _OS, _Emitter, RelaxAll);
> + }
> +}
> +
> extern "C" void LLVMInitializeX86Target() {
> // Register the target.
> RegisterTargetMachine X(TheX86_32Target);
> @@ -57,6 +71,12 @@ extern "C" void LLVMInitializeX86Target(
> createX86_32AsmBackend);
> TargetRegistry::RegisterAsmBackend(TheX86_64Target,
> createX86_64AsmBackend);
> +
> + // Register the streamer.
> + TargetRegistry::RegisterStreamer(TheX86_32Target,
> + createMCStreamer);
> + TargetRegistry::RegisterStreamer(TheX86_64Target,
> + createMCStreamer);
> }
>
>
> Index: llvm/lib/MC/MCParser/AsmParser.cpp
> ===================================================================
> --- llvm.orig/lib/MC/MCParser/AsmParser.cpp
> +++ llvm/lib/MC/MCParser/AsmParser.cpp
> @@ -23,6 +23,7 @@
> #include "llvm/MC/MCSymbol.h"
> #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
> #include "llvm/Support/Compiler.h"
> +#include "llvm/Support/ELF.h"
> #include "llvm/Support/SourceMgr.h"
> #include "llvm/Support/raw_ostream.h"
> #include "llvm/Target/TargetAsmParser.h"
> @@ -103,11 +104,9 @@ const AsmToken &AsmParser::Lex() {
> bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
> // Create the initial section, if requested.
> //
> - // FIXME: Target hook & command line option for initial section.
> + // FIXME: Command line option for initial section.
> if (!NoInitialTextSection)
> - Out.SwitchSection(Ctx.getMachOSection("__TEXT", "__text",
> - MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
> - 0, SectionKind::getText()));
> + Out.SwitchSection(Out.LookupSection(".text"));
>
> // Prime the lexer.
> Lex();
> @@ -482,145 +481,28 @@ bool AsmParser::ParseStatement() {
> // FIXME: This should be driven based on a hash lookup and callback.
> if (IDVal == ".section")
> return ParseDirectiveDarwinSection();
> - if (IDVal == ".text")
> - // FIXME: This changes behavior based on the -static flag to the
> - // assembler.
> - return ParseDirectiveSectionSwitch("__TEXT", "__text",
> - MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS);
> - if (IDVal == ".const")
> - return ParseDirectiveSectionSwitch("__TEXT", "__const");
> - if (IDVal == ".static_const")
> - return ParseDirectiveSectionSwitch("__TEXT", "__static_const");
> - if (IDVal == ".cstring")
> - return ParseDirectiveSectionSwitch("__TEXT","__cstring",
> - MCSectionMachO::S_CSTRING_LITERALS);
> - if (IDVal == ".literal4")
> - return ParseDirectiveSectionSwitch("__TEXT", "__literal4",
> - MCSectionMachO::S_4BYTE_LITERALS,
> - 4);
> - if (IDVal == ".literal8")
> - return ParseDirectiveSectionSwitch("__TEXT", "__literal8",
> - MCSectionMachO::S_8BYTE_LITERALS,
> - 8);
> - if (IDVal == ".literal16")
> - return ParseDirectiveSectionSwitch("__TEXT","__literal16",
> - MCSectionMachO::S_16BYTE_LITERALS,
> - 16);
> - if (IDVal == ".constructor")
> - return ParseDirectiveSectionSwitch("__TEXT","__constructor");
> - if (IDVal == ".destructor")
> - return ParseDirectiveSectionSwitch("__TEXT","__destructor");
> - if (IDVal == ".fvmlib_init0")
> - return ParseDirectiveSectionSwitch("__TEXT","__fvmlib_init0");
> - if (IDVal == ".fvmlib_init1")
> - return ParseDirectiveSectionSwitch("__TEXT","__fvmlib_init1");
> -
> - // FIXME: The assembler manual claims that this has the self modify code
> - // flag, at least on x86-32, but that does not appear to be correct.
> - if (IDVal == ".symbol_stub")
> - return ParseDirectiveSectionSwitch("__TEXT","__symbol_stub",
> - MCSectionMachO::S_SYMBOL_STUBS |
> - MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
> - // FIXME: Different on PPC and ARM.
> - 0, 16);
> - // FIXME: PowerPC only?
> - if (IDVal == ".picsymbol_stub")
> - return ParseDirectiveSectionSwitch("__TEXT","__picsymbol_stub",
> - MCSectionMachO::S_SYMBOL_STUBS |
> - MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
> - 0, 26);
> - if (IDVal == ".data")
> - return ParseDirectiveSectionSwitch("__DATA", "__data");
> - if (IDVal == ".static_data")
> - return ParseDirectiveSectionSwitch("__DATA", "__static_data");
> -
> - // FIXME: The section names of these two are misspelled in the assembler
> - // manual.
> - if (IDVal == ".non_lazy_symbol_pointer")
> - return ParseDirectiveSectionSwitch("__DATA", "__nl_symbol_ptr",
> - MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS,
> - 4);
> - if (IDVal == ".lazy_symbol_pointer")
> - return ParseDirectiveSectionSwitch("__DATA", "__la_symbol_ptr",
> - MCSectionMachO::S_LAZY_SYMBOL_POINTERS,
> - 4);
> -
> - if (IDVal == ".dyld")
> - return ParseDirectiveSectionSwitch("__DATA", "__dyld");
> - if (IDVal == ".mod_init_func")
> - return ParseDirectiveSectionSwitch("__DATA", "__mod_init_func",
> - MCSectionMachO::S_MOD_INIT_FUNC_POINTERS,
> - 4);
> - if (IDVal == ".mod_term_func")
> - return ParseDirectiveSectionSwitch("__DATA", "__mod_term_func",
> - MCSectionMachO::S_MOD_TERM_FUNC_POINTERS,
> - 4);
> - if (IDVal == ".const_data")
> - return ParseDirectiveSectionSwitch("__DATA", "__const");
> -
> -
> - if (IDVal == ".objc_class")
> - return ParseDirectiveSectionSwitch("__OBJC", "__class",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_meta_class")
> - return ParseDirectiveSectionSwitch("__OBJC", "__meta_class",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_cat_cls_meth")
> - return ParseDirectiveSectionSwitch("__OBJC", "__cat_cls_meth",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_cat_inst_meth")
> - return ParseDirectiveSectionSwitch("__OBJC", "__cat_inst_meth",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_protocol")
> - return ParseDirectiveSectionSwitch("__OBJC", "__protocol",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_string_object")
> - return ParseDirectiveSectionSwitch("__OBJC", "__string_object",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_cls_meth")
> - return ParseDirectiveSectionSwitch("__OBJC", "__cls_meth",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_inst_meth")
> - return ParseDirectiveSectionSwitch("__OBJC", "__inst_meth",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_cls_refs")
> - return ParseDirectiveSectionSwitch("__OBJC", "__cls_refs",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP |
> - MCSectionMachO::S_LITERAL_POINTERS,
> - 4);
> - if (IDVal == ".objc_message_refs")
> - return ParseDirectiveSectionSwitch("__OBJC", "__message_refs",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP |
> - MCSectionMachO::S_LITERAL_POINTERS,
> - 4);
> - if (IDVal == ".objc_symbols")
> - return ParseDirectiveSectionSwitch("__OBJC", "__symbols",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_category")
> - return ParseDirectiveSectionSwitch("__OBJC", "__category",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_class_vars")
> - return ParseDirectiveSectionSwitch("__OBJC", "__class_vars",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_instance_vars")
> - return ParseDirectiveSectionSwitch("__OBJC", "__instance_vars",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_module_info")
> - return ParseDirectiveSectionSwitch("__OBJC", "__module_info",
> - MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
> - if (IDVal == ".objc_class_names")
> - return ParseDirectiveSectionSwitch("__TEXT", "__cstring",
> - MCSectionMachO::S_CSTRING_LITERALS);
> - if (IDVal == ".objc_meth_var_types")
> - return ParseDirectiveSectionSwitch("__TEXT", "__cstring",
> - MCSectionMachO::S_CSTRING_LITERALS);
> - if (IDVal == ".objc_meth_var_names")
> - return ParseDirectiveSectionSwitch("__TEXT", "__cstring",
> - MCSectionMachO::S_CSTRING_LITERALS);
> - if (IDVal == ".objc_selector_strs")
> - return ParseDirectiveSectionSwitch("__OBJC", "__selector_strs",
> - MCSectionMachO::S_CSTRING_LITERALS);
> -
> +
> + if (IDVal == ".text" || IDVal == ".const" || IDVal == ".static_const" ||
> + IDVal == ".cstring" || IDVal == ".literal4" || IDVal == ".literal8" ||
> + IDVal == ".literal16" || IDVal == ".constructor" ||
> + IDVal == ".destructor" || IDVal == ".fvmlib_init0" ||
> + IDVal == ".fvmlib_init1" || IDVal == ".symbol_stub" ||
> + IDVal == ".picsymbol_stub" || IDVal == ".data" ||
> + IDVal == ".static_data" || IDVal == ".non_lazy_symbol_pointer" ||
> + IDVal == ".lazy_symbol_pointer" || IDVal == ".dyld" ||
> + IDVal == ".mod_init_func" || IDVal == ".mod_term_func" ||
> + IDVal == ".const_data" || IDVal == ".objc_class" ||
> + IDVal == ".objc_meta_class" || IDVal == ".objc_cat_cls_meth" ||
> + IDVal == ".objc_cat_inst_meth" || IDVal == ".objc_protocol" ||
> + IDVal == ".objc_string_object" || IDVal == ".objc_cls_meth" ||
> + IDVal == ".objc_inst_meth" || IDVal == ".objc_cls_refs" ||
> + IDVal == ".objc_message_refs" || IDVal == ".objc_symbols" ||
> + IDVal == ".objc_category" || IDVal == ".objc_class_vars" ||
> + IDVal == ".objc_instance_vars" || IDVal == ".objc_module_info" ||
> + IDVal == ".objc_class_names" || IDVal == ".objc_meth_var_types" ||
> + IDVal == ".objc_meth_var_names" || IDVal == ".objc_selector_strs")
> + return ParseDirectiveSectionSwitch(IDVal);
> +
> // Assembler features
> if (IDVal == ".set")
> return ParseDirectiveSet();
> @@ -886,30 +768,12 @@ bool AsmParser::ParseDirectiveDarwinSect
> }
>
> /// ParseDirectiveSectionSwitch -
> -bool AsmParser::ParseDirectiveSectionSwitch(const char *Segment,
> - const char *Section,
> - unsigned TAA, unsigned Align,
> - unsigned StubSize) {
> +bool AsmParser::ParseDirectiveSectionSwitch(StringRef Section) {
> if (Lexer.isNot(AsmToken::EndOfStatement))
> return TokError("unexpected token in section switching directive");
> Lex();
>
> - // FIXME: Arch specific.
> - bool isText = StringRef(Segment) == "__TEXT"; // FIXME: Hack.
> - Out.SwitchSection(Ctx.getMachOSection(Segment, Section, TAA, StubSize,
> - isText ? SectionKind::getText()
> - : SectionKind::getDataRel()));
> -
> - // Set the implicit alignment, if any.
> - //
> - // FIXME: This isn't really what 'as' does; I think it just uses the implicit
> - // alignment on the section (e.g., if one manually inserts bytes into the
> - // section, then just issueing the section switch directive will not realign
> - // the section. However, this is arguably more reasonable behavior, and there
> - // is no good reason for someone to intentionally emit incorrectly sized
> - // values into the implicitly aligned sections.
> - if (Align)
> - Out.EmitValueToAlignment(Align, 0, 1, 0);
> + Out.SwitchSection(Out.LookupSection(Section));
>
> return false;
> }
> Index: llvm/include/llvm/MC/MCParser/AsmParser.h
> ===================================================================
> --- llvm.orig/include/llvm/MC/MCParser/AsmParser.h
> +++ llvm/include/llvm/MC/MCParser/AsmParser.h
> @@ -116,9 +116,7 @@ private:
>
> // Directive Parsing.
> bool ParseDirectiveDarwinSection(); // Darwin specific ".section".
> - bool ParseDirectiveSectionSwitch(const char *Segment, const char *Section,
> - unsigned TAA = 0, unsigned ImplicitAlign = 0,
> - unsigned StubSize = 0);
> + bool ParseDirectiveSectionSwitch(StringRef Section);
> bool ParseDirectiveAscii(bool ZeroTerminated); // ".ascii", ".asciiz"
> bool ParseDirectiveValue(unsigned Size); // ".byte", ".long", ...
> bool ParseDirectiveFill(); // ".fill"
> Index: llvm/include/llvm/MC/MCStreamer.h
> ===================================================================
> --- llvm.orig/include/llvm/MC/MCStreamer.h
> +++ llvm/include/llvm/MC/MCStreamer.h
> @@ -102,6 +102,9 @@ namespace llvm {
> /// This corresponds to assembler directives like .section, .text, etc.
> virtual void SwitchSection(const MCSection *Section) = 0;
>
> + /// LookupSection - Return the corresponding output section for @Section.
> + virtual const MCSection *LookupSection(StringRef Section) = 0;
> +
> /// EmitLabel - Emit a label for @p Symbol into the current section.
> ///
> /// This corresponds to an assembler statement such as:
> Index: llvm/lib/MC/MCMachOStreamer.cpp
> ===================================================================
> --- llvm.orig/lib/MC/MCMachOStreamer.cpp
> +++ llvm/lib/MC/MCMachOStreamer.cpp
> @@ -15,6 +15,7 @@
> #include "llvm/MC/MCExpr.h"
> #include "llvm/MC/MCInst.h"
> #include "llvm/MC/MCSection.h"
> +#include "llvm/MC/MCSectionMachO.h"
> #include "llvm/MC/MCSymbol.h"
> #include "llvm/MC/MCMachOSymbolFlags.h"
> #include "llvm/Support/ErrorHandling.h"
> @@ -95,10 +96,41 @@ public:
> return Value;
> }
>
> + // Set the implicit alignment, if any.
> + //
> + // FIXME: This isn't really what 'as' does; I think it just uses the implicit
> + // alignment on the section (e.g., if one manually inserts bytes into the
> + // section, then just issueing the section switch directive will not realign
> + // the section. However, this is arguably more reasonable behavior, and there
> + // is no good reason for someone to intentionally emit incorrectly sized
> + // values into the implicitly aligned sections.
> + const MCSection *AlignedSection(StringRef Segment,
> + StringRef Section,
> + unsigned TypeAndAttributes,
> + unsigned Reserved2,
> + SectionKind K,
> + unsigned Align) {
> + const MCSection *S = getContext().getMachOSection(Segment, Section,
> + TypeAndAttributes,
> + Reserved2, K);
> +
> + MCSectionData *SD = &Assembler.getOrCreateSectionData(*S);
> +
> + MCFragment *F = new MCAlignFragment(Align, 0, 1, Align, SD);
> + F->setAtom(CurrentAtomMap.lookup(SD));
> +
> + // Update the maximum alignment on the current section if necessary.
> + if (Align > SD->getAlignment())
> + SD->setAlignment(Align);
> +
> + return S;
> + }
> +
> /// @name MCStreamer Interface
> /// @{
>
> virtual void SwitchSection(const MCSection *Section);
> + virtual const MCSection *LookupSection(StringRef Section);
> virtual void EmitLabel(MCSymbol *Symbol);
> virtual void EmitAssemblerFlag(MCAssemblerFlag Flag);
> virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value);
> @@ -166,6 +198,178 @@ void MCMachOStreamer::SwitchSection(cons
> CurSectionData = &Assembler.getOrCreateSectionData(*Section);
> }
>
> +
> +const MCSection *MCMachOStreamer::LookupSection(StringRef S) {
> +
> + MCContext &Ctx = getContext();
> +
> + if (S == ".text") {
> + return Ctx.getMachOSection("__TEXT", "__text",
> + MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
> + 0, SectionKind::getText());
> + } else if (S == ".const") {
> + return Ctx.getMachOSection("__TEXT", "__const", 0, 0,
> + SectionKind::getText());
> + } else if (S == ".static_const") {
> + return Ctx.getMachOSection("__TEXT", "__static_const", 0, 0,
> + SectionKind::getText());
> + } else if (S == ".cstring") {
> + return Ctx.getMachOSection("__TEXT","__cstring",
> + MCSectionMachO::S_CSTRING_LITERALS, 0,
> + SectionKind::getText());
> + } else if (S == ".literal4") {
> + return AlignedSection("__TEXT", "__literal4",
> + MCSectionMachO::S_4BYTE_LITERALS,
> + 0, SectionKind::getText(), 4);
> + } else if (S == ".literal8") {
> + return AlignedSection("__TEXT", "__literal8",
> + MCSectionMachO::S_8BYTE_LITERALS,
> + 0, SectionKind::getText(), 8);
> + } else if (S == ".literal16") {
> + return AlignedSection("__TEXT","__literal16",
> + MCSectionMachO::S_16BYTE_LITERALS,
> + 0, SectionKind::getText(), 16);
> + } else if (S == ".constructor") {
> + return Ctx.getMachOSection("__TEXT","__constructor", 0, 0,
> + SectionKind::getText());
> + } else if (S == ".destructor") {
> + return Ctx.getMachOSection("__TEXT","__destructor", 0, 0,
> + SectionKind::getText());
> + } else if (S == ".fvmlib_init0") {
> + return Ctx.getMachOSection("__TEXT","__fvmlib_init0", 0, 0,
> + SectionKind::getText());
> + } else if (S == ".fvmlib_init1") {
> + return Ctx.getMachOSection("__TEXT","__fvmlib_init1", 0, 0,
> + SectionKind::getText());
> +
> + // FIXME: The assembler manual claims that this has the self modify code
> + // flag, at least on x86-32, but that does not appear to be correct.
> + } else if (S == ".symbol_stub") {
> + return Ctx.getMachOSection("__TEXT","__symbol_stub",
> + MCSectionMachO::S_SYMBOL_STUBS |
> + MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
> + // FIXME: Different on PPC and ARM.
> + 16, SectionKind::getText());
> + // FIXME: PowerPC only?
> + } else if (S == ".picsymbol_stub") {
> + return Ctx.getMachOSection("__TEXT","__picsymbol_stub",
> + MCSectionMachO::S_SYMBOL_STUBS |
> + MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
> + 26, SectionKind::getText());
> + } else if (S == ".data") {
> + return Ctx.getMachOSection("__DATA", "__data", 0, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".static_data") {
> + return Ctx.getMachOSection("__DATA", "__static_data", 0, 0,
> + SectionKind::getDataRel());
> +
> + // FIXME: The section names of these two are misspelled in the assembler
> + // manual.
> + } else if (S == ".non_lazy_symbol_pointer") {
> + return AlignedSection("__DATA", "__nl_symbol_ptr",
> + MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS,
> + 0, SectionKind::getDataRel(), 4);
> + } else if (S == ".lazy_symbol_pointer") {
> + return AlignedSection("__DATA", "__la_symbol_ptr",
> + MCSectionMachO::S_LAZY_SYMBOL_POINTERS,
> + 0, SectionKind::getDataRel(), 4);
> + } else if (S == ".dyld") {
> + return Ctx.getMachOSection("__DATA", "__dyld", 0, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".mod_init_func") {
> + return AlignedSection("__DATA", "__mod_init_func",
> + MCSectionMachO::S_MOD_INIT_FUNC_POINTERS,
> + 0, SectionKind::getDataRel(), 4);
> + } else if (S == ".mod_term_func") {
> + return AlignedSection("__DATA", "__mod_term_func",
> + MCSectionMachO::S_MOD_TERM_FUNC_POINTERS,
> + 0, SectionKind::getDataRel(), 4);
> + } else if (S == ".const_data") {
> + return Ctx.getMachOSection("__DATA", "__const", 0, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_class") {
> + return Ctx.getMachOSection("__OBJC", "__class",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_meta_class") {
> + return Ctx.getMachOSection("__OBJC", "__meta_class",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_cat_cls_meth") {
> + return Ctx.getMachOSection("__OBJC", "__cat_cls_meth",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_cat_inst_meth") {
> + return Ctx.getMachOSection("__OBJC", "__cat_inst_meth",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_protocol") {
> + return Ctx.getMachOSection("__OBJC", "__protocol",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_string_object") {
> + return Ctx.getMachOSection("__OBJC", "__string_object",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_cls_meth") {
> + return Ctx.getMachOSection("__OBJC", "__cls_meth",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_inst_meth") {
> + return Ctx.getMachOSection("__OBJC", "__inst_meth",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_cls_refs") {
> + return AlignedSection("__OBJC", "__cls_refs",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP |
> + MCSectionMachO::S_LITERAL_POINTERS,
> + 0, SectionKind::getDataRel(), 4);
> + } else if (S == ".objc_message_refs") {
> + return AlignedSection("__OBJC", "__message_refs",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP |
> + MCSectionMachO::S_LITERAL_POINTERS,
> + 0, SectionKind::getDataRel(), 4);
> + } else if (S == ".objc_symbols") {
> + return Ctx.getMachOSection("__OBJC", "__symbols",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_category") {
> + return Ctx.getMachOSection("__OBJC", "__category",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_class_vars") {
> + return Ctx.getMachOSection("__OBJC", "__class_vars",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_instance_vars") {
> + return Ctx.getMachOSection("__OBJC", "__instance_vars",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_module_info") {
> + return Ctx.getMachOSection("__OBJC", "__module_info",
> + MCSectionMachO::S_ATTR_NO_DEAD_STRIP, 0,
> + SectionKind::getDataRel());
> + } else if (S == ".objc_class_names") {
> + return Ctx.getMachOSection("__TEXT", "__cstring",
> + MCSectionMachO::S_CSTRING_LITERALS, 0,
> + SectionKind::getText());
> + } else if (S == ".objc_meth_var_types") {
> + return Ctx.getMachOSection("__TEXT", "__cstring",
> + MCSectionMachO::S_CSTRING_LITERALS, 0,
> + SectionKind::getText());
> + } else if (S == ".objc_meth_var_names") {
> + return Ctx.getMachOSection("__TEXT", "__cstring",
> + MCSectionMachO::S_CSTRING_LITERALS, 0,
> + SectionKind::getText());
> + } else if (S == ".objc_selector_strs") {
> + return Ctx.getMachOSection("__OBJC", "__selector_strs",
> + MCSectionMachO::S_CSTRING_LITERALS, 0,
> + SectionKind::getDataRel());
> + }
> +
> + return 0;
> +}
> +
> void MCMachOStreamer::EmitLabel(MCSymbol *Symbol) {
> assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
> assert(!Symbol->isVariable() && "Cannot emit a variable symbol!");
> Index: llvm/lib/MC/MCAsmStreamer.cpp
> ===================================================================
> --- llvm.orig/lib/MC/MCAsmStreamer.cpp
> +++ llvm/lib/MC/MCAsmStreamer.cpp
> @@ -100,6 +100,15 @@ public:
>
> virtual void SwitchSection(const MCSection *Section);
>
> + virtual const MCSection *LookupSection(StringRef Section) {
> + // FIXME: What sort of section should we create? Does it even
> + // matter? I think we're just doing this to appease the other
> + // layers.
> + return getContext().getMachOSection("__TEXT", ".text",
> + MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
> + 0, SectionKind::getText());
> + }
> +
> virtual void EmitLabel(MCSymbol *Symbol);
>
> virtual void EmitAssemblerFlag(MCAssemblerFlag Flag);
> Index: llvm/lib/MC/MCNullStreamer.cpp
> ===================================================================
> --- llvm.orig/lib/MC/MCNullStreamer.cpp
> +++ llvm/lib/MC/MCNullStreamer.cpp
> @@ -13,6 +13,7 @@
> #include "llvm/MC/MCInst.h"
> #include "llvm/MC/MCSectionMachO.h"
> #include "llvm/MC/MCSymbol.h"
> +#include "llvm/Support/raw_ostream.h"
>
> using namespace llvm;
>
> @@ -29,6 +30,11 @@ namespace {
> CurSection = Section;
> }
>
> + virtual const MCSection *LookupSection(StringRef Section) {
> + errs() << "FIXME: MCNullStreamer:LookupSection not implemented\n";
> + return 0;
> + }
> +
> virtual void EmitLabel(MCSymbol *Symbol) {
> assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
> assert(CurSection && "Cannot emit before setting section!");
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From foldr at codedgers.com Wed May 19 14:24:32 2010
From: foldr at codedgers.com (Mikhail Glushenkov)
Date: Wed, 19 May 2010 19:24:32 -0000
Subject: [llvm-commits] [llvm] r104145 -
/llvm/trunk/lib/CompilerDriver/Action.cpp
Message-ID: <20100519192432.6974E312800A@llvm.org>
Author: foldr
Date: Wed May 19 14:24:32 2010
New Revision: 104145
URL: http://llvm.org/viewvc/llvm-project?rev=104145&view=rev
Log:
llvmc: report an error if a child process segfaults.
Modified:
llvm/trunk/lib/CompilerDriver/Action.cpp
Modified: llvm/trunk/lib/CompilerDriver/Action.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CompilerDriver/Action.cpp?rev=104145&r1=104144&r2=104145&view=diff
==============================================================================
--- llvm/trunk/lib/CompilerDriver/Action.cpp (original)
+++ llvm/trunk/lib/CompilerDriver/Action.cpp Wed May 19 14:24:32 2010
@@ -67,7 +67,20 @@
argv.push_back(0); // null terminate list.
// Invoke the program.
- return sys::Program::ExecuteAndWait(prog, &argv[0], 0, &redirects[0]);
+ int ret = sys::Program::ExecuteAndWait(prog, &argv[0], 0, &redirects[0]);
+
+ if (ret < 0) {
+ const char** B = &argv[0];
+
+ errs() << "Segmentation fault:";
+ while (*B)
+ errs() << ' ' << *(B++);
+ errs() << '\n';
+
+ return 1;
+ }
+
+ return ret;
}
void print_string (const std::string& str) {
From stoklund at 2pi.dk Wed May 19 15:08:00 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Wed, 19 May 2010 20:08:00 -0000
Subject: [llvm-commits] [llvm] r104146 - in /llvm/trunk:
lib/CodeGen/TwoAddressInstructionPass.cpp test/CodeGen/ARM/reg_sequence.ll
Message-ID: <20100519200800.52882312800A@llvm.org>
Author: stoklund
Date: Wed May 19 15:08:00 2010
New Revision: 104146
URL: http://llvm.org/viewvc/llvm-project?rev=104146&view=rev
Log:
TwoAddressInstructionPass doesn't really know how to merge live intervals when
lowering REG_SEQUENCE instructions.
Insert copies for REG_SEQUENCE sources not killed to avoid breaking later passes.
Modified:
llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
llvm/trunk/test/CodeGen/ARM/reg_sequence.ll
Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=104146&r1=104145&r2=104146&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Wed May 19 15:08:00 2010
@@ -1275,9 +1275,10 @@
if (!Seen.insert(SrcReg) ||
MI->getParent() != DefMI->getParent() ||
+ !MI->getOperand(i).isKill() ||
HasOtherRegSequenceUses(SrcReg, MI, MRI)) {
// REG_SEQUENCE cannot have duplicated operands, add a copy.
- // Also add an copy if the source if live-in the block. We don't want
+ // Also add an copy if the source is live-in the block. We don't want
// to end up with a partial-redef of a livein, e.g.
// BB0:
// reg1051:10 =
@@ -1287,6 +1288,10 @@
// BB2:
// reg1051:9 =
// LiveIntervalAnalysis won't like it.
+ //
+ // If the REG_SEQUENCE doesn't kill its source, keeping live variables
+ // correctly up to date becomes very difficult. Insert a copy.
+ //
const TargetRegisterClass *RC = MRI->getRegClass(SrcReg);
unsigned NewReg = MRI->createVirtualRegister(RC);
MachineBasicBlock::iterator InsertLoc = MI;
Modified: llvm/trunk/test/CodeGen/ARM/reg_sequence.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/reg_sequence.ll?rev=104146&r1=104145&r2=104146&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/reg_sequence.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/reg_sequence.ll Wed May 19 15:08:00 2010
@@ -302,6 +302,23 @@
ret i32 0
}
+; This test crashes the coalescer because live variables were not updated properly.
+define <8 x i8> @t11(i8* %A1, i8* %A2, i8* %A3, i8* %A4, i8* %A5, i8* %A6, i8* %A7, i8* %A8, i8* %B) nounwind {
+ %tmp1d = call %struct.__neon_int8x8x3_t @llvm.arm.neon.vld3.v8i8(i8* %A4) ; <%struct.__neon_int8x8x3_t> [#uses=1]
+ %tmp2d = extractvalue %struct.__neon_int8x8x3_t %tmp1d, 0 ; <<8 x i8>> [#uses=1]
+ %tmp1f = call %struct.__neon_int8x8x3_t @llvm.arm.neon.vld3.v8i8(i8* %A6) ; <%struct.__neon_int8x8x3_t> [#uses=1]
+ %tmp2f = extractvalue %struct.__neon_int8x8x3_t %tmp1f, 0 ; <<8 x i8>> [#uses=1]
+ %tmp2bd = add <8 x i8> zeroinitializer, %tmp2d ; <<8 x i8>> [#uses=1]
+ %tmp2abcd = mul <8 x i8> zeroinitializer, %tmp2bd ; <<8 x i8>> [#uses=1]
+ %tmp2ef = sub <8 x i8> zeroinitializer, %tmp2f ; <<8 x i8>> [#uses=1]
+ %tmp2efgh = mul <8 x i8> %tmp2ef, undef ; <<8 x i8>> [#uses=2]
+ call void @llvm.arm.neon.vst3.v8i8(i8* %A2, <8 x i8> undef, <8 x i8> undef, <8 x i8> %tmp2efgh)
+ %tmp2 = sub <8 x i8> %tmp2efgh, %tmp2abcd ; <<8 x i8>> [#uses=1]
+ %tmp7 = mul <8 x i8> undef, %tmp2 ; <<8 x i8>> [#uses=1]
+ tail call void @llvm.arm.neon.vst3.v8i8(i8* %B, <8 x i8> undef, <8 x i8> undef, <8 x i8> %tmp7)
+ ret <8 x i8> undef
+}
+
declare <4 x i32> @llvm.arm.neon.vld1.v4i32(i8*) nounwind readonly
declare <8 x i16> @llvm.arm.neon.vld1.v8i16(i8*) nounwind readonly
From evan.cheng at apple.com Wed May 19 15:19:50 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 19 May 2010 20:19:50 -0000
Subject: [llvm-commits] [llvm] r104147 - in /llvm/trunk:
include/llvm/Target/TargetLowering.h include/llvm/Target/TargetMachine.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/CodeGen/SelectionDAG/TargetLowering.cpp
lib/Target/ARM/ARMISelLowering.cpp lib/Target/CellSPU/SPUISelLowering.cpp
lib/Target/MSP430/MSP430ISelLowering.cpp
lib/Target/SystemZ/SystemZISelLowering.cpp
lib/Target/X86/X86ISelLowering.cpp lib/Target/XCore/XCoreISelLowering.cpp
Message-ID: <20100519201951.3124C312800A@llvm.org>
Author: evancheng
Date: Wed May 19 15:19:50 2010
New Revision: 104147
URL: http://llvm.org/viewvc/llvm-project?rev=104147&view=rev
Log:
Code refactoring: pull SchedPreference enum from TargetLowering.h to TargetMachine.h and put it in its own namespace.
Modified:
llvm/trunk/include/llvm/Target/TargetLowering.h
llvm/trunk/include/llvm/Target/TargetMachine.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp
llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp
Modified: llvm/trunk/include/llvm/Target/TargetLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=104147&r1=104146&r2=104147&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetLowering.h (original)
+++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed May 19 15:19:50 2010
@@ -97,11 +97,6 @@
ZeroOrNegativeOneBooleanContent // All bits equal to bit 0.
};
- enum SchedPreference {
- SchedulingForLatency, // Scheduling for shortest total latency.
- SchedulingForRegPressure // Scheduling for lowest register pressure.
- };
-
/// NOTE: The constructor takes ownership of TLOF.
explicit TargetLowering(const TargetMachine &TM,
const TargetLoweringObjectFile *TLOF);
@@ -150,7 +145,7 @@
BooleanContent getBooleanContents() const { return BooleanContents;}
/// getSchedulingPreference - Return target scheduling preference.
- SchedPreference getSchedulingPreference() const {
+ Sched::Preference getSchedulingPreference() const {
return SchedPreferenceInfo;
}
@@ -906,7 +901,7 @@
void setBooleanContents(BooleanContent Ty) { BooleanContents = Ty; }
/// setSchedulingPreference - Specify the target scheduling preference.
- void setSchedulingPreference(SchedPreference Pref) {
+ void setSchedulingPreference(Sched::Preference Pref) {
SchedPreferenceInfo = Pref;
}
@@ -1521,7 +1516,7 @@
/// SchedPreferenceInfo - The target scheduling preference: shortest possible
/// total cycles or lowest register usage.
- SchedPreference SchedPreferenceInfo;
+ Sched::Preference SchedPreferenceInfo;
/// JumpBufSize - The size, in bytes, of the target's jmp_buf buffers
unsigned JumpBufSize;
Modified: llvm/trunk/include/llvm/Target/TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=104147&r1=104146&r2=104147&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetMachine.h (original)
+++ llvm/trunk/include/llvm/Target/TargetMachine.h Wed May 19 15:19:50 2010
@@ -70,6 +70,13 @@
};
}
+namespace Sched {
+ enum Preference {
+ Latency, // Scheduling for shortest total latency.
+ RegPressure // Scheduling for lowest register pressure.
+ };
+}
+
//===----------------------------------------------------------------------===//
///
/// TargetMachine - Primary interface to the complete machine description for
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=104147&r1=104146&r2=104147&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed May 19 15:19:50 2010
@@ -132,10 +132,10 @@
if (OptLevel == CodeGenOpt::None)
return createFastDAGScheduler(IS, OptLevel);
- if (TLI.getSchedulingPreference() == TargetLowering::SchedulingForLatency)
+ if (TLI.getSchedulingPreference() == Sched::Latency)
return createTDListDAGScheduler(IS, OptLevel);
- assert(TLI.getSchedulingPreference() ==
- TargetLowering::SchedulingForRegPressure && "Unknown sched type!");
+ assert(TLI.getSchedulingPreference() == Sched::RegPressure &&
+ "Unknown sched type!");
return createBURRListDAGScheduler(IS, OptLevel);
}
}
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=104147&r1=104146&r2=104147&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Wed May 19 15:19:50 2010
@@ -543,7 +543,7 @@
ExceptionPointerRegister = 0;
ExceptionSelectorRegister = 0;
BooleanContents = UndefinedBooleanContent;
- SchedPreferenceInfo = SchedulingForLatency;
+ SchedPreferenceInfo = Sched::Latency;
JumpBufSize = 0;
JumpBufAlignment = 0;
IfCvtBlockSizeLimit = 2;
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=104147&r1=104146&r2=104147&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed May 19 15:19:50 2010
@@ -466,7 +466,7 @@
setTargetDAGCombine(ISD::MUL);
setStackPointerRegisterToSaveRestore(ARM::SP);
- setSchedulingPreference(SchedulingForRegPressure);
+ setSchedulingPreference(Sched::RegPressure);
// FIXME: If-converter should use instruction latency to determine
// profitability rather than relying on fixed limits.
Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=104147&r1=104146&r2=104147&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Wed May 19 15:19:50 2010
@@ -485,7 +485,7 @@
// Set pre-RA register scheduler default to BURR, which produces slightly
// better code than the default (could also be TDRR, but TargetLowering.h
// needs a mod to support that model):
- setSchedulingPreference(SchedulingForRegPressure);
+ setSchedulingPreference(Sched::RegPressure);
}
const char *
Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp?rev=104147&r1=104146&r2=104147&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp Wed May 19 15:19:50 2010
@@ -83,7 +83,7 @@
setStackPointerRegisterToSaveRestore(MSP430::SPW);
setBooleanContents(ZeroOrOneBooleanContent);
- setSchedulingPreference(SchedulingForLatency);
+ setSchedulingPreference(Sched::Latency);
// We have post-incremented loads / stores.
setIndexedLoadAction(ISD::POST_INC, MVT::i8, Legal);
Modified: llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp?rev=104147&r1=104146&r2=104147&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp Wed May 19 15:19:50 2010
@@ -81,7 +81,7 @@
// LLVM's current latency-oriented scheduler can't handle physreg definitions
// such as SystemZ has with PSW, so set this to the register-pressure
// scheduler, because it can.
- setSchedulingPreference(SchedulingForRegPressure);
+ setSchedulingPreference(Sched::RegPressure);
setBooleanContents(ZeroOrOneBooleanContent);
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=104147&r1=104146&r2=104147&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed May 19 15:19:50 2010
@@ -94,7 +94,7 @@
// X86 is weird, it always uses i8 for shift amounts and setcc results.
setShiftAmountType(MVT::i8);
setBooleanContents(ZeroOrOneBooleanContent);
- setSchedulingPreference(SchedulingForRegPressure);
+ setSchedulingPreference(Sched::RegPressure);
setStackPointerRegisterToSaveRestore(X86StackPtr);
if (Subtarget->isTargetDarwin()) {
Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=104147&r1=104146&r2=104147&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Wed May 19 15:19:50 2010
@@ -80,7 +80,7 @@
setShiftAmountType(MVT::i32);
setStackPointerRegisterToSaveRestore(XCore::SP);
- setSchedulingPreference(SchedulingForRegPressure);
+ setSchedulingPreference(Sched::RegPressure);
// Use i32 for setcc operations results (slt, sgt, ...).
setBooleanContents(ZeroOrOneBooleanContent);
From echristo at apple.com Wed May 19 15:35:15 2010
From: echristo at apple.com (Eric Christopher)
Date: Wed, 19 May 2010 20:35:15 -0000
Subject: [llvm-commits] [llvm] r104148 - in /llvm/trunk/test/MC/MachO:
tdata.s thread_init_func.s tlv.s
Message-ID: <20100519203515.956C3312800A@llvm.org>
Author: echristo
Date: Wed May 19 15:35:15 2010
New Revision: 104148
URL: http://llvm.org/viewvc/llvm-project?rev=104148&view=rev
Log:
Few more simple tls testcases.
Added:
llvm/trunk/test/MC/MachO/tdata.s
llvm/trunk/test/MC/MachO/thread_init_func.s
llvm/trunk/test/MC/MachO/tlv.s
Added: llvm/trunk/test/MC/MachO/tdata.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/tdata.s?rev=104148&view=auto
==============================================================================
--- llvm/trunk/test/MC/MachO/tdata.s (added)
+++ llvm/trunk/test/MC/MachO/tdata.s Wed May 19 15:35:15 2010
@@ -0,0 +1,106 @@
+// RUN: llvm-mc -triple x86_64-apple-darwin %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+.tdata
+_a$tlv$init:
+ .long 4
+
+// CHECK: ('cputype', 16777223)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 336)
+// CHECK: ('flag', 0)
+// CHECK: ('reserved', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 25)
+// CHECK: ('size', 232)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 4)
+// CHECK: ('file_offset', 368)
+// CHECK: ('file_size', 4)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 2)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 0)
+// CHECK: ('offset', 368)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x80000000)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '')
+// CHECK: # Section 1
+// CHECK: (('section_name', '__thread_data\x00\x00\x00')
+// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 4)
+// CHECK: ('offset', 368)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x11)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '\x04\x00\x00\x00')
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 1
+// CHECK: (('command', 2)
+// CHECK: ('size', 24)
+// CHECK: ('symoff', 372)
+// CHECK: ('nsyms', 1)
+// CHECK: ('stroff', 388)
+// CHECK: ('strsize', 16)
+// CHECK: ('_string_data', '\x00_a$tlv$init\x00\x00\x00\x00')
+// CHECK: ('_symbols', [
+// CHECK: # Symbol 0
+// CHECK: (('n_strx', 1)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_a$tlv$init')
+// CHECK: ),
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 2
+// CHECK: (('command', 11)
+// CHECK: ('size', 80)
+// CHECK: ('ilocalsym', 0)
+// CHECK: ('nlocalsym', 1)
+// CHECK: ('iextdefsym', 1)
+// CHECK: ('nextdefsym', 0)
+// CHECK: ('iundefsym', 1)
+// CHECK: ('nundefsym', 0)
+// CHECK: ('tocoff', 0)
+// CHECK: ('ntoc', 0)
+// CHECK: ('modtaboff', 0)
+// CHECK: ('nmodtab', 0)
+// CHECK: ('extrefsymoff', 0)
+// CHECK: ('nextrefsyms', 0)
+// CHECK: ('indirectsymoff', 0)
+// CHECK: ('nindirectsyms', 0)
+// CHECK: ('extreloff', 0)
+// CHECK: ('nextrel', 0)
+// CHECK: ('locreloff', 0)
+// CHECK: ('nlocrel', 0)
+// CHECK: ('_indirect_symbols', [
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
Added: llvm/trunk/test/MC/MachO/thread_init_func.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/thread_init_func.s?rev=104148&view=auto
==============================================================================
--- llvm/trunk/test/MC/MachO/thread_init_func.s (added)
+++ llvm/trunk/test/MC/MachO/thread_init_func.s Wed May 19 15:35:15 2010
@@ -0,0 +1,63 @@
+// RUN: llvm-mc -triple x86_64-apple-darwin %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+
+ .thread_init_func
+ .quad 0
+
+// CHECK: ('cputype', 16777223)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 232)
+// CHECK: ('flag', 0)
+// CHECK: ('reserved', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 25)
+// CHECK: ('size', 232)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 8)
+// CHECK: ('file_offset', 264)
+// CHECK: ('file_size', 8)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 2)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 0)
+// CHECK: ('offset', 264)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x80000000)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '')
+// CHECK: # Section 1
+// CHECK: (('section_name', '__thread_init\x00\x00\x00')
+// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 8)
+// CHECK: ('offset', 264)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x15)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
Added: llvm/trunk/test/MC/MachO/tlv.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/tlv.s?rev=104148&view=auto
==============================================================================
--- llvm/trunk/test/MC/MachO/tlv.s (added)
+++ llvm/trunk/test/MC/MachO/tlv.s Wed May 19 15:35:15 2010
@@ -0,0 +1,110 @@
+// RUN: llvm-mc -triple x86_64-apple-darwin %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+
+ .tlv
+ .globl _a
+_a:
+ .quad 0
+ .quad 0
+ .quad 0
+
+// CHECK: ('cputype', 16777223)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 336)
+// CHECK: ('flag', 0)
+// CHECK: ('reserved', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 25)
+// CHECK: ('size', 232)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 24)
+// CHECK: ('file_offset', 368)
+// CHECK: ('file_size', 24)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 2)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 0)
+// CHECK: ('offset', 368)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x80000000)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '')
+// CHECK: # Section 1
+// CHECK: (('section_name', '__thread_vars\x00\x00\x00')
+// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 24)
+// CHECK: ('offset', 368)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x13)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 1
+// CHECK: (('command', 2)
+// CHECK: ('size', 24)
+// CHECK: ('symoff', 392)
+// CHECK: ('nsyms', 1)
+// CHECK: ('stroff', 408)
+// CHECK: ('strsize', 4)
+// CHECK: ('_string_data', '\x00_a\x00')
+// CHECK: ('_symbols', [
+// CHECK: # Symbol 0
+// CHECK: (('n_strx', 1)
+// CHECK: ('n_type', 0xf)
+// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_a')
+// CHECK: ),
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 2
+// CHECK: (('command', 11)
+// CHECK: ('size', 80)
+// CHECK: ('ilocalsym', 0)
+// CHECK: ('nlocalsym', 0)
+// CHECK: ('iextdefsym', 0)
+// CHECK: ('nextdefsym', 1)
+// CHECK: ('iundefsym', 1)
+// CHECK: ('nundefsym', 0)
+// CHECK: ('tocoff', 0)
+// CHECK: ('ntoc', 0)
+// CHECK: ('modtaboff', 0)
+// CHECK: ('nmodtab', 0)
+// CHECK: ('extrefsymoff', 0)
+// CHECK: ('nextrefsyms', 0)
+// CHECK: ('indirectsymoff', 0)
+// CHECK: ('nindirectsyms', 0)
+// CHECK: ('extreloff', 0)
+// CHECK: ('nextrel', 0)
+// CHECK: ('locreloff', 0)
+// CHECK: ('nlocrel', 0)
+// CHECK: ('_indirect_symbols', [
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
From stoklund at 2pi.dk Wed May 19 15:36:23 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Wed, 19 May 2010 20:36:23 -0000
Subject: [llvm-commits] [llvm] r104149 - in /llvm/trunk:
include/llvm/CodeGen/MachineInstr.h lib/CodeGen/MachineInstr.cpp
Message-ID: <20100519203623.12D89312800A@llvm.org>
Author: stoklund
Date: Wed May 19 15:36:22 2010
New Revision: 104149
URL: http://llvm.org/viewvc/llvm-project?rev=104149&view=rev
Log:
Add MachineInstr::readsVirtualRegister() in preparation for proper handling of
partial redefines.
We are going to treat a partial redefine of a virtual register as a
read-modify-write:
%reg1024:6 = OP
Unless the register is fully clobbered:
%reg1024:6 = OP, %reg1024
MachineInstr::readsVirtualRegister() knows the difference. The first case is a
read, the second isn't.
Modified:
llvm/trunk/include/llvm/CodeGen/MachineInstr.h
llvm/trunk/lib/CodeGen/MachineInstr.cpp
Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=104149&r1=104148&r2=104149&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Wed May 19 15:36:22 2010
@@ -230,10 +230,17 @@
/// readsRegister - Return true if the MachineInstr reads the specified
/// register. If TargetRegisterInfo is passed, then it also checks if there
/// is a read of a super-register.
+ /// This does not count partial redefines of virtual registers as reads:
+ /// %reg1024:6 = OP.
bool readsRegister(unsigned Reg, const TargetRegisterInfo *TRI = NULL) const {
return findRegisterUseOperandIdx(Reg, false, TRI) != -1;
}
+ /// readsVirtualRegister - Return true if the MachineInstr reads the specified
+ /// virtual register. Take into account that a partial define is a
+ /// read-modify-write operation.
+ bool readsVirtualRegister(unsigned Reg) const;
+
/// killsRegister - Return true if the MachineInstr kills the specified
/// register. If TargetRegisterInfo is passed, then it also checks if there is
/// a kill of a super-register.
Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=104149&r1=104148&r2=104149&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Wed May 19 15:36:22 2010
@@ -781,7 +781,30 @@
}
return -1;
}
-
+
+/// readsVirtualRegister - Return true if the MachineInstr reads the specified
+/// virtual register. Take into account that a partial define is a
+/// read-modify-write operation.
+bool MachineInstr::readsVirtualRegister(unsigned Reg) const {
+ bool PartDef = false; // Partial redefine
+ bool FullDef = false; // Full define
+
+ for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
+ const MachineOperand &MO = getOperand(i);
+ if (!MO.isReg() || MO.getReg() != Reg)
+ continue;
+ if (MO.isUse())
+ return true;
+ if (MO.getSubReg())
+ PartDef = true;
+ else
+ FullDef = true;
+ }
+ // A partial register definition causes a read unless the full register is
+ // also defined.
+ return PartDef && !FullDef;
+}
+
/// findRegisterDefOperandIdx() - Returns the operand index that is a def of
/// the specified register or -1 if it is not found. If isDead is true, defs
/// that are not dead are skipped. If TargetRegisterInfo is non-null, then it
From echristo at apple.com Wed May 19 16:19:42 2010
From: echristo at apple.com (Eric Christopher)
Date: Wed, 19 May 2010 21:19:42 -0000
Subject: [llvm-commits] [llvm] r104163 - /llvm/trunk/test/MC/MachO/tls.s
Message-ID: <20100519211942.6310A312800A@llvm.org>
Author: echristo
Date: Wed May 19 16:19:42 2010
New Revision: 104163
URL: http://llvm.org/viewvc/llvm-project?rev=104163&view=rev
Log:
A more combo tls testcase.
Added:
llvm/trunk/test/MC/MachO/tls.s
Added: llvm/trunk/test/MC/MachO/tls.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/tls.s?rev=104163&view=auto
==============================================================================
--- llvm/trunk/test/MC/MachO/tls.s (added)
+++ llvm/trunk/test/MC/MachO/tls.s Wed May 19 16:19:42 2010
@@ -0,0 +1,232 @@
+// RUN: llvm-mc -triple x86_64-apple-darwin %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+
+.tbss _a$tlv$init, 4
+
+.tlv
+ .globl _a
+_a:
+ .quad _tlv_bootstrap
+ .quad 0
+ .quad _a$tlv$init
+
+.tbss _b$tlv$init, 8, 4
+
+.tlv
+ .globl _b
+_b:
+ .quad _tlv_bootstrap
+ .quad 0
+ .quad _b$tlv$init
+
+.tdata
+_c$tlv$init:
+ .quad 8
+
+.tlv
+ .globl _c
+_c:
+ .quad _tlv_bootstrap
+ .quad 0
+ .quad _c$tlv$init
+
+// CHECK: ('cputype', 16777223)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 496)
+// CHECK: ('flag', 0)
+// CHECK: ('reserved', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 25)
+// CHECK: ('size', 392)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 104)
+// CHECK: ('file_offset', 528)
+// CHECK: ('file_size', 80)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 4)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 0)
+// CHECK: ('offset', 528)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x80000000)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '')
+// CHECK: # Section 1
+// CHECK: (('section_name', '__thread_bss\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 80)
+// CHECK: ('size', 24)
+// CHECK: ('offset', 0)
+// CHECK: ('alignment', 4)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x12)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '\xcf\xfa\xed\xfe\x07\x00\x00\x01\x03\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\xf0\x01\x00\x00')
+// CHECK: # Section 2
+// CHECK: (('section_name', '__thread_vars\x00\x00\x00')
+// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 72)
+// CHECK: ('offset', 528)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 608)
+// CHECK: ('num_reloc', 6)
+// CHECK: ('flags', 0x13)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: # Relocation 0
+// CHECK: (('word-0', 0x40),
+// CHECK: ('word-1', 0xe000002)),
+// CHECK: # Relocation 1
+// CHECK: (('word-0', 0x30),
+// CHECK: ('word-1', 0xe000006)),
+// CHECK: # Relocation 2
+// CHECK: (('word-0', 0x28),
+// CHECK: ('word-1', 0xe000001)),
+// CHECK: # Relocation 3
+// CHECK: (('word-0', 0x18),
+// CHECK: ('word-1', 0xe000006)),
+// CHECK: # Relocation 4
+// CHECK: (('word-0', 0x10),
+// CHECK: ('word-1', 0xe000000)),
+// CHECK: # Relocation 5
+// CHECK: (('word-0', 0x0),
+// CHECK: ('word-1', 0xe000006)),
+// CHECK: ])
+// CHECK: ('_section_data', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: # Section 3
+// CHECK: (('section_name', '__thread_data\x00\x00\x00')
+// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 72)
+// CHECK: ('size', 8)
+// CHECK: ('offset', 600)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x11)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '\x08\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 1
+// CHECK: (('command', 2)
+// CHECK: ('size', 24)
+// CHECK: ('symoff', 656)
+// CHECK: ('nsyms', 7)
+// CHECK: ('stroff', 768)
+// CHECK: ('strsize', 64)
+// CHECK: ('_string_data', '\x00_a\x00_tlv_bootstrap\x00_b\x00_c\x00_a$tlv$init\x00_b$tlv$init\x00_c$tlv$init\x00\x00\x00\x00')
+// CHECK: ('_symbols', [
+// CHECK: # Symbol 0
+// CHECK: (('n_strx', 25)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 80)
+// CHECK: ('_string', '_a$tlv$init')
+// CHECK: ),
+// CHECK: # Symbol 1
+// CHECK: (('n_strx', 37)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 96)
+// CHECK: ('_string', '_b$tlv$init')
+// CHECK: ),
+// CHECK: # Symbol 2
+// CHECK: (('n_strx', 49)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 4)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 72)
+// CHECK: ('_string', '_c$tlv$init')
+// CHECK: ),
+// CHECK: # Symbol 3
+// CHECK: (('n_strx', 1)
+// CHECK: ('n_type', 0xf)
+// CHECK: ('n_sect', 3)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_a')
+// CHECK: ),
+// CHECK: # Symbol 4
+// CHECK: (('n_strx', 19)
+// CHECK: ('n_type', 0xf)
+// CHECK: ('n_sect', 3)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 24)
+// CHECK: ('_string', '_b')
+// CHECK: ),
+// CHECK: # Symbol 5
+// CHECK: (('n_strx', 22)
+// CHECK: ('n_type', 0xf)
+// CHECK: ('n_sect', 3)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 48)
+// CHECK: ('_string', '_c')
+// CHECK: ),
+// CHECK: # Symbol 6
+// CHECK: (('n_strx', 4)
+// CHECK: ('n_type', 0x1)
+// CHECK: ('n_sect', 0)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_tlv_bootstrap')
+// CHECK: ),
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 2
+// CHECK: (('command', 11)
+// CHECK: ('size', 80)
+// CHECK: ('ilocalsym', 0)
+// CHECK: ('nlocalsym', 3)
+// CHECK: ('iextdefsym', 3)
+// CHECK: ('nextdefsym', 3)
+// CHECK: ('iundefsym', 6)
+// CHECK: ('nundefsym', 1)
+// CHECK: ('tocoff', 0)
+// CHECK: ('ntoc', 0)
+// CHECK: ('modtaboff', 0)
+// CHECK: ('nmodtab', 0)
+// CHECK: ('extrefsymoff', 0)
+// CHECK: ('nextrefsyms', 0)
+// CHECK: ('indirectsymoff', 0)
+// CHECK: ('nindirectsyms', 0)
+// CHECK: ('extreloff', 0)
+// CHECK: ('nextrel', 0)
+// CHECK: ('locreloff', 0)
+// CHECK: ('nlocrel', 0)
+// CHECK: ('_indirect_symbols', [
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
From daniel at zuster.org Wed May 19 16:26:48 2010
From: daniel at zuster.org (Daniel Dunbar)
Date: Wed, 19 May 2010 21:26:48 -0000
Subject: [llvm-commits] [zorg] r104164 - in /zorg/trunk:
buildbot/osuosl/master/config/builders.py
zorg/buildbot/builders/ClangBuilder.py
Message-ID: <20100519212648.98622312800A@llvm.org>
Author: ddunbar
Date: Wed May 19 16:26:48 2010
New Revision: 104164
URL: http://llvm.org/viewvc/llvm-project?rev=104164&view=rev
Log:
buildbot: Run FreeBSD tests inside a PTY, to work around a sporadic slave disconnect.
Modified:
zorg/trunk/buildbot/osuosl/master/config/builders.py
zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
Modified: zorg/trunk/buildbot/osuosl/master/config/builders.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/osuosl/master/config/builders.py?rev=104164&r1=104163&r2=104164&view=diff
==============================================================================
--- zorg/trunk/buildbot/osuosl/master/config/builders.py (original)
+++ zorg/trunk/buildbot/osuosl/master/config/builders.py Wed May 19 16:26:48 2010
@@ -170,7 +170,7 @@
{'name': "clang-i686-freebsd",
'slavenames':["freebsd1"],
'builddir':"clang-i686-freebsd",
- 'factory': ClangBuilder.getClangBuildFactory(clean=False)},
+ 'factory': ClangBuilder.getClangBuildFactory(clean=False, use_pty_in_tests=True)},
{'name' : "clang-i686-xp-msvc9",
'slavenames' :['dunbar-win32-2'],
'builddir' :"clang-i686-xp-msvc9",
@@ -238,6 +238,14 @@
def _get_experimental_builders():
return [
+ {'name' : "clang-i386-darwin10-selfhost-rel",
+ 'slavenames' : ["dunbar-darwin10"],
+ 'builddir' : "clang-i386-darwin10-selfhost-rel",
+ 'factory' : ClangBuilder.getClangBuildFactory(triple='i386-apple-darwin10',
+ useTwoStage=True,
+ stage1_config='Release',
+ stage2_config='Release'),
+ 'category' : 'clang.exp' },
{'name' : "clang-x86_64-darwin10-selfhost-rel",
'slavenames' : ["dunbar-darwin10"],
'builddir' : "clang-x86_64-darwin10-selfhost-rel",
Modified: zorg/trunk/zorg/buildbot/builders/ClangBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ClangBuilder.py?rev=104164&r1=104163&r2=104164&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/ClangBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/ClangBuilder.py Wed May 19 16:26:48 2010
@@ -19,7 +19,7 @@
completely_clean=False, always_install=False,
make='make', jobs="%(jobs)s",
stage1_config='Debug', stage2_config='Release',
- extra_configure_args=[]):
+ extra_configure_args=[], use_pty_in_tests=False):
# Don't use in-dir builds with a two stage build process.
inDir = not outOfDir and not useTwoStage
if inDir:
@@ -128,11 +128,13 @@
command=[make, "check-lit", "VERBOSE=1"],
description=["testing", "llvm"],
descriptionDone=["test", "llvm"],
- workdir=llvm_1_objdir))
+ workdir=llvm_1_objdir,
+ usePTY=use_pty_in_tests))
f.addStep(ClangTestCommand(name='test-clang',
command=[make, 'test', WithProperties('TESTARGS=%s' % clangTestArgs),
WithProperties('EXTRA_TESTDIRS=%s' % extraTestDirs)],
- workdir='%s/tools/clang' % llvm_1_objdir))
+ workdir='%s/tools/clang' % llvm_1_objdir,
+ usePTY=use_pty_in_tests))
# Install llvm and clang.
if llvm_1_installdir:
@@ -189,11 +191,13 @@
command=[make, "check-lit", "VERBOSE=1"],
description=["testing", "llvm"],
descriptionDone=["test", "llvm"],
- workdir=llvm_2_objdir))
+ workdir=llvm_2_objdir,
+ usePTY=use_pty_in_tests))
f.addStep(ClangTestCommand(name='test-clang',
command=[make, 'test', WithProperties('TESTARGS=%s' % clangTestArgs),
WithProperties('EXTRA_TESTDIRS=%s' % extraTestDirs)],
- workdir='%s/tools/clang' % llvm_2_objdir))
+ workdir='%s/tools/clang' % llvm_2_objdir,
+ usePTY=use_pty_in_tests))
# Install clang (stage 2).
f.addStep(ShellCommand(name="rm-install.clang.stage2",
From dpatel at apple.com Wed May 19 16:26:53 2010
From: dpatel at apple.com (Devang Patel)
Date: Wed, 19 May 2010 21:26:53 -0000
Subject: [llvm-commits] [llvm] r104165 - in
/llvm/trunk/lib/CodeGen/AsmPrinter: DwarfDebug.cpp DwarfDebug.h
Message-ID: <20100519212653.6D8EC3128018@llvm.org>
Author: dpatel
Date: Wed May 19 16:26:53 2010
New Revision: 104165
URL: http://llvm.org/viewvc/llvm-project?rev=104165&view=rev
Log:
There is no need to maintain InsnsBeginScopeSet separately.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=104165&r1=104164&r2=104165&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed May 19 16:26:53 2010
@@ -2230,11 +2230,8 @@
Label = recordSourceLine(DL.getLine(), DL.getCol(), 0);
PrevInstLoc = DL;
PrevLabel = Label;
- }
-
- // If this instruction begins a scope then note down corresponding label.
- if (InsnsBeginScopeSet.count(MI) != 0)
LabelsBeforeInsn[MI] = Label;
+ }
}
return;
@@ -2258,6 +2255,7 @@
Label = recordSourceLine(DL.getLine(), DL.getCol(), Scope);
PrevInstLoc = DL;
PrevLabel = Label;
+ LabelsBeforeInsn[MI] = Label;
}
DI->second->setDbgValueLabel(Label);
}
@@ -2273,11 +2271,9 @@
Label = recordSourceLine(DL.getLine(), DL.getCol(), Scope);
PrevInstLoc = DL;
PrevLabel = Label;
+ LabelsBeforeInsn[MI] = Label;
}
- // If this instruction begins a scope then note down corresponding label.
- if (InsnsBeginScopeSet.count(MI) != 0)
- LabelsBeforeInsn[MI] = Label;
}
/// endScope - Process end of a scope.
@@ -2535,9 +2531,8 @@
continue;
for (SmallVector::const_iterator RI = Ranges.begin(),
RE = Ranges.end(); RI != RE; ++RI) {
- assert(RI->first && "DbgRange does not have first instruction!");
- assert(RI->second && "DbgRange does not have second instruction!");
- InsnsBeginScopeSet.insert(RI->first);
+ assert(RI->first && "DbgRange does not have first instruction!");
+ assert(RI->second && "DbgRange does not have second instruction!");
InsnsEndScopeSet.insert(RI->second);
}
}
@@ -2631,7 +2626,6 @@
// Clear debug info
CurrentFnDbgScope = NULL;
DeleteContainerSeconds(DbgScopeMap);
- InsnsBeginScopeSet.clear();
InsnsEndScopeSet.clear();
DbgValueStartMap.clear();
ConcreteScopes.clear();
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=104165&r1=104164&r2=104165&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Wed May 19 16:26:53 2010
@@ -179,8 +179,6 @@
/// corresponds to the MDNode mapped with the subprogram DIE.
DenseMap ContainingTypeMap;
- typedef SmallVector ScopeVector;
- SmallPtrSet InsnsBeginScopeSet;
SmallPtrSet InsnsEndScopeSet;
/// InlineInfo - Keep track of inlined functions and their location. This
From criswell at uiuc.edu Wed May 19 16:26:57 2010
From: criswell at uiuc.edu (John Criswell)
Date: Wed, 19 May 2010 21:26:57 -0000
Subject: [llvm-commits] [poolalloc] r104166 -
/poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp
Message-ID: <20100519212657.1AE10312800A@llvm.org>
Author: criswell
Date: Wed May 19 16:26:56 2010
New Revision: 104166
URL: http://llvm.org/viewvc/llvm-project?rev=104166&view=rev
Log:
Handle the case where a DSNode::iterator can represent a NULL DSNode.
Improved comment formatting.
Modified:
poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp
Modified: poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp?rev=104166&r1=104165&r2=104166&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp Wed May 19 16:26:56 2010
@@ -184,18 +184,32 @@
for (DSGraph::node_iterator I = G->node_begin(), E = G->node_end();
I != E; ++I) {
DSNode *N = I;
+#if 0
+ //
// Ignore nodes that are just globals and not arrays.
- /*
+ //
if (N->isArray() || N->isHeapNode() || N->isAllocaNode() ||
N->isUnknownNode())
- */
+#endif
// If a node is marked, all children are too.
- if (!ReachableFromMemory.count(N))
- for (DSNode::iterator NI = N->begin(), E = N->end(); NI != E; ++NI)
+ if (!ReachableFromMemory.count(N)) {
+ for (DSNode::iterator NI = N->begin(), E = N->end(); NI != E; ++NI) {
+ //
+ // Sometimes this results in a NULL DSNode. Skip it if that is the
+ // case.
+ //
+ if (!(*NI)) continue;
+
+ //
+ // Do a depth-first iteration over the DSGraph starting with this
+ // child node.
+ //
for (df_ext_iterator
DI = df_ext_begin(*NI, ReachableFromMemory),
E = df_ext_end(*NI, ReachableFromMemory); DI != E; ++DI)
/*empty*/;
+ }
+ }
}
// Only pool allocate a node if it is reachable from a memory object (itself
From stoklund at 2pi.dk Wed May 19 16:36:05 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Wed, 19 May 2010 21:36:05 -0000
Subject: [llvm-commits] [llvm] r104167 -
/llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Message-ID: <20100519213605.3D9B4312800A@llvm.org>
Author: stoklund
Date: Wed May 19 16:36:05 2010
New Revision: 104167
URL: http://llvm.org/viewvc/llvm-project?rev=104167&view=rev
Log:
Add support for partial redefs to the fast register allocator.
A partial redef now triggers a reload if required. Also don't add
operands for physical superregisters.
Kill flags are still treated as full register kills, and operands
are added for physical superregisters as before.
Modified:
llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=104167&r1=104166&r2=104167&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Wed May 19 16:36:05 2010
@@ -200,14 +200,9 @@
void RAFast::addKillFlag(const LiveReg &LR) {
if (!LR.LastUse) return;
MachineOperand &MO = LR.LastUse->getOperand(LR.LastOpNum);
- if (MO.getReg() == LR.PhysReg) {
- if (MO.isDef())
- MO.setIsDead();
- else if (!LR.LastUse->isRegTiedToDefOperand(LR.LastOpNum))
+ if (MO.isUse() && !LR.LastUse->isRegTiedToDefOperand(LR.LastOpNum)) {
+ if (MO.getReg() == LR.PhysReg)
MO.setIsKill();
- } else {
- if (MO.isDef())
- LR.LastUse->addRegisterDead(LR.PhysReg, TRI, true);
else
LR.LastUse->addRegisterKilled(LR.PhysReg, TRI, true);
}
@@ -513,6 +508,7 @@
bool New;
tie(LRI, New) = LiveVirtRegs.insert(std::make_pair(VirtReg, LiveReg()));
LiveReg &LR = LRI->second;
+ bool PartialRedef = MI->getOperand(OpNum).getSubReg();
if (New) {
// If there is no hint, peek at the only use of this register.
if ((!Hint || !TargetRegisterInfo::isPhysicalRegister(Hint)) &&
@@ -524,7 +520,15 @@
Hint = DstReg;
}
allocVirtReg(MI, *LRI, Hint);
- } else if (LR.LastUse) {
+ // If this is only a partial redefinition, we must reload the other parts.
+ if (PartialRedef && MI->readsVirtualRegister(VirtReg)) {
+ const TargetRegisterClass *RC = MRI->getRegClass(VirtReg);
+ int FI = getStackSpaceFor(VirtReg, RC);
+ DEBUG(dbgs() << "Reloading for partial redef: %reg" << VirtReg << "\n");
+ TII->loadRegFromStackSlot(*MBB, MI, LR.PhysReg, FI, RC, TRI);
+ ++NumLoads;
+ }
+ } else if (LR.LastUse && !PartialRedef) {
// Redefining a live register - kill at the last use, unless it is this
// instruction defining VirtReg multiple times.
if (LR.LastUse != MI || LR.LastUse->getOperand(LR.LastOpNum).isUse())
@@ -593,20 +597,14 @@
// Handle subregister index.
MO.setReg(PhysReg ? TRI->getSubReg(PhysReg, MO.getSubReg()) : 0);
MO.setSubReg(0);
- if (MO.isUse()) {
- if (MO.isKill()) {
- MI->addRegisterKilled(PhysReg, TRI, true);
- return true;
- }
- return false;
- }
- // A subregister def implicitly defines the whole physreg.
- if (MO.isDead()) {
- MI->addRegisterDead(PhysReg, TRI, true);
+
+ // A kill flag implies killing the full register. Add corresponding super
+ // register kill.
+ if (MO.isKill()) {
+ MI->addRegisterKilled(PhysReg, TRI, true);
return true;
}
- MI->addRegisterDefined(PhysReg, TRI);
- return false;
+ return MO.isDead();
}
void RAFast::AllocateBasicBlock() {
From criswell at uiuc.edu Wed May 19 16:43:33 2010
From: criswell at uiuc.edu (John Criswell)
Date: Wed, 19 May 2010 21:43:33 -0000
Subject: [llvm-commits] [poolalloc] r104170 -
/poolalloc/trunk/test/TEST.poolalloc.Makefile
Message-ID: <20100519214333.594B6312800A@llvm.org>
Author: criswell
Date: Wed May 19 16:43:33 2010
New Revision: 104170
URL: http://llvm.org/viewvc/llvm-project?rev=104170&view=rev
Log:
Added a missing line which prevents reports from working properly.
Modified:
poolalloc/trunk/test/TEST.poolalloc.Makefile
Modified: poolalloc/trunk/test/TEST.poolalloc.Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.poolalloc.Makefile?rev=104170&r1=104169&r2=104170&view=diff
==============================================================================
--- poolalloc/trunk/test/TEST.poolalloc.Makefile (original)
+++ poolalloc/trunk/test/TEST.poolalloc.Makefile Wed May 19 16:43:33 2010
@@ -235,7 +235,9 @@
Output/%.mallocrepl.diff-nat \
Output/%.onlyoverhead.diff-nat \
Output/%.LOC.txt
+ @cat $<
@echo > $@
+ @echo ">>> ========= '$(RELDIR)/$*' Program" >> $@
@-if test -f Output/$*.nonpa.diff-nat; then \
printf "GCC-RUN-TIME: " >> $@;\
grep "^program" Output/$*.out-nat.time >> $@;\
From dpatel at apple.com Wed May 19 16:58:28 2010
From: dpatel at apple.com (Devang Patel)
Date: Wed, 19 May 2010 21:58:28 -0000
Subject: [llvm-commits] [llvm] r104172 - in
/llvm/trunk/lib/CodeGen/AsmPrinter: DwarfDebug.cpp DwarfDebug.h
Message-ID: <20100519215828.4C3E2312800A@llvm.org>
Author: dpatel
Date: Wed May 19 16:58:28 2010
New Revision: 104172
URL: http://llvm.org/viewvc/llvm-project?rev=104172&view=rev
Log:
Revert r104165.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=104172&r1=104171&r2=104172&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed May 19 16:58:28 2010
@@ -2230,8 +2230,11 @@
Label = recordSourceLine(DL.getLine(), DL.getCol(), 0);
PrevInstLoc = DL;
PrevLabel = Label;
- LabelsBeforeInsn[MI] = Label;
}
+
+ // If this instruction begins a scope then note down corresponding label.
+ if (InsnsBeginScopeSet.count(MI) != 0)
+ LabelsBeforeInsn[MI] = Label;
}
return;
@@ -2255,7 +2258,6 @@
Label = recordSourceLine(DL.getLine(), DL.getCol(), Scope);
PrevInstLoc = DL;
PrevLabel = Label;
- LabelsBeforeInsn[MI] = Label;
}
DI->second->setDbgValueLabel(Label);
}
@@ -2271,9 +2273,11 @@
Label = recordSourceLine(DL.getLine(), DL.getCol(), Scope);
PrevInstLoc = DL;
PrevLabel = Label;
- LabelsBeforeInsn[MI] = Label;
}
+ // If this instruction begins a scope then note down corresponding label.
+ if (InsnsBeginScopeSet.count(MI) != 0)
+ LabelsBeforeInsn[MI] = Label;
}
/// endScope - Process end of a scope.
@@ -2531,8 +2535,9 @@
continue;
for (SmallVector::const_iterator RI = Ranges.begin(),
RE = Ranges.end(); RI != RE; ++RI) {
- assert(RI->first && "DbgRange does not have first instruction!");
- assert(RI->second && "DbgRange does not have second instruction!");
+ assert(RI->first && "DbgRange does not have first instruction!");
+ assert(RI->second && "DbgRange does not have second instruction!");
+ InsnsBeginScopeSet.insert(RI->first);
InsnsEndScopeSet.insert(RI->second);
}
}
@@ -2626,6 +2631,7 @@
// Clear debug info
CurrentFnDbgScope = NULL;
DeleteContainerSeconds(DbgScopeMap);
+ InsnsBeginScopeSet.clear();
InsnsEndScopeSet.clear();
DbgValueStartMap.clear();
ConcreteScopes.clear();
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=104172&r1=104171&r2=104172&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Wed May 19 16:58:28 2010
@@ -179,6 +179,8 @@
/// corresponds to the MDNode mapped with the subprogram DIE.
DenseMap ContainingTypeMap;
+ typedef SmallVector ScopeVector;
+ SmallPtrSet InsnsBeginScopeSet;
SmallPtrSet InsnsEndScopeSet;
/// InlineInfo - Keep track of inlined functions and their location. This
From evan.cheng at apple.com Wed May 19 17:42:23 2010
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 19 May 2010 22:42:23 -0000
Subject: [llvm-commits] [llvm] r104173 -
/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
Message-ID: <20100519224223.C151E312800A@llvm.org>
Author: evancheng
Date: Wed May 19 17:42:23 2010
New Revision: 104173
URL: http://llvm.org/viewvc/llvm-project?rev=104173&view=rev
Log:
Code clean up.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp?rev=104173&r1=104172&r2=104173&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Wed May 19 17:42:23 2010
@@ -217,9 +217,6 @@
// This is a temporary workaround.
SUnits.reserve(NumNodes * 2);
- // Check to see if the scheduler cares about latencies.
- bool UnitLatencies = ForceUnitLatencies();
-
// Add all nodes in depth first order.
SmallVector Worklist;
SmallPtrSet Visited;
@@ -282,10 +279,7 @@
N->setNodeId(NodeSUnit->NodeNum);
// Assign the Latency field of NodeSUnit using target-provided information.
- if (UnitLatencies)
- NodeSUnit->Latency = 1;
- else
- ComputeLatency(NodeSUnit);
+ ComputeLatency(NodeSUnit);
}
}
@@ -377,6 +371,12 @@
}
void ScheduleDAGSDNodes::ComputeLatency(SUnit *SU) {
+ // Check to see if the scheduler cares about latencies.
+ if (ForceUnitLatencies()) {
+ SU->Latency = 1;
+ return;
+ }
+
const InstrItineraryData &InstrItins = TM.getInstrItineraryData();
// Compute the latency for the node. We use the sum of the latencies for
From grosbach at apple.com Wed May 19 17:57:06 2010
From: grosbach at apple.com (Jim Grosbach)
Date: Wed, 19 May 2010 22:57:06 -0000
Subject: [llvm-commits] [llvm] r104174 - in /llvm/trunk:
include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/ScheduleDAGInstrs.cpp
Message-ID: <20100519225706.BB1D2312800A@llvm.org>
Author: grosbach
Date: Wed May 19 17:57:06 2010
New Revision: 104174
URL: http://llvm.org/viewvc/llvm-project?rev=104174&view=rev
Log:
Fix the post-RA instruction scheduler to handle instructions referenced by
more than one dbg_value instruction. rdar://7759363
Modified:
llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp
Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=104174&r1=104173&r2=104174&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Wed May 19 17:57:06 2010
@@ -225,7 +225,6 @@
private:
SDNode *Node; // Representative node.
MachineInstr *Instr; // Alternatively, a MachineInstr.
- MachineInstr *DbgInstr; // A dbg_value referencing this.
public:
SUnit *OrigNode; // If not this, the node from which
// this node was cloned.
@@ -256,6 +255,8 @@
bool isScheduled : 1; // True once scheduled.
bool isScheduleHigh : 1; // True if preferable to schedule high.
bool isCloned : 1; // True if this node has been cloned.
+
+ SmallVector DbgInstrList; // dbg_values referencing this.
private:
bool isDepthCurrent : 1; // True if Depth is current.
bool isHeightCurrent : 1; // True if Height is current.
@@ -268,7 +269,7 @@
/// SUnit - Construct an SUnit for pre-regalloc scheduling to represent
/// an SDNode and any nodes flagged to it.
SUnit(SDNode *node, unsigned nodenum)
- : Node(node), Instr(0), DbgInstr(0), OrigNode(0), NodeNum(nodenum),
+ : Node(node), Instr(0), OrigNode(0), NodeNum(nodenum),
NodeQueueId(0), Latency(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0),
NumSuccsLeft(0), isTwoAddress(false), isCommutable(false),
hasPhysRegDefs(false), hasPhysRegClobbers(false),
@@ -280,7 +281,7 @@
/// SUnit - Construct an SUnit for post-regalloc scheduling to represent
/// a MachineInstr.
SUnit(MachineInstr *instr, unsigned nodenum)
- : Node(0), Instr(instr), DbgInstr(0), OrigNode(0), NodeNum(nodenum),
+ : Node(0), Instr(instr), OrigNode(0), NodeNum(nodenum),
NodeQueueId(0), Latency(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0),
NumSuccsLeft(0), isTwoAddress(false), isCommutable(false),
hasPhysRegDefs(false), hasPhysRegClobbers(false),
@@ -291,7 +292,7 @@
/// SUnit - Construct a placeholder SUnit.
SUnit()
- : Node(0), Instr(0), DbgInstr(0), OrigNode(0), NodeNum(~0u),
+ : Node(0), Instr(0), OrigNode(0), NodeNum(~0u),
NodeQueueId(0), Latency(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0),
NumSuccsLeft(0), isTwoAddress(false), isCommutable(false),
hasPhysRegDefs(false), hasPhysRegClobbers(false),
@@ -328,20 +329,6 @@
return Instr;
}
- /// setDbgInstr - Assign the debug instruction for the SUnit.
- /// This may be used during post-regalloc scheduling.
- void setDbgInstr(MachineInstr *MI) {
- assert(!Node && "Setting debug MachineInstr of SUnit with SDNode!");
- DbgInstr = MI;
- }
-
- /// getDbgInstr - Return the debug MachineInstr for this SUnit.
- /// This may be used during post-regalloc scheduling.
- MachineInstr *getDbgInstr() const {
- assert(!Node && "Reading debug MachineInstr of SUnit with SDNode!");
- return DbgInstr;
- }
-
/// addPred - This adds the specified edge as a pred of the current node if
/// not already. It also adds the current node as a successor of the
/// specified node.
Modified: llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp?rev=104174&r1=104173&r2=104174&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp (original)
+++ llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp Wed May 19 17:57:06 2010
@@ -210,7 +210,7 @@
assert(TRI->isPhysicalRegister(Reg) && "Virtual register encountered!");
if (MO.isDef() && DanglingDebugValue[Reg].first!=0) {
- SU->setDbgInstr(DanglingDebugValue[Reg].first);
+ SU->DbgInstrList.push_back(DanglingDebugValue[Reg].first);
DbgValueVec[DanglingDebugValue[Reg].second] = 0;
DanglingDebugValue[Reg] = std::make_pair((MachineInstr*)0, 0);
}
@@ -599,8 +599,8 @@
}
BB->insert(InsertPos, SU->getInstr());
- if (SU->getDbgInstr())
- BB->insert(InsertPos, SU->getDbgInstr());
+ for (unsigned i = 0, e = SU->DbgInstrList.size() ; i < e ; ++i)
+ BB->insert(InsertPos, SU->DbgInstrList[i]);
}
// Update the Begin iterator, as the first instruction in the block
From grosbach at apple.com Wed May 19 17:57:47 2010
From: grosbach at apple.com (Jim Grosbach)
Date: Wed, 19 May 2010 22:57:47 -0000
Subject: [llvm-commits] [llvm] r104175 -
/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
Message-ID: <20100519225747.4D943312800A@llvm.org>
Author: grosbach
Date: Wed May 19 17:57:47 2010
New Revision: 104175
URL: http://llvm.org/viewvc/llvm-project?rev=104175&view=rev
Log:
Enable preserving debug information through post-RA scheduling
Modified:
llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=104175&r1=104174&r2=104175&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original)
+++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Wed May 19 17:57:47 2010
@@ -83,7 +83,7 @@
static cl::opt