change checking for auto-init metadata to use `equalsStr` instead of casing MDOperand...
authorZain Jaffal <z_jaffal@apple.com>
Thu, 8 Jun 2023 14:57:50 +0000 (15:57 +0100)
committerZain Jaffal <z_jaffal@apple.com>
Thu, 8 Jun 2023 14:58:01 +0000 (15:58 +0100)
commitd65c0527ab70b8089492b6788c0e2ea0cfa219e6
treecd52f1be14aca9805b86914a51328db40bf3fda6
parentfa6b7dd520fc175a246c943a7c9802e4808118b1
change checking for auto-init metadata to use `equalsStr` instead of casing MDOperand nodes.

Since `MD_annotation` metadata now supports having mutliple strings in the annotation node. casing Operand to string directly will cause a crash. When checking if `MDOperand` equals str you can use `equalsStr` method.

Reviewed By: serge-sans-paille

Differential Revision: https://reviews.llvm.org/D152372
llvm/lib/Transforms/Utils/MoveAutoInit.cpp