Commit Graph

29377 Commits

Author SHA1 Message Date
Devang Patel bbf38f8f3b Add debug info utility routines.
llvm-svn: 74680
2009-07-02 01:15:24 +00:00
Devang Patel 6bab414f87 Simplify.
llvm-svn: 74677
2009-07-02 00:28:03 +00:00
Dan Gohman 43f33dd550 Fix a bunch of other places that used operator[] to test whether
a key is present in a std::map or DenseMap to use find instead.

llvm-svn: 74676
2009-07-02 00:17:47 +00:00
Owen Anderson f7691d398d Add a C wrapper for accessing the global default context.
llvm-svn: 74675
2009-07-02 00:16:38 +00:00
Devang Patel 846a5e4d3e Simplify. No intentional functionality change.
llvm-svn: 74673
2009-07-02 00:08:09 +00:00
Owen Anderson 02a9da33b3 Try again at converting the LLParser to use LLVMContext, without massive breakage this time.
llvm-svn: 74671
2009-07-01 23:57:11 +00:00
Owen Anderson 7d12807ef0 Add a few methods that got left out earlier.
llvm-svn: 74670
2009-07-01 23:56:45 +00:00
Dale Johannesen 4e6044c405 Add darwin stub removal to wishlist.
llvm-svn: 74667
2009-07-01 23:36:02 +00:00
Dan Gohman cf092389a9 Request LCSSA after LoopSimplify. This fixes a problem in which the
PassManager was scheduling LCSSA before LoopSimplify, which does not
preserve LCSSA.

llvm-svn: 74661
2009-07-01 23:21:38 +00:00
Devang Patel 53d24bc7d6 Refactor. No functionality change.
llvm-svn: 74659
2009-07-01 23:19:01 +00:00
Bob Wilson deb35afd23 Add a new addressing mode for NEON load/store instructions.
llvm-svn: 74658
2009-07-01 23:16:05 +00:00
Owen Anderson 2a15443aa8 Make the use of const with respect to LLVMContext sane. Hopefully this is the last time, for the
moment, that I will need to make far-reaching changes.

llvm-svn: 74655
2009-07-01 23:13:44 +00:00
Dan Gohman 83ff184206 Use find instead of operator[] to test whether an element is in a std::map.
This fixes a bug that caused -debug-pass=Details to abort.

llvm-svn: 74654
2009-07-01 23:12:33 +00:00
Bill Wendling 4534d2562b --- Reverse-merging (from foreign repository) r74648 into '.':
U    include/llvm/LLVMContext.h
U    lib/VMCore/LLVMContext.cpp
U    lib/AsmParser/LLParser.cpp
U    lib/AsmParser/LLParser.h

Temporarily reverting r74648. It was causing massive failures in release mode.

llvm-svn: 74653
2009-07-01 22:33:26 +00:00
Devang Patel b9fb595400 Keep DIDescriptor methods together.
No functionality change.

llvm-svn: 74652
2009-07-01 22:10:23 +00:00
Bob Wilson affb68bd08 Fix a comment typo.
llvm-svn: 74650
2009-07-01 21:59:43 +00:00
Owen Anderson 91b5e630a9 Fix typo.
llvm-svn: 74649
2009-07-01 21:58:14 +00:00
Owen Anderson 7373c6bbd6 Convert LLParser to use LLVMContext for creating constants.
llvm-svn: 74648
2009-07-01 21:57:44 +00:00
Andreas Bolka 394b4156cf Use AA to check objects before LDA.
llvm-svn: 74647
2009-07-01 21:45:23 +00:00
Dan Gohman 83348f80b6 Fix an instcombine abort on a scalar-to-vector bitcast. This fixes PR4487.
llvm-svn: 74646
2009-07-01 21:38:46 +00:00
Daniel Dunbar 4aef67c99d Tweak FindExecutable so that relative executable paths work as well.
llvm-svn: 74645
2009-07-01 21:36:28 +00:00
Bob Wilson bbbf805049 Fix up a comment: besides the >80col lines, the operation for this
addressing mode is encoded in the second operand, not the third.

