linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] llvm: remove unneeded OP_COPY support
@ 2016-12-11 10:17 Luc Van Oostenryck
  0 siblings, 0 replies; only message in thread
From: Luc Van Oostenryck @ 2016-12-11 10:17 UTC (permalink / raw)
  To: linux-sparse
  Cc: Luc Van Oostenryck, Azat Khuzhin, Xi Wang, Pekka Enberg,
	Jeff Garzik

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@gmail.com>
Cc: Xi Wang <xi.wang@gmail.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 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;
-}

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-11 10:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-11 10:17 [PATCH] llvm: remove unneeded OP_COPY support Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).