Commit Graph

64251 Commits

Author SHA1 Message Date
Owen Anderson 73f988cafa JumpThreading keeps LazyValueInfo up to date, so we don't need to rerun it
if we schedule another LVI-using pass afterwards.

llvm-svn: 112722
2010-09-01 18:27:22 +00:00
Eric Christopher 3ce9c4a65f Add some more load types in.
llvm-svn: 112721
2010-09-01 18:01:32 +00:00
Eric Christopher a5d315c665 Speculatively revert 112699 and 112702, they seem to be causing
self host errors on clang-x86-64.

llvm-svn: 112719
2010-09-01 17:29:10 +00:00
Chris Lattner c19eaaa9d4 have the makefiles check the llvm-config error code instead of charging
on an producing weird link errors.  Patch by Yuri Gribov!

llvm-svn: 112714
2010-09-01 16:11:17 +00:00
Chris Lattner 49a79412de dead code patrol
llvm-svn: 112713
2010-09-01 16:06:39 +00:00
Chris Lattner 94f834348f zap dead code.
llvm-svn: 112712
2010-09-01 16:04:34 +00:00
Chris Lattner 39eccb4754 temporarily revert r112664, it is causing a decoding conflict, and
the testcases should be merged.

llvm-svn: 112711
2010-09-01 16:00:50 +00:00
Chris Lattner 2333b12c8a zap dead code.
llvm-svn: 112708
2010-09-01 15:44:05 +00:00
Chris Lattner ec8724f250 remove dead code.
llvm-svn: 112707
2010-09-01 15:39:31 +00:00
Dan Gohman a2233f2801 Make tool_output_file's raw_ostream instance a member variable instead
of a base class.

This makes it possible to unregister the file from FilesToRemove when
the file is done. Also, this eliminates the need for
formatted_tool_output_file.

llvm-svn: 112706
2010-09-01 14:20:41 +00:00
Dan Gohman e201c07d23 Add an interface for unregistering a file from the FilesToRemove list.
llvm-svn: 112705
2010-09-01 14:17:34 +00:00
Michael J. Spencer d8e5dfccc1 COFF: Update tests to reflect changes in last commit.
llvm-svn: 112704
2010-09-01 14:15:31 +00:00
Michael J. Spencer c582c7b5c9 COFF: Fix incorrect SCT_COMPLEX_TYPE_SHIFT. Add a few constants.
llvm-svn: 112703
2010-09-01 14:09:36 +00:00
Duncan Sands 4d51e3fd17 Use the SSAUpdator to turn calls to eh.exception that are not in a
landing pad into uses of registers rather than loads from a stack
slot.  Doesn't touch the 'orrible hack code - Bill needs to persuade
me harder :)

llvm-svn: 112702
2010-09-01 14:07:47 +00:00
Dan Gohman 858806fb8b Make the iterator form of erase return void, since it always succeeds,
and since this is what std::map and std::set do.

llvm-svn: 112701
2010-09-01 14:00:35 +00:00
Duncan Sands 2afaef80e9 Define LLVM_GLOBAL_VISIBILITY to be __declspec(dllexport) on
windows systems.

llvm-svn: 112700
2010-09-01 13:07:11 +00:00
Duncan Sands f7b18437b5 If PrototypeValue is erased in the middle of using the SSAUpdator
then the SSAUpdator may access freed memory.  Instead, simply pass
in the type and name explicitly, which is all that was used anyway.

llvm-svn: 112699
2010-09-01 10:29:33 +00:00
Duncan Sands 5e2e7d7ff3 Add convenience class for working with eh.exception calls.
llvm-svn: 112698
2010-09-01 09:26:00 +00:00
Dale Johannesen e13c04d6da Attempt to fix buildbot.
llvm-svn: 112697
2010-09-01 05:19:06 +00:00
Chris Lattner 34e5361eb5 add a gross hack to work around a problem that Argiris reported
on llvmdev: SRoA is introducing MMX datatypes like <1 x i64>,
which then cause random problems because the X86 backend is
producing mmx stuff without inserting proper emms calls.

In the short term, force off MMX datatypes.  In the long term,
the X86 backend should not select generic vector types to MMX
registers.  This is being worked on, but won't be done in time
for 2.8.  rdar://8380055