llvm-svn: 74641
2009-07-01 21:22:45 +00:00
Owen Anderson 1cf085d558 Hold the LLVMContext by reference rather than by pointer.
llvm-svn: 74640
2009-07-01 21:22:36 +00:00
Devang Patel 5546b98d07 Fix metadata unittests
llvm-svn: 74638
2009-07-01 20:59:15 +00:00
Devang Patel de91b9e292 Do not print stranded metadata.
llvm-svn: 74632
2009-07-01 19:39:39 +00:00
Devang Patel 39e64d452a Support stand alone metadata syntax.
!0 = constant metadata !{i32 21, i32 22}
@llvm.blah = constant metadata !{i32 1000, i16 200, metadata !0}

llvm-svn: 74630
2009-07-01 19:21:12 +00:00
Devang Patel ea76e08645 llvm.dbg.declare is always used for local variable's debug info.
llvm-svn: 74625
2009-07-01 18:51:07 +00:00
Bill Wendling 512ff7353e Update comments to make it clear that the function alignment is the Log2 of the
bytes and not bytes.

llvm-svn: 74624
2009-07-01 18:50:55 +00:00
Jeffrey Yasskin 1a93330ffa Add a portable strerror*() wrapper, llvm::sys::StrError(). This includes the
Windows variant, strerror_s, but I couldn't test that.

I'll update configure and config.h.in in a subsequent patch.

llvm-svn: 74621
2009-07-01 18:11:20 +00:00
Owen Anderson e722976d54 I give up on trying to use reader/writer locks for recursive type refinement. Use a recursive mutex instead, which will (in theory) generate more contention, but is really
a much more natural fit for what's going on during recursive type refinement.

llvm-svn: 74618
2009-07-01 17:22:27 +00:00
Owen Anderson 6773d388aa Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools.

Patches for Clang and LLVM-GCC to follow.

llvm-svn: 74614
2009-07-01 16:58:40 +00:00
Chris Lattner 1f50b61329 Fix codegen for references to available_externally symbols. This fixes
PR4482.

llvm-svn: 74613
2009-07-01 16:53:44 +00:00
Owen Anderson 02c4de3573 Try again at making this work on OpenBSD.
llvm-svn: 74612
2009-07-01 16:19:23 +00:00
Daniel Dunbar b8f779db87 Fix FindExecutable to work if given an absolute executable path name.
- Patch by Viktor Kutuzov, with tweaks by me.

llvm-svn: 74608
2009-07-01 15:26:13 +00:00
Evan Cheng 04f72fc955 CommuteChangesDestination() should check if to-be-commuted instruction defines any register. Also teaches the default commuteInstruction() to commute instruction without definitions (e.g. X86::test / ARM::tsp).
llvm-svn: 74602
2009-07-01 08:29:08 +00:00
Evan Cheng 2a5efe14a7 Remove special handling of implicit_def. Fix a couple more bugs in liveintervalanalysis and coalescer handling of implicit_def.
Note, isUndef marker must be placed even on implicit_def def operand or else the scavenger will not ignore it. This is necessary because -O0 path does not use liveintervalanalysis, it treats implicit_def just like any other def.

llvm-svn: 74601
2009-07-01 08:19:36 +00:00
Owen Anderson cb86e113a9 Fix the build on OpenBSD.
llvm-svn: 74597
2009-07-01 06:53:29 +00:00
Daniel Dunbar 23a72aa476 Dump MCInsts in the MC .s printer, for now.
llvm-svn: 74593
2009-07-01 06:35:03 +00:00
Chris Lattner 96122debc1 improve the APIs for creating struct and function types with no arguments/elements
to not have to create a temporary vector (in the API at least).  Patch by Jay Foad!

llvm-svn: 74584
2009-07-01 04:13:31 +00:00
Chris Lattner f95fa1b721 Fix some fast-isel problems selecting global variable addressing in
pic mode.

llvm-svn: 74582
2009-07-01 03:27:19 +00:00
Evan Cheng d379e896ff Handle IMPLICIT_DEF with isUndef operand marker, part 2. This patch moves the code to annotate machineoperands to LiveIntervalAnalysis. It also add markers for implicit_def that define physical registers. The rest, is just a lot of details.
llvm-svn: 74580
2009-07-01 01:59:31 +00:00
Daniel Dunbar 75c12e1569 Remove unused AsmPrinter OptLevel argument, and propogate.
- This more or less amounts to a revert of r65379. I'm curious to know what
   happened that caused this variable to become unused.

