summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-17 18:19:23 +0000
committerChris Lattner <sabre@nondot.org>2007-05-17 18:19:23 +0000
commit0184f88debf35638c3566bb26d5d0232da5f9ade (patch)
tree7f9ff2681c0d46752dda23fac7a131825b9c5a73 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parent2135bc08d67d0322ac74a72ceec18e2aabb10e96 (diff)
downloadbcm5719-llvm-0184f88debf35638c3566bb26d5d0232da5f9ade.tar.gz
bcm5719-llvm-0184f88debf35638c3566bb26d5d0232da5f9ade.zip
disable MaskedValueIsZero, ComputeMaskedBits, and SimplifyDemandedBits for
i128 integers. The 64-bit masks are not wide enough to represent the results. These should be converted to APInt someday. llvm-svn: 37169
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 970533b9a51..a0125d395d1 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -365,6 +365,11 @@ bool TargetLowering::SimplifyDemandedBits(SDOperand Op, uint64_t DemandedMask,
TargetLoweringOpt &TLO,
unsigned Depth) const {
KnownZero = KnownOne = 0; // Don't know anything.
+
+ // The masks are not wide enough to represent this type! Should use APInt.
+ if (Op.getValueType() == MVT::i128)
+ return false;
+
// Other users may use these bits.
if (!Op.Val->hasOneUse()) {
if (Depth != 0) {
@@ -874,6 +879,10 @@ bool TargetLowering::SimplifyDemandedBits(SDOperand Op, uint64_t DemandedMask,
/// for bits that V cannot have.
bool TargetLowering::MaskedValueIsZero(SDOperand Op, uint64_t Mask,
unsigned Depth) const {
+ // The masks are not wide enough to represent this type! Should use APInt.
+ if (Op.getValueType() == MVT::i128)
+ return false;
+
uint64_t KnownZero, KnownOne;
ComputeMaskedBits(Op, Mask, KnownZero, KnownOne, Depth);
assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
@@ -891,6 +900,10 @@ void TargetLowering::ComputeMaskedBits(SDOperand Op, uint64_t Mask,
if (Depth == 6 || Mask == 0)
return; // Limit search depth.
+ // The masks are not wide enough to represent this type! Should use APInt.
+ if (Op.getValueType() == MVT::i128)
+ return;
+
uint64_t KnownZero2, KnownOne2;
switch (Op.getOpcode()) {
OpenPOWER on IntegriCloud