Commit Graph

43380 Commits

Author SHA1 Message Date
Dan Gohman bb92a1b815 Use the correct Preds and Succs lists in setHeightDirty()
and setDepthDirty(), respectively. This fixes PR3241.

llvm-svn: 61276
2008-12-20 16:34:57 +00:00
Bill Wendling 7be667c075 More precise XFAIL.
llvm-svn: 61265
2008-12-19 22:28:23 +00:00
Bill Wendling be2a77f52c Un-XFAIL this test because it's passing and John doesn't seem interested in un-XFAILing it.
llvm-svn: 61264
2008-12-19 22:25:01 +00:00
Dan Gohman 650b1e7ff8 Use ~0u instead of -1u as the special value, to hopefully avoid
warnings on compilers that warn about such things.

llvm-svn: 61263
2008-12-19 22:23:43 +00:00
Evan Cheng 0869f78555 Fix PR3149. If an early clobber def is a physical register and it is tied to an input operand, it effectively extends the live range of the physical register. Currently we do not have a good way to represent this.
172     %ECX<def> = MOV32rr %reg1039<kill>
180     INLINEASM <es:subl $5,$1
        sbbl $3,$0>, 10, %EAX<def>, 14, %ECX<earlyclobber,def>, 9, %EAX<kill>,
36, <fi#0>, 1, %reg0, 0, 9, %ECX<kill>, 36, <fi#1>, 1, %reg0, 0
188     %EAX<def> = MOV32rr %EAX<kill>
196     %ECX<def> = MOV32rr %ECX<kill>
204     %ECX<def> = MOV32rr %ECX<kill>
212     %EAX<def> = MOV32rr %EAX<kill>
220     %EAX<def> = MOV32rr %EAX
228     %reg1039<def> = MOV32rr %ECX<kill>

The early clobber operand ties ECX input to the ECX def.

The live interval of ECX is represented as this:
%reg20,inf = [46,47:1)[174,230:0)  0@174-(230) 1@46-(47)

The right way to represent this is something like
%reg20,inf = [46,47:2)[174,182:1)[181:230:0)  0@174-(182) 1@181-230 @2@46-(47)

Of course that won't work since that means overlapping live ranges defined by two val#.

The workaround for now is to add a bit to val# which says the val# is redefined by a early clobber def somewhere. This prevents the move at 228 from being optimized away by SimpleRegisterCoalescing::AdjustCopiesBackFrom.

llvm-svn: 61259
2008-12-19 20:58:01 +00:00
John Criswell 8dd90a7245 The fields for the stoppoint debug intrinsic have not changed, so update the
version number assertions.

llvm-svn: 61257
2008-12-19 19:56:36 +00:00
Bill Wendling dc2b987abb This test works again for Darwin because a patch was reverted.
llvm-svn: 61254
2008-12-19 19:08:13 +00:00
Gordon Henriksen 05a868f7af Add dyn_cast_or_null bindings for some additional classes missed in r61252.
llvm-svn: 61253
2008-12-19 18:51:17 +00:00
Gordon Henriksen 29e3894e7d C bindings for dyn_cast_or_null.
This operation can be used to build dyn_cast, isa, and cast.

llvm-svn: 61252
2008-12-19 18:39:45 +00:00
Chris Lattner af4c0bf44f Add support for writing LLVM IR to a specified BitstreamWriter.
Patch by Lukasz Janyst!

llvm-svn: 61251
2008-12-19 18:37:59 +00:00
Dan Gohman b289d4163b Move the patterns which have i8 immediates before the patterns
that have i32 immediates so that they get selected first. This
currently only matters in the JIT, as assemblers will
automatically use the smallest encoding.

llvm-svn: 61250
2008-12-19 18:25:21 +00:00
Dan Gohman f1fb65c747 Use dyn_cast intead of isa + cast in the generated DAGISel code. This
reduces the amount of code slightly when assertions are enabled.

llvm-svn: 61249
2008-12-19 18:13:39 +00:00
Evan Cheng 3b3de7c228 - CodeGenPrepare does not split loop back edges but it only knows about back edges of single block loops. It now does a DFS walk to find loop back edges.
- Use SplitBlockPredecessors to factor out common predecessors of the critical edge destination. This is disabled for now due to some regressions.

