Bill Wendling [Mon, 30 Aug 2010 01:47:35 +0000 (01:47 +0000)]
Create Thumb2sI_cpsr and T2sI_cpsr. These new classes indicate that CPSR is the
optional modified register (instead of reg0). Along with r112461 it will make
sure that the optional define of CPSR is marked as "def" and will thus mark the
instructions using these classes (t2ANDS*) as setting the 's' flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112462
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 30 Aug 2010 01:36:05 +0000 (01:36 +0000)]
When adding a register, we should mark it as "def" if it can optionally define
said (physical) register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112461
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 22:28:18 +0000 (22:28 +0000)]
revert 112457, it looks like it broke selfhost.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112459
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 19:54:28 +0000 (19:54 +0000)]
rewrite DwarfEHPrepare to use SSAUpdater to promote its allocas
instead of PromoteMemToReg. This allows it to stop using DF and DT,
eliminating a computation of DT and DF from clang -O3. Clang is now
down to 2 runs of DomFrontier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112457
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 19:28:28 +0000 (19:28 +0000)]
inline function into its only caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112455
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 18:42:23 +0000 (18:42 +0000)]
two changes: 1) make AliasSet hold the list of call sites with an
assertingvh so we get a violent explosion if the pointer dangles.
2) Fix AliasSetTracker::deleteValue to remove call sites with
by-pointer comparisons instead of by-alias queries. Using
findAliasSetForCallSite can cause alias sets to get merged
when they shouldn't, and can also miss alias sets when the
call is readonly.
#2 fixes PR6889, which only repros with a .c file :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112452
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 18:22:25 +0000 (18:22 +0000)]
LICM does get dead instructions input to it. Instead of sinking them
out of loops, just delete them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112451
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 18:18:40 +0000 (18:18 +0000)]
use moveBefore instead of remove+insert, it avoids some
symtab manipulation, so its faster (in addition to being
more elegant)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112450
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 18:11:16 +0000 (18:11 +0000)]
revert 112448 for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112449
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 18:03:33 +0000 (18:03 +0000)]
optimize LICM::hoist to use moveBefore. Correct its updating
of AST to remove the hoisted instruction from the AST, since it
is no longer in the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112448
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 18:00:00 +0000 (18:00 +0000)]
fix some bugs (found by inspection) where LICM would not update
LICM correctly. When sinking an instruction, it should not add
entries for the sunk instruction to the AST, it should remove
the entry for the sunk instruction. The blocks being sunk to
are not in the loop, so their instructions shouldn't be in the
AST (yet)!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112447
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 17:46:00 +0000 (17:46 +0000)]
rework the ownership of subloop alias information: instead of
keeping them around until the pass is destroyed, keep them
around a) just when useful (not for outer loops) and b) destroy
them right after we use them. This should reduce memory use
and fixes potential bugs where a loop is deleted and another
loop gets allocated to the same address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112446
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 17:23:19 +0000 (17:23 +0000)]
apparently unswitch had the same "Feature". Stop its
claims that it preserves domfrontier if it doesn't really.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112445
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 17:21:35 +0000 (17:21 +0000)]
now that loop passes don't use DomFrontier, there is no reason
for the unroller to pretend it supports updating it. It still
has a horrible hack for DomTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112444
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 16:40:03 +0000 (16:40 +0000)]
Make IVUsers iterative instead of recursive.
This has the side effect of reversing the order of most of
IVUser's results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112442
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 16:39:22 +0000 (16:39 +0000)]
Optionally rerun dedicated-register filtering after applying
other filtering techniques, as those may allow it to filter
out more obviously unprofitable candidates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112441
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 16:32:54 +0000 (16:32 +0000)]
Fix several areas in LSR to do a better job keeping the main
LSRInstance data structures up to date. This fixes some
pessimizations caused by stale data which will be exposed
in an upcoming change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112440
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 16:09:42 +0000 (16:09 +0000)]
Refactor the three main groups of code out of
NarrowSearchSpaceUsingHeuristics into separate functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112439
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 15:30:29 +0000 (15:30 +0000)]
Delete a bogus check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112438
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 15:27:08 +0000 (15:27 +0000)]
Add some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112437
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 15:21:38 +0000 (15:21 +0000)]
Move this debug output into GenerateAllReuseFormula, to declutter
the high-level logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112436
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 15:19:11 +0000 (15:19 +0000)]
Delete an unused declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112435
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 15:18:49 +0000 (15:18 +0000)]
Do one lookup instead of two.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112434
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 15:16:58 +0000 (15:16 +0000)]
Restructure the {A,+,B}<L> * {C,+,D}<L> folding so that it folds
all applicable addrecs before recursing on getMulExpr, instead of
recursing on getMulExpr for each one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112433
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 15:10:06 +0000 (15:10 +0000)]
Batch up subtracts along with adds, when analyzing long chains of
operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112432
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 15:07:13 +0000 (15:07 +0000)]
Micro-optimize GroupByComplexity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112431
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 14:55:19 +0000 (14:55 +0000)]
Hold AddRec->getLoop() in a variable, to make the Mul code more consistent
with the Add code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112430
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 14:53:34 +0000 (14:53 +0000)]
Rename a variable, for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112429
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 14:52:02 +0000 (14:52 +0000)]
Use iterators instead of indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112428
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 14:50:21 +0000 (14:50 +0000)]
Don't worry about union types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112427
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 14:49:42 +0000 (14:49 +0000)]
Make this test less dependent on register allocation choices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112426
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 14:49:00 +0000 (14:49 +0000)]
Use exec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112425
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Aug 2010 14:48:15 +0000 (14:48 +0000)]
Delete an unused declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112424
91177308-0d34-0410-b5e6-
96231b3b80d8
Kalle Raiskila [Sun, 29 Aug 2010 12:41:50 +0000 (12:41 +0000)]
Fix lowering of INSERT_VECTOR_ELT in SPU.
The IDX was treated as byte index, not element index.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112422
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 29 Aug 2010 11:31:07 +0000 (11:31 +0000)]
Fix whitespaces. No functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112421
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 07:05:51 +0000 (07:05 +0000)]
Stop explicitly scheduling domfrontier before the loop passes,
since none of them use it. With this, we now only run
domfrontier (an N^2 analysis) 3 times at clang -O3: once for
"early" per-function cleanup, once at the start of the
per-function pipeline to support SRoA, and once late because
the EHPrepare class uses it.
EHPrepare needs to stop using it, this is silly and wasteful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112420
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 07:02:56 +0000 (07:02 +0000)]
licm preserves the cfg, it doesn't have to explicitly say it
preserves domfrontier. It does preserve AA though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112419
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 06:49:44 +0000 (06:49 +0000)]
now that it doesn't use the PromoteMemToReg function, LICM doesn't
require DomFrontier. Dropping this doesn't actually save any runs
of the pass though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112418
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 06:43:52 +0000 (06:43 +0000)]
completely rewrite the memory promotion algorithm in LICM.
Among other things, this uses SSAUpdater instead of
PromoteMemToReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112417
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Sun, 29 Aug 2010 05:57:34 +0000 (05:57 +0000)]
Remove NEON vaddl, vaddw, vsubl, and vsubw intrinsics. Instead, use llvm
IR add/sub operations with one or both operands sign- or zero-extended.
Auto-upgrade the old intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112416
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 05:12:21 +0000 (05:12 +0000)]
use getUniqueExitBlocks instead of a manual set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112412
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sun, 29 Aug 2010 05:07:40 +0000 (05:07 +0000)]
A couple of small missed optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112411
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 04:55:06 +0000 (04:55 +0000)]
reimplement LICM::sink to use SSAUpdater instead of PromoteMemToReg.
This leads to much simpler code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112410
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 04:54:06 +0000 (04:54 +0000)]
implement SSAUpdater::RewriteUseAfterInsertions, a helpful form of RewriteUse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112409
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 04:53:24 +0000 (04:53 +0000)]
remove dead proto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112408
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 04:28:20 +0000 (04:28 +0000)]
reduce indentation in LICM::sink by using early exits, use
getUniqueExitBlocks instead of getExitBlocks and a manual
set to eliminate dupes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112405
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 04:23:04 +0000 (04:23 +0000)]
modernize this pass a bit: use efficient set/map and reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112404
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Sun, 29 Aug 2010 04:22:35 +0000 (04:22 +0000)]
Flesh out the list of things I've worked on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112403
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 04:14:47 +0000 (04:14 +0000)]
when merging two alias sets, the result set is volatile if either
of the sets is volatile. We were dropping the volatile bit of the
merged in set, leading (luckily) to assertions in cases like
PR7535. I cannot produce a testcase that repros with opt, but this
is obviously correct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112402
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 04:13:43 +0000 (04:13 +0000)]
more cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112401
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 04:06:55 +0000 (04:06 +0000)]
clean this up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112400
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 29 Aug 2010 03:55:31 +0000 (03:55 +0000)]
- Add a parameter to T2I_bin_irs for those patterns which set the S bit.
- Create T2I_bin_sw_irs to be like T2I_bin_w_irs, but that it sets the S bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112399
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 03:19:04 +0000 (03:19 +0000)]
merge a bunch of shuffle tests into sse2.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112398
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 03:08:08 +0000 (03:08 +0000)]
add a bunch more common shuffles to the instprinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112397
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 29 Aug 2010 03:07:47 +0000 (03:07 +0000)]
add some nounwind's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112396
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 29 Aug 2010 03:06:09 +0000 (03:06 +0000)]
Name ANDflag to ANDS, which is less stupid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112395
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 29 Aug 2010 03:02:28 +0000 (03:02 +0000)]
File missing from last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112394
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 29 Aug 2010 03:02:11 +0000 (03:02 +0000)]
Create an ARMISD::AND node. This node is exactly like the "ARM::AND" node, but
it sets the CPSR register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112393
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 28 Aug 2010 21:12:51 +0000 (21:12 +0000)]
Minor change.
This is test for git svn dcommit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112389
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 20:42:31 +0000 (20:42 +0000)]
I have manually decoded the imm field of an insertps one too many
times. This patch causes llc and llvm-mc (which both default to
verbose-asm) to print out comments after a few common shuffle
instructions which indicates the shuffle mask, e.g.:
insertps $113, %xmm3, %xmm0 ## xmm0 = zero,xmm0[1,2],xmm3[1]
unpcklps %xmm1, %xmm0 ## xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
pshufd $1, %xmm1, %xmm1 ## xmm1 = xmm1[1,0,0,0]
This is carefully factored to keep the information extraction (of the
shuffle mask) separate from the printing logic. I plan to move the
extraction part out somewhere else at some point for other parts of
the x86 backend that want to introspect on the behavior of shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112387
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 20:40:28 +0000 (20:40 +0000)]
fixme accomplished
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112386
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 20:34:35 +0000 (20:34 +0000)]
tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112385
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 28 Aug 2010 20:24:43 +0000 (20:24 +0000)]
Add me to the "blame list"!
And it is my 1st test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112384
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sat, 28 Aug 2010 20:14:05 +0000 (20:14 +0000)]
Remove obsolete keywords which are no longer relevant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112382
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sat, 28 Aug 2010 20:11:28 +0000 (20:11 +0000)]
Remove unions from the vim syntax highlighting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112381
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 17:59:08 +0000 (17:59 +0000)]
fix the buildvector->insertp[sd] logic to not always create a redundant
insertp[sd] $0, which is a noop. Before:
_f32: ## @f32
pshufd $1, %xmm1, %xmm2
pshufd $1, %xmm0, %xmm3
addss %xmm2, %xmm3
addss %xmm1, %xmm0
## kill: XMM0<def> XMM0<kill> XMM0<def>
insertps $0, %xmm0, %xmm0
insertps $16, %xmm3, %xmm0
ret
after:
_f32: ## @f32
movdqa %xmm0, %xmm2
addss %xmm1, %xmm2
pshufd $1, %xmm1, %xmm1
pshufd $1, %xmm0, %xmm3
addss %xmm1, %xmm3
movdqa %xmm2, %xmm0
insertps $16, %xmm3, %xmm0
ret
The extra movs are due to a random (poor) scheduling decision.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112379
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 17:28:30 +0000 (17:28 +0000)]
fix the BuildVector -> unpcklps logic to not do pointless shuffles
when the top elements of a vector are undefined. This happens all
the time for X86-64 ABI stuff because only the low 2 elements of
a 4 element vector are defined. For example, on:
_Complex float f32(_Complex float A, _Complex float B) {
return A+B;
}
We used to produce (with SSE2, SSE4.1+ uses insertps):
_f32: ## @f32
movdqa %xmm0, %xmm2
addss %xmm1, %xmm2
pshufd $16, %xmm2, %xmm2
pshufd $1, %xmm1, %xmm1
pshufd $1, %xmm0, %xmm0
addss %xmm1, %xmm0
pshufd $16, %xmm0, %xmm1
movdqa %xmm2, %xmm0
unpcklps %xmm1, %xmm0
ret
We now produce:
_f32: ## @f32
movdqa %xmm0, %xmm2
addss %xmm1, %xmm2
pshufd $1, %xmm1, %xmm1
pshufd $1, %xmm0, %xmm3
addss %xmm1, %xmm3
movaps %xmm2, %xmm0
unpcklps %xmm3, %xmm0
ret
This implements rdar://
8368414
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112378
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 17:15:43 +0000 (17:15 +0000)]
improve comments in the unpcklps generating logic, introduce
a new EltStride variable instead of reusing NumElems variable
for a non-obvious purpose. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112377
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Sat, 28 Aug 2010 16:39:32 +0000 (16:39 +0000)]
Don't cast Win32 FILETIME structs to int64. Patch by Dimitry Andric!
According to the Microsoft documentation here:
http://msdn.microsoft.com/en-us/library/ms724284%28VS.85%29.aspx
this cast used in lib/System/Win32/Path.inc:
__int64 ft = *reinterpret_cast<__int64*>(&fi.ftLastWriteTime);
should not be done. The documentation says: "Do not cast a pointer to a
FILETIME structure to either a ULARGE_INTEGER* or __int64* value because
it can cause alignment faults on 64-bit Windows."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112376
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 16:33:36 +0000 (16:33 +0000)]
remove the MSIL backend. It isn't maintained, is buggy, has no testcases
and hasn't kept up with ToT. Approved by Anton.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112375
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 28 Aug 2010 10:29:41 +0000 (10:29 +0000)]
Update ocaml test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112364
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 28 Aug 2010 09:47:42 +0000 (09:47 +0000)]
Remove unions from the ocaml bindings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112363
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Sat, 28 Aug 2010 05:12:57 +0000 (05:12 +0000)]
Use pseudo instructions for VST1 and VST2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112357
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 04:09:24 +0000 (04:09 +0000)]
remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 03:51:24 +0000 (03:51 +0000)]
remove the ABCD and SSI passes. They don't have any clients that
I'm aware of, aren't maintained, and LVI will be replacing their value.
nlewycky approved this on irc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112355
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 03:45:03 +0000 (03:45 +0000)]
remove dead proto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112354
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 03:43:50 +0000 (03:43 +0000)]
more dead thing zapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112353
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 03:42:45 +0000 (03:42 +0000)]
zap dead method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112352
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 03:36:51 +0000 (03:36 +0000)]
for completeness, allow undef also.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112351
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 03:21:03 +0000 (03:21 +0000)]
squish dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112350
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 03:18:45 +0000 (03:18 +0000)]
zap dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112349
91177308-0d34-0410-b5e6-
96231b3b80d8
Bruno Cardoso Lopes [Sat, 28 Aug 2010 02:46:39 +0000 (02:46 +0000)]
Clean up the logic of vector shuffles -> vector shifts.
Also teach this logic how to handle target specific shuffles if
needed, this is necessary while searching recursively for zeroed
scalar elements in vector shuffle operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112348
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 01:50:57 +0000 (01:50 +0000)]
handle the constant case of vector insertion. For something
like this:
struct S { float A, B, C, D; };
struct S g;
struct S bar() {
struct S A = g;
++A.B;
A.A = 42;
return A;
}
we now generate:
_bar: ## @bar
## BB#0: ## %entry
movq _g@GOTPCREL(%rip), %rax
movss 12(%rax), %xmm0
pshufd $16, %xmm0, %xmm0
movss 4(%rax), %xmm2
movss 8(%rax), %xmm1
pshufd $16, %xmm1, %xmm1
unpcklps %xmm0, %xmm1
addss LCPI1_0(%rip), %xmm2
pshufd $16, %xmm2, %xmm2
movss LCPI1_1(%rip), %xmm0
pshufd $16, %xmm0, %xmm0
unpcklps %xmm2, %xmm0
ret
instead of:
_bar: ## @bar
## BB#0: ## %entry
movq _g@GOTPCREL(%rip), %rax
movss 12(%rax), %xmm0
pshufd $16, %xmm0, %xmm0
movss 4(%rax), %xmm2
movss 8(%rax), %xmm1
pshufd $16, %xmm1, %xmm1
unpcklps %xmm0, %xmm1
addss LCPI1_0(%rip), %xmm2
movd %xmm2, %eax
shlq $32, %rax
addq $
1109917696, %rax ## imm = 0x42280000
movd %rax, %xmm0
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112345
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Sat, 28 Aug 2010 01:30:02 +0000 (01:30 +0000)]
Straighten out any triple strings passed on the command line before
they hit the rest of the system.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112344
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 28 Aug 2010 01:20:38 +0000 (01:20 +0000)]
optimize bitcasts from large integers to vector into vector
element insertion from the pieces that feed into the vector.
This handles a pattern that occurs frequently due to code
generated for the x86-64 abi. We now compile something like
this:
struct S { float A, B, C, D; };
struct S g;
struct S bar() {
struct S A = g;
++A.A;
++A.C;
return A;
}
into all nice vector operations:
_bar: ## @bar
## BB#0: ## %entry
movq _g@GOTPCREL(%rip), %rax
movss LCPI1_0(%rip), %xmm1
movss (%rax), %xmm0
addss %xmm1, %xmm0
pshufd $16, %xmm0, %xmm0
movss 4(%rax), %xmm2
movss 12(%rax), %xmm3
pshufd $16, %xmm2, %xmm2
unpcklps %xmm2, %xmm0
addss 8(%rax), %xmm1
pshufd $16, %xmm1, %xmm1
pshufd $16, %xmm3, %xmm2
unpcklps %xmm2, %xmm1
ret
instead of icky integer operations:
_bar: ## @bar
movq _g@GOTPCREL(%rip), %rax
movss LCPI1_0(%rip), %xmm1
movss (%rax), %xmm0
addss %xmm1, %xmm0
movd %xmm0, %ecx
movl 4(%rax), %edx
movl 12(%rax), %esi
shlq $32, %rdx
addq %rcx, %rdx
movd %rdx, %xmm0
addss 8(%rax), %xmm1
movd %xmm1, %eax
shlq $32, %rsi
addq %rax, %rsi
movd %rsi, %xmm1
ret
This resolves rdar://
8360454
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112343
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sat, 28 Aug 2010 00:51:03 +0000 (00:51 +0000)]
Completely disable tail calls when fast-isel is enabled, as fast-isel
doesn't currently support dealing with this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112341
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sat, 28 Aug 2010 00:49:13 +0000 (00:49 +0000)]
Trim a #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112340
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sat, 28 Aug 2010 00:39:27 +0000 (00:39 +0000)]
Fix an index calculation thinko.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112337
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Sat, 28 Aug 2010 00:20:11 +0000 (00:20 +0000)]
We don't need to custom-select VLDMQ and VSTMQ anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112336
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 28 Aug 2010 00:11:12 +0000 (00:11 +0000)]
Update CMake build. Add newline at end of file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112332
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Fri, 27 Aug 2010 23:57:52 +0000 (23:57 +0000)]
When merging Thumb2 loads/stores, do not give up when the offset is one of
the special values that for ARM would be used with IB or DA modes. Fall
through and consider materializing a new base address is it would be
profitable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112329
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 27 Aug 2010 23:31:36 +0000 (23:31 +0000)]
Add a prototype of a new peephole optimizing pass that uses LazyValue info to simplify PHIs and select's.
This pass addresses the missed optimizations from PR2581 and PR4420.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112325
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 27 Aug 2010 23:29:38 +0000 (23:29 +0000)]
Improve the precision of getConstant().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112323
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Fri, 27 Aug 2010 23:18:17 +0000 (23:18 +0000)]
Change ARM VFP VLDM/VSTM instructions to use addressing mode #4, just like
all the other LDM/STM instructions. This fixes asm printer crashes when
compiling with -O0. I've changed one of the NEON tests (vst3.ll) to run
with -O0 to check this in the future.
Prior to this change VLDM/VSTM used addressing mode #5, but not really.
The offset field was used to hold a count of the number of registers being
loaded or stored, and the AM5 opcode field was expanded to specify the IA
or DB mode, instead of the standard ADD/SUB specifier. Much of the backend
was not aware of these special cases. The crashes occured when rewriting
a frameindex caused the AM5 offset field to be changed so that it did not
have a valid submode. I don't know exactly what changed to expose this now.
Maybe we've never done much with -O0 and NEON. Regardless, there's no longer
any reason to keep a count of the VLDM/VSTM registers, so we can use
addressing mode #4 and clean things up in a lot of places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112322
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 27 Aug 2010 23:15:21 +0000 (23:15 +0000)]
tidy up test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112321
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 27 Aug 2010 23:05:54 +0000 (23:05 +0000)]
no really, fix the test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112317
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 27 Aug 2010 23:05:27 +0000 (23:05 +0000)]
fix this test. It's not clear what it's really testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112316
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 27 Aug 2010 22:53:44 +0000 (22:53 +0000)]
Enhance the shift propagator to handle the case when you have:
A = shl x, 42
...
B = lshr ..., 38
which can be transformed into:
A = shl x, 4
...
iff we can prove that the would-be-shifted-in bits
are already zero. This eliminates two shifts in the testcase
and allows eliminate of the whole i128 chain in the real example.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112314
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Fri, 27 Aug 2010 22:25:51 +0000 (22:25 +0000)]
Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112305
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 27 Aug 2010 22:24:38 +0000 (22:24 +0000)]
Implement a pretty general logical shift propagation
framework, which is good at ripping through bitfield
operations. This generalize a bunch of the existing
xforms that instcombine does, such as
(x << c) >> c -> and
to handle intermediate logical nodes. This is useful for
ripping up the "promote to large integer" code produced by
SRoA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112304
91177308-0d34-0410-b5e6-
96231b3b80d8