[PATCH] D133672: [GlobalISel] Fix crash when lowering G_SELECT of pointer vectors.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 11 12:29:21 PDT 2022


aemerson added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:7275
+  else {
+    auto Or = MIRBuilder.buildOr(DstTy, NewOp1, NewOp2);
+    MIRBuilder.buildIntToPtr(DstReg, Or);
----------------
tschuett wrote:
> Could you hoist the `buildOr` out of the if-statement? Then you only need the cast if `IsEltPtr`.
Not really, because in the !IsEltPtr case we're trying to re-use the `DstReg` register, while in the other branch we're creating a new value since we need to then cast it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133672/new/

https://reviews.llvm.org/D133672



More information about the llvm-commits mailing list