llvm-svn: 61248
2008-12-19 18:03:11 +00:00
Chris Lattner 9c148c8fc2 Fix some release-assert warnings
llvm-svn: 61244
2008-12-19 17:03:38 +00:00
Rafael Espindola 770b4b830a Fix bug 3202.
The EH_frame and .eh symbols are now private, except for darwin9 and earlier.
The patch also fixes the definition of PrivateGlobalPrefix on pcc linux.

llvm-svn: 61242
2008-12-19 10:55:56 +00:00
Nick Lewycky 3cde35175c Update the .cvs files for nocapture.
llvm-svn: 61241
2008-12-19 09:41:54 +00:00
Nick Lewycky 8d69f48833 Commit missed files from nocapture change.
llvm-svn: 61240
2008-12-19 09:38:31 +00:00
Nick Lewycky 2abb108f1b Resubmit support for the 'nocapture' attribute.
The problematic part of this patch is that we were out of attribute bits,
requiring some fancy bit hacking to make it fit (by shrinking alignment)
without breaking existing users or the file format.

This change will require users to rebuild llvm-gcc to match llvm.

llvm-svn: 61239
2008-12-19 06:39:12 +00:00
Bill Wendling 19a54ffc7f Perform this loop only when the -debug flag is specified.
llvm-svn: 61238
2008-12-19 02:09:57 +00:00
Dan Gohman 8c82a8a984 Initialize the ImplicitDefed member, to avoid getting stale
data from a previous block.

llvm-svn: 61237
2008-12-19 00:46:20 +00:00
Dan Gohman b4c55bb857 Fix RegScavenger::forward() to work on basic blocks containing exactly
one instruction.

llvm-svn: 61236
2008-12-19 00:45:13 +00:00
Dan Gohman 4293cea3e5 Delete the RegScavenging constructor that takes a MachineBasicBlock
argument. Nothing was using it, and it set the MBB member without
calling enterBasicBlock, which was problematic.

llvm-svn: 61234
2008-12-19 00:34:32 +00:00
Mon P Wang 308a1acaaf Fix test to account for generating some vector code for mul v2i64 instead
of incorrectly generating pmuldq

llvm-svn: 61228
2008-12-18 23:42:37 +00:00
Bill Wendling 070de29fcf Didn't mean to commit this.
llvm-svn: 61222
2008-12-18 22:19:50 +00:00
Dan Gohman 9abd04bf3f Teach LowerSubregs to preserve kill/dead information when lowering
subreg instructions.

llvm-svn: 61220
2008-12-18 22:14:08 +00:00
Bill Wendling 4c13e77d49 Re-XFAIL this test until debug stuff settles down.
llvm-svn: 61219
2008-12-18 22:13:31 +00:00
Dan Gohman c4ce336205 Make LowerSubregs' debug output for EXTRACT_SUBREG consistent with
that of INSERT_SUBREG and SUBREG_TO_REG.

llvm-svn: 61218
2008-12-18 22:11:34 +00:00
Dan Gohman d38c00c85b Fix a copy+pasto in an assertion message.
llvm-svn: 61217
2008-12-18 22:07:25 +00:00
Dan Gohman 451afdd9fe Fix indentation level.
llvm-svn: 61216
2008-12-18 22:06:01 +00:00
Dan Gohman 69cd963b9a When emitting instructions that define EFLAGS and the EFLAGS value isn't
used, mark the defs as dead.

llvm-svn: 61215
2008-12-18 22:03:42 +00:00
Dan Gohman 975f78ae79 When setting up the frame pointer, add it as a live-in register to all
non-entry blocks, so that it doesn't appear use-before-def anywhere.

llvm-svn: 61214
2008-12-18 22:01:52 +00:00
Dan Gohman 0ab1144c79 Print subreg information in MachineInstr::dump.
llvm-svn: 61213
2008-12-18 21:51:27 +00:00
Mon P Wang 998fd29ce1 Fixed x86 code generation of multiple for v2i64. It was incorrect for SSE4.1.
llvm-svn: 61211
2008-12-18 21:42:19 +00:00
Mon P Wang 6e5f4bc1e7 Added some basic test cases for r61209
llvm-svn: 61210
2008-12-18 20:05:58 +00:00
Mon P Wang a501640ffa Added support for vector widening.
llvm-svn: 61209
2008-12-18 20:03:17 +00:00
Evan Cheng 8e0f6f272f Remove dead comments.
llvm-svn: 61201
2008-12-18 09:01:18 +00:00
Nick Lewycky c3a70ade66 Oops! Left out a line.
Simplifying the sdiv might allow further simplifications for our users.