llvm-svn: 74579
2009-07-01 01:48:54 +00:00
David Goodwin 86c7e20ca6 Add PIC load and store patterns for Thumb-2.
llvm-svn: 74577
2009-07-01 00:01:13 +00:00
Owen Anderson 1938fb1954 Add a global context, for easing backwards compatibility.
llvm-svn: 74574
2009-06-30 23:39:59 +00:00
David Goodwin a83100f687 Thumb-2 load and store double description. But nothing yet creates them.
llvm-svn: 74566
2009-06-30 22:50:01 +00:00
Bill Wendling 31ceb1bcba Add an "alignment" field to the MachineFunction object. It makes more sense to
have the alignment be calculated up front, and have the back-ends obey whatever
alignment is decided upon.

This allows for future work that would allow for precise no-op placement and the
like.

llvm-svn: 74564
2009-06-30 22:38:32 +00:00
David Goodwin d0890a2bad Add thumb-2 store word, halfword, and byte.
llvm-svn: 74555
2009-06-30 22:11:34 +00:00
Dan Gohman 3423e72b55 Minor code cleanups.
llvm-svn: 74551
2009-06-30 20:13:32 +00:00
Dan Gohman 10f1733d9a Reapply 74494, this time removing the conflicting definition of operator<<
in APIntTest.cpp.

llvm-svn: 74550
2009-06-30 20:10:56 +00:00
David Goodwin 28d6d87244 Improve Thumb-2 jump table support.
llvm-svn: 74549
2009-06-30 19:50:22 +00:00
David Greene 50475de6af Add 256-bit memory operand support.
llvm-svn: 74548
2009-06-30 19:24:59 +00:00
David Goodwin 27303cde82 Add conditional and unconditional thumb-2 branch. Add thumb-2 jump table.
llvm-svn: 74543
2009-06-30 18:04:13 +00:00
Owen Anderson a8560219c7 Add wrappers for type construction to LLVMContext.
llvm-svn: 74542
2009-06-30 17:50:28 +00:00
Owen Anderson 36f62e5df6 Fix up header comments to make Chris happy.
llvm-svn: 74537
2009-06-30 17:06:46 +00:00
Rafael Espindola 317fd045e2 Fix PR4485.
Avoid unnecessary duplication of operand 0 of X86::FpSET_ST0_80. This duplication would
cause one register to remain on the stack at the function return.

llvm-svn: 74534
2009-06-30 16:40:03 +00:00
Oscar Fuentes 136f9a6512 Fixed assert that checks return value of TlsSetValue.
See http://msdn.microsoft.com/en-us/library/ms686818(VS.85).aspx

Patch by Olaf Krzikalla!

llvm-svn: 74526
2009-06-30 14:12:28 +00:00
Rafael Espindola bd971ffcc6 Fix PR4484.
This was caused by me confounding FP0 and ST(0).

llvm-svn: 74523
2009-06-30 12:18:16 +00:00
Evan Cheng dcf1f59305 Temporarily restore the scavenger implicit_def checking code. MachineOperand isUndef mark is not being put on implicit_def of physical registers (created for parameter passing, etc.).
llvm-svn: 74519
2009-06-30 09:19:42 +00:00
Evan Cheng 0dc101b897 Add a bit IsUndef to MachineOperand. This indicates the def / use register operand is defined by an implicit_def. That means it can def / use any register and passes (e.g. register scavenger) can feel free to ignore them.
The register allocator, when it allocates a register to a virtual register defined by an implicit_def, can allocate any physical register without worrying about overlapping live ranges. It should mark all of operands of the said virtual register so later passes will do the right thing.

This is not the best solution. But it should be a lot less fragile to having the scavenger try to track what is defined by implicit_def.

