[PATCH] D106776: [GlobalISel] Add a constant folding combine.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 26 11:12:35 PDT 2021


aemerson updated this revision to Diff 361731.
aemerson added a comment.

Add a variant of `replaceInstWithConstant` taking APInt. It still seems convenient to have an int64_t version since that one builds the constant with the type of the DstOp, while we'd have to construct a correctly sized APInt in each call site if we replaced it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106776

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
  llvm/include/llvm/Target/GlobalISel/Combine.td
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/lib/Target/AArch64/AArch64Combine.td
  llvm/test/CodeGen/AArch64/GlobalISel/arm64-atomic-128.ll
  llvm/test/CodeGen/AArch64/GlobalISel/postlegalizer-combiner-constant-fold.mir
  llvm/test/CodeGen/AArch64/fold-global-offsets.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/fshl.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/fshr.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/saddsat.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/ssubsat.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/udiv.i32.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/urem.i32.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106776.361731.patch
Type: text/x-patch
Size: 409950 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210726/d95e4c0c/attachment-0001.bin>


More information about the llvm-commits mailing list