[LLVMdev] SCCP

Chris Lattner sabre at nondot.org
Tue May 9 20:32:43 PDT 2006


On Tue, 9 May 2006, Nick Lewycky wrote:
>> You could do that, but SCCPSolver isn't really useful to mainline LLVM
>> for anything other than SCCP and IPSCCP, so we don't need it in a public
>> header.  Out of curiosity, what are you looking to use the latice values
>> for?  Why not just run SCCP and then look at the transformed code?
>
> I was planning to write an analysis pass that checks the expression at
> every conditional statement to see whether the value is underdefined or
> not.

Then just run the SCCP pass, and check to see if any operands satisfy the 
predicate "isa<UndefValue>(V)".  LLVM explicitly represents undefined 
values.

> This would be after SCCP and other optimizations have already been
> run, so conditional statements with constant expressions would already
> be eliminated.

Right, conditionals like "cst1 < cst2" will certainly be folded to true or 
false.  Also "undef < X" will be folded to undef by the SCCP pass.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list