Commit Graph

131351 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen 06d6a5363b Make the hasPHIKills flag a computed property.
The VNInfo::HAS_PHI_KILL is only half supported. We precompute it in
LiveIntervalAnalysis, but it isn't properly updated by live range
splitting and functions like shrinkToUses().

It is only used in one place: RegisterCoalescer::removeCopyByCommutingDef().

This patch changes that function to use a new LiveIntervals::hasPHIKill()
function that computes the flag for a given value number.

llvm-svn: 161254
2012-08-03 20:10:24 +00:00
Eric Christopher 84864018c2 Add a configure flag for enabling -Werror on the command line
while building as requested by Lang.

llvm-svn: 161253
2012-08-03 19:58:20 +00:00
Eric Christopher c807c53ef6 Add support for detecting libxml for Dmitri's work. He'll
commit code in clang that uses this shortly.

llvm-svn: 161252
2012-08-03 19:47:19 +00:00
Eric Christopher 04e35970f5 Add a configure option to pass -std=c++11 on the command line.
rdar://11366674

llvm-svn: 161251
2012-08-03 19:47:14 +00:00
Jakob Stoklund Olesen e82f403c51 Remove a dead prototype.
llvm-svn: 161250
2012-08-03 18:34:32 +00:00
Anna Zaks 4bd96c4469 [analyzer] Fix a typo. Thanks Jordan.
llvm-svn: 161249
2012-08-03 18:30:20 +00:00
Anna Zaks 52242a6677 [analyzer] Malloc: track non-allocated but freed memory
There is no reason why we should not track the memory which was not
allocated in the current function, but was freed there. This would
allow to catch more use-after-free and double free with no/limited IPA.

Also fix a realloc issue which surfaced as the result of this patch.

llvm-svn: 161248
2012-08-03 18:30:18 +00:00
Howard Hinnant aca09de378 Performance tweaking rotate.
rotate is a critical algorithm because it is often used by other algorithms,
both std and non-std.  The main thrust of this optimization is a specialized
algorithm when the 'distance' to be shifted is 1 (either left or right).  To my
surprise, this 'optimization' was not effective for types like std::string.
std::string favors rotate algorithms which only use swap.  But for types like
scalars, and especially when the sequence is random access, these new
specializations are a big win.  If it is a vector<size_t> for example, the
rotate is done via a memmove and can be several times faster than the gcd
algorithm.

I'm using is_trivially_move_assignable to distinguish between types like int and
types like string.  This is obviously an ad-hoc approximation, but I haven't
found a case where it doesn't give good results.

I've used a 'static if' (with is_trivially_move_assignable) in three places. 
Testing with both -Os and -O3 showed that clang eliminated all code not be
executed by the 'static if' (including the 'static if' itself).

llvm-svn: 161247
2012-08-03 18:01:20 +00:00
Eric Christopher 46342fecd0 Revert previous patch here, we should instead configure in specific
packages for particular uses.

llvm-svn: 161246
2012-08-03 17:45:31 +00:00
Michael Han a9171bcf7d Fix line endings.
llvm-svn: 161245
2012-08-03 17:40:43 +00:00
Jim Grosbach cc6b1816fd TableGen: Remove extraneous \ character from arm_neon.h definitions.
llvm-svn: 161244
2012-08-03 17:30:46 +00:00
Benjamin Kramer 4a9020839c Flesh out test for defaulted key functions a bit more.
llvm-svn: 161243
2012-08-03 15:43:22 +00:00
Jakob Stoklund Olesen 19c4596629 Delete dead function.
llvm-svn: 161242
2012-08-03 15:21:21 +00:00
Jakob Stoklund Olesen 47ac20d4d6 Don't delete dead code in TwoAddressInstructionPass.
This functionality was added before we started running
DeadMachineInstructionElim on all targets. It serves no purpose now.

llvm-svn: 161241
2012-08-03 15:11:57 +00:00
Gabor Greif a1529b6ca4 allow 'make CPPFLAGS=<something>' work again
this makes this hack a bit more bearable
for poor souls who need to pass custom
preprocessor flags to the build process

llvm-svn: 161240
2012-08-03 13:31:24 +00:00
Tobias Grosser 6217e18a7d Add preliminary implementation for GPGPU code generation.
Translate the selected parallel loop body into a ptx string and run it with the
cuda driver API. We limit this preliminary implementation to target the
following special test cases:

  - Support only 2-dimensional parallel loops with or without only one innermost
    non-parallel loop.
  - Support write memory access to only one array in a SCoP.

The patch was committed with smaller changes to the build system:

There is now a flag to enable gpu code generation explictly. This was required
as we need the llvm.codegen() patch applied on the llvm sources, to compile this
feature correctly. Also, enabling gpu code generation does not require cuda.
This requirement was removed to allow 'make polly-test' runs, even without an
installed cuda runtime.

Contributed by:  Yabin Hu  <yabin.hwu@gmail.com>

