mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-23 01:25:32 +00:00
[ARM] Fix handling of thumb1 out-of-range frame offsets
LocalStackSlotPass assumes that isFrameOffsetLegal doesn't change its answer when the base register changes. Unfortunately this isn't true in thumb1, where SP-based loads allow a larger offset than non-SP-based loads, and this causes the base register reuse code to generate instructions that are unencodable, causing an assertion failure. Solve this by adding a BaseReg parameter to isFrameOffsetLegal, which ARMBaseRegisterInfo can then make use of to give the correct answer. Differential Revision: http://reviews.llvm.org/D8419 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232825 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -799,9 +799,9 @@ public:
|
||||
llvm_unreachable("resolveFrameIndex does not exist on this target");
|
||||
}
|
||||
|
||||
/// isFrameOffsetLegal - Determine whether a given offset immediate is
|
||||
/// encodable to resolve a frame index.
|
||||
virtual bool isFrameOffsetLegal(const MachineInstr *MI,
|
||||
/// isFrameOffsetLegal - Determine whether a given base register plus offset
|
||||
/// immediate is encodable to resolve a frame index.
|
||||
virtual bool isFrameOffsetLegal(const MachineInstr *MI, unsigned BaseReg,
|
||||
int64_t Offset) const {
|
||||
llvm_unreachable("isFrameOffsetLegal does not exist on this target");
|
||||
}
|
||||
|
Reference in New Issue
Block a user