summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2007-11-27 19:28:48 +0000
committerNate Begeman <natebegeman@mac.com>2007-11-27 19:28:48 +0000
commit6f026a654c852543ad4d757bcf0804707062ed3d (patch)
tree5d60c6731734ea95596bc38c14f06e9bed3f2e55 /llvm/lib/CodeGen/SelectionDAG
parentb960acebded5b68a847d746fb1d812b29375ee2d (diff)
downloadbcm5719-llvm-6f026a654c852543ad4d757bcf0804707062ed3d.tar.gz
bcm5719-llvm-6f026a654c852543ad4d757bcf0804707062ed3d.zip
Support returning non-power-of-2 vectors to unblock some work
llvm-svn: 44371
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index eadfa1fbb29..2be31c82601 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -364,6 +364,13 @@ unsigned TargetLowering::getVectorTypeBreakdown(MVT::ValueType VT,
unsigned NumVectorRegs = 1;
+ // FIXME: We don't support non-power-of-2-sized vectors for now. Ideally we
+ // could break down into LHS/RHS like LegalizeDAG does.
+ if (!isPowerOf2_32(NumElts)) {
+ NumVectorRegs = NumElts;
+ NumElts = 1;
+ }
+
// Divide the input until we get to a supported size. This will always
// end with a scalar if the target doesn't support vectors.
while (NumElts > 1 &&
OpenPOWER on IntegriCloud