Commit Graph

96285 Commits

Author SHA1 Message Date
Chris Lattner 5ea7d07d2a The final result of all this refactoring: instead of doing stat immediately
followed by an open for every source file we open, probe the file system with
'open' and then do an fstat when it succeeds.  open+fstat is faster than
stat+open because the kernel only has to perform the string->inode mapping
once.  Presumably it gets faster the deeper in your filesystem a lookup
happens.

For -Eonly on cocoa.h, this reduces system time from 0.042s to 0.039s on
my machine, a 7.7% speedup.

llvm-svn: 120066
2010-11-23 22:32:37 +00:00
Chris Lattner 6bf4e6d8b2 add a MemoryBuffer::getOpenFile method, which turns an open
file descriptor into a MemoryBuffer (and closes the FD).

llvm-svn: 120065
2010-11-23 22:20:27 +00:00
Howard Hinnant e78881314a Update testsuite strucuture to latest draft
llvm-svn: 120064
2010-11-23 22:13:07 +00:00
John McCall 8a1013f8c3 Redeclarations of using declarations are not okay in function scopes.
Not sure what I was thinking before.

Fixes PR8668.

llvm-svn: 120063
2010-11-23 22:03:51 +00:00
Chris Lattner f77e11ba05 if we succeed in opening a directory but expected a file, ensure we don't
leak a filedescriptor if a client ever starts returning one.

llvm-svn: 120062
2010-11-23 21:53:56 +00:00
Chris Lattner 278038b4be hopefully resolve the windows buildbot issue (retch)
llvm-svn: 120061
2010-11-23 21:53:15 +00:00
Chris Lattner dd278430a3 change the 'is directory' indicator to be a null-or-not
pointer that is passed down through the APIs, and make
FileSystemStatCache::get be the one that filters out
directory lookups that hit files.  This also paves the
way to have stat queries be able to return opened files.

llvm-svn: 120060
2010-11-23 21:17:56 +00:00
Michael J. Spencer 5aef638057 system_error: Add fixme.
llvm-svn: 120059
2010-11-23 21:09:11 +00:00
Howard Hinnant b32f147bbf Update testsuite strucuture to latest draft
llvm-svn: 120058
2010-11-23 20:55:56 +00:00
Howard Hinnant fedfe3b69c Update testsuite strucuture to latest draft
llvm-svn: 120057
2010-11-23 20:55:36 +00:00
Chris Lattner 9624b695d2 pull "is directory" handling into FileManager::getStatValue
which simplifies clients and is important for future directions.
Add a FD member to FileEntry which isn't used but will be shortly.

llvm-svn: 120056
2010-11-23 20:50:22 +00:00
John McCall feb624a435 A few tweaks to the value-kind computation:
- Default argument expressions pick up the value kind of the incoming
   expression, not the value kind of the parameter it initializes.
 - When building a template argument for substitution, A::x is an rvalue
   if x is an instance method.
 - Anonymous struct/union paths pick up value kind the same way that
   normal member accesses do;  extract out a common code path for this.

Enable the value-kind assertion, now that it passes self-host.

llvm-svn: 120055
2010-11-23 20:48:44 +00:00
Howard Hinnant ab7be6e43c Update testsuite strucuture to latest draft
llvm-svn: 120054
2010-11-23 20:47:09 +00:00
Peter Collingbourne e57e9ef9b7 Remove static_casts from SemaDeclAttr.cpp
llvm-svn: 120053
2010-11-23 20:45:58 +00:00
Howard Hinnant 53a3dfcf98 Update testsuite strucuture to latest draft
llvm-svn: 120052
2010-11-23 20:45:26 +00:00
Duncan Sands 0488d564e1 Rename SimplifyDistributed to the more meaningfull name SimplifyByFactorizing.
llvm-svn: 120051
2010-11-23 20:42:39 +00:00
Howard Hinnant 2066341b0d Update testsuite strucuture to latest draft
llvm-svn: 120050
2010-11-23 20:41:07 +00:00
Benjamin Kramer 94a622af4c The srem -> urem transform is not safe for any divisor that's not a power of two.
E.g. -5 % 5 is 0 with srem and 1 with urem.

Also addresses Frits van Bommel's comments.

llvm-svn: 120049
2010-11-23 20:33:57 +00:00
Chris Lattner 966b25b938 tidy up code, add a comment about dir caching.
llvm-svn: 120048
2010-11-23 20:30:42 +00:00
Howard Hinnant 165e25c974 Update testsuite strucuture to latest draft
llvm-svn: 120047
2010-11-23 20:29:54 +00:00
Howard Hinnant 1435748d25 Update testsuite strucuture to latest draft
llvm-svn: 120046
2010-11-23 20:27:28 +00:00
Howard Hinnant 4030e72457 Update testsuite strucuture to latest draft
llvm-svn: 120045
2010-11-23 20:26:48 +00:00
Duncan Sands 433c1679cf Replace calls to ConstantFoldInstruction with calls to SimplifyInstruction
in two places that are really interested in simplified instructions, not
constants.

llvm-svn: 120044
2010-11-23 20:26:33 +00:00
Howard Hinnant 46cc61ea7c Update testsuite strucuture to latest draft
llvm-svn: 120043
2010-11-23 20:25:10 +00:00
Duncan Sands bb2cd025a9 Constant folding here is pointless, because InstructionSimplify
(which does constant folding and more) is called a few lines
later.

