This is an archive of the discontinued LLVM Phabricator instance.

[SimplifyLibCalls] Fix instruction misplacement in string/memory libcall optimization
ClosedPublic

Authored by bruno on Sep 30 2015, 11:47 AM.

Details

Summary
When trying to optimize fortified library functions use the right
location to insert new instructions in order to preserve correct
def-use order.

This fixes an issue where a misplaced instruction definition would
happen to be *after* one of its use after a RAUW, forming invalid IR.
This behaviour was introduced by r227250.

Diff Detail

Repository
rL LLVM

Event Timeline

bruno updated this revision to Diff 36132.Sep 30 2015, 11:47 AM
bruno retitled this revision from to [SimplifyLibCalls] Fix instruction misplacement in string/memory libcall optimization.
bruno updated this object.
bruno added reviewers: ab, echristo.
bruno set the repository for this revision to rL LLVM.
bruno added a subscriber: llvm-commits.
ab accepted this revision.Sep 30 2015, 1:14 PM
ab edited edge metadata.

Seems reasonable, thanks!

lib/Transforms/Utils/SimplifyLibCalls.cpp
2080

Why not sink this in the block below? That'll eliminate the need for the SimplifiedCI null check.

This revision is now accepted and ready to land.Sep 30 2015, 1:14 PM
bruno added inline comments.Oct 1 2015, 3:08 PM
lib/Transforms/Utils/SimplifyLibCalls.cpp
2080

Doh! I'll include it in the commit. :-)

bruno closed this revision.Oct 2 2015, 7:57 AM

Committed in r249092