This is an archive of the discontinued LLVM Phabricator instance.

Fix another infinite loop in InstCombine
ClosedPublic

Authored by steven_wu on Dec 11 2014, 8:10 PM.

Details

Summary

InstCombine infinite-loops for the testcase added
It is because InstCombine is generating instructions that can be
optimized by itself. Fix by not optimizing frem if the optimized
type is the same as original type.
rdar://problem/19150820

Diff Detail

Repository
rL LLVM

Event Timeline

steven_wu updated this revision to Diff 17209.Dec 11 2014, 8:10 PM
steven_wu retitled this revision from to Fix another infinite loop in InstCombine.
steven_wu updated this object.
steven_wu edited the test plan for this revision. (Show Details)
steven_wu added a reviewer: majnemer.
majnemer accepted this revision.Dec 11 2014, 8:24 PM
majnemer edited edge metadata.

LGTM with tweaks

test/Transforms/InstCombine/fpcast.ll
84–86 ↗(On Diff #17209)

this should be:
; CHECK-NEXT: %[[frem:.*]] = frem double %[[fext]], 1.000000e-01
; CHECK-NEXT: %[[trunc:.*]] = fptrunc double %[[frem]] to float
; CHECK-NEXT: ret float %[[trunc]]

This revision is now accepted and ready to land.Dec 11 2014, 8:24 PM

Sorry I forget to add llvm-commits for the first try. Since David has already reviewed it, I will not create a new review.

Steven

This revision was automatically updated to reflect the committed changes.