[PATCH] D110290: [JumpThreading] Use cost model for jump threading decision

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 13:52:39 PDT 2021


nikic created this revision.
nikic added reviewers: aeubanks, lebedev.ri, spatel.
Herald added a subscriber: hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is similar to D108837 <https://reviews.llvm.org/D108837>. My primary goal here is to ensure that JumpThreading ignores free instructions for its threading decisions. It already skips some (like pointer bitcasts), but does not skip various free intrinsics.

This could be achieved using just a check for TCC_Free, but I figured it makes sense to use the cost model for entire cost calculation, rather than the ad-hoc calculation it performs now. If desired, I could reduce this patch to just the TCC_Free check though.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110290

Files:
  llvm/include/llvm/Transforms/Scalar/JumpThreading.h
  llvm/lib/Transforms/Scalar/JumpThreading.cpp
  llvm/test/Transforms/JumpThreading/free_instructions.ll
  llvm/test/Transforms/PhaseOrdering/inlining-alignment-assumptions.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110290.374357.patch
Type: text/x-patch
Size: 12174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210922/9c528a66/attachment.bin>


More information about the llvm-commits mailing list