Remove GlobalValue::getAlignment().
authorEli Friedman <efriedma@quicinc.com>
Tue, 19 May 2020 03:38:13 +0000 (20:38 -0700)
committerEli Friedman <efriedma@quicinc.com>
Wed, 24 Jun 2020 02:13:42 +0000 (19:13 -0700)
commita2caa3b61497b6be8c8b77823d0fd62b4be1f177
tree9da9e17f80ffd8bb60a06eb2d7932c8a91611932
parentf8bd6a75edac7560deb5fdcb31041b454dd9d7e0
Remove GlobalValue::getAlignment().

This function is deceptive at best: it doesn't return what you'd expect.
If you have an arbitrary GlobalValue and you want to determine the
alignment of that pointer, Value::getPointerAlignment() returns the
correct value.  If you want the actual declared alignment of a function
or variable, GlobalObject::getAlignment() returns that.

This patch switches all the users of GlobalValue::getAlignment to an
appropriate alternative.

Differential Revision: https://reviews.llvm.org/D80368
25 files changed:
llvm/include/llvm/CodeGen/AsmPrinter.h
llvm/include/llvm/IR/GlobalObject.h
llvm/include/llvm/IR/GlobalValue.h
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/IR/ConstantFold.cpp
llvm/lib/IR/Core.cpp
llvm/lib/IR/Globals.cpp
llvm/lib/IR/Verifier.cpp
llvm/lib/LTO/LTOModule.cpp
llvm/lib/Object/IRSymtab.cpp
llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
llvm/lib/Target/SystemZ/SystemZSubtarget.cpp
llvm/lib/Target/XCore/XCoreISelLowering.cpp
llvm/test/CodeGen/AArch64/funcptr_cast.ll
llvm/test/CodeGen/AArch64/global-alignment.ll
llvm/test/CodeGen/PowerPC/atomics-constant.ll