llvm-svn: 74518
2009-06-30 08:49:04 +00:00
Bill Wendling 778a517725 Temporarily revert r74494. It was causing failures in the unit tests.
llvm-svn: 74515
2009-06-30 07:05:27 +00:00
Owen Anderson 00d07afe98 Fix the build on Cygwin. Patch by Aaron Gray.
llvm-svn: 74510
2009-06-30 05:33:46 +00:00
Chris Lattner b127c0684f remove a bogus note.
llvm-svn: 74509
2009-06-30 05:22:31 +00:00
Chris Lattner 5ed255e642 add a note
llvm-svn: 74508
2009-06-30 04:20:46 +00:00
Bill Wendling 855263371a #include <iostream> is forbidden. Remove it in favor of raw_ostream.
llvm-svn: 74507
2009-06-30 04:07:12 +00:00
Evan Cheng 57726817aa A few more load instructions.
llvm-svn: 74500
2009-06-30 02:15:48 +00:00
Andreas Bolka 9541801105 Array accesses are independent if the underlying arrays differ.
llvm-svn: 74499
2009-06-30 02:12:10 +00:00
Dan Gohman e95d409bdd Define an operator<< for APInt to be used with std::ostream.
This will allow it to be used in unittests that use gtest's
EXPECT_EQ.

llvm-svn: 74494
2009-06-30 01:28:08 +00:00
Dan Gohman e8eca73cdd Minor formatting, whitespace, and 80-column fixes.
llvm-svn: 74492
2009-06-30 01:25:30 +00:00
Dan Gohman 4dfc680059 Minor code simplification.
llvm-svn: 74491
2009-06-30 01:24:43 +00:00
Daniel Dunbar c9dc78ae40 Normalize SourceMgr messages.
- Don't print "Parsing" in front of every message.

 - Take additional "type" argument which is prepended to the message (with ": ")
   if given.

 - Update clients to print errors (warnings) as:
<filename>:<line number>: error(warning): ...

llvm-svn: 74489
2009-06-30 00:49:23 +00:00
Owen Anderson 8e66e0bab4 Add LLVMContext, which will eventually be used as a container for privatizing a lot of (currently) global state, including the
constant and type uniquing tables.  For now, just make it a wrapper around the existing APIs.

llvm-svn: 74488
2009-06-30 00:48:55 +00:00
Mikhail Glushenkov 3fcdada6b4 Add a way to access argv[0] in hooks.
llvm-svn: 74483
2009-06-30 00:16:00 +00:00
Mikhail Glushenkov f40b590721 Move the driver entry point out of Main.inc.
llvm-svn: 74482
2009-06-30 00:15:24 +00:00
Daniel Dunbar cc566a714b llvm-mc: Parse .{,b,p2}align{,w,l} directives.
llvm-svn: 74478
2009-06-29 23:46:59 +00:00
Devang Patel 0a9f9759a3 Struct types are described using field types only.
llvm-svn: 74477
2009-06-29 23:46:50 +00:00
Daniel Dunbar f71a0cca84 Fix install of libCompilerDriver dynamic library to not copy on every build.
llvm-svn: 74473
2009-06-29 22:59:36 +00:00
David Greene 8adf1fdc80 Add a 256-bit register class and YMM registers.
llvm-svn: 74469
2009-06-29 22:50:51 +00:00
David Goodwin 76b37950ca Add Thumb-2 support for TEQ amd TST.
llvm-svn: 74468
2009-06-29 22:49:42 +00:00
Dan Gohman 9d203c636b Use getSCEV instead of getUnknown to create a SCEV for a
Constant. This lets ConstantInts be handled as SCEVConstant instead
of SCEVUnknown, as getUnknown no longer has special-case code for
ConstantInt and friends. This usually doesn't affect the final
output, since the constants end up getting folded later, but it
does make intermediate expressions more obvious in many cases.

llvm-svn: 74459
2009-06-29 21:31:18 +00:00
Daniel Dunbar fdbbc52cfd Don't build LLVMC when configured with --disable-pic (it needs requires shared
module support to build).

