-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[VectorCombine] Fix scalarizeExtExtract for big-endian #157962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
1e1ef6c
8f8e444
75d1625
d4a1421
97ebb99
fd77ffb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: opt -passes='vector-combine,dce' -S -mtriple=aarch64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefix=LE | ||
|
||
; RUN: opt -passes='vector-combine,dce' -S -mtriple=aarch64_be-unknown-linux-gnu %s -o - | FileCheck %s --check-prefix=BE | ||
|
||
define i64 @g(<8 x i8> %v) { | ||
RKSimon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
%z = zext <8 x i8> %v to <8 x i64> | ||
%e0 = extractelement <8 x i64> %z, i32 0 | ||
%e7 = extractelement <8 x i64> %z, i32 7 | ||
%sum = add i64 %e0, %e7 | ||
ret i64 %sum | ||
} | ||
|
||
; LE-LABEL: @g( | ||
; LE: bitcast <8 x i8> %{{.*}} to i64 | ||
; LE: lshr i64 %{{.*}}, 56 | ||
; LE: and i64 %{{.*}}, 255 | ||
; LE-NOT: extractelement | ||
|
||
; BE-LABEL: @g( | ||
; BE: bitcast <8 x i8> %{{.*}} to i64 | ||
; BE: and i64 %{{.*}}, 255 | ||
; BE: lshr i64 %{{.*}}, 56 | ||
; BE-NOT: extractelement | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: opt -passes='vector-combine,dce' -S -mtriple=aarch64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefix=LE | ||
; RUN: opt -passes='vector-combine,dce' -S -mtriple=powerpc64-ibm-aix-xcoff %s -o - | FileCheck %s --check-prefix=BE | ||
|
||
RKSimon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
define i64 @g(<8 x i8> %v) { | ||
%z = zext <8 x i8> %v to <8 x i64> | ||
%e0 = extractelement <8 x i64> %z, i32 0 | ||
%e7 = extractelement <8 x i64> %z, i32 7 | ||
%sum = add i64 %e0, %e7 | ||
ret i64 %sum | ||
} | ||
|
||
; LE-LABEL: @g( | ||
; LE: bitcast <8 x i8> %{{.*}} to i64 | ||
; LE: lshr i64 %{{.*}}, 56 | ||
; LE: and i64 %{{.*}}, 255 | ||
; LE-NOT: extractelement | ||
|
||
; BE-LABEL: @g( | ||
; BE: bitcast <8 x i8> %{{.*}} to i64 | ||
; BE: and i64 %{{.*}}, 255 | ||
; BE: lshr i64 %{{.*}}, 56 | ||
; BE-NOT: extractelement | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format this bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done thanks