Commit Graph

2 Commits

Author SHA1 Message Date
Dan Gohman 21c6216c87 Teach lib/VMCore/ConstantFold.cpp how to set the inbounds keyword and
how to fold notionally-out-of-bounds array getelementptr indices instead
of just doing these in lib/Analysis/ConstantFolding.cpp, because it can
be done in a fairly general way without TargetData, and because not all
constants are visited by lib/Analysis/ConstantFolding.cpp. This enables
more constant folding.

Also, set the "inbounds" flag when the getelementptr indices are
one-past-the-end.

llvm-svn: 81483
2009-09-11 00:04:14 +00:00
Chris Lattner 73b5b5adae add testcase for strange types of gep indices
llvm-svn: 70085
2009-04-25 22:20:49 +00:00