Chris Lattner
83067bc3e7
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
70711ea54d
Revert r122936. I'll re-implement the change.
...
llvm-svn: 122949
2011-01-06 06:17:53 +00:00
Michael J. Spencer
223074e281
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
2b6edb1efa
UnitTests/Path: More ASSERT_NO_ERROR cleanup.
...
llvm-svn: 122947
2011-01-06 05:57:54 +00:00
Cameron Zwarich
246056cbb7
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
314d16039a
Move the GEP handling in CodeGenPrepare to OptimizeInst().
...
llvm-svn: 122944
2011-01-06 02:44:52 +00:00
Cameron Zwarich
40cfb75bd7
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
Jakob Stoklund Olesen
b3e7b27c1f
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
7b1480ff12
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
b3bf7cd562
Fix test to coincide with r122934 change from PR8919.
...
llvm-svn: 122937
2011-01-06 01:09:35 +00:00
Evan Cheng
d425aa5d2a
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
2af40ae781
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
a59afdaec5
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
fae0dd1afa
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
eeea9f7113
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
Owen Anderson
ba8ae674d7
Reorder, rename, and document some members to make this easier to follow.
...
llvm-svn: 122929
2011-01-05 23:26:22 +00:00
Evan Cheng
bf92316fab
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
Chris Lattner
3ef9db5cd4
fix PR8900, a shuffle miscompilation. Patch by Nadav Rotem!
...
llvm-svn: 122921
2011-01-05 22:28:46 +00:00
Chris Lattner
0caa2500c0
silence more self assignment warnings.
...
llvm-svn: 122920
2011-01-05 22:26:52 +00:00
Jakob Stoklund Olesen
ce25984bae
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
bd9910dbe2
Silence a warning from non-standard warning avoidance code.
...
llvm-svn: 122911
2011-01-05 21:50:21 +00:00
Eric Christopher
651810d717
80-cols.
...
llvm-svn: 122909
2011-01-05 21:45:56 +00:00
Owen Anderson
97bd86a5e7
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
70abb04bf5
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
3d7ba422df
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
Chris Lattner
d419fe1dfe
fix some -Wself-assign warnings.
...
llvm-svn: 122893
2011-01-05 18:41:05 +00:00
Cameron Zwarich
2543ec1d29
Add some more statistics to CodeGenPrepare.
...
llvm-svn: 122891
2011-01-05 17:47:38 +00:00
Wesley Peck
b6eccbe55a
Commit 122778 broke DWARF debug output when using the MBlaze backend. Fixed by overriding TargetFrameInfo::getFrameIndexOffset to take into account the new frame index information.
...
llvm-svn: 122889
2011-01-05 17:34:20 +00:00
Cameron Zwarich
eca6d2c70a
Add some stats to CodeGenPrepare to make it easier to speed it up without
...
regressing code quality.
llvm-svn: 122887
2011-01-05 17:27:27 +00:00
Wesley Peck
832c9e07a1
Fix small bug in setDebugInfoAvailability.
...
llvm-svn: 122886
2011-01-05 17:01:57 +00:00
Michael J. Spencer
965b6c0d1e
UnitTests/Path: Fix typo, add error number, and enable the directory cleanup code.
...
llvm-svn: 122885
2011-01-05 16:39:46 +00:00
Michael J. Spencer
76c9f102b3
Support/PathV2: Implement remove_all.
...
llvm-svn: 122884
2011-01-05 16:39:38 +00:00
Michael J. Spencer
674358d496
Support/Windows/PathV2: Make directory iteration ignore . and ..
...
llvm-svn: 122883
2011-01-05 16:39:30 +00:00
Michael J. Spencer
bacdde1270
Support/Windows/PathV2: Fix remove to handle both files and directories.
...
llvm-svn: 122882
2011-01-05 16:39:22 +00:00
Michael J. Spencer
6bae59fb06
Support/PathV2: Implement directory_entry::status.
...
llvm-svn: 122881
2011-01-05 16:39:13 +00:00
Michael J. Spencer
0506a5377e
UnitTests/PathV2: Setup a test fixture to make tracking created file system
...
entities easier.
llvm-svn: 122880
2011-01-05 16:39:05 +00:00
Michael J. Spencer
e369cc8053
Support/PathV2: Implement directory iteration on POSIX.
...
llvm-svn: 122879
2011-01-05 16:38:57 +00:00
Cameron Zwarich
a7b9603f24
Use pop_back_val instead of back followed by pop_back.
...
llvm-svn: 122876
2011-01-05 16:08:47 +00:00
Frits van Bommel
4c9ed7d055
Fix lit for people whose LLVM path contains 'opt', which is a common directory name on Unix-like systems.
...
llvm-svn: 122873
2011-01-05 15:10:24 +00:00
Cameron Zwarich
1dc3325c51
Use a worklist for later iterations just like ordinary instsimplify. The next
...
step is to only process instructions in subloops if they have been modified by
an earlier simplification.
llvm-svn: 122869
2011-01-05 05:47:47 +00:00
Cameron Zwarich
498b19fe4f
Change LoopInstSimplify back to a LoopPass. It revisits subloops rather than
...
skipping them, but it should probably use a worklist and only revisit those
instructions in subloops that have actually changed. It should probably also
use a worklist after the first iteration like instsimplify now does. Regardless,
it's only 0.3% of opt -O2 time on 403.gcc if it replaces the instcombine placed
in the middle of the loop passes.
llvm-svn: 122868
2011-01-05 05:15:53 +00:00
Chris Lattner
de8f64f331
Fix PR8906: -fno-builtin should disable loop-idiom recognition.
...
It forms memset and memcpy's, and will someday form popcount and
other stuff. All of this is bad when compiling the implementation
of memset, memcpy, popcount, etc.
llvm-svn: 122854
2011-01-05 01:03:32 +00:00
Eric Christopher
be2382f9a6
Remove TODO, these appear to be implemented.
...
llvm-svn: 122849
2011-01-04 22:31:50 +00:00
Owen Anderson
cc0a091a5b
Don't bother value numbering instructions with void types in GVN. In theory this should allow us to insert
...
fewer things into the value numbering maps, but any speedup is beneath the noise threshold on my machine
on 403.gcc.
llvm-svn: 122844
2011-01-04 22:15:21 +00:00
Jakob Stoklund Olesen
76e782c385
Use the EdgeBundles analysis in X86FloatingPoint instead of recomputing CFG
...
bundles in the pass.
llvm-svn: 122833
2011-01-04 21:10:11 +00:00
Jakob Stoklund Olesen
abf8941a60
Turn the EdgeBundles class into a stand-alone machine CFG analysis pass.
...
The analysis will be needed by both the greedy register allocator and the
X86FloatingPoint pass. It only needs to be computed once when the CFG doesn't
change.
This pass is very fast, usually showing up as 0.0% wall time.
llvm-svn: 122832
2011-01-04 21:10:05 +00:00
Dale Johannesen
c7168aa6fe
Eliminate a warning compiling with llvm-gcc. (IMO the
...
warning is overzealous but gcc is what it is.)
llvm-svn: 122829
2011-01-04 19:31:24 +00:00
Owen Anderson
21c2cbcdbc
Complete the NumberTable --> LeaderTable rename.
...
llvm-svn: 122828
2011-01-04 19:29:46 +00:00
Owen Anderson
52b41efbe8
Fix typo in a comment.
...
llvm-svn: 122827
2011-01-04 19:25:18 +00:00
Owen Anderson
eab44ddb0d
Prune #include's.
...
llvm-svn: 122826
2011-01-04 19:24:57 +00:00