[GlobalISel] Combine sext([sz]ext) -> [sz]ext, zext(zext) -> zext
authorDominik Montada <dominik.montada@hightec-rt.com>
Wed, 1 Apr 2020 09:20:15 +0000 (11:20 +0200)
committerDominik Montada <dominik.montada@hightec-rt.com>
Wed, 8 Apr 2020 09:24:29 +0000 (11:24 +0200)
commit432720f1c4c6b47edfb475f8616e471d14c26974
tree29271f4f10e1071c5d282290b4a95f11154f26e4
parent06ddb7946bb18b9340d0033f5c2d16fb0e075291
[GlobalISel] Combine sext([sz]ext) -> [sz]ext, zext(zext) -> zext

Summary:
Combine sext(zext x) to (zext x) since the sign-bit is 0
after the zero-extension.

Combine sext(sext x) to (sext x) and ext(zext x) to (zext x)
since the intermediate step is not needed.

Reviewers: arsenm, volkan, aemerson, aditya_nandakumar

Reviewed By: arsenm

Subscribers: jvesely, wdng, nhaehnle, rovka, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77210
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
llvm/test/CodeGen/AMDGPU/GlobalISel/combine-ext-legalizer.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-saddo.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-ssubo.mir