Commit Graph

6351 Commits

Author SHA1 Message Date
Mon P Wang
a7b6cff99f If unsafe FP optimization is not set, don't allow -(A-B) => B-A because
when A==B, -0.0 != +0.0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63474 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-31 06:07:45 +00:00
Chris Lattner
2e0d5f8432 Simplify and generalize the SROA "convert to scalar" transformation to
be able to handle *ANY* alloca that is poked by loads and stores of 
bitcasts and GEPs with constant offsets.  Before the code had a number
of annoying limitations and caused it to miss cases such as storing into
holes in structs and complex casts (as in bitfield-sroa) where we had
unions of bitfields etc.  This also handles a number of important cases
that are exposed due to the ABI lowering stuff we do to pass stuff by
value.

One case that is pretty great is that we compile 
2006-11-07-InvalidArrayPromote.ll into:

define i32 @func(<4 x float> %v0, <4 x float> %v1) nounwind {
	%tmp10 = call <4 x i32> @llvm.x86.sse2.cvttps2dq(<4 x float> %v1)
	%tmp105 = bitcast <4 x i32> %tmp10 to i128
	%tmp1056 = zext i128 %tmp105 to i256	
	%tmp.upgrd.43 = lshr i256 %tmp1056, 96
	%tmp.upgrd.44 = trunc i256 %tmp.upgrd.43 to i32	
	ret i32 %tmp.upgrd.44
}

which turns into:

_func:
	subl	$28, %esp
	cvttps2dq	%xmm1, %xmm0
	movaps	%xmm0, (%esp)
	movl	12(%esp), %eax
	addl	$28, %esp
	ret

Which is pretty good code all things considering :).

One effect of this is that SROA will start generating arbitrary bitwidth 
integers that are a multiple of 8 bits.  In the case above, we got a 
256 bit integer, but the codegen guys assure me that it can handle the 
simple and/or/shift/zext stuff that we're doing on these operations.

This addresses rdar://6532315



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-31 02:28:54 +00:00
Devang Patel
dd9db66882 Each input file is encoded as a separate compile unit in LLVM debugging
information output. However, many target specific tool chains prefer to encode
only one compile unit in an object file. In this situation, the LLVM code
generator will include  debugging information entities in the compile unit 
that is marked as main compile unit. The code generator accepts maximum one main
compile unit per module. If a module does not contain any main compile unit 
then the code generator will emit multiple compile units in the output object 
file.

[Part 1]

Update DebugInfo APIs to accept optional boolean value while creating DICompileUnit  to mark the unit as "main" unit. By defaults all units are considered  non-main.  Update SourceLevelDebugging.html to document "main" compile unit.

Update DebugInfo APIs to not accept and encode separate source file/directory entries while creating various llvm.dbg.* entities. There was a recent, yet to be documented, change to include this additional information so no documentation changes are required here.

Update DwarfDebug to handle "main" compile unit. If "main" compile unit is seen then all DIEs are inserted into "main" compile unit. All other compile units are used to find source location for llvm.dbg.* values. If there is not any "main" compile unit then create unique compile unit DIEs for each llvm.dbg.compile_unit.

[Part 2]

Create separate llvm.dbg.compile_unit for each input file. Mark compile unit create for main_input_filename as "main" compile unit. Use appropriate compile unit, based on source location information collected from the tree node, while creating llvm.dbg.* values using DebugInfo APIs.

---

