1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

45992 Commits

Author SHA1 Message Date
Dan Gohman
471996598f Use BasicBlock::iterator instead of Instruction* for insert points,
to better handle inserting instructions at the end of a block.

llvm-svn: 69807
2009-04-22 16:05:50 +00:00
Dan Gohman
5a677884a1 Make SCEVExpanders private methods private, instead of protected.
llvm-svn: 69806
2009-04-22 16:00:36 +00:00
Dan Gohman
6cf471ad30 Use CloneModule's ValueMap in more places, instead of looking
up functions by name.

llvm-svn: 69805
2009-04-22 15:57:18 +00:00
Dan Gohman
640b379ae6 ISD::ADD_PARTS is gone; use ISD::SMUL_LOHI as an example instead.
llvm-svn: 69804
2009-04-22 15:55:31 +00:00
Sanjiv Gupta
60c6705684 Make the function begin label start after ther data pointer.
The address of data frame for function can be obtained by subtracting 2 from the function begin label.

llvm-svn: 69801
2009-04-22 12:02:36 +00:00
Duncan Sands
6f29099800 These tests are x86 specific.
llvm-svn: 69798
2009-04-22 10:39:51 +00:00
Owen Anderson
309568c469 Real fix for PR3549, by using caching for predecessor counts in addition to the predecessors themselves. This halves the time
to optimize the testcase, beyond what my previous patch did.

llvm-svn: 69792
2009-04-22 08:50:12 +00:00
Owen Anderson
1cf271e1d8 Add caching of predecessor counts as well as predecessors themselves.
llvm-svn: 69791
2009-04-22 08:46:33 +00:00
Owen Anderson
b36babc111 Use PredIteratorCache in LCSSA, which gives a 37% overall speedup on the testcase from PR3549. More improvements to come.
llvm-svn: 69788
2009-04-22 08:09:13 +00:00
Owen Anderson
dd6babaa30 Fix for PR3946, in which SmallVector could behave strangely in corner cases.
Patch by Peter Johnson.

llvm-svn: 69785
2009-04-22 07:16:54 +00:00
Chris Lattner
60c88b66da use predicate instead of hand-rolled loop
llvm-svn: 69752
2009-04-21 23:37:18 +00:00
Dan Gohman
4cb9d25f4a De-pImpl-ify ScalarEvolution. The pImpl pattern doesn't provide much
practical benefit in the case of ScalarEvolution, and it's otherwise
a nuisance.

llvm-svn: 69749
2009-04-21 23:15:49 +00:00
Evan Cheng
a36c6c6819 It has finally happened. Spiller is now using live interval info.
This fixes a very subtle bug. vr defined by an implicit_def is allowed overlap with any register since it doesn't actually modify anything. However, if it's used as a two-address use, its live range can be extended and it can be spilled. The spiller must take care not to emit a reload for the vn number that's defined by the implicit_def. This is both a correctness and performance issue.

llvm-svn: 69743
2009-04-21 22:46:52 +00:00
Dan Gohman
19990f2310 When turning (ashr(shl(x, n), n)) into sext(trunc(x)), the width of the
type to truncate to should be the number of bits of the value that are
preserved, not the number that are clobbered with sign-extension.
This fixes regressions in ldecod.

llvm-svn: 69704
2009-04-21 20:18:36 +00:00
Mikhail Glushenkov
1b37a864d2 Support --with-llvmgccdir and friends in llvmc, take 2.
Should now work when building with objdir != srcdir and when llvm-gcc is not
available.

Thanks to Duncan Sands for testing and advice!

llvm-svn: 69700
2009-04-21 19:46:10 +00:00
Devang Patel
17f434a8f0 Test case for revision 69683.
llvm-svn: 69684
2009-04-21 17:21:01 +00:00
Chris Lattner
95aad4d625 fix a crash on a pointless but valid zero-length memset, rdar://6808691
llvm-svn: 69680
2009-04-21 16:52:12 +00:00
Anton Korobeynikov
b53ac333d7 Silence warnings.
Patch by Jay Foad!

llvm-svn: 69679
2009-04-21 16:04:56 +00:00
Anton Korobeynikov
0a64083f49 Drop obsolete reference to __eprintf.
Patch by Jay Foad!

llvm-svn: 69678
2009-04-21 16:04:41 +00:00
Anton Korobeynikov
478dc7fb5e 'The "or die" is intended to catch the case where nm returned a
non-zero exit status, so nm will already have printed some error
messages.'

Patch by Jay Foad!

llvm-svn: 69677
2009-04-21 16:04:14 +00:00
Duncan Sands
58c9c564a9 Get rid of what looks like a copy-and-pasted typo.
Spotted by gcc-4.5.

llvm-svn: 69673
2009-04-21 09:44:39 +00:00
Rafael Espindola
5adc7ad39e TLS_addr64 and TLS_addr32 define RDI and EAX. They don't use them.
This fixes PR4002.

llvm-svn: 69672
2009-04-21 08:22:09 +00:00
Sanjiv Gupta
30ea654901 Handle direct aggregate type arguments.
llvm-svn: 69665
2009-04-21 05:54:51 +00:00
Dan Gohman
5cf1e72db9 Teach ScalarEvolution how to recognize zext-inreg and sext-inreg,
as they appear in LLVM IR. This isn't particularly interesting
on its own; this is just setting up some infrastructure.

llvm-svn: 69655
2009-04-21 02:26:00 +00:00
Dan Gohman
f920d0a020 This FIXME is fixed, now that SCEV understands pointers.
llvm-svn: 69651
2009-04-21 01:41:18 +00:00
Dan Gohman
4e3e945880 Factor out a common base class from SCEVTruncateExpr, SCEVZeroExtendExpr,
and SCEVSignExtendExpr.

llvm-svn: 69649
2009-04-21 01:25:57 +00:00
Dan Gohman
2f8d813b3a Usage getAnalysisToUpdate for TargetData, per PR760.
llvm-svn: 69645
2009-04-21 01:11:19 +00:00
Dan Gohman
55d8490e7b Introduce encapsulation for ScalarEvolution's TargetData object, and refactor
the code to minimize dependencies on TargetData.

llvm-svn: 69644
2009-04-21 01:07:12 +00:00
Dan Gohman
5665fdf2e3 Move some assertion checks so they can do more complete checking.
llvm-svn: 69643
2009-04-21 00:55:22 +00:00
Dan Gohman
dd1bfdc7b1 Convert ScalarEvolution to use raw_ostream instead of OStream.
llvm-svn: 69640
2009-04-21 00:47:46 +00:00
Devang Patel
d679dbbacc Fix Visual Studio 2008 build failure.
Patch by Marius Wachtler

llvm-svn: 69637
2009-04-21 00:08:56 +00:00
Dan Gohman
de72d5129b Make X86's copyRegToReg able to handle copies to and from subclasses.
This makes the extra copyRegToReg calls in ScheduleDAGSDNodesEmit.cpp
unnecessary. Derived from a patch by Jakob Stoklund Olesen.

llvm-svn: 69635
2009-04-20 22:54:34 +00:00
Dan Gohman
69fa329052 Simplify this code. getConstant knows how to make
broadcasted vector constants.

llvm-svn: 69634
2009-04-20 22:51:43 +00:00
Evan Cheng
2ae6d55955 No, we are not avoiding -O3, just -fstrict-aliasing.
llvm-svn: 69633
2009-04-20 22:49:59 +00:00
Dale Johannesen
a263eac5f8 Adjust loop size estimate for full unrolling;
GEP's don't usually become instructions.

llvm-svn: 69631
2009-04-20 22:19:33 +00:00
Evan Cheng
9118b7ce52 One Mac OS X, just build with -O3 but without -fstrict-aliasing (which is kinda broken).
llvm-svn: 69630
2009-04-20 22:16:40 +00:00
Daniel Dunbar
024320d274 Make Unix.h:MakeErrMsg separate the prefix and errno string, so we get:
clang: error: unable to make temporary file: /etc/cc: can't make
  unique filename: Permission denied

instead of 

  clang: error: unable to make temporary file: /etc/cc: can't make
  unique filenamePermission denied

for example.

Also, audited the uses of MakeErrMsg to make the prefix strings
consistent (not end with newline/punctuation/space/": ").

llvm-svn: 69626
2009-04-20 20:50:13 +00:00
Daniel Dunbar
6326c97515 Remove unused variable.
llvm-svn: 69624
2009-04-20 20:34:38 +00:00
Bob Wilson
f7e9ff1d28 Move duplicated AddLiveIn function from X86 and ARM backends to be a method
in the MachineFunction class, renaming it to addLiveIn for consistency with
the same method in MachineBasicBlock.  Thanks for Anton for suggesting this.

