[PATCH] D50979: Eliminate instances of `EmitScalarExpr(E->getArg(n))` in EmitX86BuiltinExpr().

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 13:02:23 PST 2020


rnk added inline comments.
Herald added a subscriber: pengfei.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:10471
   case X86::BI_InterlockedIncrement64:
     return EmitMSVCBuiltinExpr(MSVCIntrin::_InterlockedIncrement, E);
   case X86::BI_InterlockedCompareExchange128: {
----------------
I noticed that EmitMSVCBuiltinExpr evaluates args again, so each one of these intrinsic implementations has this same bug. :(

I'll put together a fix.

It's a bit not straightforward because AArch64 doesn't pre-evaluate all the builtin arguments like x86, so we need an adapter from one style to the other.


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

https://reviews.llvm.org/D50979



More information about the cfe-commits mailing list