This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Drop reference to callee from an operand of erased call instruction
Needs ReviewPublic

Authored by evgeny777 on Oct 13 2017, 10:27 AM.

Details

Summary

LLVM inliner gives a huge bonus (15000) to internal functions which have a single call site (hasOneUse is true). However this doesn't happen call uses bitcast expression referencing callee, because reference from that expression to callee is not being dropped by instcombine.

In practice this leads to a funny side effect when those two commands:

opt -instcombine -inline -S file.ll

and

opt -instcombine -S file.ll | opt -inline -S

may produce different results.

Diff Detail

Repository
rL LLVM