[JumpThreading] Ignore free instructions
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 22 Sep 2021 19:34:24 +0000 (21:34 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 23 Sep 2021 16:28:36 +0000 (18:28 +0200)
commit1e3c6fc7cb9d2ee6a5328881f95d6643afeadbff
tree1a9679917740eee2d3dc4dccb4172ba20f2350cf
parent1a6e1ee42a6af255d45e3fd2fe87021dd31f79bb
[JumpThreading] Ignore free instructions

This is basically D108837 but for jump threading. Free instructions
should be ignored for the threading decision. JumpThreading already
skips some free instructions (like pointer bitcasts), but does not
skip various free intrinsics -- in fact, it currently gives them a
fairly large cost of 2.

Differential Revision: https://reviews.llvm.org/D110290
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