diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-12-23 19:58:16 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-12-23 19:58:16 +0000 |
commit | 9933574ac324d44e2acf336308fd322cb8458c4b (patch) | |
tree | 22d9dfb14239a0b7dcd5f5b723e348108478f0d4 /llvm/lib/CodeGen | |
parent | 8bc612f63b72936d61d87d599448365b6e7459b0 (diff) | |
download | bcm5719-llvm-9933574ac324d44e2acf336308fd322cb8458c4b.tar.gz bcm5719-llvm-9933574ac324d44e2acf336308fd322cb8458c4b.zip |
[DAGCombiner] allow hoisting vector bitwise logic ahead of extends
llvm-svn: 350032
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 81bb73bf28e..93af1f4cc14 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -3731,13 +3731,12 @@ SDValue DAGCombiner::hoistLogicOpWithSameOpcodeHands(SDNode *N) { if (!N0.hasOneUse() && !N1.hasOneUse()) return SDValue(); // We need matching integer source types. - // Do not hoist logic op inside of a vector extend, since it may combine - // into a vsetcc. - // TODO: Should the vector check apply to truncate though? - if (VT.isVector() || XVT != Y.getValueType()) + if (XVT != Y.getValueType()) return SDValue(); - // Don't create an illegal op during or after legalization. - if (LegalOperations && !TLI.isOperationLegal(LogicOpcode, XVT)) + // Don't create an illegal op during or after legalization. Don't ever + // create an unsupported vector op. + if ((VT.isVector() || LegalOperations) && + !TLI.isOperationLegalOrCustom(LogicOpcode, XVT)) return SDValue(); // Avoid infinite looping with PromoteIntBinOp. // TODO: Should we apply desirable/legal constraints to all opcodes? |