[PowerPC] Fix EmitPPCBuiltinExpr to emit arguments once
This patch changes `EmitPPCBuiltinExpr` in `CGBuiltin.cpp` to remove the loop at the beginning of the function that emits the arguments and to delay emitting the arguments until inside the switch statement. These changes will put `EmitPPCBuiltinExpr` in line with the strategy of the target independent function `EmitBuiltinExpr`. Also, this patch ensures that arguments are only emitted once. Tests that included builtins affected by these changes have been modified to match expected behaviour. Reviewed By: #powerpc, nemanjai, amyk Differential Revision: https://reviews.llvm.org/D121637
Showing
- clang/lib/CodeGen/CGBuiltin.cpp 180 additions, 125 deletionsclang/lib/CodeGen/CGBuiltin.cpp
- clang/test/CodeGen/PowerPC/builtins-ppc-fastmath.c 14 additions, 20 deletionsclang/test/CodeGen/PowerPC/builtins-ppc-fastmath.c
- clang/test/CodeGen/PowerPC/builtins-ppc-pair-mma-types.c 259 additions, 0 deletionsclang/test/CodeGen/PowerPC/builtins-ppc-pair-mma-types.c
- clang/test/CodeGen/PowerPC/builtins-ppc-stmtexpr-argument.c 22 additions, 0 deletionsclang/test/CodeGen/PowerPC/builtins-ppc-stmtexpr-argument.c
- clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c 0 additions, 8 deletionsclang/test/CodeGen/PowerPC/builtins-ppc-vsx.c
- clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-cas.c 6 additions, 6 deletionsclang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-cas.c
- clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-fetch.c 8 additions, 16 deletionsclang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-fetch.c
- clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-fp.c 44 additions, 66 deletionsclang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-fp.c
- clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-math.c 0 additions, 2 deletionsclang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-math.c
- clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-sync.c 0 additions, 4 deletionsclang/test/CodeGen/PowerPC/builtins-ppc-xlcompat-sync.c
- clang/test/CodeGen/PowerPC/ppc-mma-types.c 427 additions, 11 deletionsclang/test/CodeGen/PowerPC/ppc-mma-types.c
- clang/test/Sema/ppc-pair-mma-types.c 0 additions, 135 deletionsclang/test/Sema/ppc-pair-mma-types.c
Loading