summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
diff options
context:
space:
mode:
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2018-06-13 18:52:54 +0000
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2018-06-13 18:52:54 +0000
commit7bec57300c799632d282d67916745b6d20a12e6f (patch)
tree1f480c96f4729e1fa78241d79878ba0be1044d7a /llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
parent2d283830977b751564ca6a03ecc7c8260e72bafc (diff)
downloadbcm5719-llvm-7bec57300c799632d282d67916745b6d20a12e6f.tar.gz
bcm5719-llvm-7bec57300c799632d282d67916745b6d20a12e6f.zip
[AMDGPU] Corrected computeKnownBits for V_PERM_B32
Differential Revision: https://reviews.llvm.org/D48133 llvm-svn: 334640
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
index 148de14dd5e..19106a5ae8d 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
@@ -4317,18 +4317,19 @@ void AMDGPUTargetLowering::computeKnownBitsForTargetNode(
unsigned Sel = CMask->getZExtValue();
for (unsigned I = 0; I < 32; I += 8) {
- unsigned ByteMask = 0xff << I;
unsigned SelBits = Sel & 0xff;
if (SelBits < 4) {
- Known.One |= RHSKnown.One & ByteMask;
- Known.Zero |= RHSKnown.Zero & ByteMask;
+ SelBits *= 8;
+ Known.One |= ((RHSKnown.One.getZExtValue() >> SelBits) & 0xff) << I;
+ Known.Zero |= ((RHSKnown.Zero.getZExtValue() >> SelBits) & 0xff) << I;
} else if (SelBits < 7) {
- Known.One |= LHSKnown.One & ByteMask;
- Known.Zero |= LHSKnown.Zero & ByteMask;
+ SelBits = (SelBits & 3) * 8;
+ Known.One |= ((LHSKnown.One.getZExtValue() >> SelBits) & 0xff) << I;
+ Known.Zero |= ((LHSKnown.Zero.getZExtValue() >> SelBits) & 0xff) << I;
} else if (SelBits == 0x0c) {
- Known.Zero |= ByteMask;
+ Known.Zero |= 0xff << I;
} else if (SelBits > 0x0c) {
- Known.One |= ByteMask;
+ Known.One |= 0xff << I;
}
Sel >>= 8;
}
OpenPOWER on IntegriCloud