llvm-svn: 112696
2010-09-01 05:14:33 +00:00
Chris Lattner b9ed4f252f filecheckize
llvm-svn: 112695
2010-09-01 05:10:14 +00:00
Bruno Cardoso Lopes b3825216ce Use movlps, movlpd, movss and movsd specific nodes instead of pattern matching with movlp pattern fragment
llvm-svn: 112694
2010-09-01 05:08:25 +00:00
Dan Gohman 110ed64fbb Revert 112442 and 112440 until the compile time problems introduced
by 112440 are resolved.

llvm-svn: 112692
2010-09-01 01:45:53 +00:00
Bruno Cardoso Lopes 6aaebe877b minor change, simplify some logic
llvm-svn: 112689
2010-09-01 00:57:08 +00:00
Bruno Cardoso Lopes 2b025707a2 Move some functions around so they can be used for some other to come function
llvm-svn: 112687
2010-09-01 00:51:36 +00:00
Dale Johannesen 56661c5011 Add some MMX intrinsics that duplicate functionality
available in normal llvm operators.  We aren't going to
use those for MMX any more because it's unsafe for the
optimizers to synthesize new MMX instructions.

llvm-svn: 112685
2010-09-01 00:40:09 +00:00
Devang Patel ea63639da5 Use absolute label for DW_AT_stmt_list if a target does not prefer offset here.
This patch was developed on top of original patch by Artur Pietrek.

llvm-svn: 112678
2010-08-31 23:50:19 +00:00
Dale Johannesen 52bd0dc3bb Testcase for llvm checkin 112674.
llvm-svn: 112675
2010-08-31 23:43:55 +00:00
Benjamin Kramer 1835c13fc2 Remove noisy semicolon.
llvm-svn: 112673
2010-08-31 23:38:13 +00:00
Chris Lattner 030f02021b licm is wasting time hoisting constant foldable operations,
instead of hoisting them, just fold them away.  This occurs in the
testcase for PR8041, for example.

llvm-svn: 112669
2010-08-31 23:00:16 +00:00
Kevin Enderby d94dacf829 This is the second of three patches to implement support for the .loc directive
and output the dwarf line number tables.  This takes the current loc info after
an instruction is assembled and saves the needed info into an object that has
vector and for each section.  These objects will be used for the final patch to 
build and emit the encoded dwarf line number tables.  Again for now this is only
in the Mach-O streamer but at some point will move to a more generic place.

llvm-svn: 112668
2010-08-31 22:55:11 +00:00
Dan Gohman 47308d5da3 Reapply r112432, now that the real problem is addressed.
llvm-svn: 112667
2010-08-31 22:53:17 +00:00
Dan Gohman f01a5eed1e Reapply r112433, now that the real problem is addressed.
llvm-svn: 112666
2010-08-31 22:52:12 +00:00
Dan Gohman aabfc52790 Revert r110916. This patch is buggy because the code inside the
inner loop doesn't update all the variables in the outer loop.

llvm-svn: 112665
2010-08-31 22:50:31 +00:00
Bill Wendling 6789f8b6ae We have a chance for an optimization. Consider this code:
int x(int t) {
  if (t & 256)
    return -26;
  return 0;
}

We generate this:

     tst.w   r0, #256
     mvn     r0, #25
     it      eq
     moveq   r0, #0

while gcc generates this:

     ands    r0, r0, #256
     it      ne
     mvnne   r0, #25
     bx      lr

Scandalous really!

During ISel time, we can look for this particular pattern. One where we have a
"MOVCC" that uses the flag off of a CMPZ that itself is comparing an AND
instruction to 0. Something like this (greatly simplified):

  %r0 = ISD::AND ...
  ARMISD::CMPZ %r0, 0         @ sets [CPSR]
  %r0 = ARMISD::MOVCC 0, -26  @ reads [CPSR]

All we have to do is convert the "ISD::AND" into an "ARM::ANDS" that sets [CPSR]
when it's zero. The zero value will all ready be in the %r0 register and we only
need to change it if the AND wasn't zero. Easy!

