Re-apply "[JumpThreading] Ignore free instructions"
authorHans Wennborg <hans@chromium.org>
Fri, 24 Sep 2021 16:44:20 +0000 (18:44 +0200)
committerHans Wennborg <hans@chromium.org>
Fri, 24 Sep 2021 16:52:30 +0000 (18:52 +0200)
commit1e9afab875696ebf1a8abb5637f04735411ee0b7
tree7a1f3b039d6b39a2a1babea47247f15244733d73
parent321be24aa6808c5829f3433407e13603901849f4
Re-apply "[JumpThreading] Ignore free instructions"

It seems the crashes we saw wasn't caused by this (see comments on the review).

> 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

This reverts commit 4604695d7c20e72b551a1a5224f3de877cb41bd3.
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