-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SLP]Fix PR89635: do not try to vectorize single-gather alternate node.
No need to try to vectorize single gather/buildvector with alternate opcode graph, it is not profitable. In other cases, need to use last instruction for inserting the vectorized code.
- Loading branch information
1 parent
e0a763c
commit b4a0fd4
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
llvm/test/Transforms/SLPVectorizer/X86/alternate-opcode-sindle-bv.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4 | ||
; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s | ||
|
||
define <2 x i32> @test(i32 %arg) { | ||
; CHECK-LABEL: define <2 x i32> @test( | ||
; CHECK-SAME: i32 [[ARG:%.*]]) { | ||
; CHECK-NEXT: bb: | ||
; CHECK-NEXT: [[OR:%.*]] = or i32 [[ARG]], 0 | ||
; CHECK-NEXT: [[MUL:%.*]] = mul i32 0, 1 | ||
; CHECK-NEXT: [[MUL1:%.*]] = mul i32 [[OR]], [[MUL]] | ||
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i32 0, [[MUL1]] | ||
; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> poison, i32 [[OR]], i32 0 | ||
; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i32> [[TMP0]], i32 [[MUL]], i32 1 | ||
; CHECK-NEXT: ret <2 x i32> [[TMP1]] | ||
; | ||
bb: | ||
%or = or i32 %arg, 0 | ||
%mul = mul i32 0, 1 | ||
%mul1 = mul i32 %or, %mul | ||
%cmp = icmp ugt i32 0, %mul1 | ||
%0 = insertelement <2 x i32> poison, i32 %or, i32 0 | ||
%1 = insertelement <2 x i32> %0, i32 %mul, i32 1 | ||
ret <2 x i32> %1 | ||
} | ||
|