[RISCV] Return false for unsupported VTs in isFPImmLegal.
authorCraig Topper <craig.topper@sifive.com>
Mon, 13 Mar 2023 06:29:25 +0000 (23:29 -0700)
committerCraig Topper <craig.topper@sifive.com>
Mon, 13 Mar 2023 06:34:13 +0000 (23:34 -0700)
commitc0c4c725e98c7339d8dbc8eec2a773d26f87929b
tree352426e81d91b84baf625cd9ce3abae2e0f54f09
parent23bd0e037b744d1f93bdfad59b7575017725a96c
[RISCV] Return false for unsupported VTs in isFPImmLegal.

I don't have a test case that fails for this, but it seemed like
we should only handle legal types. The callers I looked at in
DAGCombine either check the type is legal or don't even call
isFPImmLegal unless LegalOperations is true.

Written in a slightly odd way because switches on EVT require
an additional isSimple check so an if/else chain is easier. Used a bool
to shorten the code instead of having multiple ifs and returns.
AArch64 uses a similarish structure.
llvm/lib/Target/RISCV/RISCVISelLowering.cpp