diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2010-04-01 18:19:11 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2010-04-01 18:19:11 +0000 |
| commit | 4c014c892a36ac9a8423573b132408009d0738ae (patch) | |
| tree | 0166b9ce9389e54216c494b80492b944a3ea890f /llvm/lib/Target/X86/X86ISelLowering.cpp | |
| parent | 1a55ef0427f242827f37e80c5c48baba756ba46d (diff) | |
| download | bcm5719-llvm-4c014c892a36ac9a8423573b132408009d0738ae.tar.gz bcm5719-llvm-4c014c892a36ac9a8423573b132408009d0738ae.zip | |
- Avoid using floating point stores to implement memset unless the value is zero.
- Do not try to infer GV alignment unless its type is sized. It's not possible to infer alignment if it has opaque type.
llvm-svn: 100118
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index bd268eca8f5..5d6e571db12 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -1076,6 +1076,7 @@ unsigned X86TargetLowering::getByValTypeAlignment(const Type *Ty) const { EVT X86TargetLowering::getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign, + bool SafeToUseFP, SelectionDAG &DAG) const { // FIXME: This turns off use of xmm stores for memset/memcpy on targets like // linux. This is because the stack realignment code can't handle certain @@ -1089,9 +1090,10 @@ X86TargetLowering::getOptimalMemOpType(uint64_t Size, Subtarget->getStackAlignment() >= 16) { if (Subtarget->hasSSE2()) return MVT::v4i32; - if (Subtarget->hasSSE1()) + if (SafeToUseFP && Subtarget->hasSSE1()) return MVT::v4f32; - } else if (Size >= 8 && + } else if (SafeToUseFP && + Size >= 8 && Subtarget->getStackAlignment() >= 8 && Subtarget->hasSSE2()) return MVT::f64; |

