File tree Expand file tree Collapse file tree 3 files changed +25
-3
lines changed
test/Transforms/VectorCombine Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -2021,8 +2021,7 @@ bool VectorCombine::scalarizeExtExtract(Instruction &I) {
20212021 uint64_t ShiftAmt = DL->isBigEndian ()
20222022 ? (TotalBits - SrcEltSizeInBits - Idx * SrcEltSizeInBits)
20232023 : (Idx * SrcEltSizeInBits);
2024- Value *ShAmtVal = ConstantInt::get (PackedTy, ShiftAmt);
2025- Value *LShr = Builder.CreateLShr (ScalarV, ShAmtVal);
2024+ Value *LShr = Builder.CreateLShr (ScalarV, ShiftAmt);
20262025 Value *And = Builder.CreateAnd (LShr, Mask);
20272026 U->replaceAllUsesWith (And);
20282027 }
Original file line number Diff line number Diff line change 11; RUN: opt -passes='vector-combine,dce' -S -mtriple=aarch64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefix=LE
2- ; RUN: opt -passes='vector-combine,dce' -S -mtriple=powerpc64-ibm-aix-xcoff %s -o - | FileCheck %s --check-prefix=BE
2+ ; RUN: opt -passes='vector-combine,dce' -S -mtriple=aarch64_be-unknown-linux-gnu %s -o - | FileCheck %s --check-prefix=BE
33
44define i64 @g (<8 x i8 > %v ) {
55 %z = zext <8 x i8 > %v to <8 x i64 >
Original file line number Diff line number Diff line change 1+ ; RUN: opt -passes='vector-combine,dce' -S -mtriple=aarch64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefix=LE
2+ ; RUN: opt -passes='vector-combine,dce' -S -mtriple=powerpc64-ibm-aix-xcoff %s -o - | FileCheck %s --check-prefix=BE
3+
4+ define i64 @g (<8 x i8 > %v ) {
5+ %z = zext <8 x i8 > %v to <8 x i64 >
6+ %e0 = extractelement <8 x i64 > %z , i32 0
7+ %e7 = extractelement <8 x i64 > %z , i32 7
8+ %sum = add i64 %e0 , %e7
9+ ret i64 %sum
10+ }
11+
12+ ; LE-LABEL: @g(
13+ ; LE: bitcast <8 x i8> %{{.*}} to i64
14+ ; LE: lshr i64 %{{.*}}, 56
15+ ; LE: and i64 %{{.*}}, 255
16+ ; LE-NOT: extractelement
17+
18+ ; BE-LABEL: @g(
19+ ; BE: bitcast <8 x i8> %{{.*}} to i64
20+ ; BE: and i64 %{{.*}}, 255
21+ ; BE: lshr i64 %{{.*}}, 56
22+ ; BE-NOT: extractelement
23+
You can’t perform that action at this time.
0 commit comments