"ret (constexpr)" can't be folded into a Constant. Add a method to
authorNick Lewycky <nicholas@mxc.ca>
Sun, 25 May 2008 20:56:15 +0000 (20:56 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sun, 25 May 2008 20:56:15 +0000 (20:56 +0000)
commit3dfd7bf5110c47e99fd0fcce96122b90f699ca3a
treeca0758bdfa2da8febe3e0e2bc5e69d7523e90f2b
parenta5464f3659a721328da98f7096390ac32f9ec6ed
"ret (constexpr)" can't be folded into a Constant. Add a method to
Analysis/ConstantFolding to fold ConstantExpr's, then make instcombine use it
to try to use targetdata to fold constant expressions on void instructions.

Also extend the icmp(inttoptr, inttoptr) folding to handle the case where
int size != ptr size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51559 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ConstantFolding.h
lib/Analysis/ConstantFolding.cpp
lib/Transforms/Scalar/InstructionCombining.cpp
test/Transforms/InstCombine/2008-05-18-FoldIntToPtr.ll [new file with mode: 0644]