[PATCH] D55754: [PowerPC] Implement the ”isSelectSupported()“ target hook
Zhang Kang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 16 19:13:14 PST 2018
ZhangKang updated this revision to Diff 178420.
ZhangKang added a comment.
Add space on the right of `!=`. So that the `Kind !=SelectSupportKind::ScalarCondVectorVal` will be modified to `Kind != SelectSupportKind::ScalarCondVectorVal`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55754/new/
https://reviews.llvm.org/D55754
Files:
llvm/lib/Target/PowerPC/PPCISelLowering.h
llvm/test/CodeGen/PowerPC/select-i1-vs-i1.ll
Index: llvm/test/CodeGen/PowerPC/select-i1-vs-i1.ll
===================================================================
--- llvm/test/CodeGen/PowerPC/select-i1-vs-i1.ll
+++ llvm/test/CodeGen/PowerPC/select-i1-vs-i1.ll
@@ -928,10 +928,8 @@
; CHECK-LABEL: @testv4floateq
; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4
; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2
-; CHECK: crxor [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}}
-; CHECK: bc 12, [[REG1]], .LBB[[BB1:[0-9_]+]]
-; CHECK: vmr 3, 2
-; CHECK: .LBB[[BB1]]
+; CHECK: creqv [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}}
+; CHECK: bclr 12, [[REG1]], 0
; CHECK: vmr 2, 3
; CHECK: blr
}
@@ -1065,7 +1063,7 @@
; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4
; CHECK: bc 12, 2, .LBB[[BB:[0-9_]+]]
; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2
-; CHECK: bc 4, 2, .LBB[[BB]]
+; CHECK: bclr 12, 2, 0
; CHECK: .LBB[[BB]]:
; CHECK: vmr 2, 3
; CHECK: blr
@@ -1083,7 +1081,7 @@
; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4
; CHECK: bc 4, 2, .LBB[[BB:[0-9_]+]]
; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2
-; CHECK: bc 12, 2, .LBB[[BB]]
+; CHECK: bclr 4, 2, 0
; CHECK: .LBB[[BB]]:
; CHECK: vmr 2, 3
; CHECK: blr
@@ -1134,10 +1132,8 @@
; CHECK-LABEL: @testv2doubleeq
; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4
; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2
-; CHECK: crxor [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}}
-; CHECK: bc 12, [[REG1]], .LBB[[BB55:[0-9_]+]]
-; CHECK: vmr 3, 2
-; CHECK: .LBB[[BB55]]
+; CHECK: creqv [[REG1:[0-9]+]], {{[0-9]+}}, {{[0-9]+}}
+; CHECK: bclr 12, [[REG1]], 0
; CHECK: vmr 2, 3
; CHECK: blr
}
@@ -1188,7 +1184,7 @@
; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4
; CHECK: bc 4, 2, .LBB[[BB:[0-9_]+]]
; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2
-; CHECK: bc 12, 2, .LBB[[BB]]
+; CHECK: bclr 4, 2, 0
; CHECK: .LBB[[BB]]
; CHECK: vmr 2, 3
; CHECK: blr
@@ -1206,7 +1202,7 @@
; CHECK-DAG: fcmpu {{[0-9]+}}, 3, 4
; CHECK: bc 12, 2, .LBB[[BB:[0-9_]+]]
; CHECK-DAG: fcmpu {{[0-9]+}}, 1, 2
-; CHECK: bc 4, 2, .LBB[[BB]]
+; CHECK: bclr 12, 2, 0
; CHECK: .LBB[[BB]]
; CHECK: vmr 2, 3
; CHECK: blr
Index: llvm/lib/Target/PowerPC/PPCISelLowering.h
===================================================================
--- llvm/lib/Target/PowerPC/PPCISelLowering.h
+++ llvm/lib/Target/PowerPC/PPCISelLowering.h
@@ -561,6 +561,11 @@
/// DAG node.
const char *getTargetNodeName(unsigned Opcode) const override;
+ bool isSelectSupported(SelectSupportKind Kind) const override {
+ // PowerPC does not support scalar condition selects on vectors.
+ return (Kind != SelectSupportKind::ScalarCondVectorVal);
+ }
+
/// getPreferredVectorAction - The code we generate when vector types are
/// legalized by promoting the integer element type is often much worse
/// than code we generate if we widen the type for applicable vector types.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55754.178420.patch
Type: text/x-patch
Size: 2751 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181217/b1c34adb/attachment.bin>
More information about the llvm-commits
mailing list