diff options
author | Chris Lattner <sabre@nondot.org> | 2010-07-29 05:02:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-07-29 05:02:29 +0000 |
commit | 15842bd05bd6d3b7450385ac8f73aaee5f807e19 (patch) | |
tree | e638a87f784e96c7924c53ca4086fef6a18ae362 /test | |
parent | 0f408f5242522cbede304472e17931357c1b573d (diff) |
ignore structs that wrap vectors in IR, the abstraction shouldn't add penalty.
Before we'd compile the example into something like:
%coerce.dive2 = getelementptr %struct.v4f32wrapper* %retval, i32 0, i32 0 ; <<4 x float>*> [#uses=1]
%1 = bitcast <4 x float>* %coerce.dive2 to <2 x double>* ; <<2 x double>*> [#uses=1]
%2 = load <2 x double>* %1, align 1 ; <<2 x double>> [#uses=1]
ret <2 x double> %2
Now we produce:
%coerce.dive2 = getelementptr %struct.v4f32wrapper* %retval, i32 0, i32 0 ; <<4 x float>*> [#uses=1]
%0 = load <4 x float>* %coerce.dive2, align 1 ; <<4 x float>> [#uses=1]
ret <4 x float> %0
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/x86_64-arguments.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGen/x86_64-arguments.c b/test/CodeGen/x86_64-arguments.c index ed1c9f165a..04447c12d9 100644 --- a/test/CodeGen/x86_64-arguments.c +++ b/test/CodeGen/x86_64-arguments.c @@ -168,3 +168,13 @@ struct foo26 f26(struct foo26 *P) { // CHECK: define %struct.foo26 @f26(%struct.foo26* %P) return *P; } + + +struct v4f32wrapper { + v4f32 v; +}; + +struct v4f32wrapper f27(struct v4f32wrapper X) { + // CHECK: define <4 x float> @f27(<4 x float> %X.coerce) + return X; +}
\ No newline at end of file |