Commit Graph

41347 Commits

Author SHA1 Message Date
Chris Lattner
69c7249a6f simplify the hacks around jrcxz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 20:10:12 +00:00
Chris Lattner
ec6789f4f9 have tblgen detect when an instruction would have matched, but
failed because a subtarget feature was not enabled.  Use this to
remove a bunch of hacks from the X86AsmParser for rejecting things
like popfl in 64-bit mode.  Previously these hacks weren't needed,
but were important to get a message better than "invalid instruction"
when used in the wrong mode.

This also fixes bugs where pushal would not be rejected correctly in
32-bit mode (just pusha).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113166 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 20:08:02 +00:00
Chris Lattner
79ed3f77e8 change MatchInstructionImpl to return an enum instead of bool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 19:22:17 +00:00
Chris Lattner
0692ee676f have AsmMatcherEmitter.cpp produce the hunk of code that gets included
into the middle of the class, and rework how the different sections of
the generated file are conditionally included for simplicity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 19:11:01 +00:00
Roman Divacky
436c54a186 Redefine LOOP* instructions from I to Ii8PCRel as they take an i8 argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 18:43:14 +00:00
Chris Lattner
47ab90bfa8 random cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 18:32:06 +00:00
Benjamin Kramer
a9eadca2fd MCELF: Align symtab, relocation sections and section headers properly. Patch by Krister Wombell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 16:11:52 +00:00
Chris Lattner
9c7f075270 compute the HasSSE3 bit correctly, patch by Nikolai Saoukh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 05:19:44 +00:00
Chris Lattner
0cccd7633e fix PR8067, an over-aggressive assertion in LICM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 05:11:24 +00:00
Chris Lattner
09981982f1 cleanup some of the lifetime/invariant marker stuff, add a big fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 03:58:04 +00:00
Chris Lattner
c5a5cf26fd speed up -gvn 3.4% on the testcase in PR7023
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 01:26:29 +00:00
Chris Lattner
50fb46983c Teach loop rotate to hoist trivially invariant instructions
in the duplicated block instead of duplicating them.  

Duplicating them into the end of the loop and the preheader 
means that we got a phi node in the header of the loop, 
which prevented LICM from hoisting them.  GVN would
usually come around later and merge the duplicated 
instructions so we'd get reasonable output... except that
anything dependent on the shoulda-been-hoisted value can't
be hoisted.  In PR5319 (which this fixes), a memory value
didn't get promoted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 01:10:22 +00:00
Chris Lattner
adc799112d pull a simple method out of LICM into a new
Loop::hasLoopInvariantOperands method. Remove
a useless and confusing Loop::isLoopInvariant(Instruction)
method, which didn't do what you thought it did.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 01:05:37 +00:00
Chris Lattner
979b061819 remove some dead code. t2addrmode_imm8s4 is never used in a
pattern, so there is no need to define a matching function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 22:51:11 +00:00
Chris Lattner
252b491875 cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 21:18:45 +00:00
Chris Lattner
dfe254b86e add a comment about where this should eventually move.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 20:33:40 +00:00
Chris Lattner
f0f5780b39 update this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 20:22:09 +00:00
Chris Lattner
3ae0924d6b more cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113115 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 20:13:07 +00:00
Chris Lattner
bdabacdcca Change lower atomic pass to use IntrinsicInst to simplify it a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113114 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 20:10:47 +00:00
Chris Lattner
906a675db8 eliminate some non-obvious casts. UndefValue isa Constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 20:03:09 +00:00
Chris Lattner
e971131695 fix PR8063, a crash in globalopt in the malloc analysis code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 17:20:46 +00:00
Lang Hames
b76d20969f Added initialisers for reduction rule counters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 13:42:32 +00:00
Nick Lewycky
e110abb313 Fix warning reported by MSVC++ builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 09:11:38 +00:00
Nick Lewycky
b0e17779ba Switch FnSet to containing the ComparableFunction instead of a pointer to one.
This reduces malloc traffic (yay!) and removes MergeFunctionsEqualityInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 09:00:32 +00:00
Nick Lewycky
b0104e1bb5 Fix many bugs when merging weak-strong and weak-weak pairs. We now merge all
strong functions first to make sure they're the canonical definitions and then
do a second pass looking only for weak functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 08:22:49 +00:00
Chris Lattner
beac75da37 implement rdar://6653118 - fastisel should fold loads where possible.
Since mem2reg isn't run at -O0, we get a ton of reloads from the stack,
for example, before, this code:

int foo(int x, int y, int z) {
  return x+y+z;
}

used to compile into:

