diff options
author | Pete Cooper <peter_cooper@apple.com> | 2013-02-12 03:14:50 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2013-02-12 03:14:50 +0000 |
commit | b0fde6dc029a33945bfeea7082a03940f664943c (patch) | |
tree | eeb6fa81cdedb5083bd49418b0c8aead022eeba2 /lib | |
parent | 6851623c54b35673f6e9a0ed0fd12378c93f48c4 (diff) | |
download | external_llvm-b0fde6dc029a33945bfeea7082a03940f664943c.zip external_llvm-b0fde6dc029a33945bfeea7082a03940f664943c.tar.gz external_llvm-b0fde6dc029a33945bfeea7082a03940f664943c.tar.bz2 |
Check type for legality before forming a select from loads.
Sorry for the lack of a test case. I tried writing one for i386 as i know selects are illegal on this target, but they are actually considered legal by isel and expanded later.
I can't see any targets to trigger this, but checking for the legality of a node before forming it is general goodness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 472919c..5b83149 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -9400,7 +9400,9 @@ bool DAGCombiner::SimplifySelectOps(SDNode *TheSelect, SDValue LHS, // src value info, don't do the transformation if the memory // locations are not in the default address space. LLD->getPointerInfo().getAddrSpace() != 0 || - RLD->getPointerInfo().getAddrSpace() != 0) + RLD->getPointerInfo().getAddrSpace() != 0 || + !TLI.isOperationLegalOrCustom(TheSelect->getOpcode(), + LLD->getBasePtr().getValueType())) return false; // Check that the select condition doesn't reach either load. If so, |