[LLVMdev] target specific ways to extend ConstantExpr

Eli Friedman eli.friedman at gmail.com
Tue Dec 18 16:44:29 PST 2012


On Mon, Dec 17, 2012 at 8:51 PM, Yuan Lin <yulin at nvidia.com> wrote:
> That's an interesting idea. What are the essential differences between the new subclass and ConstantExpr? Will it end up like ConstantExpr? Or you want it to be ConstantExpr 'done right'?

In some sense, it's ConstantExpr done right: it's a Constant with some
sort of opcode, and operands.

It's rather different from ConstantExpr in the sense that it won't be
usable as constant folding API.  It will only have operations which
actually make sense, it won't share an opcode space with Instructions,
it won't have the implementation quirks of ConstantExpr (like
canTrap()), and we can come up with more sane rules for what operands
are allowed for a given operation.

-Eli



More information about the llvm-dev mailing list