[PATCH] D133788: [InstCombine] try multi-use demanded bits folds for 'add'

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 10:09:33 PDT 2022


spatel created this revision.
spatel added reviewers: craig.topper, RKSimon, nikic.
Herald added subscribers: StephenFan, zzheng, hiraditya, mcrosier.
Herald added a project: All.
spatel requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added a project: LLVM.

This is actually 2 changes in 1 patch, but putting them together shows wins in output and compile-time:
https://llvm-compile-time-tracker.com/?config=NewPM-O3&stat=instructions&remote=rotateright

The 1st part enables a multi-use demanded bits fold (motivated by issue #57576 <https://github.com/llvm/llvm-project/issues/57576>):
https://alive2.llvm.org/ce/z/DsZakh

The 2nd part avoids computing known bits for every other multi-use add (giving the small improvement in compile-time). That also results in the test diffs that show large unsigned constants becoming small negative numbers. That should make analysis easier and codegen better in most cases.


https://reviews.llvm.org/D133788

Files:
  llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
  llvm/test/Transforms/InstCombine/add.ll
  llvm/test/Transforms/InstCombine/shift.ll
  llvm/test/Transforms/LoopVectorize/AArch64/intrinsiccost.ll
  llvm/test/Transforms/LoopVectorize/X86/float-induction-x86.ll
  llvm/test/Transforms/LoopVectorize/X86/intrinsiccost.ll
  llvm/test/Transforms/LoopVectorize/float-induction.ll
  llvm/test/Transforms/LoopVectorize/if-conversion-nest.ll
  llvm/test/Transforms/LoopVectorize/induction.ll
  llvm/test/Transforms/LoopVectorize/interleaved-accesses.ll
  llvm/test/Transforms/LoopVectorize/loop-scalars.ll
  llvm/test/Transforms/LoopVectorize/runtime-check.ll
  llvm/test/Transforms/PhaseOrdering/X86/excessive-unrolling.ll
  llvm/test/Transforms/PhaseOrdering/X86/vdiv.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133788.459787.patch
Type: text/x-patch
Size: 67459 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220913/e7fa7742/attachment.bin>


More information about the llvm-commits mailing list