[PATCH] llvm: remove unneeded OP_COPY support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OP_COPY instructions are only introduced by the 'unSSA' phase
which is not used by sparse-llvm.

Remove the code which tried to handle this.

Cc: Azat Khuzhin <a3at.mail@xxxxxxxxx>
Cc: Xi Wang <xi.wang@xxxxxxxxx>
Cc: Pekka Enberg <penberg@xxxxxxxxxx>
Cc: Jeff Garzik <jeff@xxxxxxxxxx>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 sparse-llvm.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/sparse-llvm.c b/sparse-llvm.c
index 6b41afd8..5af473a3 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -788,34 +788,6 @@ static void output_op_cast(struct function *fn, struct instruction *insn, LLVMOp
 	insn->target->priv = target;
 }
 
-static void output_op_copy(struct function *fn, struct instruction *insn,
-			   pseudo_t pseudo)
-{
-	LLVMValueRef src, target;
-	LLVMTypeRef const_type;
-	char target_name[64];
-
-	pseudo_name(insn->target, target_name);
-	src = pseudo_to_value(fn, insn, pseudo);
-	const_type = insn_symbol_type(fn->module, insn);
-
-	/*
-	 * This is nothing more than 'target = src'
-	 *
-	 * TODO: find a better way to provide an identity function,
-	 * than using "X + 0" simply to produce a new LLVM pseudo
-	 */
-
-	if (symbol_is_fp_type(insn->type))
-		target = LLVMBuildFAdd(fn->builder, src,
-			LLVMConstReal(const_type, 0.0), target_name);
-	else
-		target = LLVMBuildAdd(fn->builder, src,
-			LLVMConstInt(const_type, 0, 0), target_name);
-
-	insn->target->priv = target;
-}
-
 static void output_insn(struct function *fn, struct instruction *insn)
 {
 	switch (insn->opcode) {
@@ -914,7 +886,7 @@ static void output_insn(struct function *fn, struct instruction *insn)
 		assert(0);
 		break;
 	case OP_COPY:
-		output_op_copy(fn, insn, insn->src);
+		assert(0);
 		break;
 	default:
 		break;
-- 
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux