1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
Commit Graph

38081 Commits

Author SHA1 Message Date
Dan Gohman
caa827af2c This doesn't need SmallVector.h anymore.
llvm-svn: 101790
2010-04-19 17:51:31 +00:00
Johnny Chen
b386de1758 Better error-handling for DisassembleThumb2DPSoReg() where the 3-reg operand
instructions should have Rd (Inst{11-8}) != 0b1111.

Ref: A6.3 32-bit Thumb instruction encoding
     A6.3.11 Data-processing (shifted register)
llvm-svn: 101788
2010-04-19 17:16:40 +00:00
Dan Gohman
ede59ecfbb Fix this for std::vectors which don't have .data().
llvm-svn: 101785
2010-04-19 16:33:28 +00:00
Johnny Chen
091c01cb2f ARM disassembler did not react to recent changes to the NEON instruction table.
VLD1q*_UPD and VST1q*_UPD have the ${dst:dregpair} operand now.

llvm-svn: 101784
2010-04-19 16:20:34 +00:00
Benjamin Kramer
96b4f6c003 Don't write into MemoryBuffers.
llvm-svn: 101783
2010-04-19 16:15:31 +00:00
Dan Gohman
e2e1b9063a Fix -Wcast-qual warnings.
llvm-svn: 101782
2010-04-19 15:55:10 +00:00
Dan Gohman
735c177251 Revert 91528 and use a std::vector instead, fixing an abuse of std::string.
llvm-svn: 101781
2010-04-19 15:54:44 +00:00
Dan Gohman
f2998652a8 Fix -Wcast-qual warnings.
llvm-svn: 101779
2010-04-19 15:42:05 +00:00
Anton Korobeynikov
dc153b7539 Add missed part of prev. commit
llvm-svn: 101755
2010-04-18 20:41:42 +00:00
Anton Korobeynikov
e325c693a5 Make processor FUs unique for given itinerary. This extends the limit of 32
FU per CPU arch to 32 per intinerary allowing precise modelling of quite
complex pipelines in the future.

llvm-svn: 101754
2010-04-18 20:31:01 +00:00
Chris Lattner
746abd86e7 avoid temporary std::string in non posix_spawn path.
llvm-svn: 101723
2010-04-18 17:34:10 +00:00
Benjamin Kramer
2cade0b3ff Eliminate temporary string.
llvm-svn: 101711
2010-04-18 09:19:41 +00:00
Benjamin Kramer
6f6354213f Properly inherit the environment on darwin where environ is not available for shared libraries.
llvm-svn: 101710
2010-04-18 09:16:04 +00:00
Nick Lewycky
152b2bc046 This is horrible. Split the difference, and declare 'environ' on all non-Darwin
platforms to unbreak the darwin and linux builds. The BSD folks should feel
free to change the #if, if this breaks them.

llvm-svn: 101703
2010-04-18 07:07:48 +00:00
Nick Lewycky
459afe3cce Revert r101701, Darwin doesn't have 'environ'. Go figure.
llvm-svn: 101702
2010-04-18 06:44:21 +00:00
Nick Lewycky
2b694c49bb Fix linux build. posix_spawn doesn't inherit the environment by default.
llvm-svn: 101701
2010-04-18 06:22:26 +00:00
Chris Lattner
22b58ac393 make Program::Execute use posix_spawn on systems that support it,
as it is more efficient than fork/exec.

Thanks to Eric for adding the autoconf check.  It would be nice if
a cmake guru could add a cmake check for posix_spawn as well.

llvm-svn: 101693
2010-04-18 04:14:37 +00:00
Chris Lattner
f543d5e029 reduce indentation
llvm-svn: 101692
2010-04-18 03:35:23 +00:00
Chris Lattner
49c39866b3 unnest from namespace.
llvm-svn: 101691
2010-04-18 03:33:55 +00:00
Bill Wendling
3592f4fac4 Don't rely upon the MCSymbol "isDefined" method to indicate if a label has been
emitted or not. The JIT doesn't set that. Look it up in the label location table
instead.

llvm-svn: 101686
2010-04-18 00:56:05 +00:00
Bill Wendling
19aefaac85 Formatting changes. No functionality change.
llvm-svn: 101685
2010-04-18 00:52:08 +00:00
Daniel Dunbar
0cfafd5b8f Revert "reject forward references to functions whose type don't match", because DJG told me to!
llvm-svn: 101675
2010-04-17 21:24:55 +00:00
Chris Lattner
8028c98fe2 reject forward references to functions whose type don't match
up with the definition (and fix a broken testcase).  PR6491.

llvm-svn: 101670
2010-04-17 20:45:56 +00:00
Chris Lattner
99d17acb35 fix PR6332, allowing an index of zero into a zero sized array
even if the element of the array has no size.

llvm-svn: 101662
2010-04-17 19:02:33 +00:00
Chris Lattner
65d1e40895 teach the x86 asm parser how to handle segment prefixes
in memory operands.  rdar://7874844

llvm-svn: 101661
2010-04-17 18:56:34 +00:00
Chris Lattner
a5798151a3 refactor .if handling code a bit.
llvm-svn: 101659
2010-04-17 18:14:27 +00:00
Chris Lattner
a5eb6419eb fix PR6858: a dangling pointer use bug which was caused
by switching CachedFunctionInfo from a std::map to a 
ValueMap (which is implemented in terms of a DenseMap).

DenseMap has different iterator invalidation semantics
than std::map.

This should hopefully fix the dragonegg builder.

llvm-svn: 101658
2010-04-17 17:57:56 +00:00
Chris Lattner
d506ae2617 a bunch of cleanups and tweaks, no functionality changes.
llvm-svn: 101657
2010-04-17 17:55:00 +00:00
Dan Gohman
fba34ef042 Fix -Wcast-qual warnings.
llvm-svn: 101655
2010-04-17 17:42:52 +00:00
Chris Lattner
99878c7ca4 remove a dead variable, PR6856
llvm-svn: 101648
2010-04-17 17:28:00 +00:00
Dan Gohman
3dde4fe35f Add const qualifiers to TargetLoweringObjectFile usage.
llvm-svn: 101640
2010-04-17 16:44:48 +00:00
Dan Gohman
b5109cda0e Use const_cast instead of a C-style cast to cast away const.
llvm-svn: 101639
2010-04-17 16:43:55 +00:00
Dan Gohman
5736cd1e47 Start function numbering at 0.
llvm-svn: 101638
2010-04-17 16:29:15 +00:00
Dan Gohman
6065ff317b Delete now-unnecessary const_casts.
llvm-svn: 101637
2010-04-17 15:32:28 +00:00
Dan Gohman
87af9f6bf4 Use cast instead of dyn_cast when assuming success.
llvm-svn: 101636
2010-04-17 15:31:16 +00:00
Dan Gohman
a0f855157e Use const qualifiers with TargetLowering. This eliminates several
const_casts, and it reinforces the design of the Target classes being
immutable.

SelectionDAGISel::IsLegalToFold is now a static member function, because
PIC16 uses it in an unconventional way. There is more room for API
cleanup here.

And PIC16's AsmPrinter no longer uses TargetLowering.

llvm-svn: 101635
2010-04-17 15:26:15 +00:00
Dan Gohman
5c8db5ab3f Move per-function state out of TargetLowering subclasses and into
MachineFunctionInfo subclasses.

llvm-svn: 101634
2010-04-17 14:41:14 +00:00
Chandler Carruth
c03e85229d Name these stub files consistently with the SPU and PPC targets' conventions.
Also rename the classes appropriately. The CMake build already used these
names.

llvm-svn: 101631
2010-04-17 08:50:29 +00:00
Chris Lattner
42337931b2 a bunch of ssse3 instructions are misencoded to think they have an
i8 field when they really do not.  This fixes rdar://7840289

llvm-svn: 101629
2010-04-17 07:38:24 +00:00
Chris Lattner
bef627e798 reenable r101565, removing a problematic assertion.
CGSCC can delete nodes in regions of the callgraph that
have already been visited.  If new CG nodes are allocated
to the same pointer, we shouldn't abort, just handle it
correctly by assigning a new number.  This should restore
stability by removing invalidated pointers that *will* be
reused from the densemap in the iterator.

llvm-svn: 101628
2010-04-17 07:17:19 +00:00
Evan Cheng
0004496a98 Postra machine licm must add registers defined by loop invariants to *all* of
the live-in sets of BBs in the loop. Otherwise later pass may end up using the
registers and override the invariant. rdar://7852937
No reasonablly sized test case possible.

llvm-svn: 101626
2010-04-17 07:07:11 +00:00
Evan Cheng
81f543c005 Fix codegen passes. -disable-ssc shouldn't disable postra machine licm.
llvm-svn: 101622
2010-04-17 06:47:47 +00:00
Evan Cheng
6442d111dd More work to allow dag combiner to promote 16-bit ops to 32-bit.
llvm-svn: 101621
2010-04-17 06:13:15 +00:00
Evan Cheng
aa2f3449c4 Another 80 col violation.
llvm-svn: 101620
2010-04-17 06:12:32 +00:00
Bob Wilson
7e53f886d2 Revise my previous change to ExpandBIT_CONVERT. I hadn't realized that this
may be called when either the source or destination type is i64, and my
change also hadn't fixed the most obvious problem -- assuming that i64 will
only be bitconverted to f64, ignoring the various vector types.
Radar 7873160.

llvm-svn: 101615
2010-04-17 05:30:19 +00:00
Bob Wilson
ad00f21093 Re-commit my previous SSAUpdater changes. The previous version naively tried
to determine where to place PHIs by iteratively comparing reaching definitions
at each block.  That was just plain wrong.  This version now computes the
dominator tree within the subset of the CFG where PHIs may need to be placed,
and then places the PHIs in the iterated dominance frontier of each definition.
The rest of the patch is mostly the same, with a few more performance
improvements added in.

llvm-svn: 101612
2010-04-17 03:08:24 +00:00
Bob Wilson
01b8b8ef7d As a temporary workaround for post-RA not handling DebugValue instructions,
just remove them all.  Radar 7873207 (working around the root problem of
Radar 7759363).

llvm-svn: 101604
2010-04-17 00:49:11 +00:00
Jakob Stoklund Olesen
2f0fbb4587 Revert "Use a simpler data structure to calculate the least recently used register in RegAllocLocal."
This reverts commit 101392. It broke a buildbot.

llvm-svn: 101595
2010-04-17 00:38:36 +00:00
Chris Lattner
36a76e4185 disable r101565: an assert is getting triggered. More lurking badness no doubt.
llvm-svn: 101583
2010-04-17 00:05:36 +00:00
Chris Lattner
136547652d add a note
llvm-svn: 101581
2010-04-16 23:52:30 +00:00
Eric Christopher
e78496e5f1 Revert 101465, it broke internal OpenGL testing.
Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.

llvm-svn: 101579
2010-04-16 23:37:20 +00:00
Devang Patel
1929d78e71 Add support to emit dwarf ranges.
llvm-svn: 101575
2010-04-16 23:33:45 +00:00
Jakob Stoklund Olesen
51248b6cb4 Use a simpler data structure to calculate the least recently used register in RegAllocLocal.
This makes the local register allocator about 20% faster.

llvm-svn: 101574
2010-04-16 23:32:37 +00:00
Johnny Chen
8de98d4036 Cast to (uint64_t) instead of relying on the "ul" suffix.
llvm-svn: 101573
2010-04-16 23:30:28 +00:00
Chris Lattner
d28dcb3ffe building on the new CallGraphSCC abstraction, teach CallGraphSCCPassManager
to keep the node entries in scc_iterator up to date instead of dangling as
the SCC mutates.

This is a really terrible problem which was causing -g to affect codegen 
because it would permute the memory image of the compiler process.

Thanks to Dale for expertly hunting it down.

llvm-svn: 101565
2010-04-16 23:04:30 +00:00
Dan Gohman
982923742d Add skeleton target-specific SelectionDAGInfo files.
llvm-svn: 101564
2010-04-16 23:04:22 +00:00
Johnny Chen
2b1390e9bc Fixed logic error. Should check Builder for validity before calling SetSession
on it.

llvm-svn: 101563
2010-04-16 23:02:25 +00:00
Chris Lattner
a9a7c28cd2 move ReplaceNode out of line, rename scc_iterator::fini -> isAtEnd().
No functionality change.

llvm-svn: 101562
2010-04-16 22:59:24 +00:00
Chris Lattner
6a038be777 introduce a new CallGraphSCC class, and pass it around
to CallGraphSCCPass's instead of passing around a
std::vector<CallGraphNode*>.  No functionality change,
but now we have a much tidier interface.

llvm-svn: 101558
2010-04-16 22:42:17 +00:00
Johnny Chen
44087236da Fixed a bug in DisassembleN1RegModImmFrm() where a break stmt was missing for a
case.  Also, the 0xFF hex literal involved in the shift for ESize64 should be
suffixed "ul" to preserve the shift result.

Implemented printHex*ImmOperand() by copying from ARMAsmPrinter.cpp and added a
test case for DisassembleN1RegModImmFrm()/printHex64ImmOperand().

llvm-svn: 101557
2010-04-16 22:40:20 +00:00
Evan Cheng
b55929892f (i32 sext_in_reg (i32 aext (i16 x)), i16) -> (i32 sext x). No known test case until -promote-16bit is enabled.
llvm-svn: 101551
2010-04-16 22:26:19 +00:00
Chris Lattner
5d6a95d587 move PrintCallGraphPass out of the middle of CGPassManager.
llvm-svn: 101543
2010-04-16 21:43:55 +00:00
Chris Lattner
4671fb68c5 add a missing break back, patch by Nico Schmidt!
llvm-svn: 101538
2010-04-16 21:15:15 +00:00
Dan Gohman
b3afc2a215 Create a new TargetSelectionDAGInfo class. This will eventually acquire
SelectionDAG-specific parts of TargetLowering.

llvm-svn: 101537
2010-04-16 21:12:11 +00:00
Dan Gohman
2912cb780f Commit this, which should have accompanied 101531.
llvm-svn: 101532
2010-04-16 20:22:43 +00:00
Dan Gohman
1119e6060b Eliminate an unnecessary SelectionDAG dependency in getOptimalMemOpType.
llvm-svn: 101531
2010-04-16 20:11:05 +00:00
Johnny Chen
7ac96eac03 In the same spirit of r101524, which removed the assert() from printAddrMode2OffsetOperand(),
this patch removes the assert() from printAddrMode3OffsetOperand() and adds a test case.

llvm-svn: 101529
2010-04-16 19:57:21 +00:00
Johnny Chen
3cc0200f74 Multiclass LdStCop was using pre-UAL syntax LDC<c>L for the L fragment. Changed
to the UAL syntax of LDCL<c>, instead.

Add a test case for this change which also tests the removal of assert() from
printAddrMode2OffsetOperand().

llvm-svn: 101527
2010-04-16 19:33:23 +00:00
Johnny Chen
3a03b36cd0 Remove the assert() from printAddrMode2OffsetOperand(). "#0 and #-0" are
considered legal instructions.

Refs: A8.6.51 LDC, LDC2 (immediate) -- page A8-107, A8.6.58 LDR (immediate, ARM)
-- page A8-121, and A8.6.194 STR (immediate, ARM) -- page A8-395.

llvm-svn: 101524
2010-04-16 19:10:52 +00:00
Evan Cheng
80afc6964c 80 col.
llvm-svn: 101501
2010-04-16 17:58:41 +00:00
Evan Cheng
e541446e11 80 col.
llvm-svn: 101500
2010-04-16 17:57:59 +00:00
Dan Gohman
e9683c52da Avoid creating virtual registers for unused values.
llvm-svn: 101480
2010-04-16 17:15:02 +00:00
Dan Gohman
30de6c2b1c Fix an assertion string.
llvm-svn: 101478
2010-04-16 16:55:18 +00:00
Dan Gohman
cb1d4ed9d0 Fix a comment.
llvm-svn: 101477
2010-04-16 16:52:37 +00:00
Dan Gohman
58add81e7d Disable inlining of recursive calls. It can complicate tailcallelim and
dependent analyses, and increase code size, so doing it profitably would
require more complex heuristics.

llvm-svn: 101471
2010-04-16 16:01:18 +00:00
Dan Gohman
f0457a82fa Refine the detection of seemingly infinitely recursive calls where the
callee is expected to be expanded to something else by codegen, so that
normal infinitely recursive calls are still transformed.

llvm-svn: 101468
2010-04-16 15:57:50 +00:00
Gabor Greif
e7d6812008 reapply r101434
with a fix for self-hosting

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

llvm-svn: 101465
2010-04-16 15:33:14 +00:00
Dan Gohman
f754ff8ee9 Make callIsSmall accessible as a utility function.
llvm-svn: 101463
2010-04-16 15:14:50 +00:00
Dan Gohman
2d575a91e0 Fix SCEVCommutativeExpr::print to be robust in the case of improper
expression canonicalization. Its job is to print what's there, not to
make judgements about it.

llvm-svn: 101461
2010-04-16 15:03:25 +00:00
Bill Wendling
7ede9396f4 The JIT calls TidyLandingPads to tidy up the landing pads. However, because the
JIT doesn't use the MC back-end asm printer to emit labels that it uses, the
section for the MCSymbol is never set. And thus the MCSymbol for the EH label
isn't marked as "defined". Because of that, TidyLandingPads removes the needed
landing pads from the JIT output. This breaks EH for every JIT program.

This is a work-around for this limitation. We pass in the label locations
map. If the label has a non-zero value, then it was "emitted" by the JIT and
TidyLandingPads shouldn't remove that label.

A nicer solution would be to mark the MCSymbol as "used" by the JIT and not rely
upon the section being set to determine if it's defined or not.

llvm-svn: 101453
2010-04-16 08:46:10 +00:00
Evan Cheng
d143bfe0a4 Adding support for dag combiner to promote operations for profit. This requires target specific queries. For example, x86 should promote i16 to i32 when it does not impact load folding.
x86 support is off by default. It can be enabled with -promote-16bit.

Work in progress.

llvm-svn: 101448
2010-04-16 06:14:10 +00:00
Evan Cheng
428f7f39a8 Use getAL() rather than a major constant.
llvm-svn: 101446
2010-04-16 05:46:06 +00:00
Dan Gohman
01d4af69bf Refine further the scope where the global DebugLoc value is active.
llvm-svn: 101443
2010-04-16 05:06:56 +00:00
Eric Christopher
ebbc0cfced Silence an unused variable warning.
llvm-svn: 101438
2010-04-16 04:02:04 +00:00
Chris Lattner
74934dcb1d fix comment noticed by Bob
llvm-svn: 101437
2010-04-16 02:32:17 +00:00
Gabor Greif
cd116e8c6a back out r101423 and r101397, they break llvm-gcc self-host on darwin10
llvm-svn: 101434
2010-04-16 01:16:20 +00:00
Chris Lattner
f90092185c fix PR6832: we were using the alignment of a pointer when we
wanted the alignment of the pointee.

llvm-svn: 101432
2010-04-16 01:05:38 +00:00
Chris Lattner
5baf2c68e5 improve comments.
llvm-svn: 101429
2010-04-16 00:38:19 +00:00
Chris Lattner
9c8dd19de8 pull all the ConvertToScalarInfo code together into one
place.

llvm-svn: 101427
2010-04-16 00:24:57 +00:00
Chris Lattner
082c018658 more refactoring: suck some stuff out of SRoA into
ConvertToScalarInfo.

llvm-svn: 101425
2010-04-16 00:20:00 +00:00
Gabor Greif
257aae9752 shift intrinsic operand
llvm-svn: 101423
2010-04-16 00:06:45 +00:00
Chris Lattner
977c0bfeb8 introduce a new ConvertToScalarInfo struct to simplify
CanConvertToScalar/MergeInType.  Eliminate a pointless
LLVMContext argument to MergeInType.

llvm-svn: 101422
2010-04-15 23:50:26 +00:00
Jakob Stoklund Olesen
00bd3bcbe4 Avoid sinking machine instructions into a loop.
MachineLoopInfo is already available when MachineSinking runs, so the check is
free.

There is no test case because it would require a critical edge into a loop, and
CodeGenPrepare splits those. This check is just to be extra careful.

llvm-svn: 101420
2010-04-15 23:41:02 +00:00
Johnny Chen
53225c4582 Fixed a bug in ARM disassembly where LDRSBT should have am3offset operand, not
am2offset.  Modified the instruction table entry and added a new test case.

llvm-svn: 101415
2010-04-15 23:12:47 +00:00
Evan Cheng
c843326d60 Use default lowering of DYNAMIC_STACKALLOC. As far as I can tell, ARM isle is doing the right thing and codegen looks correct for both Thumb and Thumb2.
llvm-svn: 101410
2010-04-15 22:20:34 +00:00
Chris Lattner
c38eea2b85 tidy interface to isOnlyCopiedFromConstantGlobal
llvm-svn: 101405
2010-04-15 21:59:20 +00:00
Gabor Greif
2e18d34d80 reapply r101364, which has been backed out in r101368
with a fix

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

llvm-svn: 101397
2010-04-15 20:51:13 +00:00
Jakob Stoklund Olesen
a40915cc26 Fix PR6847. RegScavenger should ignore DebugValues.
llvm-svn: 101392
2010-04-15 20:28:39 +00:00
Nicolas Geoffray
2a7f992240 Make sure the initialization of a GC root is after its definition.
llvm-svn: 101388
2010-04-15 19:53:35 +00:00
Anton Korobeynikov
a1cca8a579 Revert r100896 and around - this breaks the only mingw32 buildbot we have.
llvm-svn: 101387
2010-04-15 19:51:42 +00:00
Gabor Greif
61f227914e prune includes
llvm-svn: 101385
2010-04-15 19:44:21 +00:00
Evan Cheng
2f6d7ecd1b ARM SelectDYN_ALLOC should emit a copy from SP rather than referencing SP directly. In cases where there are two dyn_alloc in the same BB it would have caused the old SP value to be reused and badness ensues. rdar://7493908
llvm is generating poor code for dynamic alloca, I'll fix that later.

llvm-svn: 101383
2010-04-15 18:42:28 +00:00
Johnny Chen
6fdcb6241d DEBUG() print out "Unknown format" msg.
llvm-svn: 101382
2010-04-15 18:13:51 +00:00
Dan Gohman
b15905534c ReuseFrameIndexVals is used in multiple files, so it can't be static.
llvm-svn: 101379
2010-04-15 17:34:58 +00:00
Dan Gohman
eaff379069 EnablePPC64RS and EnablePPC32RS are used in multiple files, so they
can't be static.

llvm-svn: 101377
2010-04-15 17:20:57 +00:00
Dan Gohman
d48633d340 Fix a bunch of namespace polution.
llvm-svn: 101376
2010-04-15 17:08:50 +00:00
Dan Gohman
15f925cd5c Fix namespace polution.
llvm-svn: 101375
2010-04-15 16:23:27 +00:00
Dan Gohman
034c0f7354 Make getPredecessorWithUniqueSuccessorForBB return the unique successor
in addition to the predecessor.

llvm-svn: 101374
2010-04-15 16:19:08 +00:00
Gabor Greif
53da5ab8cf typos
llvm-svn: 101371
2010-04-15 15:14:46 +00:00
Gabor Greif
6022150477 back out r101364, as it trips the linux nightlybot on some clang C++ tests
llvm-svn: 101368
2010-04-15 12:46:56 +00:00
Gabor Greif
428ca23bbd rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

llvm-svn: 101364
2010-04-15 10:49:53 +00:00
Chris Lattner
1b7ecfdf60 enhance the load/store narrowing optimization to handle a
tokenfactor in between the load/store.  This allows us to 
optimize test7 into:

_test7:                                 ## @test7
## BB#0:                                ## %entry
	movl	(%rdx), %eax
                                        ## kill: SIL<def> ESI<kill>
	movb	%sil, 5(%rdi)
	ret

instead of:

_test7:                                 ## @test7
## BB#0:                                ## %entry
	movl	4(%esp), %ecx
	movl	$-65281, %eax           ## imm = 0xFFFFFFFFFFFF00FF
	andl	4(%ecx), %eax
	movzbl	8(%esp), %edx
	shll	$8, %edx
	addl	%eax, %edx
	movl	12(%esp), %eax
	movl	(%eax), %eax
	movl	%edx, 4(%ecx)
	ret

llvm-svn: 101355
2010-04-15 06:10:49 +00:00
Chris Lattner
8c5a5c9094 teach codegen to turn trunc(zextload) into load when possible.
This doesn't occur much at all, it only seems to formed in the case
when the trunc optimization kicks in due to phase ordering.  In that
case it is saves a few bytes on x86-32.

