[llvm-commits] [llvm] r95628 - in /llvm/trunk: include/llvm/LinkAllPasses.h include/llvm/Support/StandardPasses.h include/llvm/Transforms/Scalar.h lib/Transforms/Scalar/ObjectSizeLowering.cpp test/Transforms/InstCombine/objsize.ll test/Transforms/ObjSizeLower/ test/Transforms/ObjSizeLower/objsize.ll

Eric Christopher echristo at apple.com
Tue Feb 9 09:07:23 PST 2010


> 
> Right now, yes, it's a big hammer. However, for various different permutations of geps etc I found I was duplicating (iteratively) a lot of SCEV's internal code to determine offsets into objects etc.
> 
> Ideally we'd also like to use that along with loop information to be able to tell something like this:
> 
> char buffer[128];
> 
> for (int i = 0; i < 128; i++)
>   strcpy(buffer[i], "f")
> 
> or assorted and tell that we're not going to overrun the buffer and lower to an explicit strcpy instead of the checking version.

After chatting yesterday it doesn't appear that gcc deals with any of this, mostly just merging phis/conditionals so I'll just go ahead and do this in instcombine and  attempt to lower the checking calls there, moving that code from simplifylibcalls.

If we ever do want to resurrect this, it's obviously pretty easy to write :)

How's that sound?

-eric



More information about the llvm-commits mailing list