llvm-svn: 161239
2012-08-03 12:50:07 +00:00
Benjamin Kramer 7555b54020 Reduce temp file pollution in some test cases.
llvm-svn: 161237
2012-08-03 10:35:06 +00:00
Benjamin Kramer 73d1be7c56 Fix failed to generate vtables in certain cases.
By C++ standard, the vtable should be generated if the first non-inline
virtual function is defined in the TU.  Current version of clang doesn't
generate vtable if the first virtual function is defaulted, because the
key function is regarded as the defaulted function.

Patch by Li Kan!

llvm-svn: 161236
2012-08-03 08:39:58 +00:00
Tobias Grosser 08ffdba6bd Remove 'using namespace llvm' from header file
This fixes a conflict between polly::createIndVarSimplifyPass() and
llvm::createIndVarSimplifyPass(), which causes problems on windows.

Reported by:  Michael Kruse  <MichaelKruse@meinersbur.de

llvm-svn: 161235
2012-08-03 08:11:24 +00:00
Tobias Grosser 5a2925c6a1 cmake: Fix building of Polly on Apple system
The Apple linker fails by default, if some function calls can not be resolved at
link time. However, all functions that are part of LLVM itself will not be
linked into Polly, but will be provided by the compiler that Polly is loaded
into.  Hence, during linking we need to ignore failures due to unresolved
function calls.

llvm-svn: 161234
2012-08-03 07:12:07 +00:00
Eric Christopher caa3e7a0ef Add a BUILD_FLAGS variable so that autoconf checks have a place
to store additional flag options since too many things can
and do override CPPFLAGS. Also, this is exported, unlike CPPFLAGS
so it can be actually used elsewhere. This should enable us
to remove the AC_SUBSTs in the intel checks, but I have no way
of testing it.

llvm-svn: 161233
2012-08-03 05:18:00 +00:00
Bob Wilson 3e6fa462f3 Fall back to selection DAG isel for calls to builtin functions.
Fast isel doesn't currently have support for translating builtin function
calls to target instructions.  For embedded environments where the library
functions are not available, this is a matter of correctness and not
just optimization.  Most of this patch is just arranging to make the
TargetLibraryInfo available in fast isel.  <rdar://problem/12008746>

llvm-svn: 161232
2012-08-03 04:06:28 +00:00
Bob Wilson c740e3f0d1 Add new getLibFunc method to TargetLibraryInfo.
This just provides a way to look up a LibFunc::Func enum value for a
function name.  Alphabetize the enums and function names so we can use a
binary search.

llvm-svn: 161231
2012-08-03 04:06:22 +00:00
Jush Lu 4705da9020 [arm-fast-isel] Add support for shl, lshr, and ashr.
llvm-svn: 161230
2012-08-03 02:37:48 +00:00
NAKAMURA Takumi edac6ee6aa [CMake] Add yaml2obj to check-llvm.
llvm-svn: 161229
2012-08-03 00:45:32 +00:00
Bill Wendling 8555a37c04 Move the "findUsedStructTypes" functionality outside of the Module class.
The "findUsedStructTypes" method is very expensive to run. It needs to be
optimized so that LTO can run faster. Splitting this method out of the Module
class will help this occur. For instance, it can keep a list of seen objects so
that it doesn't process them over and over again.

llvm-svn: 161228
2012-08-03 00:30:35 +00:00
Eric Christopher d15385c9e4 Add some missing functions to builtins.py.
rdar://10112601

llvm-svn: 161227
2012-08-03 00:13:44 +00:00
Eric Christopher b3322364e4 Add support for the ARM GHC calling convention, this patch was in 3.0,
but somehow managed to be dropped later.

Patch by Karel Gardas.

llvm-svn: 161226
2012-08-03 00:05:53 +00:00
Dmitri Gribenko 0567de88e6 Comment AST: convert a huge if -- else if statement on Decl's type into a
switch.  Thanks Sean Silva for suggestion!

llvm-svn: 161225
2012-08-03 00:01:01 +00:00
Anna Zaks 4c03dfd4b1 [analyzer] Solve another source of non-determinism in the diagnostic
engine.

The code that was supposed to split the tie in a deterministic way is
not deterministic. Most likely one of the profile methods uses a
pointer. After this change we do finally get the consistent diagnostic
output. Testing this requires running the analyzer on large code bases
and diffing the results.

llvm-svn: 161224
2012-08-02 23:41:05 +00:00
Richard Trieu bcd829c2d0 Remove redundant '== true' after a comparison.
llvm-svn: 161223
2012-08-02 23:22:39 +00:00
Jim Grosbach 5d6d015969 ARM: Tidy up. Remove unused template parameters.
llvm-svn: 161222
2012-08-02 22:08:27 +00:00
Howard Hinnant 3a86b142a1 Update status.
llvm-svn: 161221
2012-08-02 22:06:41 +00:00
Jim Grosbach b79c33ef55 ARM: More InstAlias refactors to use #NAME#.
llvm-svn: 161220
2012-08-02 21:59:52 +00:00
Matt Beaumont-Gay 99fc2e19a6 Move test yaml files under Inputs until they are converted to be the actual
test files.

