Commit Graph

22794 Commits

Author SHA1 Message Date
Evan Cheng
c9fdea915a Move PICEnabled declaration here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26271 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-18 00:06:03 +00:00
Chris Lattner
012f241987 Fix a tricky issue in the SimplifyDemandedBits code where CombineTo wasn't
exactly the API we wanted to call into.  This fixes the crash on crafty last
night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26269 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 21:58:01 +00:00
Chris Lattner
80274268b9 add a new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26268 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 21:57:00 +00:00
Nate Begeman
b1d3c15c3c A few final (for now) tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26267 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 21:38:45 +00:00
Nate Begeman
3bd5403920 Yet another test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26266 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 21:32:46 +00:00
Nate Begeman
d44d3d5fc3 New tests!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26265 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 21:22:08 +00:00
Robert Bocchino
7b81c758ab Added documentation for vset and vselect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26264 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 21:18:08 +00:00
Nate Begeman
fb7217bea3 Clean up DemandedBitsAreZero interface
Make more use of the new mask helpers in valuetypes.h
Combine (sra (srl x, c1), c1) -> sext_inreg if legal


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26263 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 19:54:08 +00:00
Nate Begeman
70804d3e14 Fix a nit sabre noticed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26262 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 18:06:19 +00:00
Nate Begeman
cd6a6ed0a9 Don't expand sdiv by power of two before legalize, since it will likely
generate illegal nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26261 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 07:26:20 +00:00
Chris Lattner
c2fe97e726 unbreak the build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26260 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 07:09:27 +00:00
Evan Cheng
5298bcc722 Unbreak x86 be
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26259 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 07:01:52 +00:00
Chris Lattner
0017d480cc Fix loops where the header has an exit, fixing a loop-unswitch crash on crafty
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26258 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 06:39:56 +00:00
Nate Begeman
8ec18177da Fix a comment sabre noticed :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26257 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 06:24:31 +00:00
Nate Begeman
b5fefc732c A couple new regression tests to make sure we always pattern match the new
opcodes on ppc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26256 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 06:16:56 +00:00
Nate Begeman
551bf3f800 kill ADD_PARTS & SUB_PARTS and replace them with fancy new ADDC, ADDE, SUBC
and SUBE nodes that actually expose what's going on and allow for
significant simplifications in the targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26255 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 05:43:56 +00:00
Chris Lattner
25125697fb Fix another miscompilation exposed by lencode, where we lowered i64->f32
conversions to __floatdidf instead of __floatdisf on targets that support
f32 but not i64 (e.g. sparc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26254 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 04:32:33 +00:00
Chris Lattner
a648df2871 add note about div by power of 2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26253 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 04:20:13 +00:00
Jeff Cohen
5755b17044 Fix bug noticed by VC++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26252 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 02:12:18 +00:00
Jeff Cohen
ddc0022c6f Inform Visual Studio of deleted file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26251 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 02:11:34 +00:00
Nate Begeman
9c3c2e9686 Whoops, didn't mean to check this in yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26250 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 00:56:19 +00:00
Nate Begeman
c22f357b78 Add a missing and useful pat frag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26249 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 00:51:06 +00:00
Chris Lattner
52221f7b16 start of some new simplification code, not thoroughly tested, use at your own
risk :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26248 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 00:31:07 +00:00
Evan Cheng
7634ac4a9b Remind ourselves to revisit the "pxor vs. xorps/xorpd to clear XMM registers"
issue. Need to do more experiments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26247 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 00:04:28 +00:00
Nate Begeman
4c5dcf54ff Kill the x86 pattern isel. boom.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26246 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 00:03:04 +00:00
Evan Cheng
dc8acb6420 Remove the entry about using movapd for SSE reg-reg moves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26245 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-17 00:00:58 +00:00
Evan Cheng
39d1761c70 pxor (for FLD0SS) encoding was missing the OpSize prefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26244 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 23:59:30 +00:00
Chris Lattner
6a6eb7b622 Remove the skeleton target, it doesn't produce useful code and there are
other small targets that do that can be learned from.  They also have
the added advantage of being tested :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26243 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 23:14:50 +00:00
Evan Cheng
cffbb5174f Dumb bug. Code sees a memcpy from X+c so it increments src offset. But it
turns out not to point to a constant string but it forgot change the offset
back.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26242 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 23:11:42 +00:00
Evan Cheng
fe5cb19405 1. Use pxor instead of xoraps / xorapd to clear FR32 / FR64 registers. This
proves to be worth 20% on Ptrdist/ks. Might be related to dependency
   breaking support.
2. Added FsMOVAPSrr and FsMOVAPDrr as aliases to MOVAPSrr and MOVAPDrr. These
   are used for FR32 / FR64 reg-to-reg copies.
3. Tell reg-allocator to generate MOVSSrm / MOVSDrm and MOVSSmr / MOVSDmr to
   spill / restore FsMOVAPSrr and FsMOVAPDrr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26241 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 22:45:17 +00:00
Evan Cheng
19ade3bf9c Use movaps / movapd to spill / restore V4F4 / V2F8 registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26240 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 21:20:26 +00:00
Chris Lattner
56b9e1cd72 remove skeleton target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26239 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 21:12:54 +00:00
Nate Begeman
368e18d56a Rework the SelectionDAG-based implementations of SimplifyDemandedBits
and ComputeMaskedBits to match the new improved versions in instcombine.
Tested against all of multisource/benchmarks on ppc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26238 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 21:11:51 +00:00
Chris Lattner
a6bbfe8448 don't build the skeleton target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26237 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 21:11:49 +00:00
Chris Lattner
27630d500e remove support for the skeleton target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26236 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 21:10:57 +00:00
Chris Lattner
10cd9bbde7 Change SplitBlock to increment a BasicBlock::iterator, not an Instruction*. Apparently they do different things :)
This fixes a testcase that nate reduced from spass.

Also included are a couple minor code changes that don't affect the generated
code at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26235 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 19:36:22 +00:00
Evan Cheng
77dea9b3c3 MOVAPSrr and MOVAPDrr instruction format should be MRMSrcReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26234 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 19:34:41 +00:00
Duraid Madina
00d3d44b75 distinguish between objects and register names, now we can have stuff
with names like "f84", "in6" etc etc.

this should fix one or two tests


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26232 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 13:12:57 +00:00
Evan Cheng
298ebf2bd8 If the false case is the current basic block, then this is a self loop.
We do not want to emit "Loop: ... brcond Out; br Loop", as it adds an extra
instruction in the loop.  Instead, invert the condition and emit
"Loop: ... br!cond Loop; br Out.

Generalize the fix by moving it from PPCDAGToDAGISel to SelectionDAGLowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26231 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 08:27:56 +00:00
Chris Lattner
8f4880be66 Lowering of sdiv X, pow2 was broken, this fixes it. This patch is written
by Nate, I'm just committing it for him.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26230 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 08:02:36 +00:00
Chris Lattner
af2f351869 Fix a minor makefile bug with lex/yacc handling that nate noticed. We don't
want to copy the files when the .cpp file changes, we want to copy them
to the .cvs versions when the .l/.y file change (like the comments even say).
This avoids having bogus changes show up in diffs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26229 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 05:10:48 +00:00
Jeff Cohen
21c107ab0f Fix VC++ warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26228 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 04:07:37 +00:00
Jeff Cohen
8e77a8cdd5 Visual Studio enters the future of bisoning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26227 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 04:07:03 +00:00
Evan Cheng
d51425a82d Use movaps / movapd (instead of movss / movsd) to do FR32 / FR64 reg to reg
transfer.

According to the Intel P4 Optimization Manual:

Moves that write a portion of a register can introduce unwanted
dependences. The movsd reg, reg instruction writes only the bottom
64 bits of a register, not to all 128 bits. This introduces a dependence on
the preceding instruction that produces the upper 64 bits (even if those
bits are not longer wanted). The dependence inhibits register renaming,
and thereby reduces parallelism.

Not to mention movaps is shorter than movss.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26226 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 01:50:02 +00:00
Chris Lattner
f17c42d409 fix a bug where we unswitched the wrong way
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26225 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 01:24:41 +00:00
Evan Cheng
18a8452f3d A bit more memset / memcpy optimization.
Turns them into calls to memset / memcpy if 1) buffer(s) are not DWORD aligned,
2) size is not known to be greater or equal to some minimum value (currently 128).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26224 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-16 00:21:07 +00:00
Chris Lattner
a48654ef23 Implement trivial unswitching for switch stmts. This allows us to trivial
unswitch this loop on 2 before sweating to unswitch on 1/3.

void test4(int N, int i, int C, int*P, int*Q) {
  int j;
  for (j = 0; j < N; ++j) {
    switch (C) {                // general unswitching.
    default: P[i+j] = 0; break;
    case 1: Q[i+j] = 0; break;
    case 3: P[i+j] = Q[i+j]; break;
    case 2: break;              //  TRIVIAL UNSWITCH on C==2
    }
  }
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26223 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-15 22:52:05 +00:00
Evan Cheng
fe1c31204e Remove an entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26222 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-15 22:14:34 +00:00
Evan Cheng
a47876d87a Remove an unused function parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26221 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-15 22:12:35 +00:00
Chris Lattner
4e1323969c make "trivial" unswitching significantly more general. It can now handle
this for example:

  for (j = 0; j < N; ++j) {     // trivial unswitch
    if (C)
      P[i+j] = 0;
  }

turning it into the obvious code without bothering to duplicate an empty loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26220 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-15 22:03:36 +00:00