[llvm-commits] [llvm-gcc-4.2] r79470 - /llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
Bob Wilson
bob.wilson at apple.com
Wed Aug 19 14:25:05 PDT 2009
Author: bwilson
Date: Wed Aug 19 16:25:05 2009
New Revision: 79470
URL: http://llvm.org/viewvc/llvm-project?rev=79470&view=rev
Log:
Revise the fix for pr4731. The vector types should be canonicalized in code
gen, not in the front-end. The revised patch is essentially what Sandeep Patel
proposed in the bug report.
Modified:
llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp?rev=79470&r1=79469&r2=79470&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp Wed Aug 19 16:25:05 2009
@@ -1866,20 +1866,13 @@
break;
}
- case NEON_BUILTIN_vbsl: {
- // Canonicalize the vector type to have 32-bit integer elements.
- const VectorType *VTy = dyn_cast<const VectorType>(Ops[0]->getType());
- assert(VTy && "expected a vector type");
- VTy = VectorType::get(Type::getInt32Ty(Context), VTy->getBitWidth() / 32);
- Ops[0] = Builder.CreateBitCast(Ops[0], VTy);
- Ops[1] = Builder.CreateBitCast(Ops[1], VTy);
- Ops[2] = Builder.CreateBitCast(Ops[2], VTy);
+ case NEON_BUILTIN_vbsl:
+ Ops[1] = BitCastToType(Ops[1], Ops[0]->getType());
+ Ops[2] = BitCastToType(Ops[2], Ops[0]->getType());
Result = Builder.CreateOr(Builder.CreateAnd(Ops[1], Ops[0]),
Builder.CreateAnd(Ops[2],
Builder.CreateNot(Ops[0])));
- Result = Builder.CreateBitCast(Result, ResultType);
break;
- }
case NEON_BUILTIN_vtbl1:
case NEON_BUILTIN_vtbl2:
More information about the llvm-commits
mailing list