llvm-svn: 161219
2012-08-02 21:52:49 +00:00
Jim Grosbach 6d27ad62a8 ARM: Refactor instaliases using TableGen support for #NAME#.
Now that TableGen supports references to NAME w/o it being explicitly
referenced in the definition's own name, use that to simplify
assembly InstAlias definitions in multiclasses.

llvm-svn: 161218
2012-08-02 21:50:41 +00:00
Dmitri Gribenko 37a7fafd44 Comments AST: refactor DeclInfo to use an enum for decl kind instead of
separate flags.

llvm-svn: 161217
2012-08-02 21:45:39 +00:00
Chad Rosier 637ecd2098 [driver] Lipo can handle the lto-bc type.
rdar://12000401

llvm-svn: 161216
2012-08-02 21:39:47 +00:00
Dmitri Gribenko baeb60e919 Comments: handle template paramter documentation in alias-declaration
templates.

llvm-svn: 161215
2012-08-02 21:36:57 +00:00
Jordan Rose 9a2eec3826 [analyzer] Add a simple check for initializing reference variables with null.
There's still more work to be done here; this doesn't catch reference
parameters or return values. But it's a step in the right direction.

Part of <rdar://problem/11212286>.

llvm-svn: 161214
2012-08-02 21:33:42 +00:00
Dmitri Gribenko 7f4b3773be Attaching comments to declarations: handle using-declaration.
llvm-svn: 161211
2012-08-02 20:49:51 +00:00
Sean Callanan c40b0f38b3 Updating Xcode project version numbers for lldb-164 and debugserver-191
llvm-svn: 161209
2012-08-02 20:40:53 +00:00
Manman Ren ba8122cc25 X86 Peephole: fold loads to the source register operand if possible.
Add more comments and use early returns to reduce nesting in isLoadFoldable.
Also disable folding for V_SET0 to avoid introducing a const pool entry and
a const pool load.

rdar://10554090 and rdar://11873276

llvm-svn: 161207
2012-08-02 19:37:32 +00:00
Michael J. Spencer 152a3735ce [yaml2obj] Fix build. Apparently I've gotten too familiar with C++11.
llvm-svn: 161206
2012-08-02 19:36:30 +00:00
Michael J. Spencer 1ffd9de4f1 Add yaml2obj. A utility to convert YAML to binaries.
yaml2obj takes a textual description of an object file in YAML format
and outputs the binary equivalent. This greatly simplifies writing
tests that take binary object files as input.

llvm-svn: 161205
2012-08-02 19:16:56 +00:00
Jim Grosbach bc5b61c74d TableGen: Allow use of #NAME# outside of 'def' names.
Previously, def NAME values were only populated, and references to NAME
resolved, when NAME was referenced in the 'def' entry of the multiclass
sub-entry. e.g.,
multiclass foo<...> {
  def prefix_#NAME : ...
}

It's useful, however, to be able to reference NAME even when the default
def name is used. For example, when a multiclass has 'def : Pat<...>'
or 'def : InstAlias<...>' entries which refer to earlier instruction
definitions in the same multiclass. e.g.,
multiclass myMulti<RegisterClass rc> {
  def _r : myI<(outs rc:$d), (ins rc:$r), "r $d, $r", []>;

  def : InstAlias<\"wilma $r\", (!cast<Instruction>(NAME#\"_r\") rc:$r, rc:$r)>;
}

llvm-svn: 161198
2012-08-02 18:46:42 +00:00
Jakob Stoklund Olesen 5d30630e22 Compute the critical path length through a trace.
Whenever both instruction depths and instruction heights are known in a
block, it is possible to compute the length of the critical path as
max(depth+height) over the instructions in the block.

The stored live-in lists make it possible to accurately compute the
length of a critical path that bypasses the current (small) block.

llvm-svn: 161197
2012-08-02 18:45:54 +00:00
Howard Hinnant 0cbea7fa90 Andrew Morrow: The attached patch updates the initialization of the 'struct tm' in
__time_get_storage<char> to match the initialization behavior in
__time_get_storage<wchar>. Without the initialization, valgrind
reports errors in the subsequent calls to strftime_l.

llvm-svn: 161196
2012-08-02 18:44:17 +00:00
Howard Hinnant fb2f0a5e01 Andrew Morrow: There are two tests under test/utilities/memory that heap allocate two
integers which remain unused and are subsequently leaked, so the test
fail when run under valgrind. Unless I'm overlooking a subtle reason
why they are needed I think they can be removed, allowing these tests
to pass under valgrind. The attached patch removes the variables. If
there is a reason for them to exist, I can change this to just delete
them at the end of the test.

llvm-svn: 161195
2012-08-02 18:39:48 +00:00
Fariborz Jahanian 9191865b2d objc-arc: Modify test for more prcecise fixit.
// rdar://11913153

llvm-svn: 161194
2012-08-02 18:38:41 +00:00