llvm-svn: 74456
2009-06-29 21:12:26 +00:00
Torok Edwin 896556eec7 Set wasRun to false here on Dan's suggestion.
llvm-svn: 74455
2009-06-29 21:05:10 +00:00
Devang Patel 40d784180b s/MainCU/ModuleCU/g
llvm-svn: 74452
2009-06-29 20:45:18 +00:00
Devang Patel 8635345d8a Multiple DW_TAG_compile_unit is not used, afaict, on any target.
Update dwarf writer to only emit one DW_TAG_compile_unit per .o file. 

llvm-svn: 74449
2009-06-29 20:38:13 +00:00
Dan Gohman 19d2417c90 Don't cache PHI exit values from exhaustive evaluations, because
an individual exhaustive evaluation reflects only the exit value
implied by an individual exit, which may differ from the actual
exit value of the loop if there are other exits. This fixes PR4477.

llvm-svn: 74447
2009-06-29 20:34:13 +00:00
Rafael Espindola 538064d6b1 FIX PR 4459.
Not sure I understand how the temp register gets used,
but this fixes a bug and introduces no regressions.

llvm-svn: 74446
2009-06-29 20:29:59 +00:00
Torok Edwin 6fb3e98eed Initialize CurSection in constructor.
Not doing so causes some unittests to fail, because CurSection is uninitialized.

llvm-svn: 74442
2009-06-29 19:59:10 +00:00
Daniel Dunbar a97615adf8 Rename MCValue::getCst to getConstant and add MCValue::isConstant.
llvm-svn: 74440
2009-06-29 19:51:00 +00:00
Andreas Bolka 6037bc9e60 Relax LDA memory instruction checks.
llvm-svn: 74439
2009-06-29 18:51:11 +00:00
Torok Edwin 24c7835d19 Call doInitialization(), releaseMemory(), and doFinalization() for on-the-fly passes as well.
Also don't call finalizers for LoopPass if initialization was not called.
Add a unittest that tests that these methods are called, in the proper
order, and the correct number of times.

llvm-svn: 74438
2009-06-29 18:49:09 +00:00
Dan Gohman e00beaaee8 Simplify this code, and avoid using APInt(). This fixes
(otherwise harmless) uninitialized value warnings that
Duncan found with gcc-4.4.

llvm-svn: 74437
2009-06-29 18:25:52 +00:00
Owen Anderson 45c299ef65 Add a target-specific DAG combine on X86 to fold the common pattern of
fence-atomic-fence down to just the atomic op.  This is possible thanks to
X86's relatively strong memory model, which guarantees that locked instructions
(which are used to implement atomics) are implicit fences.

llvm-svn: 74435
2009-06-29 18:04:45 +00:00
David Greene 46b56ffae3 Add processor descriptions for Istanbul and Shanghai.
llvm-svn: 74429
2009-06-29 16:54:06 +00:00
David Greene a4b8998fbb Fix a subtarget feature bug.
llvm-svn: 74428
2009-06-29 16:51:01 +00:00
David Greene f92ba97cda Add more vector ValueTypes for AVX and other extended vector instruction
sets.

llvm-svn: 74427
2009-06-29 16:47:10 +00:00
David Goodwin dbf11ba800 Rename ARMcmpNZ to ARMcmpZ and use it to represent comparisons that set only the Z flag (i.e. eq and ne). Make ARMcmpZ commutative.
llvm-svn: 74423
2009-06-29 15:33:01 +00:00
Duncan Sands 14814d4477 Add triple for OpenBSD.
llvm-svn: 74422
2009-06-29 13:36:13 +00:00
Duncan Sands 24a3724b04 Include the new file ThumbRegisterInfo.cpp to CMakeLists.txt
to make sure ThumbRegisterInfo.cpp are compiled and linked in.
Patch by Xerxes.

llvm-svn: 74421
2009-06-29 13:11:32 +00:00
Evan Cheng b23b50d54d Implement Thumb2 ldr.
After much back and forth, I decided to deviate from ARM design and split LDR into 4 instructions (r + imm12, r + imm8, r + r << imm12, constantpool). The advantage of this is 1) it follows the latest ARM technical manual, and 2) makes it easier to reduce the width of the instruction later. The down side is this creates more inconsistency between the two sub-targets. We should split ARM LDR instruction in a similar fashion later. I've added a README entry for this.