_foo:                                   ## @foo
	subq	$12, %rsp
	movl	%edi, 8(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	movl	8(%rsp), %edx
	movl	4(%rsp), %esi
	addl	%edx, %esi
	movl	(%rsp), %edx
	addl	%esi, %edx
	movl	%edx, %eax
	addq	$12, %rsp
	ret

Now we produce:

_foo:                                   ## @foo
	subq	$12, %rsp
	movl	%edi, 8(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	movl	8(%rsp), %edx
	addl	4(%rsp), %edx    ## Folded load
	addl	(%rsp), %edx     ## Folded load
	movl	%edx, %eax
	addq	$12, %rsp
	ret

Fewer instructions and less register use = faster compiles.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 02:18:34 +00:00
Jakob Stoklund Olesen
07c2b7ff68 Remove dead code.
Clobber ranges are no longer used when joining physical registers.
Instead, all aliases are checked for interference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 21:09:33 +00:00
Chris Lattner
ab2cee6d51 dead method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 18:19:16 +00:00
Chris Lattner
17aa68055b zap dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 18:12:00 +00:00
Chris Lattner
89f87e8f5a remove dead code, mblaze uses SelectAddrRegImm/SelectAddrRegReg,
not SelectAddr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 18:02:47 +00:00
Bruno Cardoso Lopes
2eb63dfa0a Remove the last bit of isShuffleMaskLegal checks and improve the comment regarding mmx shuffles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113059 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 02:58:56 +00:00
Bruno Cardoso Lopes
828f6ae03c make explicit that we not handle several mmx shuffles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 02:50:13 +00:00
Dan Gohman
ffa75cdcf8 Fix LoopSimplify to notify ScalarEvolution when splitting a loop backedge
into an inner loop, as the new loop iteration may differ substantially.
This fixes PR8078.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113057 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 02:42:48 +00:00
Bruno Cardoso Lopes
aace0f295b Emit target specific nodes to handle palignr. Do not touch it for MMX versions yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 02:36:07 +00:00
Bruno Cardoso Lopes
c800c0d25f Emit target specific nodes to handle splats starting at zero indicies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113055 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 02:02:14 +00:00
Bruno Cardoso Lopes
bbfc31012b Emit target specific nodes for isPSHUFHWMask and isPSHUFLWMask
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 01:36:45 +00:00
Bruno Cardoso Lopes
4c827f5ae1 Emit target specific nodes for isSHUFPMask
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113048 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 01:22:57 +00:00
Bruno Cardoso Lopes
d344f28b9d Previous isMOVLMask matching already emits targets nodes, remove check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 00:50:08 +00:00
Bruno Cardoso Lopes
e09abcd3c4 One more check from the original isShuffleMaskLegal goes away
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 00:46:16 +00:00
Bruno Cardoso Lopes
b733996110 Remove a duplicated but useless check that i've inserted in the previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 00:43:12 +00:00
Bruno Cardoso Lopes
a22c84571a Refactor some code and remove the extra checks for unpckl_undef and unpckh_undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 00:39:43 +00:00
Chris Lattner
469996400c fix a bug in my licm rewrite when a load from the promoted memory
location is being re-stored to the memory location.  We would get
a dangling pointer from the SSAUpdate data structure and miss a 
use.  This fixes PR8068


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 00:12:30 +00:00
Bruno Cardoso Lopes
43c05744b5 Remove check for unpckh mask
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113035 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 23:32:47 +00:00
Bruno Cardoso Lopes
ef3adb3243 Remove check for unpckl mask
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 23:31:50 +00:00
Bruno Cardoso Lopes
7256e22f77 Inline isShuffleMaskLegal into LowerVECTOR_SHUFFLE, so we can start
checking each standalone condition and decide whether emit target
specific nodes or remove the condition if it's already matched before.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 23:24:06 +00:00
Owen Anderson
597dad35b8 Propagate non-local comparisons. Fixes PR1757.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113025 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 22:47:08 +00:00
Dan Gohman
46ffb231c6 Disable the asserts that check that normalization is perfectly
invertible. ScalarEvolution's folding routines don't always succeed
in canonicalizing equal expressions to a single canonical form, and
this can cause these asserts to fail, even though there's no actual
correctness problem. This fixes PR8066.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 22:12:56 +00:00
Bruno Cardoso Lopes
e8f279cbd4 Reapply considered harmfull part of rr112934 and r112942.
"Use target specific nodes instead of relying in unpckl and
unpckh pattern fragments during isel time. Also place a
depth limit in getShuffleScalarElt.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 22:09:41 +00:00
Jim Grosbach
ee72651df4 previous patch was a little too tricky for its own good. Don't try to
overload UserInInstr. Explicitly check Allocatable. The early exit in the
condition will mean the performance impact of the extra test should be
minimal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113016 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 21:45:15 +00:00
Dale Johannesen
caa9ba228d Remove the rest of the nonexistent 64-bit AVX instructions.
Bruno, please review.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 21:23:00 +00:00