llvm-svn: 112664
2010-08-31 22:41:22 +00:00
Anton Korobeynikov 4e7351d2ba Some fixes for NetBSD
llvm-svn: 112662
2010-08-31 22:38:00 +00:00
Bruno Cardoso Lopes 4b56d87290 Use x86 specific MOVSLDUP node, add more patterns to match it and remove useless load nodes
llvm-svn: 112661
2010-08-31 22:35:05 +00:00
Devang Patel 86ec8b3a3f Reapply r112623. Included additional check for unused byval argument.
llvm-svn: 112659
2010-08-31 22:22:42 +00:00
Bruno Cardoso Lopes 61996ef835 Use x86 specific MOVSHDUP node and add more patterns to match it
llvm-svn: 112657
2010-08-31 22:22:11 +00:00
Bill Wendling d657d82597 And ANDS pattern to match the t2ANDS pattern.
llvm-svn: 112654
2010-08-31 22:05:37 +00:00
Jakob Stoklund Olesen 94e90b9406 Stack slot access methods are in TargetInstrInfo.
llvm-svn: 112653
2010-08-31 22:01:07 +00:00
Dale Johannesen 9b7fdc0483 Comment typo.
llvm-svn: 112652
2010-08-31 21:53:15 +00:00
Jakob Stoklund Olesen 33e9fce2d6 Make %EFLAGS unallocatable.
No CCR virtual registers should exist, and %EFLAGS is used in ways that can
surprise RegAllocFast.

llvm-svn: 112650
2010-08-31 21:51:07 +00:00
Jakob Stoklund Olesen 7993dae7bd Track liveness of unallocatable, unreserved registers in machine DCE.
Reserved registers are unpredictable, and are treated as always live by machine
DCE.

Allocatable registers are never reserved, and can be used for virtual registers.

Unreserved, unallocatable registers can not be used for virtual registers, but
otherwise behave like a normal allocatable register. Most targets only have
the flag register in this set.

llvm-svn: 112649
2010-08-31 21:51:05 +00:00
Bruno Cardoso Lopes 5de15ce468 Use MOVHLPS node instead of matching using movhlps and movhlps_undef pattern fragments
llvm-svn: 112644
2010-08-31 21:38:49 +00:00
Chris Lattner daca6f3483 tidy up
llvm-svn: 112643
2010-08-31 21:21:25 +00:00
Bruno Cardoso Lopes 03e4c35302 Use MOVLHPS and MOVHLPS x86 nodes whenever possible. Also remove some useless nodes
llvm-svn: 112642
2010-08-31 21:15:21 +00:00
Dan Gohman 90f29bcd90 Revert r112432. It appears to be exposing a problem in the emacs build.
llvm-svn: 112638
2010-08-31 20:58:44 +00:00
Owen Anderson a5e6b3eca4 Merge 2010-08-31-InfiniteRecursion.ll into crash.ll.
llvm-svn: 112635
2010-08-31 20:27:17 +00:00
Owen Anderson 3c84ecb067 More cleanups of my JumpThreading transforms, including extracting some duplicated code into a helper function.
llvm-svn: 112634
2010-08-31 20:26:04 +00:00
Jakob Stoklund Olesen 2c325dc907 Ignore unallocatable registers in RegAllocFast.
llvm-svn: 112632
2010-08-31 19:54:25 +00:00
Devang Patel 529f248eb4 Revert r112623. It is causing self host build failures.
llvm-svn: 112631
2010-08-31 19:41:03 +00:00
Duncan Sands 11c23fc349 Update the Ada instructions to LLVM 2.7 (from LLVM 2.5).
llvm-svn: 112630
2010-08-31 19:40:21 +00:00
Owen Anderson 6fdcb172a9 Add an RAII helper to make cleanup of the RecursionSet more fool-proof.
llvm-svn: 112628
2010-08-31 19:24:27 +00:00
Owen Anderson 048efbe225 Only try to clean up the current block if we changed that block already.
llvm-svn: 112625
2010-08-31 18:55:52 +00:00
Jim Grosbach 9ce9210e47 SP relative offsets need to be adjusted by the local allocation size when
determining if they're likely to be in range of the SP when resolving
frame references.

llvm-svn: 112624
2010-08-31 18:52:31 +00:00
Devang Patel 8559932d36 Remember byval argument's frame index during argument lowering and use this info to emit debug info.
Fixes Radar 8367011.

llvm-svn: 112623
2010-08-31 18:50:09 +00:00
Jim Grosbach 6f6b590b99 this assert should just be a condition, since this function is just asking if
the offset is legally encodable, not actually trying to do the encoding.