llvm-svn: 61196
2008-12-18 06:42:28 +00:00
Nick Lewycky 0f0e63fe73 Make all the vector elements positive in an srem of constant vector.
llvm-svn: 61195
2008-12-18 06:31:11 +00:00
Chris Lattner 4caf5eb70c Fix PR2929 by making bugpoint/code extract propagate the nothrow
bit from the original function to the cloned one.

llvm-svn: 61194
2008-12-18 05:52:56 +00:00
Mikhail Glushenkov cf029824e1 Fix typo in error message.
llvm-svn: 61191
2008-12-18 04:06:58 +00:00
Nick Lewycky 9c7379d077 Recommit this grammar fix that was backed out along with nocapture.
llvm-svn: 61189
2008-12-18 02:15:05 +00:00
Dan Gohman 83682a9441 Give MachineLICM a name, for -time-passes etc.
llvm-svn: 61184
2008-12-18 01:37:56 +00:00
Dan Gohman b0ef9140e5 Move post-RA scheduling before branch folding for now, because branch
folding's tail merging doesn't currently preserve liveness information
which post-RA scheduling requires.

llvm-svn: 61183
2008-12-18 01:36:42 +00:00
Owen Anderson ad4d2ab15b Re-apply r61158 in a form that no longer breaks tests.
llvm-svn: 61182
2008-12-18 01:27:19 +00:00
Dale Johannesen 3e5843b992 Revert previous patch, appears to break bootstrap.
llvm-svn: 61181
2008-12-18 01:23:41 +00:00
Dan Gohman 49c44fa014 Mark the x86 fp stack registers as "reserved". This tells LiveVariables
and the RegisterScavenger not to expect traditional liveness 
techniques are applicable to these registers, since we don't fully
modify the effects of push and pop after stackification.

llvm-svn: 61179
2008-12-18 01:05:09 +00:00
Dale Johannesen 12d031b716 Fix the time regression I introduced in 464.h264ref with
my last patch to this file.

The issue there was that all uses of an IV inside a loop
are actually references to Base[IV*2], and there was one
use outside that was the same but LSR didn't see the base
or the scaling because it didn't recurse into uses outside
the loop; thus, it used base+IV*scale mode inside the loop
instead of pulling base out of the loop.  This was extra bad
because register pressure later forced both base and IV into
memory.  Doing that recursion, at least enough
to figure out addressing modes, is a good idea in general;
the change in AddUsersIfInteresting does this.  However,
there were side effects....

It is also possible for recursing outside the loop to
introduce another IV where there was only 1 before (if
the refs inside are not scaled and the ref outside is).
I don't think this is a common case, but it's in the testsuite.
It is right to be very aggressive about getting rid of
such introduced IVs (CheckForIVReuse and the handling of
nonzero RewriteFactor in StrengthReduceStridedIVUsers).
In the testcase in question the new IV produced this way
has both a nonconstant stride and a nonzero base, neither
of which was handled before.  (This patch does not handle 
all the cases where this can happen.)  And when inserting 
new code that feeds into a PHI, it's right to put such 
code at the original location rather than in the PHI's 
immediate predecessor(s) when the original location is outside 
the loop (a case that couldn't happen before)
(RewriteInstructionToUseNewBase); better to avoid making
multiple copies of it in this case.

Everything above is exercised in
CodeGen/X86/lsr-negative-stride.ll (and ifcvt4 in ARM which is
the same IR).

llvm-svn: 61178
2008-12-18 00:57:22 +00:00
Chris Lattner b6372933b5 reapply this hunk from Bill's reversion in r61169, it is conservative
and safe and orthogonal from turning off load pre.

llvm-svn: 61177
2008-12-18 00:51:32 +00:00
Bill Wendling 7ecf774262 XFAIL on Linux.
llvm-svn: 61176
2008-12-18 00:35:21 +00:00
Chris Lattner c1c6404bba make instnamer name unnamed blocks as well as instructions and args.
llvm-svn: 61175
2008-12-18 00:33:11 +00:00