Commit Graph

13 Commits

Author SHA1 Message Date
John McCall d2bfe4b73e In swiftcall, don't merge FP/vector types within a chunk.
llvm-svn: 345536
2018-10-29 20:32:36 +00:00
Akira Hatanaka 673af7a688 Generalize NRVO to cover C structs.
This commit generalizes NRVO to cover C structs (both trivial and
non-trivial structs).

rdar://problem/33599681

Differential Revision: https://reviews.llvm.org/D44968

llvm-svn: 328809
2018-03-29 17:56:24 +00:00
George Burgess IV 5701606165 Fix a typo from r326844; NFC
llvm-svn: 326845
2018-03-06 23:09:01 +00:00
George Burgess IV 7e03f350e8 [CodeGen] Don't emit lifetime.end without lifetime.start
EmitLifetimeStart returns a non-null `size` pointer if it actually
emits a lifetime.start. Later in this function, we use `tempSize`'s
nullness to determine whether or not we should emit a lifetime.end.

llvm-svn: 326844
2018-03-06 23:07:00 +00:00
Daniel Neilson 6e938effaa Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Summary:
  Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the Clang tests for this change.

  The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.

 This change removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.

 For example, code which used to read:
   call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)

 At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.

llvm-svn: 322964
2018-01-19 17:12:54 +00:00
Arnold Schwaighofer 7b871611b9 SwiftCC: Perform physical layout when computing coercion types
We need to take type alignment padding into account whe computing physical
layouts.

The layout must be compatible with the input layout, offsets are defined in
terms of offsets within a packed struct which are computed in terms of the alloc
size of a type.

Usingthe store size we would insert padding for the following type for example:

struct {

  int3 v;
  long long l;
} __attribute((packed))

On x86-64 int3 is padded to int4 alignment. The swiftcc type would be
<{ <3 x float>, [4 x i8], i64 }> which is not compatible with <{ <3 x float>,
i64 }>.

The latter has i64 at offset 16 and the former at offset 20.

rdar://32618125

llvm-svn: 305956
2017-06-21 21:43:40 +00:00
Arnold Schwaighofer 634e320376 CodeGen: Define Swift's legal vector types for AArch64, ARM
rdar://32401301

llvm-svn: 304017
2017-05-26 18:11:54 +00:00
Reid Kleckner afd7b69658 Revert "Disable swiftcall test on windows: More brutal way to appease windows bots"
This reverts commit r284174. The tests pass for me locally. It must have
been a 2015 only crash.

Fixes PR30699

llvm-svn: 284781
2016-10-20 21:17:28 +00:00
Arnold Schwaighofer b715eb4504 Add more swift calling convention tests
llvm-svn: 284285
2016-10-14 21:55:56 +00:00
Arnold Schwaighofer 18fad46fe3 Disable swiftcall test on windows: More brutal way to appease windows bots
The backtrace on the bot does not give me any indication what is wrong.
The test case interestingly passes in stage2 of the build.
I don't have a way of debugging this.

Disable the test on windows and hope if there is truly a bug in the code that
was causing we will eventually run into this on other platforms.

llvm-svn: 284174
2016-10-13 22:47:03 +00:00
Arnold Schwaighofer c45025e763 Add required targets to tests to (hopefully) appease bots
llvm-svn: 284162
2016-10-13 20:59:23 +00:00
Arnold Schwaighofer 3d01ad116c Swift Calling Convention: Fix out of bounds access
Use iterator instead of address of element in vector

It is not valid to access one after the last element.

rdar://28759508

llvm-svn: 284150
2016-10-13 19:19:37 +00:00
Arnold Schwaighofer 2d556f2d06 Add more 64bit swiftcall convention tests
llvm-svn: 284133
2016-10-13 17:17:36 +00:00