llvm-svn: 101350
2010-04-15 05:40:59 +00:00
Chris Lattner
510d19e597 add a simple dag combine to replace trivial shl+lshr with
and.  This happens with the store->load narrowing stuff.

llvm-svn: 101348
2010-04-15 05:28:43 +00:00
Chris Lattner
3282f3d34f Implement rdar://7860110 (also in target/readme.txt) narrowing
a load/or/and/store sequence into a narrower store when it is
safe.  Daniel tells me that clang will start producing this sort
of thing with bitfields, and this does  trigger a few dozen times
on 176.gcc produced by llvm-gcc even now.

This compiles code like CodeGen/X86/2009-05-28-DAGCombineCrash.ll 
into:

        movl    %eax, 36(%rdi)

instead of:

        movl    $4294967295, %eax       ## imm = 0xFFFFFFFF
        andq    32(%rdi), %rax
        shlq    $32, %rcx
        addq    %rax, %rcx
        movq    %rcx, 32(%rdi)

and each of the testcases into a single store.  Each of them used
to compile into craziness like this:

_test4:
	movl	$65535, %eax            ## imm = 0xFFFF
	andl	(%rdi), %eax
	shll	$16, %esi
	addl	%eax, %esi
	movl	%esi, (%rdi)
	ret

llvm-svn: 101343
2010-04-15 04:48:01 +00:00
Dan Gohman
64a84ceb3f Add more const qualifiers for LLVM IR pointers in CodeGen.
llvm-svn: 101342
2010-04-15 04:33:49 +00:00
Anders Carlsson
32747b3841 Fix build.
llvm-svn: 101335
2010-04-15 03:11:28 +00:00
Dan Gohman
0e0b8cf9fd Add const qualifiers to CodeGen's use of LLVM IR constructs.
llvm-svn: 101334
2010-04-15 01:51:59 +00:00
Eric Christopher
3be394d9b1 Allow lowering for palignr instructions for mmx sized vectors. Add
patterns to handle the lowering.

llvm-svn: 101331
2010-04-15 01:40:20 +00:00
Evan Cheng
8249affa3b More 80 violations.
llvm-svn: 101330
2010-04-15 01:25:27 +00:00
Johnny Chen
b74c5b564c Wrap the error msgs in DEBUG() macro so that they won't appear in NDEBUG build.
llvm-svn: 101329
2010-04-15 01:20:56 +00:00
Evan Cheng
263c547804 80 col violations.
llvm-svn: 101325
2010-04-15 01:01:55 +00:00
Devang Patel
1b457aa5cd Add comment.
llvm-svn: 101317
2010-04-15 00:02:49 +00:00
Devang Patel
2374ea6452 There is no need to track compile unit offsets if there is only one compile unit.
llvm-svn: 101315
2010-04-14 23:56:24 +00:00
Devang Patel
321a86f14b Remove dead code.
llvm-svn: 101314
2010-04-14 23:54:13 +00:00
Tobias Grosser
ff64e0fb16 IPO needs ScalarOpts and InstCombine in its libs
The commit "Adding IPSCCP and Internalize passes to the C-bindings" introduced
new dependencies for IPO. Add these to the CMAKE build as otherwise the
BUILD_SHARED_LIBS=1 build fails.

llvm-svn: 101313
2010-04-14 23:42:23 +00:00
Johnny Chen
a793a40572 Fixed another assert exposed by fuzzing. Now, the DisassembleVFPLdStMulFrm()
function checks whether we have a valid submode for VLDM/VSTM (must be either
"ia" or "db") before calling ARM_AM::getAM5Opc(AMSubMode, unsigned char).

llvm-svn: 101306
2010-04-14 22:37:17 +00:00
Jim Grosbach
92490b077a Add -arm-long-calls option to force calls to be indirect. This makes the
kernel linker happier when dealing with kexts.

Radar 7805069

llvm-svn: 101303
2010-04-14 22:28:31 +00:00
Dan Gohman
5c72d507d7 Constify GetConstantStringInfo.
llvm-svn: 101298
2010-04-14 22:20:45 +00:00
Nicolas Geoffray
8e94bbf2e1 Don't use DILocation when processing a DebugLoc.
llvm-svn: 101294
2010-04-14 22:06:37 +00:00
Johnny Chen
f609eeff77 For t2BFI disassembly, apply the same error checking as in r101205.
Change the error msg to read "Encoding error: msb < lsb".

