[llvm-commits] [gcc-plugin] r83403 - /gcc-plugin/trunk/x86/llvm-target.cpp
Duncan Sands
baldrick at free.fr
Tue Oct 6 12:39:28 PDT 2009
Author: baldrick
Date: Tue Oct 6 14:39:28 2009
New Revision: 83403
URL: http://llvm.org/viewvc/llvm-project?rev=83403&view=rev
Log:
Remove useless value names ("tmp") - this are not helpful,
and they fatten the bitcode.
Modified:
gcc-plugin/trunk/x86/llvm-target.cpp
Modified: gcc-plugin/trunk/x86/llvm-target.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/x86/llvm-target.cpp?rev=83403&r1=83402&r2=83403&view=diff
==============================================================================
--- gcc-plugin/trunk/x86/llvm-target.cpp (original)
+++ gcc-plugin/trunk/x86/llvm-target.cpp Tue Oct 6 14:39:28 2009
@@ -75,7 +75,7 @@
case IX86_BUILTIN_PADDW128:
case IX86_BUILTIN_PADDD128:
case IX86_BUILTIN_PADDQ128:
- Result = Builder.CreateAdd(Ops[0], Ops[1], "tmp");
+ Result = Builder.CreateAdd(Ops[0], Ops[1]);
return true;
case IX86_BUILTIN_SUBPS:
case IX86_BUILTIN_SUBPD:
@@ -87,34 +87,34 @@
case IX86_BUILTIN_PSUBW128:
case IX86_BUILTIN_PSUBD128:
case IX86_BUILTIN_PSUBQ128:
- Result = Builder.CreateSub(Ops[0], Ops[1], "tmp");
+ Result = Builder.CreateSub(Ops[0], Ops[1]);
return true;
case IX86_BUILTIN_MULPS:
case IX86_BUILTIN_MULPD:
case IX86_BUILTIN_PMULLW:
case IX86_BUILTIN_PMULLW128:
- Result = Builder.CreateMul(Ops[0], Ops[1], "tmp");
+ Result = Builder.CreateMul(Ops[0], Ops[1]);
return true;
case IX86_BUILTIN_DIVPS:
case IX86_BUILTIN_DIVPD:
- Result = Builder.CreateFDiv(Ops[0], Ops[1], "tmp");
+ Result = Builder.CreateFDiv(Ops[0], Ops[1]);
return true;
case IX86_BUILTIN_PAND:
case IX86_BUILTIN_PAND128:
- Result = Builder.CreateAnd(Ops[0], Ops[1], "tmp");
+ Result = Builder.CreateAnd(Ops[0], Ops[1]);
return true;
case IX86_BUILTIN_PANDN:
case IX86_BUILTIN_PANDN128:
- Ops[0] = Builder.CreateNot(Ops[0], "tmp");
- Result = Builder.CreateAnd(Ops[0], Ops[1], "tmp");
+ Ops[0] = Builder.CreateNot(Ops[0]);
+ Result = Builder.CreateAnd(Ops[0], Ops[1]);
return true;
case IX86_BUILTIN_POR:
case IX86_BUILTIN_POR128:
- Result = Builder.CreateOr(Ops[0], Ops[1], "tmp");
+ Result = Builder.CreateOr(Ops[0], Ops[1]);
return true;
case IX86_BUILTIN_PXOR:
case IX86_BUILTIN_PXOR128:
- Result = Builder.CreateXor(Ops[0], Ops[1], "tmp");
+ Result = Builder.CreateXor(Ops[0], Ops[1]);
return true;
case IX86_BUILTIN_ANDPS:
case IX86_BUILTIN_ORPS:
@@ -133,27 +133,27 @@
VectorType::get(Type::getInt64Ty(Context), 2),
"tmp");
- Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType(), "tmp");
+ Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType());
switch (FnCode) {
case IX86_BUILTIN_ANDPS:
case IX86_BUILTIN_ANDPD:
- Result = Builder.CreateAnd(Ops[0], Ops[1], "tmp");
+ Result = Builder.CreateAnd(Ops[0], Ops[1]);
break;
case IX86_BUILTIN_ORPS:
case IX86_BUILTIN_ORPD:
- Result = Builder.CreateOr (Ops[0], Ops[1], "tmp");
+ Result = Builder.CreateOr (Ops[0], Ops[1]);
break;
case IX86_BUILTIN_XORPS:
case IX86_BUILTIN_XORPD:
- Result = Builder.CreateXor(Ops[0], Ops[1], "tmp");
+ Result = Builder.CreateXor(Ops[0], Ops[1]);
break;
case IX86_BUILTIN_ANDNPS:
case IX86_BUILTIN_ANDNPD:
- Ops[0] = Builder.CreateNot(Ops[0], "tmp");
- Result = Builder.CreateAnd(Ops[0], Ops[1], "tmp");
+ Ops[0] = Builder.CreateNot(Ops[0]);
+ Result = Builder.CreateAnd(Ops[0], Ops[1]);
break;
}
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
+ Result = Builder.CreateBitCast(Result, ResultType);
return true;
case IX86_BUILTIN_SHUFPS:
if (ConstantInt *Elt = dyn_cast<ConstantInt>(Ops[2])) {
@@ -293,20 +293,20 @@
}
case IX86_BUILTIN_LOADQ: {
const PointerType *i64Ptr = Type::getInt64PtrTy(Context);
- Ops[0] = Builder.CreateBitCast(Ops[0], i64Ptr, "tmp");
- Ops[0] = Builder.CreateLoad(Ops[0], "tmp");
+ Ops[0] = Builder.CreateBitCast(Ops[0], i64Ptr);
+ Ops[0] = Builder.CreateLoad(Ops[0]);
Value *Zero = ConstantInt::get(Type::getInt64Ty(Context), 0);
Result = BuildVector(Zero, Zero, NULL);
Value *Idx = ConstantInt::get(Type::getInt32Ty(Context), 0);
- Result = Builder.CreateInsertElement(Result, Ops[0], Idx, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
+ Result = Builder.CreateInsertElement(Result, Ops[0], Idx);
+ Result = Builder.CreateBitCast(Result, ResultType);
return true;
}
case IX86_BUILTIN_LOADUPS: {
VectorType *v4f32 = VectorType::get(Type::getFloatTy(Context), 4);
const PointerType *v4f32Ptr = v4f32->getPointerTo();
- Value *BC = Builder.CreateBitCast(Ops[0], v4f32Ptr, "tmp");
- LoadInst *LI = Builder.CreateLoad(BC, "tmp");
+ Value *BC = Builder.CreateBitCast(Ops[0], v4f32Ptr);
+ LoadInst *LI = Builder.CreateLoad(BC);
LI->setAlignment(1);
Result = LI;
return true;
@@ -314,8 +314,8 @@
case IX86_BUILTIN_LOADUPD: {
VectorType *v2f64 = VectorType::get(Type::getDoubleTy(Context), 2);
const PointerType *v2f64Ptr = v2f64->getPointerTo();
- Value *BC = Builder.CreateBitCast(Ops[0], v2f64Ptr, "tmp");
- LoadInst *LI = Builder.CreateLoad(BC, "tmp");
+ Value *BC = Builder.CreateBitCast(Ops[0], v2f64Ptr);
+ LoadInst *LI = Builder.CreateLoad(BC);
LI->setAlignment(1);
Result = LI;
return true;
@@ -323,8 +323,8 @@
case IX86_BUILTIN_LOADDQU: {
VectorType *v16i8 = VectorType::get(Type::getInt8Ty(Context), 16);
const PointerType *v16i8Ptr = v16i8->getPointerTo();
- Value *BC = Builder.CreateBitCast(Ops[0], v16i8Ptr, "tmp");
- LoadInst *LI = Builder.CreateLoad(BC, "tmp");
+ Value *BC = Builder.CreateBitCast(Ops[0], v16i8Ptr);
+ LoadInst *LI = Builder.CreateLoad(BC);
LI->setAlignment(1);
Result = LI;
return true;
@@ -332,7 +332,7 @@
case IX86_BUILTIN_STOREUPS: {
VectorType *v4f32 = VectorType::get(Type::getFloatTy(Context), 4);
const PointerType *v4f32Ptr = v4f32->getPointerTo();
- Value *BC = Builder.CreateBitCast(Ops[0], v4f32Ptr, "tmp");
+ Value *BC = Builder.CreateBitCast(Ops[0], v4f32Ptr);
StoreInst *SI = Builder.CreateStore(Ops[1], BC);
SI->setAlignment(1);
Result = SI;
@@ -341,7 +341,7 @@
case IX86_BUILTIN_STOREUPD: {
VectorType *v2f64 = VectorType::get(Type::getDoubleTy(Context), 2);
const PointerType *v2f64Ptr = v2f64->getPointerTo();
- Value *BC = Builder.CreateBitCast(Ops[0], v2f64Ptr, "tmp");
+ Value *BC = Builder.CreateBitCast(Ops[0], v2f64Ptr);
StoreInst *SI = Builder.CreateStore(Ops[1], BC);
SI->setAlignment(1);
Result = SI;
@@ -350,7 +350,7 @@
case IX86_BUILTIN_STOREDQU: {
VectorType *v16i8 = VectorType::get(Type::getInt8Ty(Context), 16);
const PointerType *v16i8Ptr = v16i8->getPointerTo();
- Value *BC = Builder.CreateBitCast(Ops[0], v16i8Ptr, "tmp");
+ Value *BC = Builder.CreateBitCast(Ops[0], v16i8Ptr);
StoreInst *SI = Builder.CreateStore(Ops[1], BC);
SI->setAlignment(1);
Result = SI;
@@ -358,57 +358,57 @@
}
case IX86_BUILTIN_LOADHPS: {
const PointerType *f64Ptr = Type::getDoublePtrTy(Context);
- Ops[1] = Builder.CreateBitCast(Ops[1], f64Ptr, "tmp");
- Value *Load = Builder.CreateLoad(Ops[1], "tmp");
+ Ops[1] = Builder.CreateBitCast(Ops[1], f64Ptr);
+ Value *Load = Builder.CreateLoad(Ops[1]);
Ops[1] = BuildVector(Load, UndefValue::get(Type::getDoubleTy(Context)), NULL);
- Ops[1] = Builder.CreateBitCast(Ops[1], ResultType, "tmp");
+ Ops[1] = Builder.CreateBitCast(Ops[1], ResultType);
Result = BuildVectorShuffle(Ops[0], Ops[1], 0, 1, 4, 5);
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
+ Result = Builder.CreateBitCast(Result, ResultType);
return true;
}
case IX86_BUILTIN_LOADLPS: {
const PointerType *f64Ptr = Type::getDoublePtrTy(Context);
- Ops[1] = Builder.CreateBitCast(Ops[1], f64Ptr, "tmp");
- Value *Load = Builder.CreateLoad(Ops[1], "tmp");
+ Ops[1] = Builder.CreateBitCast(Ops[1], f64Ptr);
+ Value *Load = Builder.CreateLoad(Ops[1]);
Ops[1] = BuildVector(Load, UndefValue::get(Type::getDoubleTy(Context)), NULL);
- Ops[1] = Builder.CreateBitCast(Ops[1], ResultType, "tmp");
+ Ops[1] = Builder.CreateBitCast(Ops[1], ResultType);
Result = BuildVectorShuffle(Ops[0], Ops[1], 4, 5, 2, 3);
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
+ Result = Builder.CreateBitCast(Result, ResultType);
return true;
}
case IX86_BUILTIN_LOADHPD: {
- Value *Load = Builder.CreateLoad(Ops[1], "tmp");
+ Value *Load = Builder.CreateLoad(Ops[1]);
Ops[1] = BuildVector(Load, UndefValue::get(Type::getDoubleTy(Context)), NULL);
- Ops[1] = Builder.CreateBitCast(Ops[1], ResultType, "tmp");
+ Ops[1] = Builder.CreateBitCast(Ops[1], ResultType);
Result = BuildVectorShuffle(Ops[0], Ops[1], 0, 2);
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
+ Result = Builder.CreateBitCast(Result, ResultType);
return true;
}
case IX86_BUILTIN_LOADLPD: {
- Value *Load = Builder.CreateLoad(Ops[1], "tmp");
+ Value *Load = Builder.CreateLoad(Ops[1]);
Ops[1] = BuildVector(Load, UndefValue::get(Type::getDoubleTy(Context)), NULL);
- Ops[1] = Builder.CreateBitCast(Ops[1], ResultType, "tmp");
+ Ops[1] = Builder.CreateBitCast(Ops[1], ResultType);
Result = BuildVectorShuffle(Ops[0], Ops[1], 2, 1);
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
+ Result = Builder.CreateBitCast(Result, ResultType);
return true;
}
case IX86_BUILTIN_STOREHPS: {
VectorType *v2f64 = VectorType::get(Type::getDoubleTy(Context), 2);
const PointerType *f64Ptr = Type::getDoublePtrTy(Context);
- Ops[0] = Builder.CreateBitCast(Ops[0], f64Ptr, "tmp");
+ Ops[0] = Builder.CreateBitCast(Ops[0], f64Ptr);
Value *Idx = ConstantInt::get(Type::getInt32Ty(Context), 1);
- Ops[1] = Builder.CreateBitCast(Ops[1], v2f64, "tmp");
- Ops[1] = Builder.CreateExtractElement(Ops[1], Idx, "tmp");
+ Ops[1] = Builder.CreateBitCast(Ops[1], v2f64);
+ Ops[1] = Builder.CreateExtractElement(Ops[1], Idx);
Result = Builder.CreateStore(Ops[1], Ops[0]);
return true;
}
case IX86_BUILTIN_STORELPS: {
VectorType *v2f64 = VectorType::get(Type::getDoubleTy(Context), 2);
const PointerType *f64Ptr = Type::getDoublePtrTy(Context);
- Ops[0] = Builder.CreateBitCast(Ops[0], f64Ptr, "tmp");
+ Ops[0] = Builder.CreateBitCast(Ops[0], f64Ptr);
Value *Idx = ConstantInt::get(Type::getInt32Ty(Context), 0);
- Ops[1] = Builder.CreateBitCast(Ops[1], v2f64, "tmp");
- Ops[1] = Builder.CreateExtractElement(Ops[1], Idx, "tmp");
+ Ops[1] = Builder.CreateBitCast(Ops[1], v2f64);
+ Ops[1] = Builder.CreateExtractElement(Ops[1], Idx);
Result = Builder.CreateStore(Ops[1], Ops[0]);
return true;
}
@@ -424,13 +424,13 @@
case IX86_BUILTIN_VEC_INIT_V4HI:
// Sometimes G++ promotes arguments to int.
for (unsigned i = 0; i != 4; ++i)
- Ops[i] = Builder.CreateIntCast(Ops[i], Type::getInt16Ty(Context), false, "tmp");
+ Ops[i] = Builder.CreateIntCast(Ops[i], Type::getInt16Ty(Context), false);
Result = BuildVector(Ops[0], Ops[1], Ops[2], Ops[3], NULL);
return true;
case IX86_BUILTIN_VEC_INIT_V8QI:
// Sometimes G++ promotes arguments to int.
for (unsigned i = 0; i != 8; ++i)
- Ops[i] = Builder.CreateIntCast(Ops[i], Type::getInt8Ty(Context), false, "tmp");
+ Ops[i] = Builder.CreateIntCast(Ops[i], Type::getInt8Ty(Context), false);
Result = BuildVector(Ops[0], Ops[1], Ops[2], Ops[3],
Ops[4], Ops[5], Ops[6], Ops[7], NULL);
return true;
@@ -442,24 +442,24 @@
case IX86_BUILTIN_VEC_EXT_V4SF:
case IX86_BUILTIN_VEC_EXT_V8HI:
case IX86_BUILTIN_VEC_EXT_V16QI:
- Result = Builder.CreateExtractElement(Ops[0], Ops[1], "tmp");
+ Result = Builder.CreateExtractElement(Ops[0], Ops[1]);
return true;
case IX86_BUILTIN_VEC_SET_V16QI:
// Sometimes G++ promotes arguments to int.
- Ops[1] = Builder.CreateIntCast(Ops[1], Type::getInt8Ty(Context), false, "tmp");
- Result = Builder.CreateInsertElement(Ops[0], Ops[1], Ops[2], "tmp");
+ Ops[1] = Builder.CreateIntCast(Ops[1], Type::getInt8Ty(Context), false);
+ Result = Builder.CreateInsertElement(Ops[0], Ops[1], Ops[2]);
return true;
case IX86_BUILTIN_VEC_SET_V4HI:
case IX86_BUILTIN_VEC_SET_V8HI:
// GCC sometimes doesn't produce the right element type.
- Ops[1] = Builder.CreateIntCast(Ops[1], Type::getInt16Ty(Context), false, "tmp");
- Result = Builder.CreateInsertElement(Ops[0], Ops[1], Ops[2], "tmp");
+ Ops[1] = Builder.CreateIntCast(Ops[1], Type::getInt16Ty(Context), false);
+ Result = Builder.CreateInsertElement(Ops[0], Ops[1], Ops[2]);
return true;
case IX86_BUILTIN_VEC_SET_V4SI:
- Result = Builder.CreateInsertElement(Ops[0], Ops[1], Ops[2], "tmp");
+ Result = Builder.CreateInsertElement(Ops[0], Ops[1], Ops[2]);
return true;
case IX86_BUILTIN_VEC_SET_V2DI:
- Result = Builder.CreateInsertElement(Ops[0], Ops[1], Ops[2], "tmp");
+ Result = Builder.CreateInsertElement(Ops[0], Ops[1], Ops[2]);
return true;
case IX86_BUILTIN_CMPEQPS:
case IX86_BUILTIN_CMPLTPS:
@@ -497,8 +497,8 @@
Value *Arg1 = Ops[1];
if (flip) std::swap(Arg0, Arg1);
Value *CallOps[3] = { Arg0, Arg1, Pred };
- Result = Builder.CreateCall(cmpps, CallOps, CallOps+3, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
+ Result = Builder.CreateCall(cmpps, CallOps, CallOps+3);
+ Result = Builder.CreateBitCast(Result, ResultType);
return true;
}
case IX86_BUILTIN_CMPEQSS:
@@ -527,8 +527,8 @@
}
Value *Pred = ConstantInt::get(Type::getInt8Ty(Context), PredCode);
Value *CallOps[3] = { Ops[0], Ops[1], Pred };
- Result = Builder.CreateCall(cmpss, CallOps, CallOps+3, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
+ Result = Builder.CreateCall(cmpss, CallOps, CallOps+3);
+ Result = Builder.CreateBitCast(Result, ResultType);
return true;
}
case IX86_BUILTIN_CMPEQPD:
@@ -568,8 +568,8 @@
if (flip) std::swap(Arg0, Arg1);
Value *CallOps[3] = { Arg0, Arg1, Pred };
- Result = Builder.CreateCall(cmppd, CallOps, CallOps+3, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
+ Result = Builder.CreateCall(cmppd, CallOps, CallOps+3);
+ Result = Builder.CreateBitCast(Result, ResultType);
return true;
}
case IX86_BUILTIN_CMPEQSD:
@@ -596,8 +596,8 @@
}
Value *Pred = ConstantInt::get(Type::getInt8Ty(Context), PredCode);
Value *CallOps[3] = { Ops[0], Ops[1], Pred };
- Result = Builder.CreateCall(cmpsd, CallOps, CallOps+3, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
+ Result = Builder.CreateCall(cmpsd, CallOps, CallOps+3);
+ Result = Builder.CreateBitCast(Result, ResultType);
return true;
}
case IX86_BUILTIN_LDMXCSR: {
@@ -605,7 +605,7 @@
Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse_ldmxcsr);
Value *Ptr = CreateTemporary(Type::getInt32Ty(Context));
Builder.CreateStore(Ops[0], Ptr);
- Ptr = Builder.CreateBitCast(Ptr, Type::getInt8PtrTy(Context), "tmp");
+ Ptr = Builder.CreateBitCast(Ptr, Type::getInt8PtrTy(Context));
Result = Builder.CreateCall(ldmxcsr, Ptr);
return true;
}
@@ -613,10 +613,10 @@
Function *stmxcsr =
Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse_stmxcsr);
Value *Ptr = CreateTemporary(Type::getInt32Ty(Context));
- Value *BPtr = Builder.CreateBitCast(Ptr, Type::getInt8PtrTy(Context), "tmp");
+ Value *BPtr = Builder.CreateBitCast(Ptr, Type::getInt8PtrTy(Context));
Builder.CreateCall(stmxcsr, BPtr);
- Result = Builder.CreateLoad(Ptr, "tmp");
+ Result = Builder.CreateLoad(Ptr);
return true;
}
}
More information about the llvm-commits
mailing list