[VE][NFC] Fix use-after-free in VEInstrInfo
authorSimon Moll <simon.moll@emea.nec.com>
Wed, 1 Dec 2021 17:55:28 +0000 (18:55 +0100)
committerSimon Moll <simon.moll@emea.nec.com>
Wed, 1 Dec 2021 18:30:27 +0000 (19:30 +0100)
commit435d44bf8ab3925b85b70c0736841e3c4c667199
treec256cad4a8884fa2bca66eb8906ba50fb2bf264f
parentb6f3c8de6acfa1c40cc34a46168d9987cab18c9b
[VE][NFC] Fix use-after-free in VEInstrInfo

First call getOperand, then erase the MachineInstr. Not the other way
round.

Expected to fix test/CodeGen/VE/VELIntrinsics/lvm.ll

Detected by asan buildbot:

  sanitizer-x86_64-linux-fast
  (https://lab.llvm.org/buildbot/#/builders/5/builds/15384)
llvm/lib/Target/VE/VEInstrInfo.cpp