[AArch64][GlobalISel] Don't write to WZR in non-flag-setting G_BRCOND case
authorJessica Paquette <jpaquette@apple.com>
Mon, 2 Nov 2020 17:47:51 +0000 (09:47 -0800)
committerJessica Paquette <jpaquette@apple.com>
Wed, 2 Dec 2020 00:45:37 +0000 (16:45 -0800)
commitc82f002cea304be505f14af70dce25ad149ba29f
tree7fc0bd6a1ca23fde9d98d5a3c2d5c3bef5f1c944
parent1f40d60a3b7f310ff3f77bb8643a27d979a703cb
[AArch64][GlobalISel] Don't write to WZR in non-flag-setting G_BRCOND case

We are avoiding writing to WZR just about everywhere else.

Also update the code to use MachineIRBuilder for the sake of consistency.

We also didn't have a GlobalISel testcase for this path, so add a simple one
now.

Differential Revision: https://reviews.llvm.org/D90626
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
llvm/test/CodeGen/AArch64/GlobalISel/speculative-hardening-brcond.mir [new file with mode: 0644]