forked from GPUOpen-Drivers/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SystemZ] Don't create PERMUTE nodes with an undef operand.
It's better to reuse the first source value than to use an undef second operand, because that will make more resulting VPERMs have identical operands and therefore MachineCSE more successful. Review: Ulrich Weigand
- Loading branch information
Showing
3 changed files
with
32 additions
and
4 deletions.
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
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,27 @@ | ||
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s | ||
; | ||
; Test that only one vperm of the vector compare is needed for both extracts. | ||
|
||
define void @fun() { | ||
; CHECK-LABEL: fun | ||
; CHECK: vperm | ||
; CHECK-NOT: vperm | ||
bb: | ||
%tmp = load <4 x i8>, <4 x i8>* undef | ||
%tmp1 = icmp eq <4 x i8> zeroinitializer, %tmp | ||
%tmp2 = extractelement <4 x i1> %tmp1, i32 0 | ||
br i1 %tmp2, label %bb1, label %bb2 | ||
|
||
bb1: | ||
unreachable | ||
|
||
bb2: | ||
%tmp3 = extractelement <4 x i1> %tmp1, i32 1 | ||
br i1 %tmp3, label %bb3, label %bb4 | ||
|
||
bb3: | ||
unreachable | ||
|
||
bb4: | ||
unreachable | ||
} |
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