Commit Graph

62908 Commits

Author SHA1 Message Date
Rafael Espindola 07035e6a00 Make the test while reducing blocks functional. This avoids accessing freed
memory when one of the original BB is destroyed.

llvm-svn: 109747
2010-07-29 14:20:59 +00:00
Benjamin Kramer bccfec653d Stop leaking std::strings in GetDwarfFile.
llvm-svn: 109746
2010-07-29 13:53:19 +00:00
Benjamin Kramer c2997dde85 COFFObjectWriter: Don't leak COFFSymbols and COFFSections.
llvm-svn: 109745
2010-07-29 11:57:59 +00:00
John McCall eaeede9a06 Centralize the logic to permanently unify two instructions and make sure
it establishes a context and does a complaining diff.  Also make sure we
unify the prelude and postlude of a diff after a block-diff call.

llvm-svn: 109744
2010-07-29 09:20:34 +00:00
John McCall 8489de298e Diagnose non-structural differences in the case where blocks were
structurally identical.

llvm-svn: 109743
2010-07-29 09:04:45 +00:00
John McCall 0ed6b1326c When unifying instructions during a block diff, actually complain about
any differences we see.  This should only happen if there are "non-structural"
differences between the instructions, i.e. differences which wouldn't cause
diff to return true.

llvm-svn: 109742
2010-07-29 08:59:27 +00:00
John McCall d293c4e6e0 Somehow I was getting reasonable results for the test cases I was interested
in despite not ever incrementing any path costs, so that the only nonzero costs
arose from the all-left path in the first column.  Anyway.  Perform the diff
starting from the beginning of the block to avoid capturing (say) loads of
allocas.

Vastly improves diff results on code that hasn't been mem2reg'ed.

llvm-svn: 109741
2010-07-29 08:53:59 +00:00
John McCall 10c91bfa66 Cache the result of errs() and implement formatted logging.
llvm-svn: 109740
2010-07-29 08:14:41 +00:00
John McCall 5e6a16d71f Add the llvm-diff tool, which performs a relatively naive structural
diff of a function.  There's a lot of cruft in the current version, and
it's pretty far from perfect, but it's usable.

Currently only capable of comparing functions.  Currently ignores metadata.
Currently ignores most attributes of functions and instructions.

Patches welcome.

llvm-svn: 109739
2010-07-29 07:53:27 +00:00
Daniel Dunbar 9789f81eb4 Make sure to include config.h, to pickup LLVM_ON_WIN32.
llvm-svn: 109721
2010-07-29 01:52:04 +00:00
Daniel Dunbar b759a13da8 MC: Destroy Macro instances.
llvm-svn: 109720
2010-07-29 01:51:55 +00:00
Eric Christopher ef6d5933a6 Speculatively revert r109705 since it seems to be causing some build bot
angst.

llvm-svn: 109718
2010-07-29 01:25:38 +00:00
Daniel Dunbar af77e22b36 CrashRecoveryContext: Add a simple POSIX implementation.
- This works, but won't handle crashes on stack overflow, or signals delivered
   to a thread other than the one that crashed. The latter is particular annoying
   on Darwin, because SIGABRT tends to go to the main thread.

llvm-svn: 109717
2010-07-29 01:21:47 +00:00
Jakob Stoklund Olesen 36cf119049 Fix a bug in the -regalloc=fast handling of exotic two-address instruction with
multiple defs, like t2LDRSB_POST.

The first def could accidentally steal the physreg that the second, tied def was
required to be allocated to.

Now, the tied use-def is treated more like an early clobber, and the physreg is
reserved before allocating the other defs.

This would never be a problem when the tied def was the only def which is the
usual case.

This fixes MallocBench/gs for thumb2 -O0.

llvm-svn: 109715
2010-07-29 00:52:19 +00:00
Jakob Stoklund Olesen 1222249aab Use the right gcc tool args for IsARMArchitecture.
llvm-svn: 109714
2010-07-29 00:52:16 +00:00
Dan Gohman 3d6ac44d96 Factor out some of the code for updating old SCEVUnknown values, and
extend it to handle the case where multiple RAUWs affect a single
SCEVUnknown.

Add a ScalarEvolution unittest to test for this situation.

llvm-svn: 109705
2010-07-29 00:17:55 +00:00
Owen Anderson a44f49f189 Pass the queried value by argument rather than in a member, in preparation for supporting PHI translation.
llvm-svn: 109701
2010-07-28 23:50:08 +00:00
Jim Grosbach c445a7d29b ARM mode version of r109693. Remove incorrect substitution pattern for UXTB16. It wrongly assumed the input shift was actually a rotate. rdar://8240138
llvm-svn: 109696
2010-07-28 23:25:44 +00:00
Jim Grosbach 716a596cf7 Remove incorrect substitution pattern for UXTB16. It wrongly assumed the input shift was actually a rotate. rdar://8240138
llvm-svn: 109693
2010-07-28 23:17:45 +00:00
Jim Grosbach de0874a4bc Remove dead prototype
llvm-svn: 109691
2010-07-28 23:16:12 +00:00
Gabor Greif 62f0aac99d simplify by using CallSite constructors; virtually eliminates CallSite::get from the tree
llvm-svn: 109687
2010-07-28 22:50:26 +00:00
Owen Anderson cfc2a57fcd Add an erase() method to llvm::ThreadLocal.
llvm-svn: 109686
2010-07-28 22:49:43 +00:00
Owen Anderson bcaba485ce Add more doxygen comments for llvm::ThreadLocal.
llvm-svn: 109683
2010-07-28 22:30:53 +00:00
Owen Anderson 6982dd4e1f Get rid of LVIQuery as a distinct data structure, so that we don't have to initialize a new set of maps on every query.
llvm-svn: 109679
2010-07-28 22:07:25 +00:00
Dan Gohman 7e4163d48e Move MaximumAlignment to Value.h, now that GlobalValue.h needs it.
llvm-svn: 109656
2010-07-28 21:02:38 +00:00
Dan Gohman 390914cbe8 Make GlobalValue alignment consistent with load, store, and alloca
alignment, fixing silent truncation of alignment values.

llvm-svn: 109653
2010-07-28 20:56:48 +00:00
Jakob Stoklund Olesen f2234fbe70 Create a fixed stack object for varargs that is as large as any register.
The size of this object isn't used for anything - technically it is of variable
size.

This avoids a false positive from the assert in
X86InstrInfo::loadRegFromStackSlot, and fixes PR7735.

llvm-svn: 109652
2010-07-28 20:55:38 +00:00
Kevin Enderby e5930f142a Added first bit of support for the dwarf .file directive. This patch collects
the info from the .file directive and makes file and directory tables that
will eventually be put out as part of the dwarf info in the output file.

llvm-svn: 109651
2010-07-28 20:55:35 +00:00
Daniel Dunbar 18e39cec7a RegionInfo: Make sure to free cached nodes; Tobias, please check!
llvm-svn: 109650
2010-07-28 20:28:50 +00:00
Daniel Dunbar e397dded7b MC: Put back the MCFragment vtable, so subclasses are destroyed properly (duh).
llvm-svn: 109649
2010-07-28 20:28:45 +00:00
Eric Christopher f7eb811d1a Regenerate.
llvm-svn: 109647
2010-07-28 20:26:43 +00:00
Eric Christopher 84c95cc9b5 Use a C++ compiler for the atomic builtin check since we'll
be using a C++ compiler to build.

Patch by Török Edwin!

llvm-svn: 109646
2010-07-28 20:26:34 +00:00
Dan Gohman a7e5a24093 Define a maximum supported alignment value for load, store, and
alloca instructions (constrained by their internal encoding),
and add error checking for it. Fix an instcombine bug which
generated huge alignment values (null is infinitely aligned).
This fixes undefined behavior noticed by John Regehr.

llvm-svn: 109643
2010-07-28 20:12:04 +00:00
Jakob Stoklund Olesen 0ff2c110ad Print out the regclass of any virtual registers used by a machine instruction.
llvm-svn: 109608
2010-07-28 18:35:46 +00:00
Bob Wilson 59fba9d2b9 Fix a warning from gcc-4.0 (from the ppc buildbot).
llvm-svn: 109605
2010-07-28 18:21:10 +00:00
Rafael Espindola 594994a34c Instead of abusing swapProgramIn, just add a Module argument to
EmitProgressBitcode.

llvm-svn: 109602
2010-07-28 18:12:30 +00:00
Douglas Gregor b7b5a7dff0 Unbreak my CMake build, say you'll compile for me again...
llvm-svn: 109598
2010-07-28 17:17:46 +00:00
Dan Gohman 1da02dfbe3 Fix this code to avoid decrementing an iterator past the beginning
of a std::vector.

llvm-svn: 109597
2010-07-28 17:15:36 +00:00
Dan Gohman 9cd20bf792 When user code intentionally dereferences null, the alignment of the
dereference is theoretically infinite. Put a cap on the computed
alignment to avoid overflow, noticed by John Regehr.

llvm-svn: 109596
2010-07-28 17:14:23 +00:00
Dan Gohman 32f889e552 Do GEP offset calculations with unsigned math rather than signed math
to avoid undefined behavior on overflow, noticed by John Regehr.

llvm-svn: 109594
2010-07-28 17:11:36 +00:00
Dan Gohman 44ee74292f Add some extra friend declarations to fix a gcc-4.0 compile error.
This is a temporary fix, until more elaborate changes are ready.

llvm-svn: 109593
2010-07-28 17:09:24 +00:00
Gabor Greif f0084e1333 simplify
llvm-svn: 109589
2010-07-28 15:52:43 +00:00
Daniel Dunbar 19a3b37441 Support: Add CrashRecoveryContext helper object.
- Designed as a simple wrapper to allow clients to attempt to catch crashes
   (memory errors, assertion violations, etc.) and do some kind of recovery.

 - Currently doesn't actually attempt to catch crashes.

llvm-svn: 109586
2010-07-28 15:40:20 +00:00
Gabor Greif e497e5ef46 simplify
llvm-svn: 109585
2010-07-28 15:31:37 +00:00
Gabor Greif 0a970698da use Value* constructor of CallSite to create potentially improper site, and test that
llvm-svn: 109581
2010-07-28 14:28:18 +00:00
Gabor Greif 5bf74d648d use Value* constructor of CallSite to create potentially improper site, and test that
llvm-svn: 109580
2010-07-28 12:35:54 +00:00
Gabor Greif 67a970bff2 use Value* constructor of CallSite to create potentially improper site
llvm-svn: 109579
2010-07-28 12:19:46 +00:00
Gabor Greif 7cf6056484 simplify
llvm-svn: 109578
2010-07-28 10:57:28 +00:00
Gabor Greif 2e2503cd8d simplify
llvm-svn: 109577
2010-07-28 10:46:09 +00:00
Gabor Greif 02fbd6b8ce we are supposed to only create proper CallSites from an instruction (esp. CallInst and InvokeInst)
llvm-svn: 109576
2010-07-28 10:44:59 +00:00