summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2018-07-27 06:04:40 +0000
committerTom Stellard <tstellar@redhat.com>2018-07-27 06:04:40 +0000
commite9bdc5f1d810f40aeccdafc1df100dc9a1cdc1d5 (patch)
tree778f5ef85594e83bcb35be3648aeff6bf7e428d3 /llvm/lib/Target
parent561e298e29b17123198396cda679d0e6c1ca021e (diff)
downloadbcm5719-llvm-e9bdc5f1d810f40aeccdafc1df100dc9a1cdc1d5.tar.gz
bcm5719-llvm-e9bdc5f1d810f40aeccdafc1df100dc9a1cdc1d5.zip
AMDGPU/GlobalISel: Fix crash in regbankselect on non-power-of-2 types
Reviewers: arsenm Reviewed By: arsenm Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, llvm-commits, t-tye Differential Revision: https://reviews.llvm.org/D49624 llvm-svn: 338102
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUGenRegisterBankInfo.def2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUGenRegisterBankInfo.def b/llvm/lib/Target/AMDGPU/AMDGPUGenRegisterBankInfo.def
index ef2dab781ad..3a58c6c6a29 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUGenRegisterBankInfo.def
+++ b/llvm/lib/Target/AMDGPU/AMDGPUGenRegisterBankInfo.def
@@ -96,7 +96,7 @@ const RegisterBankInfo::ValueMapping *getValueMapping(unsigned BankID,
break;
default:
Idx = BankID == AMDGPU::VGPRRegBankID ? VGPRStartIdx : SGPRStartIdx;
- Idx += llvm::countTrailingZeros(Size);
+ Idx += Log2_32_Ceil(Size);
break;
}
return &ValMappings[Idx];
OpenPOWER on IntegriCloud