Manman Ren
2a5898a76b
ARM: properly handle alignment for struct byval.
...
Factor out the expansion code into a function.
This change is to be enabled in clang.
rdar://9877866
llvm-svn: 157830
2012-06-01 19:33:18 +00:00
Jakob Stoklund Olesen
ed19f92618
Properly constrain register classes for sub-registers.
...
Not all GR64 registers have sub_8bit sub-registers.
llvm-svn: 157150
2012-05-20 06:38:37 +00:00
Chad Rosier
dba9908c4b
Revert 156658.
...
llvm-svn: 156662
2012-05-11 23:21:01 +00:00
Chad Rosier
20f6e62e43
[fast-isel] Fast-isel doesn't use the expect intrinsic.
...
llvm-svn: 156658
2012-05-11 23:10:58 +00:00
Eric Christopher
ec1405e930
To ensure that we have more accurate line information for a block
...
don't elide the branch instruction if it's the only one in the block,
otherwise it's ok.
PR9796 and rdar://11215207
llvm-svn: 154417
2012-04-10 18:18:10 +00:00
Bill Wendling
c6f065c054
If we have a VLA that has a "use" in a metadata node that's then used
...
here but it has no other uses, then we have a problem. E.g.,
int foo (const int *x) {
char a[*x];
return 0;
}
If we assign 'a' a vreg and fast isel later on has to use the selection
DAG isel, it will want to copy the value to the vreg. However, there are
no uses, which goes counter to what selection DAG isel expects.
<rdar://problem/11134152>
llvm-svn: 153705
2012-03-30 00:02:55 +00:00
Chad Rosier
ce3a78be60
[fast-isel] Fold "urem x, pow2" -> "and x, pow2-1". This should fix the 271%
...
execution-time regression for nsieve-bits on the ARMv7 -O0 -g nightly tester.
This may also improve compile-time on architectures that would otherwise
generate a libcall for urem (e.g., ARM) or fall back to the DAG selector.
rdar://10810716
llvm-svn: 153230
2012-03-22 00:21:17 +00:00
Eric Christopher
fea2d0f83a
Do everything up to generating code to try to get a register for
...
a variable. The previous code would break the debug info changing
code invariant. This will regress debug info for arguments where
we elide the alloca created.
Fixes rdar://11066468
llvm-svn: 153074
2012-03-20 01:07:58 +00:00
Eric Christopher
0a61365e70
Untabify.
...
llvm-svn: 153073
2012-03-20 01:07:56 +00:00
Eric Christopher
9907ef1870
Add another debugging statement here.
...
llvm-svn: 153072
2012-03-20 01:07:53 +00:00
Eric Christopher
1829ce5f46
Use lookUpRegForValue here instead of duplicating the code.
...
llvm-svn: 153071
2012-03-20 01:07:47 +00:00
Eric Christopher
b5497338fa
We actually handle AllocaInst via getRegForValue below just fine.
...
Part of rdar://8905263
llvm-svn: 152845
2012-03-15 21:33:47 +00:00
Eric Christopher
f744ea65be
Add some debugging output into fast isel as well.
...
llvm-svn: 152844
2012-03-15 21:33:44 +00:00
Michael J. Spencer
24f6d49962
Properly emit _fltused with FastISel. Refactor to share code with SDAG.
...
Patch by Joe Groff!
llvm-svn: 151183
2012-02-22 19:06:13 +00:00
Craig Topper
3ed929de0a
Make all pointers to TargetRegisterClass const since they are all pointers to static data that should not be modified.
...
llvm-svn: 151134
2012-02-22 05:59:10 +00:00
Eric Christopher
325985565a
Ignore the lifetime intrinsics in fast-isel.
...
llvm-svn: 150848
2012-02-17 23:03:39 +00:00
Chad Rosier
ec3053c33c
[fast-isel] HandlePHINodesInSuccessorBlocks() can promite i8 and i16 types too.
...
llvm-svn: 149730
2012-02-04 00:39:19 +00:00
Bill Wendling
fadeb75339
Remove the now-dead llvm.eh.exception and llvm.eh.selector intrinsics.
...
llvm-svn: 149331
2012-01-31 01:58:48 +00:00
Chad Rosier
281f9442f3
[fast-isel] Remove SelectInsertValue() as fast-isel wasn't designed to handle
...
instructions that define aggregate types.
llvm-svn: 146492
2011-12-13 17:45:06 +00:00
Chad Rosier
2cf6a76fd4
[fast-isel] SelectInsertValue seems to be causing miscompiles for ARM. Disable while I investigate.
...
llvm-svn: 146331
2011-12-10 21:27:40 +00:00
Chad Rosier
fa991ed762
Typo.
...
llvm-svn: 146327
2011-12-10 19:48:51 +00:00
Chad Rosier
7e0dc23863
[fast-isel] Add support for selecting insertvalue.
...
rdar://10530851
llvm-svn: 146276
2011-12-09 20:09:54 +00:00
Chad Rosier
0ff2f46d12
If fast-isel fails, remove dead instructions generated during the failed
...
attempt.
llvm-svn: 145425
2011-11-29 19:40:47 +00:00
Chad Rosier
a512a13c2c
80-column.
...
llvm-svn: 145267
2011-11-28 19:59:09 +00:00
Chad Rosier
2673f8862f
When fast iseling a GEP, accumulate the offset rather than emitting a series of
...
ADDs. MaxOffs is used as a threshold to limit the size of the offset. Tradeoffs
being: (1) If we can't materialize the large constant then we'll cause fast-isel
to bail. (2) Too large of an offset can't be directly encoded in the ADD
resulting in a MOV+ADD. Generally not a bad thing because otherwise we would
have had ADD+ADD, but on Thumb this turns into a MOVS+MOVT+ADD. Working on a fix
for that. (3) Conversely, too low of a threshold we'll miss opportunities to
coalesce ADDs.
rdar://10412592
llvm-svn: 144886
2011-11-17 07:15:58 +00:00
Chad Rosier
36cc01dbd3
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
71f1bbe1e7
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
5acb47274d
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
ba2d56b1ef
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
338df71d60
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
72886ba8d8
Revert r135423.
...
llvm-svn: 135454
2011-07-19 00:28:24 +00:00
Jeffrey Yasskin
2e0f2a0985
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
389cb9d8c6
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
e1fe7061ce
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
88fb4f4597
Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.
...
llvm-svn: 135040
2011-07-13 10:26:04 +00:00
Devang Patel
66c4bc1dda
Revert r133953 for now.
...
llvm-svn: 134116
2011-06-29 23:50:13 +00:00
Evan Cheng
4a169be530
- 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
8fbd4b55ea
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
91fee59b74
Handle debug info for i128 constants.
...
llvm-svn: 133821
2011-06-24 20:46:11 +00:00
Eli Friedman
69da49c53a
PR10077: fix fast-isel of extractvalue of aggregate constants.
...
llvm-svn: 132676
2011-06-06 05:46:34 +00:00
Eli Friedman
93ffb875ad
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
cb60e2293f
Make fast-isel work correctly s/uadd.with.overflow intrinsics.
...
llvm-svn: 131420
2011-05-16 21:06:17 +00:00
Eli Friedman
bd237ec411
Fix silly typo.
...
llvm-svn: 131419
2011-05-16 20:34:53 +00:00
Eli Friedman
5f1b7e4153
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
559f908ca7
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
35f6bae989
Allow FastISel of three-register-operand instructions.
...
llvm-svn: 130934
2011-05-05 17:59:04 +00:00
Eli Friedman
919bf1ca71
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
86181251f3
Fix a silly mistake in r130338.
...
llvm-svn: 130360
2011-04-28 00:42:03 +00:00
Eli Friedman
c5406cdb50
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
fc1152d772
Remove unused function.
...
llvm-svn: 130337
2011-04-27 22:21:02 +00:00