summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-11-19 05:56:52 +0000
committerPete Cooper <peter_cooper@apple.com>2015-11-19 05:56:52 +0000
commit67cf9a723ba5cf0a711efcb317b241104b558779 (patch)
treee362be29f8f95e45470715ea59a93f2b8ad86de9 /llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
parent3b39e88ae0e1f260ebb89f874d8006cb0b87fd2f (diff)
downloadbcm5719-llvm-67cf9a723ba5cf0a711efcb317b241104b558779.tar.gz
bcm5719-llvm-67cf9a723ba5cf0a711efcb317b241104b558779.zip
Revert "Change memcpy/memset/memmove to have dest and source alignments."
This reverts commit r253511. This likely broke the bots in http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/20202 http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/3787 llvm-svn: 253543
Diffstat (limited to 'llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
index f041a296684..a13e552cbd0 100644
--- a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
+++ b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
@@ -347,8 +347,6 @@ bool AlignmentFromAssumptions::processAssumption(CallInst *ACall) {
// instruction, but only for one operand, save it. If we reach the
// other operand through another assumption later, then we may
// change the alignment at that point.
- // FIXME: The above statement is no longer true. Fix the code below
- // to be able to reason about different dest/src alignments.
if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(MI)) {
unsigned NewSrcAlignment = getNewAlignment(AASCEV, AlignSCEV, OffSCEV,
MTI->getSource(), SE);
@@ -378,23 +376,20 @@ bool AlignmentFromAssumptions::processAssumption(CallInst *ACall) {
if (AltSrcAlignment <= std::max(NewDestAlignment, AltDestAlignment))
NewAlignment = std::max(NewAlignment, AltSrcAlignment);
- if (NewAlignment > MTI->getDestAlignment()) {
- MTI->setDestAlignment(NewAlignment);
- ++NumMemIntAlignChanged;
- }
-
- if (NewAlignment > MTI->getSrcAlignment()) {
- MTI->setSrcAlignment(NewAlignment);
+ if (NewAlignment > MI->getAlignment()) {
+ MI->setAlignment(ConstantInt::get(Type::getInt32Ty(
+ MI->getParent()->getContext()), NewAlignment));
++NumMemIntAlignChanged;
}
NewDestAlignments.insert(std::make_pair(MTI, NewDestAlignment));
NewSrcAlignments.insert(std::make_pair(MTI, NewSrcAlignment));
- } else if (NewDestAlignment > MI->getDestAlignment()) {
+ } else if (NewDestAlignment > MI->getAlignment()) {
assert((!isa<MemIntrinsic>(MI) || isa<MemSetInst>(MI)) &&
"Unknown memory intrinsic");
- MI->setDestAlignment(NewDestAlignment);
+ MI->setAlignment(ConstantInt::get(Type::getInt32Ty(
+ MI->getParent()->getContext()), NewDestAlignment));
++NumMemIntAlignChanged;
}
}
OpenPOWER on IntegriCloud