This is an archive of the discontinued LLVM Phabricator instance.

Re-add ConstantFoldInstOperands form taking opcode and return type.
ClosedPublic

Authored by mjacob on Mar 4 2016, 5:30 PM.

Details

Summary

This form was replaced by a form taking an instruction instead of opcode and
return type in r258391. After committing this change (and some depending,
follow-up changes) it turned out in the review thread to be controversial. The
discussion didn't come to a conclusion yet. I'm re-adding the old form to fix
the API regression and to provide a better base for discussion, possibly on
llvm-dev.

A difference to the original function is that it can't be called with GEPs
(similarly to how it was already the case for compares). In order to support
opaque pointers in the future, folding GEPs needs to be passed the source
element type, which is not possible with the current API.

Diff Detail

Event Timeline

mjacob updated this revision to Diff 49864.Mar 4 2016, 5:30 PM
mjacob retitled this revision from to Re-add ConstantFoldInstOperands form taking opcode and return type..
mjacob updated this object.
mjacob added reviewers: dberlin, reames.
mjacob added subscribers: eddyb, dblaikie.
eddyb added a comment.Mar 7 2016, 1:26 AM

LGTM, the assert seems to be the main difference from my original patch.

reames accepted this revision.Mar 9 2016, 11:58 AM
reames edited edge metadata.

LGTM as well.

This revision is now accepted and ready to land.Mar 9 2016, 11:58 AM
mjacob closed this revision.Mar 14 2016, 3:39 PM