Chad Rosier
ff40b1e164
Add fast-isel stats to determine who's doing all the work, the
...
target-independent selector or the target-specific selector.
llvm-svn: 144833
2011-11-16 21:05:28 +00:00
Chad Rosier
291ce47db7
GEPs with all zero indices are trivially coalesced by fast-isel. For example,
...
%arrayidx135 = getelementptr inbounds [4 x [4 x [4 x [4 x i32]]]]* %M0, i32 0, i64 0
%arrayidx136 = getelementptr inbounds [4 x [4 x [4 x i32]]]* %arrayidx135, i32 0, i64 %idxprom134
Prior to this commit, the GEP instruction that defines %arrayidx136 thought that
%arrayidx135 was a trivial kill. The GEP that defines %arrayidx135 doesn't
generate any code and thus %M0 gets folded into the second GEP. Thus, we need
to look through GEPs with all zero indices.
rdar://10443319
llvm-svn: 144730
2011-11-15 23:34:05 +00:00
Dan Gohman
de239d2647
Fix a thinko that Nick noticed. The previous code actually worked as
...
intended, but only by accident.
llvm-svn: 141779
2011-10-12 15:56:56 +00:00
Devang Patel
9d904e1a97
Directly point debug info to the stack slot of the arugment, instead of trying to keep track of vreg in which it the arugment is copied. The LiveDebugVariable can keep track of variable's ranges.
...
llvm-svn: 139330
2011-09-08 22:59:09 +00:00
Ivan Krasin
d7cbd4c518
FastISel: avoid function calls between the materialization of the constant and its use.
...
llvm-svn: 137993
2011-08-18 22:06:10 +00:00
Devang Patel
9ab3cac694
Revert r135423.
...
llvm-svn: 135454
2011-07-19 00:28:24 +00:00
Jeffrey Yasskin
7a16288157
Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ambiguity
...
errors like the one corrected by r135261. Migrate all LLVM callers of the old
constructor to the new one.
llvm-svn: 135431
2011-07-18 21:45:40 +00:00
Devang Patel
4dc76f2438
During bottom up fast-isel, instructions emitted to materalize registers are at top of basic block and do not have debug location. This may misguide debugger while entering the basic block and sometimes debugger provides semi useful view of current location to developer by picking up previous known location as current location. Assign a sensible location to the first instruction in a basic block, if it does not have one location derived from source file, so that debugger can provide meaningful user experience to developers in edge cases.
...
[take 2]
llvm-svn: 135423
2011-07-18 20:55:23 +00:00
Chris Lattner
229907cd11
land David Blaikie's patch to de-constify Type, with a few tweaks.
...
llvm-svn: 135375
2011-07-18 04:54:35 +00:00
Jay Foad
57aa636794
Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.
...
llvm-svn: 135040
2011-07-13 10:26:04 +00:00
Devang Patel
0eada03216
Revert r133953 for now.
...
llvm-svn: 134116
2011-06-29 23:50:13 +00:00
Evan Cheng
6cc775f905
- Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo and
...
sink them into MC layer.
- Added MCInstrInfo, which captures the tablegen generated static data. Chang
TargetInstrInfo so it's based off MCInstrInfo.
llvm-svn: 134021
2011-06-28 19:10:37 +00:00
Devang Patel
4dc034df1d
During bottom up fast-isel, instructions emitted to materalize registers are at top of basic block and do not have debug location. This may misguide debugger while entering the basic block and sometimes debugger provides semi useful view of current location to developer by picking up previous known location as current location. Assign a sensible location to the first instruction in a basic block, if it does not have one location derived from source file, so that debugger can provide meaningful user experience to developers in edge cases.
...
llvm-svn: 133953
2011-06-27 22:32:04 +00:00
Devang Patel
f071d72c44
Handle debug info for i128 constants.
...
llvm-svn: 133821
2011-06-24 20:46:11 +00:00
Eli Friedman
bd375f1a3f
PR10077: fix fast-isel of extractvalue of aggregate constants.
...
llvm-svn: 132676
2011-06-06 05:46:34 +00:00
Eli Friedman
c70355195c
Rewrite fast-isel integer cast handling to handle more cases, and to be simpler and more consistent.
...
The practical effects here are that x86-64 fast-isel can now handle trunc from i8 to i1, and ARM fast-isel can handle many more constructs involving integers narrower than 32 bits (including loads, stores, and many integer casts).
rdar://9437928 .
llvm-svn: 132099
2011-05-25 23:49:02 +00:00
Eli Friedman
a4d4a0162d
Make fast-isel work correctly s/uadd.with.overflow intrinsics.
...
llvm-svn: 131420
2011-05-16 21:06:17 +00:00
Eli Friedman
4c08bb450a
Fix silly typo.
...
llvm-svn: 131419
2011-05-16 20:34:53 +00:00
Eli Friedman
9ac944774f
Basic fast-isel of extractvalue. Not too helpful on its own, given the IR clang generates for cases like this, but it should become more useful soon.
...
llvm-svn: 131417
2011-05-16 20:27:46 +00:00
Eli Friedman
8f1e11cde9
Fix a FIXME by moving the fast-isel implementation of the objectsize intrinsic from the x86 code to the generic code.
...
llvm-svn: 131332
2011-05-14 00:47:51 +00:00
Owen Anderson
68b6b0efb0
Allow FastISel of three-register-operand instructions.
...
llvm-svn: 130934
2011-05-05 17:59:04 +00:00
Eli Friedman
4105ed1523
Make FastEmit_ri_ try a bit harder to succeed for supported operations; FastEmit_i can fail for non-Thumb2 ARM. Makes ARMSimplifyAddress work correctly, and reduces the number of fast-isel bailouts on non-Thumb ARM.
...
llvm-svn: 130560
2011-04-29 23:34:52 +00:00
Eli Friedman
33c133919a
Fix a silly mistake in r130338.
...
llvm-svn: 130360
2011-04-28 00:42:03 +00:00
Eli Friedman
406c471b69
Make the fast-isel code for literal 0.0 a bit shorter/faster, since 0.0 is common. rdar://problem/9303592 .
...
llvm-svn: 130338
2011-04-27 22:41:55 +00:00
Eli Friedman
121d27e9e4
Remove unused function.
...
llvm-svn: 130337
2011-04-27 22:21:02 +00:00
Dan Gohman
7da91aee83
Fast-isel support for simple inline asms.
...
llvm-svn: 130205
2011-04-26 17:18:34 +00:00
Owen Anderson
dd450b86cf
Teach FastISel to deal with instructions that have two immediate operands.
...
llvm-svn: 130033
2011-04-22 23:38:06 +00:00
Chris Lattner
91328b317b
Implement support for x86 fastisel of small fixed-sized memcpys, which are generated
...
en-mass for C++ PODs. On my c++ test file, this cuts the fast isel rejects by 10x
and shrinks the generated .s file by 5%
llvm-svn: 129755
2011-04-19 05:52:03 +00:00
Chris Lattner
48f75ad678
while we're at it, handle 'sdiv exact' of a power of 2 also,
...
this fixes a few rejects on c++ iterator loops.
llvm-svn: 129694
2011-04-18 07:00:40 +00:00
Chris Lattner
562d6e82bd
fix rdar://9297011 - udiv by power of two causing fast-isel rejects
...
llvm-svn: 129693
2011-04-18 06:55:51 +00:00
Chris Lattner
b53ccb8e36
1. merge fast-isel-shift-imm.ll into fast-isel-x86-64.ll
...
2. implement rdar://9289501 - fast isel should fold trivial multiplies to shifts
3. teach tblgen to handle shift immediates that are different sizes than the
shifted operands, eliminating some code from the X86 fast isel backend.
4. Have FastISel::SelectBinaryOp use (the poorly named) FastEmit_ri_ function
instead of FastEmit_ri to simplify code.
llvm-svn: 129666
2011-04-17 20:23:29 +00:00
Chris Lattner
fba7ca63cc
fix rdar://9289583 - fast isel should handle non-canonical commutative binops
...
allowing us to fold the immediate into the 'and' in this case:
int test1(int i) {
return 8&i;
}
llvm-svn: 129653
2011-04-17 01:16:47 +00:00
Chris Lattner
0ab5e2cded
Fix a ton of comment typos found by codespell. Patch by
...
Luis Felipe Strano Moraes!
llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Jay Foad
7c14a558fe
Don't include Operator.h from InstrTypes.h.
...
llvm-svn: 129271
2011-04-11 09:35:34 +00:00
Owen Anderson
66443c034d
Teach FastISel to support register-immediate-immediate instructions.
...
llvm-svn: 127496
2011-03-11 21:33:55 +00:00
Devang Patel
c24048a718
If dbg_declare() or dbg_value() is not lowered by isel then emit DEBUG message instead of creating DBG_VALUE for undefined value in reg0.
...
llvm-svn: 121059
2010-12-06 22:39:26 +00:00
Wesley Peck
527da1b6e2
Renaming ISD::BIT_CONVERT to ISD::BITCAST to better reflect the LLVM IR concept.
...
llvm-svn: 119990
2010-11-23 03:31:01 +00:00
Devang Patel
e4682fa8e2
Use frame index, if available for byval argument while lowering dbg_declare. Otherwise let getRegForValue() find register for this argument.
...
llvm-svn: 113843
2010-09-14 20:29:31 +00:00
Devang Patel
6095d818e5
Add DEBUG message.
...
llvm-svn: 113614
2010-09-10 20:32:09 +00:00
Eric Christopher
541f8012d9
Fix typo.
...
llvm-svn: 111223
2010-08-17 01:30:33 +00:00
Gabor Greif
dde79d8f1a
mass elimination of reliance on automatic iterator dereferencing
...
llvm-svn: 109103
2010-07-22 13:36:47 +00:00
Dan Gohman
b5e918dc05
After a custom inserter, in a block which has constant instructions,
...
update the current basic block in addition to the current insert
position, so that they remain consistent. This fixes rdar://8204072.
llvm-svn: 108765
2010-07-19 22:48:56 +00:00
Dan Gohman
1e936277c3
Revert r108369, sorting llvm.dbg.declare information by source position,
...
since it doesn't work for front-ends which don't emit column information
(which includes llvm-gcc in its present configuration), and doesn't
work for clang for K&R style variables where the variables are declared
in a different order from the parameter list.
Instead, make a separate pass through the instructions to collect the
llvm.dbg.declare instructions in order. This ensures that the debug
information for variables is emitted in this order.
llvm-svn: 108538
2010-07-16 17:54:27 +00:00
Dan Gohman
c12a6731c5
Properly restore DebugLoc after leaving the local constant area.
...
llvm-svn: 108364
2010-07-14 22:01:31 +00:00
Dan Gohman
042523340b
Delete fast-isel's trivial load optimization; it breaks debugging because
...
it can look past points where a debugger might modify user variables.
llvm-svn: 108336
2010-07-14 17:25:37 +00:00
Dan Gohman
1f471435f8
Don't propagate debug locations to instructions for materializing
...
constants, since they may not be emited near the other instructions
which get the same line, and this confuses debug info.
llvm-svn: 108302
2010-07-14 01:07:44 +00:00
Jakob Stoklund Olesen
51642aea77
Use COPY for fast-isel bitconvert, but don't create cross-class copies.
...
This doesn't change the behavior of SelectBitcast for X86.
llvm-svn: 108073
2010-07-11 05:16:54 +00:00
Jakob Stoklund Olesen
7147ab9e78
Use COPY for extracting ImplicitDef'ed values from fast-isel instructions.
...
This assumes that the registers can be copied which is probably a safe
assumption.
llvm-svn: 108070
2010-07-11 03:31:05 +00:00
Jakob Stoklund Olesen
3bb1267431
Use COPY in FastISel everywhere it is safe and trivial.
...
The remaining copyRegToReg calls actually check the return value (shock!), so we
cannot trivially replace them with COPY instructions.
llvm-svn: 108069
2010-07-11 03:31:00 +00:00
Dan Gohman
d7b5ce3312
Reapply bottom-up fast-isel, with several fixes for x86-32:
...
- Check getBytesToPopOnReturn().
- Eschew ST0 and ST1 for return values.
- Fix the PIC base register initialization so that it doesn't ever
fail to end up the top of the entry block.
llvm-svn: 108039
2010-07-10 09:00:22 +00:00