summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopStrengthReduce
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-05-19 02:15:55 +0000
committerDan Gohman <gohman@apple.com>2009-05-19 02:15:55 +0000
commit2649491f9cb18a66ee3bc545e5cc6c9e4e119d11 (patch)
tree39ef603fc460591f064eae7d8a6aa0c54d31716a /llvm/test/Transforms/LoopStrengthReduce
parent1e059f608002e77a50c9616fb7b3685106571eaf (diff)
downloadbcm5719-llvm-2649491f9cb18a66ee3bc545e5cc6c9e4e119d11.tar.gz
bcm5719-llvm-2649491f9cb18a66ee3bc545e5cc6c9e4e119d11.zip
Teach SCEVExpander to expand arithmetic involving pointers into GEP
instructions. It attempts to create high-level multi-operand GEPs, though in cases where this isn't possible it falls back to casting the pointer to i8* and emitting a GEP with that. Using GEP instructions instead of ptrtoint+arithmetic+inttoptr helps pointer analyses that don't use ScalarEvolution, such as BasicAliasAnalysis. Also, make the AddrModeMatcher more aggressive in handling GEPs. Previously it assumed that operand 0 of a GEP would require a register in almost all cases. It now does extra checking and can do more matching if operand 0 of the GEP is foldable. This fixes a problem that was exposed by SCEVExpander using GEPs. llvm-svn: 72093
Diffstat (limited to 'llvm/test/Transforms/LoopStrengthReduce')
-rw-r--r--llvm/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll b/llvm/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll
index f873b3d73e2..e1c9642ce81 100644
--- a/llvm/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll
+++ b/llvm/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll
@@ -1,4 +1,5 @@
-; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep {mul.*%lsr.iv} | count 2
+; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis \
+; RUN: | grep {getelementptr.*%lsr.iv.*%lsr.iv.*<i32\\*>}
; The multiply in bb2 must not be reduced to an add, as the sext causes the
; %1 argument to become negative after a while.
; ModuleID = '<stdin>'
OpenPOWER on IntegriCloud