mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 23:24:34 +00:00
[AlignmentFromAssumptions] Don't crash just because the target is 32-bit
We used to crash processing any relevant @llvm.assume on a 32-bit target (because we'd ask SE to subtract expressions of differing types). I've copied our 'simple.ll' test, but with the data layout from arm-linux-gnueabihf to get some meaningful test coverage here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217574 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -141,6 +141,10 @@ static unsigned getNewAlignment(const SCEV *AASCEV, const SCEV *AlignSCEV,
|
||||
const SCEV *PtrSCEV = SE->getSCEV(Ptr);
|
||||
const SCEV *DiffSCEV = SE->getMinusSCEV(PtrSCEV, AASCEV);
|
||||
|
||||
// On 32-bit platforms, DiffSCEV might now have type i32 -- we've always
|
||||
// sign-extended OffSCEV to i64, so make sure they agree again.
|
||||
DiffSCEV = SE->getNoopOrSignExtend(DiffSCEV, OffSCEV->getType());
|
||||
|
||||
// What we really want to know is the overall offset to the aligned
|
||||
// address. This address is displaced by the provided offset.
|
||||
DiffSCEV = SE->getMinusSCEV(DiffSCEV, OffSCEV);
|
||||
|
Reference in New Issue
Block a user