llvm-svn: 74420
2009-06-29 07:51:04 +00:00
Mikhail Glushenkov 72f3f7eb56 Make dynamic LLVMC plugins work on Windows (finally!).
Implemented by making lib/CompilerDriver a shared library that holds all the
global static data (CommandLine options, plugin registry) that we unfortunately
have to live with.

llvm-svn: 74417
2009-06-29 03:09:15 +00:00
Andreas Bolka 3a09c8bd5e Missed one.
llvm-svn: 74416
2009-06-29 00:53:49 +00:00
Andreas Bolka c5558a83f4 Fix case in LDA util function names.
llvm-svn: 74415
2009-06-29 00:50:26 +00:00
Andreas Bolka 9d09e20142 Print pairwise dependence results, add testcases.
llvm-svn: 74402
2009-06-28 00:35:22 +00:00
Andreas Bolka 9fee7f86ad Minimal LDA interface, maximally conservative tester.
llvm-svn: 74401
2009-06-28 00:21:21 +00:00
Andreas Bolka 8976d3bc7e LDA analysis output scaffolding.
llvm-svn: 74400
2009-06-28 00:16:08 +00:00
Dan Gohman 317f054531 Don't try to split a loop when the controlling icmp instruction
doesn't have an IV-based operand. This fixes PR4471.

llvm-svn: 74399
2009-06-27 22:58:27 +00:00
Dan Gohman ffdcba3dbd Remove the block from the LoopInfo, rather than just the Loop.
LoopInfo will handle removing it from the Loop, as well as updating
its own tables.

llvm-svn: 74398
2009-06-27 22:32:36 +00:00
Dan Gohman c8ca49659a Teach LoopSimplify how to merge multiple loop exits into a single exit,
when one of them can be converted to a trivial icmp and conditional
branch.

This addresses what is essentially a phase ordering problem.
SimplifyCFG knows how to do this transformation, but it doesn't do so
if the primary block has any instructions in it other than an icmp and
a branch. In the given testcase, the block contains other instructions,
however they are loop-invariant and can be hoisted. SimplifyCFG doesn't
have LoopInfo though, so it can't hoist them. And, it's important that
the blocks be merged before LoopRotation, as it doesn't support
multiple-exit loops.

llvm-svn: 74396
2009-06-27 21:30:38 +00:00
Dan Gohman 8918b481bf More minor code simplifications.
llvm-svn: 74395
2009-06-27 21:23:40 +00:00
Dan Gohman 4f16a2923c Eliminate a layer of indirection in LoopInfo and MachineLoopInfo.
llvm-svn: 74394
2009-06-27 21:22:48 +00:00
Dan Gohman c5c85c0fec Convert ScalarEvolution to use BumpPtrAllocator and FoldingSet, instead
of a team of individual allocations and a team of std::maps.

llvm-svn: 74393
2009-06-27 21:21:31 +00:00
Dan Gohman 830fd38d9b Change SCEVExpander to use an IRBuilder to emit instructions.
llvm-svn: 74391
2009-06-27 21:18:18 +00:00
Anton Korobeynikov 0f2158b35f Simplify a bit
llvm-svn: 74385
2009-06-27 12:59:03 +00:00
Anton Korobeynikov a1b5b18bd0 ARM refactoring. Step 2: split RegisterInfo
llvm-svn: 74384
2009-06-27 12:16:40 +00:00
Douglas Gregor 33400e3670 Add ThumbInstrInfo.cpp to the CMake makefiles
llvm-svn: 74382
2009-06-27 07:44:59 +00:00
Chris Lattner 1ec3afdc66 remove a bunch of fixmes (old checking code) and commonize all the
target-specific operand printing functionality.  Yay.

llvm-svn: 74379
2009-06-27 05:46:24 +00:00
Chris Lattner ae0acfcef0 pull @GOT, @GOTOFF, @GOTPCREL handling into isel from the asmprinter.
llvm-svn: 74378
2009-06-27 05:39:56 +00:00
Chris Lattner cce1589e4e simplify some code and eliminate the symbolicAddressesAreRIPRel() predicate.
llvm-svn: 74377
2009-06-27 05:24:12 +00:00
Dan Gohman fe174b6952 When a value is used multiple times within a single PHI, instructions
inserted to replace that value must dominate all of of the basic
blocks associated with the uses of the value in the PHI, not just
one of them.

