[llvm] r301403 - [DAG] add FIXME comments for splat detection; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 26 06:27:57 PDT 2017
Author: spatel
Date: Wed Apr 26 08:27:57 2017
New Revision: 301403
URL: http://llvm.org/viewvc/llvm-project?rev=301403&view=rev
Log:
[DAG] add FIXME comments for splat detection; NFC
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=301403&r1=301402&r2=301403&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Apr 26 08:27:57 2017
@@ -7640,6 +7640,8 @@ bool BuildVectorSDNode::isConstantSplat(
if (MinSplatBits > VecWidth)
return false;
+ // FIXME: The widths are based on this node's type, but build vectors can
+ // truncate their operands.
SplatValue = APInt(VecWidth, 0);
SplatUndef = APInt(VecWidth, 0);
@@ -7669,6 +7671,8 @@ bool BuildVectorSDNode::isConstantSplat(
// The build_vector is all constants or undefs. Find the smallest element
// size that splats the vector.
HasAnyUndefs = (SplatUndef != 0);
+
+ // FIXME: This does not work for vectors with elements less than 8 bits.
while (VecWidth > 8) {
unsigned HalfSize = VecWidth / 2;
APInt HighValue = SplatValue.lshr(HalfSize).trunc(HalfSize);
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=301403&r1=301402&r2=301403&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Wed Apr 26 08:27:57 2017
@@ -1364,6 +1364,9 @@ unsigned TargetLowering::ComputeNumSignB
return 1;
}
+// FIXME: Ideally, this would use ISD::isConstantSplatVector(), but that must
+// work with truncating build vectors and vectors with elements of less than
+// 8 bits.
bool TargetLowering::isConstTrueVal(const SDNode *N) const {
if (!N)
return false;
More information about the llvm-commits
mailing list