Hi Craig Topper,
I noticed a regression after this change set hit our repository at Intel. The code in llvm/lib/Transforms/IPO/FunctionAttrs.cpp has a function checkFunctionMemoryAccess() that is not checking for intrinsics which may have side effects. This causes the inliner to remove a function as trivially dead when it only has a ldmxcsr instruction and some setup and shutdown code. I could change the line:
if (!AliasAnalysis::onlyAccessesArgPointees(MRB))
to
if (!AliasAnalysis::onlyAccessesArgPointees(MRB) || I->mayHaveSideEffects()) {
but I do have some concern whether this will be overly conservative.
Any thoughts?
- Robert Cox from Intel (rcox2)