summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2018-01-19 20:49:05 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2018-01-19 20:49:05 +0000
commit9eb858c92fe9598b49d1a227652e7415a15e90e9 (patch)
tree1070b486e6cb4eac0a175eec06cc15c046516e99 /llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
parent5605be9e50c58c64aa2aaabf074032f7ac45a462 (diff)
downloadbcm5719-llvm-9eb858c92fe9598b49d1a227652e7415a15e90e9.tar.gz
bcm5719-llvm-9eb858c92fe9598b49d1a227652e7415a15e90e9.zip
[SystemZ] Implement computeKnownBitsForTargetNode
This provides a computeKnownBits implementation for SystemZ target nodes. Currently only SystemZISD::SELECT_CCMASK is supported. llvm-svn: 322986
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZISelLowering.cpp')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZISelLowering.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
index adf368319dc..944284d0fb8 100644
--- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
@@ -5496,6 +5496,30 @@ SDValue SystemZTargetLowering::PerformDAGCombine(SDNode *N,
return SDValue();
}
+void
+SystemZTargetLowering::computeKnownBitsForTargetNode(const SDValue Op,
+ KnownBits &Known,
+ const APInt &DemandedElts,
+ const SelectionDAG &DAG,
+ unsigned Depth) const {
+ unsigned BitWidth = Known.getBitWidth();
+
+ Known.resetAll();
+ switch (Op.getOpcode()) {
+ case SystemZISD::SELECT_CCMASK: {
+ KnownBits TrueKnown(BitWidth), FalseKnown(BitWidth);
+ DAG.computeKnownBits(Op.getOperand(0), TrueKnown, Depth + 1);
+ DAG.computeKnownBits(Op.getOperand(1), FalseKnown, Depth + 1);
+ Known.Zero = TrueKnown.Zero & FalseKnown.Zero;
+ Known.One = TrueKnown.One & FalseKnown.One;
+ break;
+ }
+
+ default:
+ break;
+ }
+}
+
//===----------------------------------------------------------------------===//
// Custom insertion
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud