[LoongArch] Eliminate the redundant sign extension of division (#107971)
commitd752f29fb333d47724484e08b32d6499cc1e460e
authorhev <wangrui@loongson.cn>
Tue, 10 Sep 2024 08:52:21 +0000 (10 16:52 +0800)
committerTobias Hieta <tobias@hieta.se>
Mon, 16 Sep 2024 18:29:52 +0000 (16 20:29 +0200)
tree0e4566564513c0d52869cdcfe8910e81d03d1940
parent78654faa0c6d9dc2f72b81953b9cffbb7675755b
[LoongArch] Eliminate the redundant sign extension of division (#107971)

If all incoming values of `div.d` are sign-extended and all users only
use the lower 32 bits, then convert them to W versions.

Fixes: #107946
(cherry picked from commit 0f47e3aebdd2a4a938468a272ea4224552dbf176)
llvm/lib/Target/LoongArch/LoongArchOptWInstrs.cpp