llvm-D42262-jumpthreading-not-i1
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Mon, 20 Jan 2020 09:26:04 +0000 (09:26 +0000)
committerGianfranco Costamagna <locutusofborg@debian.org>
Mon, 20 Jan 2020 09:26:04 +0000 (09:26 +0000)
commit3e981f1cd1649930aed84035ecd8843f77606b1b
tree38aeb0244bfee986a4384173a93b8fa81288e9a2
parentfcfc87553483a45657e1e19a2a056c0bd91312a0
llvm-D42262-jumpthreading-not-i1

commit 6a311a7a804831fea43cfb2f61322adcb407a1af
Author: Keno Fischer <keno@juliacomputing.com>
Date:   Thu Jan 18 15:57:05 2018 -0500

    [JumpThreading] Don't restrict cast-traversal to i1

    Summary:
    In D17663, JumpThreading learned to look trough simple cast instructions,
    but only if the source of those cast instructions was a phi/cmp i1
    (in an effort to limit compile time effects). I think this condition
    is too restrictive. For switches with limited value range, InstCombine
    will readily introduce an extra `trunc` instruction to a smaller
    integer type (e.g. from i8 to i2), leaving us in the somewhat perverse
    situation that jump-threading would work before running instcombine,
    but not after. Since instcombine produces this pattern, I think we
    need to consider it canonical and support it in JumpThreading.
    In general, for limiting recursion, I think the existing restriction
    to phi and cmp nodes should be sufficient to avoid looking through
    unprofitable chains of instructions.

    Reviewers: haicheng, gberry, bmakam, mcrosier

    Subscribers: llvm-commits

    Differential Revision: https://reviews.llvm.org/D42262

Gbp-Pq: Topic julia
Gbp-Pq: Name llvm-D42262-jumpthreading-not-i1.patch
lib/Transforms/Scalar/JumpThreading.cpp
test/Transforms/JumpThreading/basic.ll