[PATCH] D121637: [PowerPC] Fix EmitPPCBuiltinExpr to emit arguments once

Nemanja Ivanovic via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 7 06:59:22 PDT 2022


nemanjai accepted this revision.
nemanjai added a comment.

Please add a test case that would cause a failure prior to this patch due to the argument being emitted more than once (i.e. the test case that prompted this patch). If that is already added and I just missed it, please add a note to the test case along the lines of:

  // The argument expression must not be emitted multiple times.

Other than the minor nits, LGTM.



================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:15627
+    Value *Y =
+        Builder.CreateAnd(EmitScalarExpr(E->getArg(1)), Builder.CreateNot(Op3));
     return Builder.CreateOr(X, Y);
----------------
Nit: I understand that we only have one use of `E->getArg(1)`, but might as well initialize `Op1` as above just for consistency.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121637



More information about the cfe-commits mailing list