mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 20:26:06 +00:00

This patch looks up variant scheduling classes using a hash of the instruction. Keying by the pointer breaks certain use cases that might occur out of tree, like decoding an execution trace instruction by instruction and creating MCA instructions as one goes along, like in the MCAD case. In this case, the MCInst will always have the same address and thus all instructions with the same variant scheduling class will end up with the same instruction description, leading to undesired behavior (assertions, uses after free, invalid results, etc.).