Page MenuHomePhabricator

[SimplifyLibCalls] Preserve tail call indicator
Needs ReviewPublic

Authored by xbolva00 on Mon, Oct 12, 9:18 AM.

Details

Summary

if old (replaced) call has a tail call hint, use it.

Diff Detail

Unit TestsFailed

TimeTest
3,810 mswindows > Clang-Unit.DirectoryWatcher/_/DirectoryWatcherTests_exe::DirectoryWatcherTest.AddFiles
Note: Google Test filter = DirectoryWatcherTest.AddFiles [==========] Running 1 test from 1 test case.
3,720 mswindows > Clang-Unit.DirectoryWatcher/_/DirectoryWatcherTests_exe::DirectoryWatcherTest.DeleteFile
Note: Google Test filter = DirectoryWatcherTest.DeleteFile [==========] Running 1 test from 1 test case.
3,730 mswindows > Clang-Unit.DirectoryWatcher/_/DirectoryWatcherTests_exe::DirectoryWatcherTest.ModifyFile
Note: Google Test filter = DirectoryWatcherTest.ModifyFile [==========] Running 1 test from 1 test case.

Event Timeline

xbolva00 created this revision.Mon, Oct 12, 9:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptMon, Oct 12, 9:18 AM
xbolva00 requested review of this revision.Mon, Oct 12, 9:18 AM
xbolva00 edited the summary of this revision. (Show Details)
jdoerfert added inline comments.Tue, Oct 13, 8:28 AM
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
1741

Can omptimizeCall ever break the tail requirements, e.g., create an alloca and pass it?

xbolva00 added inline comments.Tue, Oct 13, 8:33 AM
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
1741

I dont think so. @efriedma , what do you think?

efriedma added inline comments.Tue, Oct 13, 11:20 AM
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
1741

I don't like this approach. I mean, I get the motivation, but I'm not sure this is the right way to address it. Three issues:

  1. Even if we don't break the "tail" requirements right now, it's likely if someone did introduce a way, they wouldn't notice this code (which isn't even in the same file).
  2. A lot of combines create calls, but return some other value.
  3. For the floating-point routines, we probably want to add "tail" unconditionally.