llvm-svn: 112622
2010-08-31 18:49:31 +00:00
Owen Anderson 799a08ae48 Add a test for the duplicated-conditional situation illutrated by PR5652.
llvm-svn: 112621
2010-08-31 18:49:12 +00:00
Owen Anderson cd4de7f399 Refactor my fix for PR5652 to terminate the predecessor lookups after the first failure.
llvm-svn: 112620
2010-08-31 18:48:48 +00:00
Chris Lattner e2295f1c80 merge two tests.
llvm-svn: 112617
2010-08-31 18:44:03 +00:00
Owen Anderson 3931c85956 Manually reduce this testcase.
llvm-svn: 112615
2010-08-31 18:16:29 +00:00
Chris Lattner fbcd165b59 merge two tests and convert to filecheck.
llvm-svn: 112613
2010-08-31 18:05:08 +00:00
Owen Anderson ada0623725 Add a micro-test for the transforms I added to JumpThreading.
I have not been able to find a way to test each in isolation, for a few reasons:
1) The ability to look-through non-i1 BinaryOperator's requires the ability to look through non-constant
   ICmps in order for it to ever trigger.
2) The ability to do LVI-powered PHI value determination only matters in cases that ProcessBranchOnPHI
   can't handle.  Since it already handles all the cases without other instructions in the def-use chain
   between the PHI and the branch, it requires the ability to look through ICmps and/or BinaryOperators
   as well.

llvm-svn: 112611
2010-08-31 17:59:07 +00:00
Jim Grosbach ad9b6de3b6 Update test for 112609
llvm-svn: 112610
2010-08-31 17:58:47 +00:00
Jim Grosbach 365e931f7b Improve virtual frame base register allocation heuristics.
1. Allocate them in the entry block of the function to enable function-wide
     re-use. The instructions to create them should be re-materializable, so
     there shouldn't be additional cost compared to creating them local
     to the basic blocks where they are used.
  2. Collect all of the frame index references for the function and sort them
     by the local offset referenced. Iterate over the sorted list to
     allocate the virtual base registers. This enables creation of base
     registers optimized for positive-offset access of frame references.
     (Note: This may be appropriate to later be a target hook to do the
     sorting in a target appropriate manner. For now it's done here for
     simplicity.)

llvm-svn: 112609
2010-08-31 17:58:19 +00:00
Dan Gohman 444c24a9f0 Speculatively revert r112433.
llvm-svn: 112608
2010-08-31 17:56:47 +00:00
Benjamin Kramer 4226198a1d Allow creation of SHT_NULL sections, from Roman Divacky.
llvm-svn: 112605
2010-08-31 17:03:33 +00:00
Duncan Sands bb8a3f9f6d Stop using the dom frontier in DwarfEHPrepare by not promoting alloca's
any more.  I plan to reimplement alloca promotion using SSAUpdater later.
It looks like Bill's URoR logic really always needs domtree, so the pass
now always asks for domtree info.

llvm-svn: 112597
2010-08-31 09:05:06 +00:00
Nick Lewycky 68984ede5c Fix an infinite loop; merging two functions will create a new function (if the
two are weak, we make them thunks to a new strong function) so don't iterate
through the function list as we're modifying it.

Also add back the outermost loop which got removed during the cleanups.

llvm-svn: 112595
2010-08-31 08:29:37 +00:00
Owen Anderson ce401be792 Don't perform an extra traversal of the function just to do cleanup. We can safely simplify instructions after each block has been processed without worrying about iterator invalidation.
llvm-svn: 112594
2010-08-31 07:55:56 +00:00
Bill Wendling b70dc8777e - Cleanup some whitespaces.
- Convert {0,1} and friends into 0b01, which is identical and more consistent.