llvm-svn: 120042
2010-11-23 20:24:21 +00:00
Howard Hinnant 968df4fdff Update testsuite strucuture to latest draft
llvm-svn: 120041
2010-11-23 20:22:13 +00:00
Howard Hinnant e8ce332127 Update testsuite strucuture to latest draft
llvm-svn: 120040
2010-11-23 20:21:36 +00:00
Chris Lattner ea61b32c4a replicate a terrible hack to fix a build error on VC++
llvm-svn: 120039
2010-11-23 20:07:39 +00:00
Chris Lattner 8f0583daa2 simplify the cache miss handling code, eliminating CacheMissing.
llvm-svn: 120038
2010-11-23 20:05:15 +00:00
Chris Lattner 5769c3dffd factor the "cache miss" handling code out of FM into a static
method in FileSystemStatCache.

llvm-svn: 120037
2010-11-23 19:56:39 +00:00
Howard Hinnant 274541968b Update testsuite strucuture to latest draft
llvm-svn: 120036
2010-11-23 19:52:19 +00:00
Jason W Kim 8e21bf84e8 Move the ARM reloc constants to Support/ELF.h
llvm-svn: 120035
2010-11-23 19:40:36 +00:00
Bob Wilson d7d2cf7842 Recognize sign/zero-extended constant BUILD_VECTORs for VMULL operations.
We need to check if the individual vector elements are sign/zero-extended
values.  For now this only handles constants values.  Radar 8687140.

llvm-svn: 120034
2010-11-23 19:38:38 +00:00
Bob Wilson b91ae1ac52 Fix copy-and-paste error in exception message.
llvm-svn: 120033
2010-11-23 19:38:34 +00:00
Chris Lattner b3c814538b r120013 dropped passing in the precomputed file size to
MemoryBuffer::getFile, causing us to pick up a fstat for
every file.  Restore the optimization.

llvm-svn: 120032
2010-11-23 19:38:22 +00:00
Chris Lattner 2a6fa47b26 PCH files only cache successful stats. Remove the code that reads/writes
the result code of the stat to/from the PCH file since it is always 0.

llvm-svn: 120031
2010-11-23 19:28:12 +00:00
Chris Lattner 226efd356c rework the stat cache, pulling it out of FileManager.h into
its own header and giving it some more structure.  No 
functionality change.

llvm-svn: 120030
2010-11-23 19:19:34 +00:00
Howard Hinnant e5cb278766 Update testsuite strucuture to latest draft
llvm-svn: 120029
2010-11-23 19:15:49 +00:00
Benjamin Kramer b5afa65b0a InstCombine: Reduce "X shift (A srem B)" to "X shift (A urem B)" iff B is positive.
This allows to transform the rem in "1 << ((int)x % 8);" to an and.

llvm-svn: 120028
2010-11-23 18:52:42 +00:00
Howard Hinnant e3120ed1bf N3188 - Revision to N3113: Async Launch Policies (CH 36)
llvm-svn: 120027
2010-11-23 18:33:54 +00:00
Duncan Sands 60813f96e0 Propagate LeftDistributes and RightDistributes into their only uses.
Stylistic improvement suggested by Frits van Bommel.

llvm-svn: 120026
2010-11-23 15:28:14 +00:00
Duncan Sands 22df741687 Fix typo pointed out by Frits van Bommel and Marius Wachtler.
llvm-svn: 120025
2010-11-23 15:25:34 +00:00
Duncan Sands adc7771f18 Exploit distributive laws (eg: And distributes over Or, Mul over Add, etc) in a
fairly systematic way in instcombine.  Some of these cases were already dealt
with, in which case I removed the existing code.  The case of Add has a bunch of
funky logic which covers some of this plus a few variants (considers shifts to be
a form of multiplication), which I didn't touch.  The simplification performed is:
A*B+A*C -> A*(B+C).  The improvement is to do this in cases that were not already
handled [such as A*B-A*C -> A*(B-C), which was reported on the mailing list], and
also to do it more often by not checking for "only one use" if "B+C" simplifies.

llvm-svn: 120024
2010-11-23 14:23:47 +00:00
Kalle Raiskila e1b6c273b8 Division by pow-of-2 is not cheap on SPU, do it with
shifts.

llvm-svn: 120022
2010-11-23 13:27:59 +00:00
Rafael Espindola f6c05b1d01 Implement the rex64 prefix.
llvm-svn: 120017
2010-11-23 11:23:24 +00:00
Duncan Sands a021988d64 Expand a little on the description of what InstructionSimplify does.
llvm-svn: 120016
2010-11-23 10:50:08 +00:00
Duncan Sands 763dec0ab8 Clarify that constant folding of instructions applies when all operands
are constant.  There was in fact one exception to this (phi nodes) - so
remove that exception (InstructionSimplify handles this so there should
be no loss).

llvm-svn: 120015
2010-11-23 10:16:18 +00:00
John McCall 20c00e0e7b This test does not need to test the alignment of pointers. Make it pass
on 64-bit systems.

llvm-svn: 120014
2010-11-23 10:15:48 +00:00
Chris Lattner 26b5c190f8 tidy up. Split FileManager::getBufferForFile into
two copies, since they are fundamentally different
operations and the StringRef one should go away
(it shouldn't be part of FileManager at least).

Remove some dead arguments.

llvm-svn: 120013
2010-11-23 09:19:42 +00:00
Chris Lattner 7219a5db6e don't allow remapping PTH file paths with -fworking-directory, the
client should just pass in absolute paths.

llvm-svn: 120012
2010-11-23 09:01:31 +00:00