llvm-svn: 74376
2009-06-27 05:16:57 +00:00
Chris Lattner d17366ae72 fix clang/test/CodeGenObjC/try.m, a basereg doesn't mean no global anymore.
llvm-svn: 74375
2009-06-27 04:50:14 +00:00
Chris Lattner 014e83d40d fix a bunch of failures in the X86-64 JIT by tolerating RIP as
a base register.  We just ignore it for now.

llvm-svn: 74374
2009-06-27 04:46:33 +00:00
Chris Lattner 9876bd8257 factor some logic out into a helper function, allow remat of loads from constant
globals.  This implements remat-constant.ll even without aggressive-remat.

llvm-svn: 74373
2009-06-27 04:38:55 +00:00
Chris Lattner fea81da433 Reimplement rip-relative addressing in the X86-64 backend. The new
implementation primarily differs from the former in that the asmprinter
doesn't make a zillion decisions about whether or not something will be
RIP relative or not.  Instead, those decisions are made by isel lowering
and propagated through to the asm printer.  To achieve this, we:

1. Represent RIP relative addresses by setting the base of the X86 addr
   mode to X86::RIP.
2. When ISel Lowering decides that it is safe to use RIP, it lowers to
   X86ISD::WrapperRIP.  When it is unsafe to use RIP, it lowers to
   X86ISD::Wrapper as before.
3. This removes isRIPRel from X86ISelAddressMode, representing it with
   a basereg of RIP instead.
4. The addressing mode matching logic in isel is greatly simplified.
5. The asmprinter is greatly simplified, notably the "NotRIPRel" predicate
   passed through various printoperand routines is gone now.
6. The various symbol printing routines in asmprinter now no longer infer
   when to emit (%rip), they just print the symbol.

I think this is a big improvement over the previous situation.  It does have
two small caveats though: 1. I implemented a horrible "no-rip" modifier for
the inline asm "P" constraint modifier.  This is a short term hack, there is
a much better, but more involved, solution.  2. I had to xfail an 
-aggressive-remat testcase because it isn't handling the use of RIP in the
constant-pool reading instruction.  This specific test is easy to fix without
-aggressive-remat, which I intend to do next.

llvm-svn: 74372
2009-06-27 04:16:01 +00:00
Chris Lattner c91e8c7464 When doing remat, don't consider uses of non-allocatable physregs. Patch
by Evan.

llvm-svn: 74370
2009-06-27 04:06:41 +00:00
Evan Cheng eab9ca7ea6 Renaming for consistency.
llvm-svn: 74368
2009-06-27 02:26:13 +00:00
Chris Lattner a3260c0b1b Fix PR4466 by making fastisel set operand flags correctly.
llvm-svn: 74366
2009-06-27 01:31:51 +00:00
Chris Lattner a4775f2b13 fix a typo that GCC should have caught that causes crashes with -view-*-dags
llvm-svn: 74364
2009-06-27 00:57:02 +00:00
David Goodwin 5d8b6eef5a Remove outdated comment.
llvm-svn: 74357
2009-06-26 23:39:02 +00:00
David Goodwin 5285817490 When possible, use "mvn ra, rb" instead of "eor ra, rb, -1" because mvn has a narrow version and eor(i) does not.
llvm-svn: 74355
2009-06-26 23:13:13 +00:00
Dan Gohman daafbe6168 Incorporate the insertion point into the key of SCEVExpander's CSE map.
This helps it avoid reusing an instruction that doesn't dominate all
of the users, in cases where the original instruction was inserted
before all of the users were known.  This may result in redundant
expansions of sub-expressions that depend on loop-unpredictable values
in some cases, however this isn't very common, and it primarily impacts
IndVarSimplify, so GVN can be expected to clean these up.

This eliminates the need for IndVarSimplify's FixUsesBeforeDefs,
which fixes several bugs.

