projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[AlignmentFromAssumptions] Don't crash just because the target is 32-bit
[oota-llvm.git]
/
lib
/
Transforms
/
Scalar
/
AlignmentFromAssumptions.cpp
diff --git
a/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
b/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
index 7ab16f13811ffdbaefca905b09291674227d64ef..06c3dfdf637b4bd41568c4ce115ba136064a0a3f 100644
(file)
--- a/
lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
+++ b/
lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
@@
-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);
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);
// 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);