[clang] [AMDGPU] const-fold imm operands of amdgcn_update_dpp intrinsic (PR #71139)
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 2 23:27:59 PDT 2023
================
@@ -17632,8 +17632,20 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID,
case AMDGPU::BI__builtin_amdgcn_mov_dpp:
case AMDGPU::BI__builtin_amdgcn_update_dpp: {
llvm::SmallVector<llvm::Value *, 6> Args;
- for (unsigned I = 0; I != E->getNumArgs(); ++I)
- Args.push_back(EmitScalarExpr(E->getArg(I)));
+ for (unsigned I = 0; I != E->getNumArgs(); ++I) {
+ llvm::Value *Arg = EmitScalarExpr(E->getArg(I));
+ // Except first two input operands, all other are imm operands for dpp
+ // intrinsic.
+ if (llvm::is_contained(std::initializer_list<unsigned>{2, 3, 4, 5}, I)) {
----------------
arsenm wrote:
Also if we have this issue here, we have it for every other builtin requiring constant arguments. It would be best to fix all of them
https://github.com/llvm/llvm-project/pull/71139
More information about the cfe-commits
mailing list