llvm-svn: 74352
2009-06-26 22:53:46 +00:00
Devang Patel 0f2eb5b9f7 Remove unused routines.
llvm-svn: 74351
2009-06-26 22:53:22 +00:00
David Greene 8f6f72cc99 Add feature flags for AVX and FMA and fix some SSE4A feature flag
initialization problems.

llvm-svn: 74350
2009-06-26 22:46:54 +00:00
Dan Gohman cc030b7e51 Fix ScalarEvolution::getAddRecExpr's code which canonicalized the
nesting order of nested AddRec expressions to skip the transformation
if it would introduce an AddRec with operands not loop-invariant
with respect to its loop.

llvm-svn: 74343
2009-06-26 22:36:20 +00:00
Dan Gohman 06a4e273be Fix SCEVAddRecExpr::isLoopInvariant to test if all of its operands
are loop invariant, not just the start operand.

llvm-svn: 74338
2009-06-26 22:17:21 +00:00
Evan Cheng 07b016856d Add x86 support for 'n' inline asm modifier. This will be handled target independently as part of MC work.
llvm-svn: 74336
2009-06-26 22:00:19 +00:00
Chris Lattner 3ef702e974 simplify printing of MO_ExternalSymbol in a non-pcrel context.
llvm-svn: 74334
2009-06-26 21:47:27 +00:00
Owen Anderson c043d13aeb Privatize some data.
llvm-svn: 74332
2009-06-26 21:45:04 +00:00
Owen Anderson 01ad6605c0 Constify this value.
llvm-svn: 74330
2009-06-26 21:39:56 +00:00
Anton Korobeynikov 99152f3a2c Split thumb-related stuff into separate classes.
Step 1: ARMInstructionInfo => {ARM,Thumb}InstructionInfo

llvm-svn: 74329
2009-06-26 21:28:53 +00:00
Chris Lattner 40bc649ce9 add %rip to the GR64 register class. Lets avoid allocating it to anything though! :)
llvm-svn: 74328
2009-06-26 21:25:00 +00:00
Chris Lattner 49ed726e46 Move all the TLS processing logic into isel, don't do it in asmprinter at all.
llvm-svn: 74327
2009-06-26 21:20:29 +00:00
Chris Lattner 899abc4655 make sure to propagate operand flags in SelectTLSADDRAddr properly.
llvm-svn: 74326
2009-06-26 21:18:37 +00:00
Chris Lattner bc60c14c97 fix a really subtle bug in the cross section of aliases and TLS:
the SelectionDAG::getGlobalAddress function properly looks through
aliases to determine thread-localness, but then passes the GV* down
to GlobalAddressSDNode::GlobalAddressSDNode which does not.  Instead
of passing down isTarget, just pass down the predetermined node
opcode.  This fixes some assertions with out of tree changes I'm 
working on.

llvm-svn: 74325
2009-06-26 21:14:05 +00:00
David Goodwin aa294c5593 Thumb-2 has CLZ.
llvm-svn: 74322
2009-06-26 20:47:43 +00:00
David Goodwin 35ee722d42 Use "adcs/sbcs" only when the carry-out is live, otherwise use "adc/sbc".
llvm-svn: 74321
2009-06-26 20:45:56 +00:00
Owen Anderson 4c472e1cfa Get rid of these cache variables, which are a holdover from the days when
we had multiple type planes and these lookups were expensive.

llvm-svn: 74319
2009-06-26 20:33:47 +00:00
Owen Anderson f92b432385 Make this const.
llvm-svn: 74317
2009-06-26 20:21:18 +00:00
Chris Lattner 76b3c06793 minor cleanup/framework changes.
llvm-svn: 74316
2009-06-26 20:00:05 +00:00
Owen Anderson 304d85be8c Privatize some variables.
llvm-svn: 74315
2009-06-26 19:48:37 +00:00
Chris Lattner 2ed6a9d7bd move magic for PIC constantpool references from asmprinter to isel.
llvm-svn: 74313
2009-06-26 19:22:52 +00:00
Chris Lattner 7f82a19fbf implement DOTGraphTraits<SelectionDAG*>::getNodeLabel in terms of
SDNode::print_details to eliminate a ton of near-duplicate code.

llvm-svn: 74311
2009-06-26 19:06:10 +00:00