mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Change MachineMemOperand's alignment value to be the alignment of
the base pointer, without the offset. This matches MemSDNode's new alignment behavior, and holds more interesting information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82473 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
#ifndef LLVM_CODEGEN_MACHINEMEMOPERAND_H
|
||||
#define LLVM_CODEGEN_MACHINEMEMOPERAND_H
|
||||
|
||||
#include "llvm/Support/MathExtras.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
class Value;
|
||||
@@ -47,9 +49,9 @@ public:
|
||||
};
|
||||
|
||||
/// MachineMemOperand - Construct an MachineMemOperand object with the
|
||||
/// specified address Value, flags, offset, size, and alignment.
|
||||
/// specified address Value, flags, offset, size, and base alignment.
|
||||
MachineMemOperand(const Value *v, unsigned int f, int64_t o, uint64_t s,
|
||||
unsigned int a);
|
||||
unsigned int base_alignment);
|
||||
|
||||
/// getValue - Return the base address of the memory access. This may either
|
||||
/// be a normal LLVM IR Value, or one of the special values used in CodeGen.
|
||||
@@ -72,8 +74,14 @@ public:
|
||||
uint64_t getSize() const { return Size; }
|
||||
|
||||
/// getAlignment - Return the minimum known alignment in bytes of the
|
||||
/// memory reference.
|
||||
unsigned int getAlignment() const { return (1u << (Flags >> 3)) >> 1; }
|
||||
/// actual memory reference.
|
||||
uint64_t getAlignment() const {
|
||||
return MinAlign(getBaseAlignment(), getOffset());
|
||||
}
|
||||
|
||||
/// getBaseAlignment - Return the minimum known alignment in bytes of the
|
||||
/// base address, without the offset.
|
||||
uint64_t getBaseAlignment() const { return (1u << (Flags >> 3)) >> 1; }
|
||||
|
||||
bool isLoad() const { return Flags & MOLoad; }
|
||||
bool isStore() const { return Flags & MOStore; }
|
||||
|
||||
Reference in New Issue
Block a user