This is an archive of the discontinued LLVM Phabricator instance.

avoid infinite looping when folding vector multiplies of constants (PR22698)
ClosedPublic

Authored by spatel on Feb 26 2015, 12:06 PM.

Details

Summary

We were missing a check for the following fold in DAGCombiner:

// fold (fmul (fmul x, c1), c2) -> (fmul x, (fmul c1, c2))

If 'x' is also a constant, then we shouldn't do anything. Otherwise, we could end up swapping the operands back and forth forever.

This should fix:
http://llvm.org/bugs/show_bug.cgi?id=22698

Diff Detail

Repository
rL LLVM

Event Timeline

spatel updated this revision to Diff 20788.Feb 26 2015, 12:06 PM
spatel retitled this revision from to avoid infinite looping when folding vector multiplies of constants (PR22698).
spatel updated this object.
spatel edited the test plan for this revision. (Show Details)
spatel added reviewers: mkuper, hfinkel, andreadb.
spatel added a subscriber: Unknown Object (MLST).
bkramer accepted this revision.Feb 28 2015, 9:52 AM
bkramer added a reviewer: bkramer.
bkramer added a subscriber: bkramer.

lg

This revision is now accepted and ready to land.Feb 28 2015, 9:52 AM
This revision was automatically updated to reflect the committed changes.