llvm.org GIT mirror llvm / 72eaa0e
deepen my MMX/SRoA hack to avoid hurting non-x86 codegen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112763 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 9 years ago
2 changed file(s) with 9 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2727 #include "llvm/Instructions.h"
2828 #include "llvm/IntrinsicInst.h"
2929 #include "llvm/LLVMContext.h"
30 #include "llvm/Module.h"
3031 #include "llvm/Pass.h"
3132 #include "llvm/Analysis/Dominators.h"
3233 #include "llvm/Target/TargetData.h"
196197 /// IsVerbotenVectorType - Return true if this is a vector type ScalarRepl isn't
197198 /// allowed to form. We do this to avoid MMX types, which is a complete hack,
198199 /// but is required until the backend is fixed.
199 static bool IsVerbotenVectorType(const VectorType *VTy) {
200 static bool IsVerbotenVectorType(const VectorType *VTy, const Instruction *I) {
201 StringRef Triple(I->getParent()->getParent()->getParent()->getTargetTriple());
202 if (!Triple.startswith("i386") &&
203 !Triple.startswith("x86_64"))
204 return false;
205
200206 // Reject all the MMX vector types.
201207 switch (VTy->getNumElements()) {
202208 default: return false;
225231 // involved, then we probably really do have a union of vector/array.
226232 const Type *NewTy;
227233 if (VectorTy && VectorTy->isVectorTy() && HadAVector &&
228 !IsVerbotenVectorType(cast(VectorTy))) {
234 !IsVerbotenVectorType(cast(VectorTy), AI)) {
229235 DEBUG(dbgs() << "CONVERT TO VECTOR: " << *AI << "\n TYPE = "
230236 << *VectorTy << '\n');
231237 NewTy = VectorTy; // Use the vector type.
0 ; RUN: opt < %s -scalarrepl -S | FileCheck %s
11 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
2 target triple = "x86_64-apple-darwin10.0.0"
23
34 define void @test1(<4 x float>* %F, float %f) {
45 entry: