aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2021-06-28 23:09:58 -0700
committerCraig Topper <craig.topper@sifive.com>2021-06-29 09:45:13 -0700
commit3b6dfa381edfc66864cfd6dbc2769ba645858120 (patch)
tree7693e50ce648bf09554597ba3621b7e51c829f0f /llvm/lib/CodeGen/MachineFunction.cpp
parent287847dace4408a0e4e4bfbed7db4a4d1f3eba29 (diff)
downloadllvm-3b6dfa381edfc66864cfd6dbc2769ba645858120.zip
llvm-3b6dfa381edfc66864cfd6dbc2769ba645858120.tar.gz
llvm-3b6dfa381edfc66864cfd6dbc2769ba645858120.tar.bz2
[RISCV] Protect the SHL/SRA/SRL handlers in LowerOperation against being called for an illegal i32 shift amount.
It seems it is possible for DAG combine to create a shl with an i64 result type and an i32 shift amount. This is ok before type legalization since the type don't need to match in SelectionDAG. This results in type legalization calling LowerOperation to legalize just the amount. We weren't expecting this so we asserted for not finding a fixed vector shift. To fix this, I've added a check for the fixed vector case and returned SDValue() to get the default type legalizer. I've factored all shifts together and added a fixed vector specific handler to avoid repeating similar code for each in LowerOperation. The particular case I found was exposed by D104581, but the bad shift is created after that patch triggers.
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions