Commit Graph

131319 Commits

Author SHA1 Message Date
Jordan Rose 86bedb0de0 [analyzer] Add a test for copy-constructor inlining.
llvm-svn: 161274
2012-08-03 23:08:36 +00:00
Jakob Stoklund Olesen 24bc514c0c Begin adding support for updating LiveIntervals in TwoAddressInstructionPass.
This is far from complete, and only changes behavior when the
-early-live-intervals flag is passed to llc.

llvm-svn: 161273
2012-08-03 22:58:34 +00:00
Akira Hatanaka 22bec282e9 1. Redo mips16 instructions to avoid multiple opcodes for same instruction.
Change these to patterns.
2. Add another 16 instructions.

Patch by Reed Kotler.

llvm-svn: 161272
2012-08-03 22:57:02 +00:00
Enrico Granata e2e091bd59 <rdar://problem/12027563> Making sure that some class of stop-hook commands that involve po'ing objects do not cause an endless recursion
llvm-svn: 161271
2012-08-03 22:24:48 +00:00
Jakob Stoklund Olesen 1c46589290 Add an experimental -early-live-intervals option.
This option runs LiveIntervals before TwoAddressInstructionPass which
will eventually learn to exploit and update the analysis.

Eventually, LiveIntervals will run before PHIElimination, and we can get
rid of LiveVariables.

llvm-svn: 161270
2012-08-03 22:12:54 +00:00
Jakob Stoklund Olesen 918999db95 Delete merged physreg copies in joinReservedPhysReg().
Previously, the identity copy would survive through register allocation
before it was removed by the rewriter.

llvm-svn: 161269
2012-08-03 22:12:51 +00:00
Howard Hinnant 757640b156 Fixes apple: #12020687. This was a problem in the demangler with template
substitution forward references.  That is, sometimes a mangled name refers to
a substitution that hasn't yet been defined.  The demangler was derferencing a
null pointer in this case because it wasn't properly guarded against a
forward reference.  Test case added to catch this problem.

llvm-svn: 161267
2012-08-03 22:02:07 +00:00
Fariborz Jahanian c934daba9b Make property synthesis the default on Windows.
llvm-svn: 161266
2012-08-03 21:51:38 +00:00
Anna Zaks afc13b9ec5 [analyzer] Fixup: remove the extra whitespace
llvm-svn: 161265
2012-08-03 21:49:42 +00:00
Anna Zaks 150843b87e [analyzer] ObjC Inlining: Start tracking dynamic type info in the GDM
In the following code, find the type of the symbolic receiver by
following it and updating the dynamic type info in the state when we
cast the symbol from id to MyClass *.

  MyClass *a = [[self alloc] init];
  return 5/[a testSelf];

llvm-svn: 161264
2012-08-03 21:43:37 +00:00
Bob Wilson 871701c606 Try to reduce the compile time impact of r161232.
The previous change caused fast isel to not attempt handling any calls to
builtin functions.  That included things like "printf" and caused some
noticable regressions in compile time.  I wanted to avoid having fast isel
keep a separate list of functions that had to be kept in sync with what the
code in SelectionDAGBuilder.cpp was handling.  I've resolved that here by
moving the list into TargetLibraryInfo.  This is somewhat redundant in
SelectionDAGBuilder but it will ensure that we keep things consistent.

llvm-svn: 161263
2012-08-03 21:26:24 +00:00
Bob Wilson fa59485b94 Fix memcmp code-gen to honor -fno-builtin.
I noticed that SelectionDAGBuilder::visitCall was missing a check for memcmp
in TargetLibraryInfo, so that it would use custom code for memcmp calls even
with -fno-builtin.  I also had to add a new -disable-simplify-libcalls option
to llc so that I could write a test for this.

llvm-svn: 161262
2012-08-03 21:26:18 +00:00
Dmitri Gribenko 6430583017 Comment diagnostics: warn if \returns is used in a non-function comment or if
the function returns void.

llvm-svn: 161261
2012-08-03 21:15:32 +00:00
Richard Smith ed9430274e Fix crash if a literal operator template's template parameter pack is not a non-type template parameter pack. Patch by Andy Gibbs!
llvm-svn: 161260
2012-08-03 21:14:57 +00:00
Jakob Stoklund Olesen daae19f785 Completely eliminate VNInfo flags.
The 'unused' state of a value number can be represented as an invalid
def SlotIndex. This also exposed code that shouldn't have been looking
at unused value VNInfos.

llvm-svn: 161258
2012-08-03 20:59:32 +00:00
Jakob Stoklund Olesen 21809385a6 Fix a couple of loops that were processing unused value numbers.
Unused VNInfos should be left alone. Their def SlotIndex doesn't point
to anything.

llvm-svn: 161257
2012-08-03 20:59:29 +00:00
Matt Beaumont-Gay aaba08d503 Silence unused variable warning in -asserts build
llvm-svn: 161256
2012-08-03 20:54:11 +00:00
Jakob Stoklund Olesen 9f565e19c5 Eliminate the VNInfo::hasPHIKill() flag.
The only real user of the flag was removeCopyByCommutingDef(), and it
has been switched to LiveIntervals::hasPHIKill().

All the code changed by this patch was only concerned with computing and
propagating the flag.

llvm-svn: 161255
2012-08-03 20:19:44 +00:00
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