From daf5aa8e8b0a0dfcaa75753ad9be4a5823d0200a Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Fri, 13 Jul 2012 12:14:53 -0700 Subject: [PATCH] Run inst combine before memory optimizations. We were previously emitting 64-bit indexing for some gathers where 32-bit was actually fine, due to some adds of constant vectors that hadn't been simplified to the result. --- opt.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opt.cpp b/opt.cpp index 824c5bc7..a623466b 100644 --- a/opt.cpp +++ b/opt.cpp @@ -447,6 +447,7 @@ Optimize(llvm::Module *module, int optLevel) { if (g->opt.disableGatherScatterOptimizations == false && g->target.vectorWidth > 1) { + optPM.add(llvm::createInstructionCombiningPass()); optPM.add(CreateImproveMemoryOpsPass()); } if (!g->opt.disableMaskAllOnOptimizations) { @@ -489,6 +490,7 @@ Optimize(llvm::Module *module, int optLevel) { if (g->opt.disableGatherScatterOptimizations == false && g->target.vectorWidth > 1) { + optPM.add(llvm::createInstructionCombiningPass()); optPM.add(CreateImproveMemoryOpsPass()); if (g->opt.disableCoalescing == false && @@ -507,6 +509,7 @@ Optimize(llvm::Module *module, int optLevel) { if (g->opt.disableGatherScatterOptimizations == false && g->target.vectorWidth > 1) { + optPM.add(llvm::createInstructionCombiningPass()); optPM.add(CreateImproveMemoryOpsPass()); }