[cfe-dev] support for all AltiVec functions except those with bool/pixel arguments
Chris Lattner
clattner at apple.com
Tue Jun 15 10:47:33 PDT 2010
On Jun 10, 2010, at 3:31 PM, Anton Yartsev wrote:
> The patch enables support for all the AltiVec functions from the PIM except those with bool/pixel arguments. Pleas review.
> Attach also contains C++ variant of test.
>
> The patch is equivalent to those i have sent a few weeks ago (http://thread.gmane.org/gmane.comp.compilers.clang.devel/8527) but it was probably lost
This patch looks great. One minor comment:
+ case PPC::BI__builtin_altivec_lvsr:
+ {
+ Ops[1] = Builder.CreateBitCast(Ops[1], llvm::Type::getInt8PtrTy(VMContext));
+
+ Ops[0] = !isa<Constant>(Ops[0]) || !cast<Constant>(Ops[0])->isNullValue()
+ ? Builder.CreateGEP(Ops[1], Ops[0], "tmp") : Ops[1];
There is no need to special case null here. Please just unconditionally use 'Builder.CreateGEP(Ops[1], Ops[0], "tmp")'.
With that simplification, please apply!
-Chris
More information about the cfe-dev
mailing list