[PATCH] D88315: [AMDGPU] Do not generate mul with 1 in AMDGPU Atomic Optimizer

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 07:56:27 PDT 2020


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp:407
 
+static bool isConstantOne(const Value* V) {
+  const ConstantInt *CI = dyn_cast<ConstantInt>(V);
----------------
mbrkusanin wrote:
> foad wrote:
> > It would be neater to have a BuildMul helper function that checks for and optimizes the mul-by-1 case.
> A new BuildMul or update the current one (looks like some unittests need to be updated in this case)?
I was suggesting a new BuildMul helper function in this source file, not changing IRBuilder at all.


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

https://reviews.llvm.org/D88315



More information about the llvm-commits mailing list