llvm-svn: 69615
2009-04-20 18:36:57 +00:00
Devang Patel
64cae580dc Match C backend only if it explicitly requested.
llvm-svn: 69613
2009-04-20 18:07:22 +00:00
Tanya Lattner
0f0aee8534 Remove clang since its conditionally there already.
llvm-svn: 69610
2009-04-20 17:48:16 +00:00
Bob Wilson
840cf4fa18 Revise my previous change 68996 as suggested by Duncan.
llvm-svn: 69607
2009-04-20 17:27:09 +00:00
Evan Cheng
e6a6c3a70c - Remove an arbitrary spill weight tweak that should not have been there.
- Find more reloads from SS.

llvm-svn: 69606
2009-04-20 17:23:48 +00:00
Sanjiv Gupta
44b55dc966 Emit the auto variables of a function into a different section than parameters.
llvm-svn: 69605
2009-04-20 16:59:35 +00:00
Dan Gohman
a9985913d7 It's not necessary for PrintModulePass to flush the output streams
now that errs() is properly non-buffered.

llvm-svn: 69602
2009-04-20 16:26:25 +00:00
Dan Gohman
6f18ecd37b Use .empty() instead of .size().
llvm-svn: 69599
2009-04-20 16:19:02 +00:00
Dan Gohman
88feed3657 Don't discard an AssemblyAnnotationWriter when writing GlobalValues,
which include Functions, where it can be quite useful to use an
AssemblyAnnotationWriter.

llvm-svn: 69598
2009-04-20 16:10:33 +00:00
Duncan Sands
9c1869fdaf These bitfields were being miscompiled on some
64 bit platforms when building with optimization.
So replace them by a hand-coded implementation.
This fixes PR3822.

llvm-svn: 69597
2009-04-20 16:03:21 +00:00
Dan Gohman
36c697f57e Implement operator<<(raw_ostream &OS, const Type &T).
llvm-svn: 69596
2009-04-20 15:55:38 +00:00
Evan Cheng
c248188b46 Added a linearscan register allocation optimization. When the register allocator spill an interval with multiple uses in the same basic block, it creates a different virtual register for each of the reloads. e.g.
%reg1498<def> = MOV32rm %reg1024, 1, %reg0, 12, %reg0, Mem:LD(4,4) [sunkaddr39 + 0]
        %reg1506<def> = MOV32rm %reg1024, 1, %reg0, 8, %reg0, Mem:LD(4,4) [sunkaddr42 + 0]
        %reg1486<def> = MOV32rr %reg1506
        %reg1486<def> = XOR32rr %reg1486, %reg1498, %EFLAGS<imp-def,dead>
        %reg1510<def> = MOV32rm %reg1024, 1, %reg0, 4, %reg0, Mem:LD(4,4) [sunkaddr45 + 0]

=>

        %reg1498<def> = MOV32rm %reg2036, 1, %reg0, 12, %reg0, Mem:LD(4,4) [sunkaddr39 + 0]
        %reg1506<def> = MOV32rm %reg2037, 1, %reg0, 8, %reg0, Mem:LD(4,4) [sunkaddr42 + 0]
        %reg1486<def> = MOV32rr %reg1506
        %reg1486<def> = XOR32rr %reg1486, %reg1498, %EFLAGS<imp-def,dead>
        %reg1510<def> = MOV32rm %reg2038, 1, %reg0, 4, %reg0, Mem:LD(4,4) [sunkaddr45 + 0]

From linearscan's point of view, each of reg2036, 2037, and 2038 are separate registers, each is "killed" after a single use. The reloaded register is available and it's often clobbered right away. e.g. In thise case reg1498 is allocated EAX while reg2036 is allocated RAX. This means we end up with multiple reloads from the same stack slot in the same basic block.

Now linearscan recognize there are other reloads from same SS in the same BB. So it'll "downgrade" RAX (and its aliases) after reg2036 is allocated until the next reload (reg2037) is done. This greatly increase the likihood reloads from SS are reused.

This speeds up sha1 from OpenSSL by 5.8%. It is also an across the board win for SPEC2000 and 2006.

llvm-svn: 69585
2009-04-20 08:01:12 +00:00