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.
This commit is contained in:
Matt Pharr
2012-07-13 12:14:53 -07:00
parent 98b2e0e426
commit daf5aa8e8b

View File

@@ -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());
}