llvm-svn: 112593
2010-08-31 07:50:46 +00:00
Owen Anderson 064b139c8d Rename test directory to reflect new pass name.
llvm-svn: 112592
2010-08-31 07:50:31 +00:00
Owen Anderson 48d58ad64c Rename ValuePropagation to a more descriptive CorrelatedValuePropagation.
llvm-svn: 112591
2010-08-31 07:48:34 +00:00
Owen Anderson d2918a07bd Rename file to something more descriptive.
llvm-svn: 112590
2010-08-31 07:41:39 +00:00
Owen Anderson 3997a07fb9 More Chris-inspired JumpThreading fixes: use ConstantExpr to correctly constant-fold undef, and be more careful with its return value.
This actually exposed an infinite recursion bug in ComputeValueKnownInPredecessors which theoretically already existed (in JumpThreading's
handling of and/or of i1's), but never manifested before.  This patch adds a tracking set to prevent this case.

llvm-svn: 112589
2010-08-31 07:36:34 +00:00
Michael J. Spencer 618d21978d Cleanup Whitespace.
llvm-svn: 112587
2010-08-31 06:36:46 +00:00
Michael J. Spencer 18f5005eb0 System: Fix getMagicNumber on windows.
getMagicNumber was treating the _binary_ data it read in as a
null terminated string. This resulted in the std::string
calculating the length, and causing an assert in other code that
assumed that the length it passed was the same as the length of
the string it would get back.

llvm-svn: 112586
2010-08-31 06:36:33 +00:00
Michael J. Spencer 1279e737f5 Fix spelling/typo.
llvm-svn: 112585
2010-08-31 06:36:22 +00:00
Devang Patel 417d72823a Offset is not always unsigned number.
llvm-svn: 112584
2010-08-31 06:12:08 +00:00
Devang Patel 2cfc3af181 Simplify.
llvm-svn: 112583
2010-08-31 06:11:28 +00:00
Nick Lewycky 0464d1d7ec Switch to DenseSet, simplifying much more code. We now have a single iteration
where we hash, compare and fold, instead of one iteration where we build up
the hash buckets and a second one to fold.

llvm-svn: 112582
2010-08-31 05:53:05 +00:00
Owen Anderson 376597c13e Remove r111665, which implemented store-narrowing in InstCombine. Chris discovered a miscompilation in it, and it's not easily
fixable at the optimizer level. I'll investigate reimplementing it in DAGCombine.

llvm-svn: 112575
2010-08-31 04:41:06 +00:00
Bruno Cardoso Lopes d9ef4a1a24 zap unused method. x86 is the only user and already has a more powerfull version
llvm-svn: 112571
2010-08-31 02:36:20 +00:00
Bruno Cardoso Lopes dfd9dd5d75 Use X86ISD::MOVSS and MOVSD to represent the movl mask pattern, also fix the handling of those nodes when seeking for scalars inside vector shuffles
llvm-svn: 112570
2010-08-31 02:26:40 +00:00
Eric Christopher 901176a755 Rewrite slightly so we can expand for floating point types easier.
llvm-svn: 112568
2010-08-31 01:28:42 +00:00
Jakob Stoklund Olesen 9c39690edf Add experimental -disable-physical-join command line option.
Eventually, we want to disable physreg coalescing completely, and let the
register allocator do its job using hints.

This option makes it possible to measure the impact of disabling physreg
coalescing.

llvm-svn: 112567
2010-08-31 01:27:49 +00:00
Owen Anderson b58b3c0dda Fix a typo.
llvm-svn: 112560
2010-08-30 23:59:30 +00:00
Eric Christopher bbd1098989 If we have an unhandled type then assert, we shouldn't get here for
things we can't handle.

llvm-svn: 112559
2010-08-30 23:48:26 +00:00
Dan Gohman f2d817192b Update the descriptions of NoModRef and ModRef to be consistent
with the descriptions of Mod and Ref.

llvm-svn: 112557
2010-08-30 23:47:24 +00:00
Anton Korobeynikov 3a1d87a7ba Fix borken test
llvm-svn: 112555
2010-08-30 23:41:49 +00:00
Owen Anderson 70b17c50e2 Combine these two tests, and make sure there's a newline at the end of the file.
llvm-svn: 112554
2010-08-30 23:37:41 +00:00
Owen Anderson b974dbbdd7 Cleanups suggested by Chris.
llvm-svn: 112553
2010-08-30 23:34:17 +00:00
Owen Anderson c910acb54a Re-apply r112539, being more careful to respect the return values of the constant folding methods. Additionally,
use the ConstantExpr::get*() methods to simplify some constant folding.

llvm-svn: 112550
2010-08-30 23:22:36 +00:00
Anton Korobeynikov 48043d0173 Expand MOVi32imm in ARM mode after regalloc. This provides
scheduling opportunities (extra instruction can go in between
MOVT / MOVW pair removing the stall).

llvm-svn: 112546
2010-08-30 22:50:36 +00:00
Owen Anderson 30bacbdfdf Add statistics to evaluate this pass.
llvm-svn: 112545
2010-08-30 22:45:55 +00:00
Owen Anderson 1ddcbbe49c Revert r112539. It accidentally introduced a miscompilation.
llvm-svn: 112543
2010-08-30 22:33:41 +00:00
Owen Anderson 75f6037c7c Fixes and cleanups pointed out by Chris. In general, be careful to handle 0 results from ComputeValueKnownInPredecessors
(indicating undef), and re-use existing constant folding APIs.

llvm-svn: 112539
2010-08-30 22:07:52 +00:00
Bill Wendling 87bb14c566 Use the existing T2I_bin_s_irs pattern instead of creating T2I_bin_sw_irs, which
is meant to do exactly the same thing. Thanks to Jim Grosbach for pointing this
out! :-)

