This is an archive of the discontinued LLVM Phabricator instance.

InstCombine: Fix assert when reassociating fsub with undef
ClosedPublic

Authored by arsenm on Apr 13 2017, 1:35 PM.

Details

Reviewers
majnemer
Summary

There is logic to track the expected number of instructions
produced. It thought in this case an instruction would
be necessary to negate the result, but here it folded
into a ConstantExpr fneg when the non-undef value operand
was cancelled out by the second fsub.

I'm not sure why we don't fold constant FP ops with undef currently,
but I think that would also avoid this problem.

Diff Detail

Event Timeline

arsenm created this revision.Apr 13 2017, 1:35 PM
This revision is now accepted and ready to land.Apr 24 2017, 9:49 AM
arsenm closed this revision.Apr 24 2017, 10:37 AM

r301199