This is Part 1.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 18:20:31 +00:00
Zhou Sheng
1ff06b231f This is case is to uncover the bug in IntrinsicLowering.cpp,
the LowerPartSet(). It didn't handle the situation correctly when 
the low, high argument values are in reverse order (low > high) 
with 'Val' type is i32 (a corner case).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 08:59:51 +00:00
Devang Patel
5585db0c6e Enable target tripple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 01:40:58 +00:00
Devang Patel
de9e4ce24a Linux and other target's encoding for DW_AT_declaration may not match.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 01:37:30 +00:00
Devang Patel
d234e59e57 Add DW_AT_declaration for class methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 01:21:46 +00:00
Owen Anderson
af399a6ffe XFAIL this test. It only worked before because of a bug in the spill point selection code. Not deleting because
it should be possible to enhance the selection code to handle this in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 22:27:56 +00:00
Evan Cheng
d5a4802708 Local register allocator shouldn't assume only the entry and landing pad basic blocks have live-ins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 18:37:30 +00:00
Dan Gohman
197e88f796 In the case of an extractelement on an insertelement value,
the element indices may be equal if either one is not a
constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63311 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 16:10:46 +00:00
Evan Cheng
b691b704ad Add a always_inline test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63304 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 09:31:54 +00:00
Evan Cheng
6db3612cc6 Add a test case for Chris lvalue alignment fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63300 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 08:59:46 +00:00
Evan Cheng
5a3c6a87b0 Exit with nice warnings when register allocator run out of registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 02:20:59 +00:00
Dan Gohman
e5af2d3a22 Make x86's BT instruction matching more thorough, and add some
dagcombines that help it match in several more cases. Add
several more cases to test/CodeGen/X86/bt.ll. This doesn't
yet include matching for BT with an immediate operand, it
just covers more register+register cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 01:59:02 +00:00
Mon P Wang
e91a000889 Fixed lowering of v816 shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 23:11:14 +00:00
Bill Wendling
7540561097 Make test platform agnostic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 22:20:56 +00:00
Dan Gohman
ef42a3b878 Give this test an explicit target, to make it host-independent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63244 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 22:14:58 +00:00
Devang Patel
f923574856 Do not forget to derived type while constructing an array type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 21:08:20 +00:00
Chris Lattner
6e733d34ca Fix some issues with volatility, move "CanConvertToScalar" check
after the others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 20:16:43 +00:00
Chris Lattner
6c8e35fd97 strengthen this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63222 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 19:29:30 +00:00
Evan Cheng
1632782fe9 The memory alignment requirement on some of the mov{h|l}p{d|s} patterns are 16-byte. That is overly strict. These instructions read / write f64 memory locations without alignment requirement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63195 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 08:35:02 +00:00
Mon P Wang
f4646d9902 Added sse test patterns for r62979 and r63193.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 08:13:56 +00:00
Mikhail Glushenkov
19d3e82905 Add three new option properties.
Adds new option properties 'multi_val', 'one_or_more' and 'zero_or_one'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 03:47:20 +00:00
Bill Wendling
ac7de20a49 Add testcase for r63142.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63149 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 23:00:53 +00:00
Evan Cheng
6a86bd71df Implement multiple with overflow by 2 with an add instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63090 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 03:30:42 +00:00
Evan Cheng
ccc497f152 Forgot this test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 02:59:39 +00:00
Dan Gohman
49237f04a8 Add a FrontendC testcase for the x86-64 Red Zone feature,
to help verify that the feature may be disabled through
the -mno-red-zone option.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 00:59:55 +00:00
Devang Patel
ad165bec1d Assorted debug info fixes.
- DW_AT_bit_size is only suitable for bitfields.
- Encode source location info for derived types.
- Source location and type size info is not useful for subroutine_type (info is included in respective DISubprogram) and array_type.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 00:45:04 +00:00
Dan Gohman
4e1fae5125 Add a regression test for x86-64 red zone usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63075 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 00:40:27 +00:00
Dale Johannesen
8bca3b7664 Testcase for 6522054.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 23:22:19 +00:00
Duncan Sands
5bb11b89dd Fix PR3393, which amounts to a bug in the expensive
checking logic.  Rather than make the checking more
complicated, I've tweaked some logic to make things
conform to how the checking thought things ought to
be, since this results in a simpler "mental model".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63048 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 21:54:18 +00:00
Dan Gohman
4699934647 At Nick Lewycky's request, rename this test with a more informative name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 21:36:31 +00:00
Evan Cheng
5b2e5893c6 Enhance logic in X86DAGToDAGISel::PreprocessForRMW which move load inside callseq_start to allow it to be folded into a call. It was not considering the cases where a token factor is between the load and the callseq_start.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 18:43:34 +00:00
Mon P Wang
fe6d2cd9d1 Fixed optimization of combining two shuffles where the first shuffle inputs
has a different number of elements than the output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62998 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 04:39:00 +00:00
Scott Michel
c9c8b2a804 CellSPU:
- Rename fcmp.ll test to fcmp32.ll, start adding new double tests to fcmp64.ll
- Fix select_bits.ll test
- Capitulate to the DAGCombiner and move i64 constant loads to instruction
  selection (SPUISelDAGtoDAG.cpp).

  <rant>DAGCombiner will insert all kinds of 64-bit optimizations after
  operation legalization occurs and now we have to do most of the work that
  instruction selection should be doing twice (once to determine if v2i64
  build_vector can be handled by SelectCode(), which then runs all of the
  predicates a second time to select the necessary instructions.) But,
  CellSPU is a good citizen.</rant>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 03:31:40 +00:00