llvm-svn: 112538
2010-08-30 22:05:23 +00:00
NAKAMURA Takumi fe933eb8f6 Fix a comment.
llvm-svn: 112535
2010-08-30 21:54:03 +00:00
Jakob Stoklund Olesen 4d30f90e35 Remember to clear the shadow kill flag at the same time as clearing the real
kill flag.

This could cause duplicate kill flags when the same register was used twice in a
continuous sequence of STRs.

There is no small test case. <rdar://problem/8218046>

llvm-svn: 112534
2010-08-30 21:52:40 +00:00
Dan Gohman 60bcc102d7 Fix llc to run the verifier once, not twice.
llvm-svn: 112532
2010-08-30 21:41:20 +00:00
Owen Anderson f45ee8128c Remove this from the main tree. I'll host it out of tree.
llvm-svn: 112529
2010-08-30 21:34:26 +00:00
Dan Gohman 62ddc15f06 Add comments explaining why it's not necessary to include the
is-function-local flag in metadata uniquing bits.

llvm-svn: 112528
2010-08-30 21:18:41 +00:00
Bob Wilson 4cd8a126c3 Remove NEON vmovn intrinsic, replacing it with vector truncate operations.
Auto-upgrade the old intrinsic and update tests.

llvm-svn: 112507
2010-08-30 20:02:30 +00:00
Jim Grosbach fef37287a8 Make ARM add rN, sp, #imm instructions rematerializable. That's how the address of locals is calculated, so this should
help relieve register pressure a bit. Recalculating the local address is
almost always going to be better than spilling.

llvm-svn: 112503
2010-08-30 19:49:58 +00:00
Eric Christopher e7a9db16bb Fix LLVM target initialization to deal with sociopathic outside projects
that like to randomly define things like "X86", regenerate autoconf bits
and update cmake.

Fixes PR7852.

Patch by Xerxes Rånby!

llvm-svn: 112499
2010-08-30 18:34:48 +00:00
Eric Christopher 470e84cfeb Kill a couple of unused variables.
llvm-svn: 112498
2010-08-30 18:31:44 +00:00
Chris Lattner 3f54837161 nuke dead ivar which was supposed to be committed with r112496
llvm-svn: 112497
2010-08-30 18:16:27 +00:00
Chris Lattner 34bfab0ad5 two changes:
1) nuke ConstDataCoalSection, which is dead.
2) revise my previous patch for rdar://8018335,
  which was completely wrong.  Specifically, it doesn't 
  make sense to mark __TEXT,__const_coal as PURE_INSTRUCTIONS,
  because it is for readonly data.  templates (it turns out)
  go to const_coal_nt.  The real fix for rdar://8018335 was
  to give ConstTextCoalSection a section kind of ReadOnly 
  instead of Text.

llvm-svn: 112496
2010-08-30 18:12:35 +00:00
Bob Wilson e2f8bdac14 When expanding NEON VST pseudo instructions, if the original super-register
operand is killed, add it to the expanded instruction as an implicit kill
operand instead of marking the individual subregs with kill flags.  This
should work better in general and also handles the case for VST3 where one
of the subregs was not referenced in the expanded instruction and so was
not marked killed.

llvm-svn: 112494
2010-08-30 18:10:48 +00:00
Benjamin Kramer b1b493bcab MCELF: The value of all common symbols is the offset from the start of the section. Patch by Roman Divacky.
llvm-svn: 112492
2010-08-30 17:20:17 +00:00
Owen Anderson 9517943d11 It is possible to try to merge a not-constant with a constantrage, when dealing with ptrtoint ConstantExpr's.
Unfortunately, the only testcase I have for this is huge and doesn't reduce well because the error is
sensitive to iteration-order issues, since the problem only occurs when merging values in a particular order.

