AutoUpgrade: Fix assertion on invalid name mangling usage
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 16 Nov 2022 00:52:32 +0000 (16:52 -0800)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 16 Nov 2022 19:18:02 +0000 (11:18 -0800)
commite989b8bb5fb36abac6e8f82809f06144dd762113
tree3dd9316d2d67b108acf0b4627908b9449498a6c8
parent29c92879171ddce944b177127901b8140e0a1ebf
AutoUpgrade: Fix assertion on invalid name mangling usage

This was trying to auto-upgrade a read_register call with missing type
mangling. This first would break since getCalledFunction checks the
callee type is consistent, so this would assert there. After that,
the replacement code would die on the type mismatch. Be more
defensive and let the verifier code produce an error that the IR
is broken.
llvm/lib/IR/AutoUpgrade.cpp
llvm/test/Assembler/autoupgrade-invalid-name-mangling.ll [new file with mode: 0644]