[AMDGPU] [CodeGen] Fold negate llvm.amdgcn.class into test mask
authorAnshil Gandhi <angandhi@amd.com>
Fri, 18 Jun 2021 19:04:12 +0000 (13:04 -0600)
committerAnshil Gandhi <angandhi@amd.com>
Fri, 18 Jun 2021 19:04:12 +0000 (13:04 -0600)
commit2e5dc4a1efe18a411734abb05b03431b120b1fea
treee015d6f13abd63367a314cf5bbb7069d894fd9de
parentc60f1d5d98ebf1cec20b80f5a94d733290dd6556
[AMDGPU] [CodeGen] Fold negate llvm.amdgcn.class into test mask

Implemented the transformation of xor (llvm.amdgcn.class x, mask), -1 into
llvm.amdgcn.class(x, ~mask). Added LIT tests as well.

Differential Revision: https://reviews.llvm.org/D104049
llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-foldnegate.ll [new file with mode: 0644]