llvm-svn: 112489
2010-08-30 17:03:45 +00:00
Michael J. Spencer 2f997cdedf Partially revert r112480. Caused test failures.
llvm-svn: 112486
2010-08-30 15:34:08 +00:00
NAKAMURA Takumi e53cf6f85d coff-dump.py: Fix PR7996. Now it is compatible to Python-2.4.
llvm-svn: 112485
2010-08-30 15:19:56 +00:00
Michael J. Spencer 7983340465 Fix constant-over-index.ll test on windows.
llvm-svn: 112483
2010-08-30 15:08:02 +00:00
Michael J. Spencer 41c18853c8 Test: Fix LLVMC tests on CMake.
The CMake build didn't define TEST_COMPILE_CXX_CMD. The tests assumed gcc.

llvm-svn: 112480
2010-08-30 14:49:00 +00:00
Benjamin Kramer 8548c892a8 Don't print two "0x" prefixes. Use a raw_ostream overload instead of llvm::format.
llvm-svn: 112479
2010-08-30 14:46:53 +00:00
NAKAMURA Takumi 9c0e59de64 EE/JIT: Do not invoke parent's ctors/dtors from main()! (PR3897)
On Mingw and Cygwin, the symbol __main is resolved to
callee's(eg. tools/lli) one, to invoke wrong duplicated ctors
(and register wrong callee's dtors with atexit(3)).
We expect, by callee, ExecutionEngine::runStaticConstructorsDestructors()
is called before ExecutionEngine::runFunctionAsMain() is called.

llvm-svn: 112474
2010-08-30 14:00:29 +00:00
Benjamin Kramer 8199447851 The value is offset from the start of the section for non-common symbols, submitted by Jordan Gordeev.
llvm-svn: 112473
2010-08-30 12:00:16 +00:00
Benjamin Kramer f791b9fc56 Index external symbols by symbol table instead of parent section, by Roman Divacky.
llvm-svn: 112472
2010-08-30 11:59:29 +00:00
Benjamin Kramer 6ebea89316 Mark all common symbols external. This is not exactly correct but it lets apps
link for now and can be adjusted later. Patch by Roman Divacky.

llvm-svn: 112471
2010-08-30 11:56:55 +00:00
Duncan Sands 1b6744a376 Remove a hack that tries to understand incorrect triples from the
Triple class constructor.  Only valid triples should now be used
inside LLVM - front-ends are now responsable for rejecting or
correcting invalid target triples.  The Triple::normalize method
can be used to straighten out funky triples provided by users.
Give this a whirl through the buildbots to see if I caught all
places where triples enter LLVM.

llvm-svn: 112470
2010-08-30 10:57:54 +00:00
Duncan Sands 68c30907cc Correct bogus module triple specifications.
llvm-svn: 112469
2010-08-30 10:48:29 +00:00
Owen Anderson 75c205e7e2 Add a new example to the LLVM distribution: a trace-based Brainfuck compiler that uses LLVM as its code generator.
llvm-svn: 112465
2010-08-30 07:33:39 +00:00
Chandler Carruth 1ddaacebf6 Attempt to remove the MSIL backend from CMake as well based on Chris's r112375.
llvm-svn: 112464
2010-08-30 07:25:54 +00:00
Bill Wendling f824489a1d Revert r112461. It was failing on PPC...
llvm-svn: 112463
2010-08-30 04:36:50 +00:00
Bill Wendling f8dfa461fa Create Thumb2sI_cpsr and T2sI_cpsr. These new classes indicate that CPSR is the
optional modified register (instead of reg0). Along with r112461 it will make
sure that the optional define of CPSR is marked as "def" and will thus mark the
instructions using these classes (t2ANDS*) as setting the 's' flag.

llvm-svn: 112462
2010-08-30 01:47:35 +00:00
Bill Wendling 938f299fa9 When adding a register, we should mark it as "def" if it can optionally define
said (physical) register.

llvm-svn: 112461
2010-08-30 01:36:05 +00:00
Chris Lattner ea05bf2259 revert 112457, it looks like it broke selfhost.
llvm-svn: 112459
2010-08-29 22:28:18 +00:00
Chris Lattner c843fca2fd rewrite DwarfEHPrepare to use SSAUpdater to promote its allocas
instead of PromoteMemToReg.  This allows it to stop using DF and DT,
eliminating a computation of DT and DF from clang -O3.  Clang is now
down to 2 runs of DomFrontier.

llvm-svn: 112457
2010-08-29 19:54:28 +00:00
Chris Lattner d94a7c3dc1 inline function into its only caller.
llvm-svn: 112455
2010-08-29 19:28:28 +00:00
Chris Lattner f58382ed87 two changes: 1) make AliasSet hold the list of call sites with an
assertingvh so we get a violent explosion if the pointer dangles.

