diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2025-12-06 19:56:45 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2025-12-06 20:08:43 +0000 |
| commit | 3f709e42e3be0f28a88ca3e77663a02b52c914f4 (patch) | |
| tree | 948796bf3bf7e164373caf6c31f9f128ca85fd8c /llvm/lib/Target/SystemZ/SystemZSubtarget.cpp | |
| parent | 32a711e1c447004eb1fd015925f305ed1d8426de (diff) | |
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZSubtarget.cpp')
| -rw-r--r-- | llvm/lib/Target/SystemZ/SystemZSubtarget.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp b/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp index 6c376e4bf622..942ef8838562 100644 --- a/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp +++ b/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp @@ -8,7 +8,7 @@ #include "SystemZSubtarget.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" -#include "llvm/IR/GlobalValue.h" +#include "llvm/IR/GlobalVariable.h" #include "llvm/Target/TargetMachine.h" using namespace llvm; @@ -83,9 +83,9 @@ bool SystemZSubtarget::isAddressedViaADA(const GlobalValue *GV) const { // least two byte alignment, then generated code can use relative // instructions to address the variable. Otherwise, use the ADA to address // the variable. - if (GO->getAlignment() & 0x1) { - return true; - } + if (auto *GV = dyn_cast<GlobalVariable>(GO)) + if (GV->getAlign() && (*GV->getAlign()).value() & 0x1) + return true; // getKindForGlobal only works with definitions if (GO->isDeclaration()) { |
