Commit Graph

98701 Commits

Author SHA1 Message Date
Abramo Bagnara 88cf54160f Added testcase for commit r122963.
llvm-svn: 122964
2011-01-06 16:56:00 +00:00
Abramo Bagnara a41d7aebee Fixed parsing of hex floats.
llvm-svn: 122963
2011-01-06 16:55:14 +00:00
Rafael Espindola 9f9a10691a Correctly disassemble truncated asm.
Patch by Richard Simth.

llvm-svn: 122962
2011-01-06 16:48:42 +00:00
Benjamin Kramer ae67cc13a9 InstCombine: Turn _chk functions into the "unsafe" variant if length and max langth are equal.
This happens when we take the (non-constant) length from a malloc.

llvm-svn: 122961
2011-01-06 14:22:52 +00:00
Benjamin Kramer 605f21a6c8 EarlyCSE does this now (and GVN always did it).
llvm-svn: 122960
2011-01-06 13:19:46 +00:00
Benjamin Kramer 799b011276 InstCombine: If we call llvm.objectsize on a malloc call we can replace it with the size passed to malloc.
llvm-svn: 122959
2011-01-06 13:11:05 +00:00
Benjamin Kramer a76cc117e0 InstCombine: Teach llvm.objectsize folding to look through GEPs.
llvm-svn: 122958
2011-01-06 13:07:49 +00:00
Benjamin Kramer 3aa955e906 Remove dead code and silence warnings.
llvm-svn: 122957
2011-01-06 13:01:02 +00:00
Roman Divacky 965b0b72b1 PowerPC fixes.
Fix the width and align of bool type on Darwin to be 32bits
while keeping it 8 everywhere else.

Change the definition of va_list to default to SV4 ABI one
and let darwin subtarget override this.

Both changes submitted by Nathan Whitehorn and reviewed
by Rafael Espindola.

llvm-svn: 122956
2011-01-06 08:27:10 +00:00
Evan Cheng 7998b1d6fe Use movups to lower memcpy and memset even if it's not fast (like corei7).
The theory is it's still faster than a pair of movq / a quad of movl. This
will probably hurt older chips like P4 but should run faster on current
and future Intel processors. rdar://8817010

llvm-svn: 122955
2011-01-06 07:58:36 +00:00
Chris Lattner 245de78e06 add a note about object size from drystone, add a poorly optimized loop from 179.art.
llvm-svn: 122954
2011-01-06 07:41:22 +00:00
Chris Lattner 73552c2cce add a trivial instcombine missed in Dhrystone
llvm-svn: 122953
2011-01-06 07:09:23 +00:00
Evan Cheng 3ae2b79aa3 Re-implement r122936 with proper target hooks. Now getMaxStoresPerMemcpy
etc. takes an option OptSize. If OptSize is true, it would return
the inline limit for functions with attribute OptSize.

llvm-svn: 122952
2011-01-06 06:52:41 +00:00
Chandler Carruth 080afea262 Tweak the wording of this warning further based on a suggestion from Chris.
llvm-svn: 122951
2011-01-06 06:29:28 +00:00
Chris Lattner 5858e091a6 implement constant folding support for an exotic constant expr:
ret i64 ptrtoint (i8* getelementptr ([1000 x i8]* @X, i64 1, i64 sub (i64 0, i64 ptrtoint ([1000 x i8]* @X to i64))) to i64)

to "ret i64 1000".  This allows us to correctly compute the trip count
on a loop in PR8883, which occurs with std::fill on a char array.  This
allows us to transform it into a memset with a constant size.

llvm-svn: 122950
2011-01-06 06:19:46 +00:00
Evan Cheng c052ba7ff3 Revert r122936. I'll re-implement the change.
llvm-svn: 122949
2011-01-06 06:17:53 +00:00
Michael J. Spencer 1d3c4a7b94 UnitTests/Path: Add magical tests. This will also test identify_magic.
llvm-svn: 122948
2011-01-06 05:58:02 +00:00
Michael J. Spencer 1f06360002 UnitTests/Path: More ASSERT_NO_ERROR cleanup.
llvm-svn: 122947
2011-01-06 05:57:54 +00:00
Chris Lattner 56f64c14b7 fix rdar://8823139, a crash on a comment in a preprocessed .s file
that contains the ## operator.

