summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-02-04 15:19:18 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-02-04 15:19:18 +0000
commit548ffa274a2c6ff82015139cef8cf4bb7a20bda9 (patch)
tree889139a20b4cf54884c051dc9e00d0f1cf27c21d /llvm/lib/Target/PowerPC/PPCISelLowering.cpp
parentaefc30f2a4632584f0a7d1e9fc76e7add719455a (diff)
downloadbcm5719-llvm-548ffa274a2c6ff82015139cef8cf4bb7a20bda9.tar.gz
bcm5719-llvm-548ffa274a2c6ff82015139cef8cf4bb7a20bda9.zip
SelectionDAG: Teach FoldConstantArithmetic how to deal with vectors.
This required disabling a PowerPC optimization that did the following: input: x = BUILD_VECTOR <i32 16, i32 16, i32 16, i32 16> lowered to: tmp = BUILD_VECTOR <i32 8, i32 8, i32 8, i32 8> x = ADD tmp, tmp The add now gets folded immediately and we're back at the BUILD_VECTOR we started from. I don't see a way to fix this currently so I left it disabled for now. Fix some trivially foldable X86 tests too. llvm-svn: 174325
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCISelLowering.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 9a68927103e..4cd0fc484a1 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -5032,9 +5032,14 @@ SDValue PPCTargetLowering::LowerBUILD_VECTOR(SDValue Op,
// If this value is in the range [-32,30] and is even, use:
// tmp = VSPLTI[bhw], result = add tmp, tmp
if (SextVal >= -32 && SextVal <= 30 && (SextVal & 1) == 0) {
+ // FIXME: This is currently disabled because the ADD will be folded back
+ // into an invalid BUILD_VECTOR immediately.
+ return SDValue();
+#if 0
SDValue Res = BuildSplatI(SextVal >> 1, SplatSize, MVT::Other, DAG, dl);
Res = DAG.getNode(ISD::ADD, dl, Res.getValueType(), Res, Res);
return DAG.getNode(ISD::BITCAST, dl, Op.getValueType(), Res);
+#endif
}
// If this is 0x8000_0000 x 4, turn into vspltisw + vslw. If it is
OpenPOWER on IntegriCloud