diff options
| author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2017-03-07 20:53:03 +0000 |
|---|---|---|
| committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2017-03-07 20:53:03 +0000 |
| commit | 38455ea8a61f18d2c6824b22faad49d9a8d5cd28 (patch) | |
| tree | ea24bc961f47d194ef4a2f252c2a5a29e9898194 /llvm/lib/CodeGen/GlobalISel | |
| parent | 70dd6c2212232ce8417d2d4dc53775c843dcca8b (diff) | |
| download | bcm5719-llvm-38455ea8a61f18d2c6824b22faad49d9a8d5cd28.tar.gz bcm5719-llvm-38455ea8a61f18d2c6824b22faad49d9a8d5cd28.zip | |
[GlobalISel] Relax vector G_SELECT assertion.
For vector operands, the `select` instruction supports both vector and
non-vector conditions. The MIR builder had an overly restrictive
assertion, that only accepted vector conditions for vector selects
(in effect implementing ISD::VSELECT).
Make it possible to express the full range of G_SELECTs.
llvm-svn: 297207
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel')
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp index ce84bb94dcf..9745340a05a 100644 --- a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp +++ b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp @@ -568,9 +568,10 @@ MachineInstrBuilder MachineIRBuilder::buildSelect(unsigned Res, unsigned Tst, if (ResTy.isScalar() || ResTy.isPointer()) assert(MRI->getType(Tst).isScalar() && "type mismatch"); else - assert(MRI->getType(Tst).isVector() && - MRI->getType(Tst).getNumElements() == - MRI->getType(Op0).getNumElements() && + assert((MRI->getType(Tst).isScalar() || + (MRI->getType(Tst).isVector() && + MRI->getType(Tst).getNumElements() == + MRI->getType(Op0).getNumElements())) && "type mismatch"); #endif |