Chris Lattner
18f02318a6 Handle single-entry phi nodes gracefully in condprop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 02:18:20 +00:00
Chris Lattner
3796a262c5 Fix PR3408 by making a non-obvious assumption very obvious, and
handling the flaw inherent in that assumption.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 02:11:30 +00:00
Nate Begeman
51a0437b16 Map address space 256 to gs; similar mappings could be supported for the
other x86 segments.  address space 0 is stack/default, 1-255 are reserved for
client use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62980 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 01:24:32 +00:00
Torok Edwin
c8ad2d2abf revert this patch for now, because Codegen does still want to generate SSE code,
for example in the case of va-args. XFAIL associated tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62972 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-25 20:21:24 +00:00
Torok Edwin
a10b879b4c testcase for llvm-gcc part of PR3402.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-25 18:00:06 +00:00
Torok Edwin
7f1d5252c7 If user explicitly asks not to use SSE, don't force it. This fixes LLVM part of PR3402.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62967 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-25 17:58:56 +00:00
Nick Lewycky
67e1f49a50 Actually run the test in this directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-25 08:05:07 +00:00
Nick Lewycky
9d4979123e The function that does nothing but call malloc is noalias return.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62956 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-25 07:59:57 +00:00
Evan Cheng
1902a129a5 Private linkage support for PPC / Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-25 06:32:01 +00:00
Evan Cheng
d498c8f2c8 Teach 2addr pass to be do more commuting. If both uses of a two-address instruction are killed, but the first operand has a use before and after the def, commute if the second operand does not suffer from the same issue.
%reg1028<def> = EXTRACT_SUBREG %reg1027<kill>, 1                                                                                                                                     
%reg1029<def> = MOV8rr %reg1028                                                                                                                                                      
%reg1029<def> = SHR8ri %reg1029, 7, %EFLAGS<imp-def,dead>                                                                                                                            
insert => %reg1030<def> = MOV8rr %reg1028                                                                                                                                            
%reg1030<def> = ADD8rr %reg1028<kill>, %reg1029<kill>, %EFLAGS<imp-def,dead>                                                                                                         

In this case, it might not be possible to coalesce the second MOV8rr                                                                                                                 
instruction if the first one is coalesced. So it would be profitable to                                                                                                              
commute it:                                                                                                                                                                          
%reg1028<def> = EXTRACT_SUBREG %reg1027<kill>, 1                                                                                                                                     
%reg1029<def> = MOV8rr %reg1028                                                                                                                                                      
%reg1029<def> = SHR8ri %reg1029, 7, %EFLAGS<imp-def,dead>                                                                                                                            
insert => %reg1030<def> = MOV8rr %reg1029                                                                                                                                            
%reg1030<def> = ADD8rr %reg1029<kill>, %reg1028<kill>, %EFLAGS<imp-def,dead>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62954 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-25 03:53:59 +00:00
Dan Gohman
54e853a779 Add a PR comment to this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24 17:32:54 +00:00
Torok Edwin
08ffee539e testcase for PR3381.
Also it was an empty struct, not a void after all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24 17:16:04 +00:00
Chris Lattner
3914f721cc Make InstCombineStoreToCast handle aggregates more aggressively,
handling the case in Transforms/InstCombine/cast-store-gep.ll, which
is a heavily reduced testcase from Clang on x86-64.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24 01:00:13 +00:00
Devang Patel
e591b202b9 Fix test case. Use valid file name and directory in global variable's debug info entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62883 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 21:54:18 +00:00
Chris Lattner
95900f2dda fix two more cases where we could let the NLPDI cache get unsorted.
With this, sqlite3 now passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62839 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 07:12:16 +00:00