[AMDGPU] Extend constant folding for logical operations
authorGraham Sellers <graham.sellers@amd.com>
Tue, 7 Apr 2020 18:11:24 +0000 (14:11 -0400)
committerMatt Arsenault <arsenm2@gmail.com>
Tue, 7 Apr 2020 18:37:16 +0000 (14:37 -0400)
commita19a56f6a1ff1f022f7af64bc1281fe018e84494
treeded209442955407cf8e95293980ff381622f5619
parentc41685b16fcceaa2078eb14eb27f6696f851eb49
[AMDGPU] Extend constant folding for logical operations

This patch extends existing constant folding in logical operations to
handle S_XNOR, S_NAND, S_NOR, S_ANDN2, S_ORN2, V_LSHL_ADD_U32 and
V_AND_OR_B32. Also added a couple of tests for existing folds.
llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
llvm/test/CodeGen/AMDGPU/constant-fold-imm-immreg.mir