2019-03-14 19:54:46 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
|
|
|
|
|
2019-02-07 02:59:19 +08:00
|
|
|
; Test that the dag combiner can understand that some vector operands are
|
|
|
|
; all-zeros and then optimize the logical operations.
|
|
|
|
|
2019-03-18 21:55:28 +08:00
|
|
|
define void @f1(<2 x i64> %a0) {
|
2019-02-07 02:59:19 +08:00
|
|
|
; CHECK-LABEL: f1:
|
2019-03-14 19:54:46 +08:00
|
|
|
; CHECK: # %bb.0: # %bb
|
|
|
|
; CHECK-NEXT: vlrepg %v0, 0(%r1)
|
|
|
|
; CHECK-NEXT: vgbm %v1, 0
|
2019-03-18 21:55:28 +08:00
|
|
|
; CHECK-NEXT: vceqg %v2, %v24, %v1
|
2019-03-14 19:54:46 +08:00
|
|
|
; CHECK-NEXT: vn %v0, %v0, %v0
|
|
|
|
; CHECK-NEXT: vno %v2, %v2, %v2
|
|
|
|
; CHECK-NEXT: vceqg %v0, %v0, %v1
|
[DAG] Refactor DAGCombiner::ReassociateOps
Summary:
Extract the logic for doing reassociations
from DAGCombiner::reassociateOps into a helper
function DAGCombiner::reassociateOpsCommutative,
and use that helper to trigger reassociation
on the original operand order, or the commuted
operand order.
Codegen is not identical since the operand order will
be different when doing the reassociations for the
commuted case. That causes some unfortunate churn in
some test cases. Apart from that this should be NFC.
Reviewers: spatel, craig.topper, tstellar
Reviewed By: spatel
Subscribers: dmgreen, dschuff, jvesely, nhaehnle, javed.absar, sbc100, jgravelle-google, hiraditya, aheejin, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61199
llvm-svn: 359476
2019-04-30 01:50:10 +08:00
|
|
|
; CHECK-NEXT: vx %v0, %v0, %v2
|
2019-03-14 19:54:46 +08:00
|
|
|
; CHECK-NEXT: vnc %v0, %v2, %v0
|
|
|
|
; CHECK-NEXT: vlgvf %r0, %v0, 1
|
|
|
|
; CHECK-NEXT: tmll %r0, 1
|
|
|
|
; CHECK-NEXT: # %bb.1: # %bb15
|
2019-02-07 02:59:19 +08:00
|
|
|
|
|
|
|
bb:
|
|
|
|
%tmp = shufflevector <2 x i64> undef, <2 x i64> undef, <2 x i32> zeroinitializer
|
|
|
|
br label %bb1
|
|
|
|
|
|
|
|
bb1: ; preds = %bb
|
|
|
|
%tmp2 = load i64, i64* undef, align 8
|
|
|
|
%tmp3 = insertelement <2 x i64> undef, i64 %tmp2, i32 1
|
2019-03-18 21:55:28 +08:00
|
|
|
%tmp4 = icmp ne <2 x i64> %a0, zeroinitializer
|
2019-02-07 02:59:19 +08:00
|
|
|
%tmp5 = xor <2 x i1> %tmp4, zeroinitializer
|
|
|
|
%tmp6 = xor <2 x i1> zeroinitializer, %tmp5
|
|
|
|
%tmp7 = and <2 x i64> %tmp3, %tmp
|
|
|
|
%tmp8 = icmp ne <2 x i64> %tmp7, zeroinitializer
|
|
|
|
%tmp9 = xor <2 x i1> zeroinitializer, %tmp8
|
2019-03-18 21:55:28 +08:00
|
|
|
%tmp10 = icmp ne <2 x i64> %a0, zeroinitializer
|
2019-02-07 02:59:19 +08:00
|
|
|
%tmp11 = xor <2 x i1> %tmp10, %tmp9
|
|
|
|
%tmp12 = and <2 x i1> %tmp6, %tmp11
|
|
|
|
%tmp13 = extractelement <2 x i1> %tmp12, i32 0
|
|
|
|
br i1 %tmp13, label %bb14, label %bb15
|
|
|
|
|
|
|
|
bb14: ; preds = %bb1
|
|
|
|
store i64 undef, i64* undef, align 8
|
|
|
|
br label %bb15
|
|
|
|
|
|
|
|
bb15: ; preds = %bb14, %bb1
|
|
|
|
unreachable
|
|
|
|
}
|