[x86] Fix infinite loop inside DAG combiner with lzcnt feature.
authorPierre Gousseau <pierre.gousseau@sony.com>
Tue, 5 Apr 2022 16:30:25 +0000 (17:30 +0100)
committerPierre Gousseau <pierre.gousseau@sony.com>
Tue, 5 Apr 2022 16:32:10 +0000 (17:32 +0100)
commita3d5f1cf5d88dfbbed931951e07f328d5ceba510
tree759ee7ea52bbad86fa47e06f63a4835dd842fa1c
parentd849959071c8478841a9e7b1bb625e00b848f1c7
[x86] Fix infinite loop inside DAG combiner with lzcnt feature.

The issue affects targets supporting fast-lzcnt such as btver2.
This removes extraneous zext/trunc node insertions to fix the infinite
loop.
This fixes Issue https://github.com/llvm/llvm-project/issues/54694

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

Reviewed By: RKSimon, spatel, lebedev.ri
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/lzcnt-zext-cmp.ll