llvm-svn: 101293
2010-04-14 22:04:45 +00:00
Dan Gohman
2c2f455dfa Move a bunch of methods from CallSite to CallSiteBase, so that they can
be used in ImmutableCallSite too.

llvm-svn: 101292
2010-04-14 21:47:32 +00:00
Johnny Chen
ad1fee5287 Fixed another assert exposed by fuzzing. The utility function getRegisterEnum()
was asserting because the (RegClass, RegNum) combination doesn't make sense from
an encoding point of view.

Since getRegisterEnum() is used all over the place, to change the code to check
for encoding error after each call would not only bloat the code, but also make
it less readable.  An Err flag is added to the ARMBasicMCBuilder where a client
can set a non-zero value to indicate some kind of error condition while building
up the MCInst.  ARMBasicMCBuilder::BuildIt() checks this flag and returns false
if a non-zero value is detected.

llvm-svn: 101290
2010-04-14 21:03:13 +00:00
Evan Cheng
31483b8c9b - Code clean up to reduce indentation.
- TryToOptimizeStoreOfMallocToGlobal should check if TargetData is available and bail out if it is not. The transformations being done requires TD.

llvm-svn: 101285
2010-04-14 20:52:55 +00:00
Bob Wilson
7b19d89e3a Don't custom lower bit converts to ARM VMOVDRRD or VMOVDRR when the operand
does not have a legal type.  The legalizer does not know how to handle those
nodes.  Radar 7854640.

llvm-svn: 101282
2010-04-14 20:45:23 +00:00
Dan Gohman
1b67547226 Delete unneeeded arguments.
llvm-svn: 101276
2010-04-14 20:17:22 +00:00
Dan Gohman
d5d199da5f Delete unused arguments.
llvm-svn: 101275
2010-04-14 20:05:00 +00:00
Dan Gohman
c64d1d02a3 Factor out EH landing pad code into a separate function, and constify
a bunch of stuff to support it.

llvm-svn: 101273
2010-04-14 19:53:31 +00:00
Dan Gohman
c94abce286 Reset the debug location even if the instruction was a terminator.
llvm-svn: 101272
2010-04-14 19:30:02 +00:00
Dan Gohman
2d61a3f384 Refine #includes.
llvm-svn: 101269
2010-04-14 18:49:17 +00:00
Dan Gohman
b0b1974ddd Pull utility routines with no SelectionDAG dependence out of
SelectionDAGBuilder. FunctionLoweringInfo isn't an ideal place for
them to live, but it's better than SelectionDAGBuilder for now.

llvm-svn: 101267
2010-04-14 18:31:02 +00:00
Dan Gohman
64582fc238 Fix typos in comments.
llvm-svn: 101266
2010-04-14 18:24:06 +00:00
Gabor Greif
8cbd9638a9 performance: cache the dereferenced use_iterator
llvm-svn: 101265
2010-04-14 18:13:29 +00:00
Dan Gohman
60b5b8fa20 Delete an obsolete comment.
llvm-svn: 101264
2010-04-14 17:40:25 +00:00
Dan Gohman
4fd4153d52 Delete an unused function.
llvm-svn: 101263
2010-04-14 17:22:02 +00:00
Dan Gohman
45b0642839 Clear the FunctionLoweringInfo object before doing other things that
don't need it.

llvm-svn: 101262
2010-04-14 17:13:16 +00:00
Dan Gohman
3738dc7587 Move this assert out of SelectionDAGISel into FunctionLoweringInfo, and
drop the redundant #ifndef NDEBUG.

llvm-svn: 101261
2010-04-14 17:11:23 +00:00
Dan Gohman
4374fdf868 Add a comment.
llvm-svn: 101260
2010-04-14 17:09:37 +00:00
Dan Gohman
d0c66476e1 Move the code for initialing the entry block livein set out of
SelectionDAGISel.

llvm-svn: 101258
2010-04-14 17:05:00 +00:00
Dan Gohman
859cb3eea9 Reorgnaize this code to be more tidy and readable.
llvm-svn: 101256
2010-04-14 17:02:07 +00:00