This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Don't DSE across readnone functions that may throw
ClosedPublic

Authored by sanjoy on Jan 14 2017, 11:06 PM.

Diff Detail

Event Timeline

sanjoy updated this revision to Diff 84484.Jan 14 2017, 11:06 PM
sanjoy retitled this revision from to [InstCombine] Don't DSE across readnone functions that may throw.
sanjoy updated this object.
sanjoy added a subscriber: llvm-commits.
majnemer edited edge metadata.Jan 14 2017, 11:49 PM

Instead of using I->mayReadFromMemoryOrThrow() || I->mayWriteToMemory(), I'd recommend using I->mayReadFromMemory() || I->mayHaveSideEffects()

mayReadFromMemoryOrThrow is a rather strange predicate...

Instead of using I->mayReadFromMemoryOrThrow() || I->mayWriteToMemory(), I'd recommend using I->mayReadFromMemory() || I->mayHaveSideEffects()

What do you think about I->mayReadFromMemory() || I->mayWriteToMemory() || I->mayThrow()? I don't particularly like that we club may-throw with has-side-effects.

sanjoy updated this revision to Diff 84628.Jan 16 2017, 9:07 PM
  • Address review: remove usage of mayReadMemoryOrThrow()
This revision is now accepted and ready to land.Jan 16 2017, 9:16 PM
This revision was automatically updated to reflect the committed changes.