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

Tim Northover via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 20 12:26:26 PDT 2018


t.p.northover added a comment.

> EmitAArch64BuiltinExpr() also emits args into Ops before the big switch (with some more subtlety around the last arg that I don't understand), but then almost every switch case does EmitScalarExpr(E->getArg(n)).

Took me a while to remember, but I can at least explain this bit now I think. The key is that there are two kinds of NEON intrinsics. Overloaded ones have a constant last argument that describes the real type, and non-overloaded ones use that last argument as a normal parameter.

The first massive switch you see handles the ones in the second case, so it always CodeGens the last parameter, but if you scroll all the way down to line 7369 there's another switch where only the pregenerated Ops are used, and this last arg is visible as `Ty` and/or `VTy`.

It may or may not be the best way to handle that situation, of course.


https://reviews.llvm.org/D50979





More information about the cfe-commits mailing list