diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-10-22 21:41:48 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-10-22 21:41:48 +0000 |
commit | 364f17c47162a657bb0c3516588cdfc5297664f0 (patch) | |
tree | 0918a127f169b730b88d18900f3ee4227451d088 /lib/Transforms | |
parent | b179b46cc558c720d23a066c768bad71f975eb93 (diff) | |
download | external_llvm-364f17c47162a657bb0c3516588cdfc5297664f0.zip external_llvm-364f17c47162a657bb0c3516588cdfc5297664f0.tar.gz external_llvm-364f17c47162a657bb0c3516588cdfc5297664f0.tar.bz2 |
Teach instcombine to set the alignment arguments for NEON load/store intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117154 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineCalls.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index ed078ec..d53f329 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -702,6 +702,32 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { } break; + case Intrinsic::arm_neon_vld1: + case Intrinsic::arm_neon_vld2: + case Intrinsic::arm_neon_vld3: + case Intrinsic::arm_neon_vld4: + case Intrinsic::arm_neon_vld2lane: + case Intrinsic::arm_neon_vld3lane: + case Intrinsic::arm_neon_vld4lane: + case Intrinsic::arm_neon_vst1: + case Intrinsic::arm_neon_vst2: + case Intrinsic::arm_neon_vst3: + case Intrinsic::arm_neon_vst4: + case Intrinsic::arm_neon_vst2lane: + case Intrinsic::arm_neon_vst3lane: + case Intrinsic::arm_neon_vst4lane: { + unsigned MemAlign = GetOrEnforceKnownAlignment(II->getArgOperand(0)); + unsigned AlignArg = II->getNumArgOperands() - 1; + ConstantInt *IntrAlign = dyn_cast<ConstantInt>(II->getArgOperand(AlignArg)); + if (IntrAlign && IntrAlign->getZExtValue() < MemAlign) { + II->setArgOperand(AlignArg, + ConstantInt::get(Type::getInt32Ty(II->getContext()), + MemAlign, false)); + return II; + } + break; + } + case Intrinsic::stackrestore: { // If the save is right next to the restore, remove the restore. This can // happen when variable allocas are DCE'd. |