[globalisel][tablegen] Fix PR32733 by checking which instruction operands belong to.
authorDaniel Sanders <daniel_l_sanders@apple.com>
Sat, 22 Apr 2017 14:31:28 +0000 (14:31 +0000)
committerDaniel Sanders <daniel_l_sanders@apple.com>
Sat, 22 Apr 2017 14:31:28 +0000 (14:31 +0000)
commit3016d3c6c95ff2510c695e05782165524c61b5c3
tree9e0271d9921f67d10700370dfb3cd2723cab2830
parentd57681b703259c8a87877edcb90db79b01ebc71b
[globalisel][tablegen] Fix PR32733 by checking which instruction operands belong to.

canMutate() was returning true when the operands were all in the same order as
the matched instruction. However, it wasn't checking the operands were actually
on that instruction. This worked when we could only match a single instruction
but the addition of nested instruction matching led to cases where the operands
could be split across multiple instructions. canMutate() now returns false if
operands belong to instructions other than the root of the match.

llvm-svn: 301077
llvm/test/CodeGen/AArch64/GlobalISel/select-pr32733.mir [new file with mode: 0644]
llvm/utils/TableGen/GlobalISelEmitter.cpp