[llvm-commits] [dragonegg] r127402 - in /dragonegg/trunk: llvm-convert.cpp llvm-internal.h
Duncan Sands
baldrick at free.fr
Thu Mar 10 02:27:56 PST 2011
Author: baldrick
Date: Thu Mar 10 04:27:55 2011
New Revision: 127402
URL: http://llvm.org/viewvc/llvm-project?rev=127402&view=rev
Log:
Factor the logic for turning a constant CONSTRUCTOR into a
register of vector type.
Modified:
dragonegg/trunk/llvm-convert.cpp
dragonegg/trunk/llvm-internal.h
Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=127402&r1=127401&r2=127402&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Thu Mar 10 04:27:55 2011
@@ -5914,9 +5914,8 @@
return EmitVectorRegisterConstant(reg);
case CONSTRUCTOR:
// Vector constant constructors are gimple invariant. See GCC testcase
- // pr34856.c.
- return Mem2Reg(TreeConstantToLLVM::ConvertCONSTRUCTOR(reg), TREE_TYPE(reg),
- *TheFolder);
+ // pr34856.c for an example.
+ return EmitConstantVectorConstructor(reg);
}
}
@@ -6022,6 +6021,13 @@
return ConstantFP::get(Context, APFloat(I, !isPPC_FP128));
}
+/// EmitConstantVectorConstructor - Turn the given constant CONSTRUCTOR into
+/// an LLVM constant of the corresponding vector register type.
+Constant *TreeToLLVM::EmitConstantVectorConstructor(tree reg) {
+ Constant *C = TreeConstantToLLVM::ConvertCONSTRUCTOR(reg);
+ return Mem2Reg(C, TREE_TYPE(reg), *TheFolder);
+}
+
/// EmitVectorRegisterConstant - Turn the given VECTOR_CST into an LLVM constant
/// of the corresponding register type.
Constant *TreeToLLVM::EmitVectorRegisterConstant(tree reg) {
Modified: dragonegg/trunk/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-internal.h?rev=127402&r1=127401&r2=127402&view=diff
==============================================================================
--- dragonegg/trunk/llvm-internal.h (original)
+++ dragonegg/trunk/llvm-internal.h Thu Mar 10 04:27:55 2011
@@ -802,8 +802,12 @@
/// of the corresponding register type.
Constant *EmitRealRegisterConstant(tree_node *reg);
+ /// EmitConstantVectorConstructor - Turn the given constant CONSTRUCTOR into
+ /// an LLVM constant of the corresponding vector register type.
+ Constant *EmitConstantVectorConstructor(tree_node *reg);
+
/// EmitVectorRegisterConstant - Turn the given VECTOR_CST into an LLVM
- // constant of the corresponding register type.
+ /// constant of the corresponding register type.
Constant *EmitVectorRegisterConstant(tree_node *reg);
/// Mem2Reg - Convert a value of in-memory type (that given by ConvertType)
More information about the llvm-commits
mailing list