diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-03-16 21:45:12 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-03-16 21:45:12 +0000 |
commit | 08212631e15a17157368af03180018601b31fb4d (patch) | |
tree | 16bb56f2aa62f35731a19b726e55935943e30a93 /lib/CodeGen/CGCall.cpp | |
parent | b655bf06d99bbdb58de5d012642b87cabddabd83 (diff) |
When "low alignment" is specified, then set the alignment of the aggregate's
store to 1. This allows code-gen to select a more appropriate alignment. If left
to zero, an alignment greater than the alignment of the pointer may be selected,
causing code-gen to use instructions which require an alignment greater than the
pointer guarantees.
<rdar://problem/11043589>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152951 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 4fe4fa8a14..4455f1a086 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -623,7 +623,9 @@ static void BuildAggStore(CodeGenFunction &CGF, llvm::Value *Val, SI->setAlignment(1); } } else { - CGF.Builder.CreateStore(Val, DestPtr, DestIsVolatile); + llvm::StoreInst *SI = CGF.Builder.CreateStore(Val, DestPtr, DestIsVolatile); + if (LowAlignment) + SI->setAlignment(1); } } |