diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-04-17 18:22:36 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-04-17 18:22:36 +0000 |
commit | 5b4f5b088760ab7de3733cf3da391c10fbea3d22 (patch) | |
tree | 8b6a723d3fb4bb1d815c96f4aba1c0925fb59cbf /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 46e36f0953aabb5e5cd00ed8d296d60f9f71b424 (diff) | |
download | llvm-5b4f5b088760ab7de3733cf3da391c10fbea3d22.zip llvm-5b4f5b088760ab7de3733cf3da391c10fbea3d22.tar.gz llvm-5b4f5b088760ab7de3733cf3da391c10fbea3d22.tar.bz2 |
[IR] Implement DataLayout::getPointerTypeSizeInBits using getPointerSizeInBits directly
Currently we use getTypeSizeInBits which contains a switch statement to dispatch based on what the Type is. We know we always have a pointer type here, but the compiler isn't able to figure out that out to remove the switch.
This patch changes it to just call handle the pointer type directly by calling getPointerSizeInBits without going through a switch.
getPointerTypeSizeInBits is called pretty often, particularly by getOrEnforceKnownAlignment which is used by InstCombine. This should speed that up a little bit.
Differential Revision: https://reviews.llvm.org/D31841
llvm-svn: 300475
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions