aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2020-05-07 16:25:34 -0700
committerJessica Paquette <jpaquette@apple.com>2020-05-08 13:40:02 -0700
commitf66309deab1d99a17d6740244dfd1b9f959e9095 (patch)
tree392d350ebeecff054ab8e1f2820d3f675517b8f1 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
parent0d2a0b44c812e5aafa418e4806171867f3181cbe (diff)
downloadllvm-f66309deab1d99a17d6740244dfd1b9f959e9095.zip
llvm-f66309deab1d99a17d6740244dfd1b9f959e9095.tar.gz
llvm-f66309deab1d99a17d6740244dfd1b9f959e9095.tar.bz2
[GlobalISel] Don't add duplicate successors to MBBs when translating indirectbr
This fixes a verifier failure on a bot: http://green.lab.llvm.org/green/job/test-suite-verify-machineinstrs-aarch64-O0-g/ ``` *** Bad machine code: MBB has duplicate entries in its successor list. *** - function: foo - basic block: %bb.5 indirectgoto (0x7fe3d687ca08) ``` One of the GCC torture suite tests (pr70460.c) has an indirectbr instruction which has duplicate blocks in its destination list. According to the langref this is allowed: > Blocks are allowed to occur multiple times in the destination list, though > this isn’t particularly useful. (https://www.llvm.org/docs/LangRef.html#indirectbr-instruction) We don't allow this in MIR. So, when we translate such an instruction, the verifier screams. This patch makes `translateIndirectBr` check if a successor has already been added to a block. If the successor is present, it is skipped rather than added twice. Differential Revision: https://reviews.llvm.org/D79609
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
0 files changed, 0 insertions, 0 deletions