llvm-svn: 122946
2011-01-06 05:01:51 +00:00
Cameron Zwarich 9ec19ea06a Add the CallInst optimizations that don't involve expanding inline assembly to
OptimizeInst() so that they can be used on a worklist instruction.

llvm-svn: 122945
2011-01-06 02:56:42 +00:00
Cameron Zwarich d28c78eb4f Move the GEP handling in CodeGenPrepare to OptimizeInst().
llvm-svn: 122944
2011-01-06 02:44:52 +00:00
Cameron Zwarich 14ac865ca9 Split the optimizations in CodeGenPrepare that don't manipulate the iterators
into a separate function, so that it can be called from a loop using a worklist
rather than a loop traversing a whole basic block.

llvm-svn: 122943
2011-01-06 02:37:26 +00:00
John McCall 8190451ddc Introduce an AttributedType, but don't actually use it anywhere yet.
The initial TreeTransform is a cop-out, but it's more-or-less equivalent
to what we were doing before, or rather what we're doing now and might
eventually stop doing in favor of using this type.
I am simultaneously intrigued by the possibilities of rebuilding a
dependent Attri

llvm-svn: 122942
2011-01-06 01:58:22 +00:00
Jakob Stoklund Olesen 4072e59189 Clang should not warn on code in clang that is only there to remove warnings.
llvm-svn: 122941
2011-01-06 01:37:28 +00:00
Jakob Stoklund Olesen 70be93a200 Zap the last two -Wself-assign warnings in llvm.
Simplify RALinScan::DowngradeRegister with TRI::getOverlaps while we are there.

llvm-svn: 122940
2011-01-06 01:33:22 +00:00
Jakob Stoklund Olesen 8e236eac74 Add the SpillPlacement analysis pass.
This pass precomputes CFG block frequency information that can be used by the
register allocator to find optimal spill code placement.

Given an interference pattern, placeSpills() will compute which basic blocks
should have the current variable enter or exit in a register, and which blocks
prefer the stack.

The algorithm is ready to consume block frequencies from profiling data, but for
now it gets by with the static estimates used for spill weights.

This is a work in progress and still not hooked up to RegAllocGreedy.

llvm-svn: 122938
2011-01-06 01:21:53 +00:00
Bill Wendling 2b898548e8 Fix test to coincide with r122934 change from PR8919.
llvm-svn: 122937
2011-01-06 01:09:35 +00:00
Evan Cheng 06536e7158 r105228 reduced the memcpy / memset inline limit to 4 with -Os to avoid blowing
up freebsd bootloader. However, this doesn't make much sense for Darwin, whose
-Os is meant to optimize for size only if it doesn't hurt performance.
rdar://8821501

llvm-svn: 122936
2011-01-06 01:04:47 +00:00
Evan Cheng ac730dd2d1 Avoid zero extend bit test operands to pointer type if all the masks fit in
the original type of the switch statement key.
rdar://8781238

llvm-svn: 122935
2011-01-06 01:02:44 +00:00
Bill Wendling 3b949bcaf3 PR8919 - LLVM incorrectly generates "_alloca" as the stack probing call. That
works only on MinGW32. On 64-bit, the function to call is "__chkstk".
Patch by KS Sreeram!

llvm-svn: 122934
2011-01-06 00:50:34 +00:00
Bill Wendling 81d40711f3 PR8918 - When used with MinGW64, LLVM generates a "calll __main" at the
beginning of the "main" function. The assembler complains about the invalid
suffix for the 'call' instruction. The right instruction is "callq __main".
Patch by KS Sreeram!

llvm-svn: 122933
2011-01-06 00:47:10 +00:00
Cameron Zwarich ce3b930a98 Stop reallocating SunkAddrs for each basic block. When we move to an instruction
worklist, the key will need to become std::pair<BasicBlock*, Value*>.

llvm-svn: 122932
2011-01-06 00:42:50 +00:00
Douglas Gregor df50b8448c When default-initializing a TemplateArgumentLocInfo, make sure that we
initialize *all* of the bits to zero. Also, when the pattern of a
template argument pack expansion, make sure to set the ellipsis
location along all paths.

This should clear up the valgrind failure that popped up in Clang.

llvm-svn: 122931
2011-01-06 00:33:28 +00:00
Johnny Chen 849398910f Modify test_help_version() test case to be more precise in matching the version
number string as found in the resources/LLDB-info.plist file.

llvm-svn: 122930
2011-01-06 00:03:01 +00:00
Owen Anderson 6f060afbbd Reorder, rename, and document some members to make this easier to follow.
llvm-svn: 122929
2011-01-05 23:26:22 +00:00
Douglas Gregor 86bea351a9 Fast-path an arity check when performing template argument deduction that compares two parameter-type-lists. No functionality change.
llvm-svn: 122928
2011-01-05 23:23:17 +00:00
Douglas Gregor f6272cd7e9 Eliminate an unnecessary dance where we tried to cope with the lack of
TypeSourceInfo when transforming a function parameter. The callees of
this routine already assume that TypeSourceInfo will be present, and
we want to always be sure that it exists.

llvm-svn: 122927
2011-01-05 23:16:57 +00:00
Douglas Gregor 5499af4ef9 Initial implementation of function parameter packs. This implementation allows:
1) Declaration of function parameter packs
  2) Instantiation of function parameter packs within function types.
  3) Template argument deduction of function parameter packs when
  matching two function types.

We're missing all of the important template-instantiation logic for
function template definitions, along with template argument deduction
from the argument list of a function call, so don't even think of
trying to use these for real yet.

llvm-svn: 122926
2011-01-05 23:12:31 +00:00
Evan Cheng 260acf32ee Optimize:
r1025 = s/zext r1024, 4
  r1026 = extract_subreg r1025, 4
to:
  r1026 = copy r1024

llvm-svn: 122925
2011-01-05 23:06:49 +00:00
Douglas Gregor 5ddf182fd3 Fix an embarrassing think in the disambiguation logic for the ellipsis in a parameter-type-list
llvm-svn: 122924
2011-01-05 23:06:07 +00:00
Fariborz Jahanian a61f676cfe Don't warn on missing 'copy' attribute on a 'block'
property when it is 'readonly'. // rdar://8820813

llvm-svn: 122923
2011-01-05 23:00:04 +00:00
Johnny Chen 64e3868cf0 Properly indent the short description of the test case to make it align with the
previously added ordinal number of the currently running test case.

llvm-svn: 122922
2011-01-05 22:50:11 +00:00
Chris Lattner 872908fdeb fix PR8900, a shuffle miscompilation. Patch by Nadav Rotem!
llvm-svn: 122921
2011-01-05 22:28:46 +00:00
Chris Lattner 2d7df02670 silence more self assignment warnings.
llvm-svn: 122920
2011-01-05 22:26:52 +00:00
Jakob Stoklund Olesen f3ac733684 Add a hidden command line option to display edge bundle graphs as they are
calculated.

llvm-svn: 122912
2011-01-05 21:50:24 +00:00
Jakob Stoklund Olesen 88b4b2794c Silence a warning from non-standard warning avoidance code.
llvm-svn: 122911
2011-01-05 21:50:21 +00:00
Eric Christopher c673b21a87 80-cols.
llvm-svn: 122909
2011-01-05 21:45:56 +00:00
Owen Anderson e86dacf449 When computing the value on an edge, in certain cases LVI would fail to compute the value range
in the predecessor block, leading to an incorrect conclusion for the edge value.  Found by inspection.

llvm-svn: 122908
2011-01-05 21:37:18 +00:00
Bob Wilson 7bdd440035 Revert svn 122743, removing the instcombine pass that was replaced by earlycse.
My i386 llvm-gcc nightly tester found a regression for
SingleSource/Benchmarks/McGill/chomp that a bisect blamed on 122743.
That seems strange but apparently the combination of earlycse and instcombine
did something bad.  Chris says he intended to remove the instcombine pass, so
let's go ahead and try that.  We'll see if there are any performance losses.

llvm-svn: 122907
2011-01-05 21:16:50 +00:00
Owen Anderson 118ac80c81 Re-convert several of LazyValueInfo's internal maps to Dense{Map|Set}, and fix the issue in
hasBlockValue() that was causing iterator invalidations.  Many thanks to Dimitry Andric for
tracking down those invalidations!

llvm-svn: 122906
2011-01-05 21:15:29 +00:00