2) Fix AliasSetTracker::deleteValue to remove call sites with
   by-pointer comparisons instead of by-alias queries.  Using
   findAliasSetForCallSite can cause alias sets to get merged
   when they shouldn't, and can also miss alias sets when the
   call is readonly.

#2 fixes PR6889, which only repros with a .c file :(

llvm-svn: 112452
2010-08-29 18:42:23 +00:00
Chris Lattner 263f804699 LICM does get dead instructions input to it. Instead of sinking them
out of loops, just delete them.

llvm-svn: 112451
2010-08-29 18:22:25 +00:00
Chris Lattner 6ac0659a1c use moveBefore instead of remove+insert, it avoids some
symtab manipulation, so its faster (in addition to being
more elegant)

llvm-svn: 112450
2010-08-29 18:18:40 +00:00
Chris Lattner f03b4eac48 revert 112448 for now.
llvm-svn: 112449
2010-08-29 18:11:16 +00:00
Chris Lattner 11f8ad8211 optimize LICM::hoist to use moveBefore. Correct its updating
of AST to remove the hoisted instruction from the AST, since it
is no longer in the loop.

llvm-svn: 112448
2010-08-29 18:03:33 +00:00
Chris Lattner 1a1ed69435 fix some bugs (found by inspection) where LICM would not update
LICM correctly.  When sinking an instruction, it should not add
entries for the sunk instruction to the AST, it should remove
the entry for the sunk instruction.  The blocks being sunk to
are not in the loop, so their instructions shouldn't be in the
AST (yet)!

llvm-svn: 112447
2010-08-29 18:00:00 +00:00
Chris Lattner cc9cbc66a3 rework the ownership of subloop alias information: instead of
keeping them around until the pass is destroyed, keep them
around a) just when useful (not for outer loops) and b) destroy
them right after we use them.  This should reduce memory use
and fixes potential bugs where a loop is deleted and another
loop gets allocated to the same address.

llvm-svn: 112446
2010-08-29 17:46:00 +00:00
Chris Lattner bc1a65ac6c apparently unswitch had the same "Feature". Stop its
claims that it preserves domfrontier if it doesn't really.

llvm-svn: 112445
2010-08-29 17:23:19 +00:00
Chris Lattner d6f46b8af8 now that loop passes don't use DomFrontier, there is no reason
for the unroller to pretend it supports updating it.  It still
has a horrible hack for DomTree.

llvm-svn: 112444
2010-08-29 17:21:35 +00:00
Dan Gohman 3a08ed7904 Make IVUsers iterative instead of recursive.
This has the side effect of reversing the order of most of
IVUser's results.

llvm-svn: 112442
2010-08-29 16:40:03 +00:00
Dan Gohman 002ff89cbd Optionally rerun dedicated-register filtering after applying
other filtering techniques, as those may allow it to filter
out more obviously unprofitable candidates.

llvm-svn: 112441
2010-08-29 16:39:22 +00:00
Dan Gohman f031792cc6 Fix several areas in LSR to do a better job keeping the main
LSRInstance data structures up to date. This fixes some
pessimizations caused by stale data which will be exposed
in an upcoming change.

llvm-svn: 112440
2010-08-29 16:32:54 +00:00
Dan Gohman e9e0873b08 Refactor the three main groups of code out of
NarrowSearchSpaceUsingHeuristics into separate functions.

llvm-svn: 112439
2010-08-29 16:09:42 +00:00
Dan Gohman 37a0f68036 Delete a bogus check.
llvm-svn: 112438
2010-08-29 15:30:29 +00:00
Dan Gohman b6a520d63c Add some comments.
llvm-svn: 112437
2010-08-29 15:27:08 +00:00
Dan Gohman bf673e0652 Move this debug output into GenerateAllReuseFormula, to declutter
the high-level logic.

llvm-svn: 112436
2010-08-29 15:21:38 +00:00
Dan Gohman d366b6d5c8 Delete an unused declaration.
llvm-svn: 112435
2010-08-29 15:19:11 +00:00
Dan Gohman 4f13bbfefc Do one lookup instead of two.
llvm-svn: 112434
2010-08-29 15:18:49 +00:00