Chris Lattner
9f2c0da214
generalize my previous operand loc info hack. If the same operand
...
is busted for all variants, report it as the location. This allows
us to get the operand right for bugs like:
t.s:3:12: error: invalid operand for instruction
outb %al, %gs
^
Even though there are reg/imm and reg/reg forms of this instruction.
llvm-svn: 113183
2010-09-06 23:37:39 +00:00
Chris Lattner
6ecbbff857
fix the operand constraints of the immediate form of in/out,
...
allowing unsigned 8-bit operands. This fixes rdar://8208481
llvm-svn: 113182
2010-09-06 23:29:05 +00:00
Chris Lattner
6bfa0d9988
in the case where an instruction only has one implementation
...
of a mneumonic, report operand errors with better location
info. For example, we now report:
t.s:6:14: error: invalid operand for instruction
cwtl $1
^
but we fail for common cases like:
t.s:11:4: error: invalid operand for instruction
addl $1, $1
^
because we don't know if this is supposed to be the reg/imm or imm/reg
form.
llvm-svn: 113178
2010-09-06 22:11:18 +00:00
Chris Lattner
bb5e19cb63
Now that we know if we had a total fail on the instruction mnemonic,
...
give a more detailed error. Before:
t.s:11:4: error: unrecognized instruction
addl $1, $1
^
t.s:12:4: error: unrecognized instruction
f2efqefa $1
^
After:
t.s:11:4: error: invalid operand for instruction
addl $1, $1
^
t.s:12:4: error: invalid instruction mnemonic 'f2efqefa'
f2efqefa $1
^
This fixes rdar://8017912 - llvm-mc says "unrecognized instruction" when it means "invalid operands"
llvm-svn: 113176
2010-09-06 21:54:15 +00:00
Chris Lattner
fd211fc740
simplify DEBUG_WITH_TYPE usage
...
llvm-svn: 113174
2010-09-06 21:28:52 +00:00
Chris Lattner
4a6911275e
this if can now be an assert.
...
llvm-svn: 113173
2010-09-06 21:25:43 +00:00
Chris Lattner
90ef8a5d5a
;
...
llvm-svn: 113172
2010-09-06 21:23:43 +00:00
Chris Lattner
7b80f3c39c
now that the opcode is trivially exposed, start matching instructions
...
by doing a binary search over the mnemonic instead of doing a linear
search through all possible instructions. This implements rdar://7785064
llvm-svn: 113171
2010-09-06 21:22:45 +00:00
Chris Lattner
e443a993fb
emit the match table at global scope instead of within the
...
MatchInstructionImpl. This makes it easier to read/understand
MatchInstructionImpl.
llvm-svn: 113170
2010-09-06 21:08:38 +00:00
Chris Lattner
d323dac9bd
special case the mnemonic operand of the instruction in the
...
generated matcher, emiting it as a column in the MatchEntry
table instead of forcing it to go through classification and
everything else. Making it be classified caused tblgen to
produce a ton of one-off classes for each mneumonic. This
should reduce the size of the generated matcher significantly
while paving the way for future improvements.
llvm-svn: 113169
2010-09-06 21:01:37 +00:00
Chris Lattner
72d2fb8001
The "ambiguous instructions" check only produces anything with -debug,
...
so only do the N^2 loop with debug mode.
llvm-svn: 113168
2010-09-06 20:21:47 +00:00
Chris Lattner
87234fd589
simplify the hacks around jrcxz.
...
llvm-svn: 113167
2010-09-06 20:10:12 +00:00
Chris Lattner
68f7c5b750
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).
llvm-svn: 113166
2010-09-06 20:08:02 +00:00
Chris Lattner
22bb9cb511
change MatchInstructionImpl to return an enum instead of bool.
...
llvm-svn: 113165
2010-09-06 19:22:17 +00:00
Chris Lattner
faf356777a
add note
...
llvm-svn: 113164
2010-09-06 19:14:40 +00:00
Chris Lattner
45a204be76
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.
llvm-svn: 113163
2010-09-06 19:11:01 +00:00
Eric Christopher
fa4de56909
Regenerate.
...
llvm-svn: 113160
2010-09-06 18:47:10 +00:00
Eric Christopher
b26776adb4
Update to 2.9 post-2.8 branch.
...
llvm-svn: 113159
2010-09-06 18:47:00 +00:00
Roman Divacky
f760edb301
Redefine LOOP* instructions from I to Ii8PCRel as they take an i8 argument.
...
llvm-svn: 113158
2010-09-06 18:43:14 +00:00
Chris Lattner
3bd0996c77
random cleanups
...
llvm-svn: 113157
2010-09-06 18:32:06 +00:00
Benjamin Kramer
2447226e73
MCELF: Align symtab, relocation sections and section headers properly. Patch by Krister Wombell.
...
llvm-svn: 113155
2010-09-06 16:11:52 +00:00
Chris Lattner
7cd17a7a4a
compute the HasSSE3 bit correctly, patch by Nikolai Saoukh.
...
llvm-svn: 113147
2010-09-06 05:19:44 +00:00
Chris Lattner
6e6a535055
fix PR8067, an over-aggressive assertion in LICM.
...
llvm-svn: 113146
2010-09-06 05:11:24 +00:00
Chris Lattner
1f45ad0aba
emit the LLVM intrinsic name -> intrinsic number mapping table with
...
StringMatcher instead of a linear sequence of memcmps.
llvm-svn: 113145
2010-09-06 03:58:45 +00:00
Chris Lattner
cec733bec6
cleanup some of the lifetime/invariant marker stuff, add a big fixme.
...
llvm-svn: 113144
2010-09-06 03:58:04 +00:00
Chris Lattner
8615b37209
allow specifying an indentation level for the string matcher.
...
llvm-svn: 113143
2010-09-06 03:50:59 +00:00
Chris Lattner
8d0ee62652
emit the __builtin -> intrinsic map with StringMatcher instead of a
...
copy of a close relative of it.
llvm-svn: 113142
2010-09-06 03:14:45 +00:00
Chris Lattner
81f696e142
same bug, another place.
...
llvm-svn: 113141
2010-09-06 03:12:27 +00:00
Chris Lattner
6075477174
fix a critical bug where the generated table would say
...
"1 strings to match" in a comment, which isn't gramatic.
llvm-svn: 113140
2010-09-06 03:11:10 +00:00
Chris Lattner
b58e070f0c
update cmake
...
llvm-svn: 113139
2010-09-06 02:58:25 +00:00
Chris Lattner
df487455cb
factor the snazzy string matcher code that Daniel hates
...
out of AsmMatcherEmitter.cpp into its own class.
llvm-svn: 113137
2010-09-06 02:01:51 +00:00
Chris Lattner
9feb462669
slightly improve the runtime and code size of the Intrinsics info table by not
...
comparing the "llvm." prefix in the memcmp, and not storing it in the string literal.
llvm-svn: 113136
2010-09-06 01:44:44 +00:00
Chris Lattner
7576ffb974
speed up -gvn 3.4% on the testcase in PR7023
...
llvm-svn: 113135
2010-09-06 01:26:29 +00:00
Chris Lattner
4100881939
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.
llvm-svn: 113134
2010-09-06 01:10:22 +00:00
Chris Lattner
818045f208
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.
llvm-svn: 113133
2010-09-06 01:05:37 +00:00
Chris Lattner
df0d49314e
fit in 80 columns and don't crash on exit, fixes PR8080
...
llvm-svn: 113123
2010-09-05 23:09:30 +00:00
Chris Lattner
c0e5368884
remove some dead code. t2addrmode_imm8s4 is never used in a
...
pattern, so there is no need to define a matching function.
llvm-svn: 113122
2010-09-05 22:51:11 +00:00
Chris Lattner
92429b2601
fix inconsistent formatting.
...
llvm-svn: 113121
2010-09-05 22:43:56 +00:00
Chris Lattner
0bae45de26
cleanups: mark stuff static, only tagdecls should be in anon namespaces.
...
llvm-svn: 113120
2010-09-05 21:25:43 +00:00
Chris Lattner
bd47c48735
cleanups.
...
llvm-svn: 113119
2010-09-05 21:18:45 +00:00
Chris Lattner
091212f130
some random notes.
...
llvm-svn: 113118
2010-09-05 20:49:45 +00:00
Chris Lattner
6c08c3b321
add a comment about where this should eventually move.
...
llvm-svn: 113117
2010-09-05 20:33:40 +00:00
Chris Lattner
908d8e9de2
update this.
...
llvm-svn: 113116
2010-09-05 20:22:09 +00:00
Chris Lattner
e54b9e2332
more cleanups
...
llvm-svn: 113115
2010-09-05 20:13:07 +00:00
Chris Lattner
41d0913a1d
Change lower atomic pass to use IntrinsicInst to simplify it a bit.
...
llvm-svn: 113114
2010-09-05 20:10:47 +00:00
Chris Lattner
fc6bf7cb34
eliminate some non-obvious casts. UndefValue isa Constant.
...
llvm-svn: 113113
2010-09-05 20:03:09 +00:00
Chris Lattner
4dccd368f3
fix PR8063, a crash in globalopt in the malloc analysis code.
...
llvm-svn: 113109
2010-09-05 17:20:46 +00:00
Lang Hames
af037cded6
Added initialisers for reduction rule counters.
...
llvm-svn: 113108
2010-09-05 13:42:32 +00:00
Nick Lewycky
d48f0c5718
Fix warning reported by MSVC++ builder.
...
llvm-svn: 113106
2010-09-05 09:11:38 +00:00
Nick Lewycky
97d03432c5
Switch FnSet to containing the ComparableFunction instead of a pointer to one.
...
This reduces malloc traffic (yay!) and removes MergeFunctionsEqualityInfo.
llvm-svn: 113105
2010-09-05 09:00:32 +00:00