This is an archive of the discontinued LLVM Phabricator instance.

Canonicalize guards for NOT OR condition
ClosedPublic

Authored by mkazantsev on Jan 24 2017, 3:13 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

mkazantsev accepted this revision.Jan 24 2017, 3:13 AM
mkazantsev created this revision.
This revision is now accepted and ready to land.Jan 24 2017, 3:14 AM
mkazantsev requested review of this revision.Jan 24 2017, 3:14 AM
mkazantsev edited edge metadata.
apilipenko added inline comments.Jan 24 2017, 9:54 AM
lib/Transforms/InstCombine/InstCombineCalls.cpp
2897–2900 ↗(On Diff #85556)

We might have a guard with non-standard calling convention. I guess you'll need to set the cc for new guards as well.

mkazantsev marked an inline comment as done.Jan 24 2017, 9:20 PM
apilipenko added inline comments.Jan 25 2017, 12:30 AM
lib/Transforms/InstCombine/InstCombineCalls.cpp
2900–2905 ↗(On Diff #85692)

Maybe:

auto CC = II->getCallingConv()
Builder->CreateCall(A)->setCallingConv(CC)
Builder->CreateCall(B)->setCallingConv(CC)
test/Transforms/InstCombine/call-guard.ll
42 ↗(On Diff #85692)

Please add a test for non-default calling convention.

mkazantsev added inline comments.Jan 25 2017, 1:01 AM
lib/Transforms/InstCombine/InstCombineCalls.cpp
2900–2905 ↗(On Diff #85692)

I would rather not do call creation and setting the convention in one line, because in case if we want to do to them something more than setting the CC in future, this code will need to be changed.

mkazantsev updated this revision to Diff 85713.Jan 25 2017, 1:36 AM
mkazantsev marked 3 inline comments as done.

Added test for cc99

apilipenko accepted this revision.Jan 25 2017, 1:47 AM
apilipenko added inline comments.
test/Transforms/InstCombine/call-guard.ll
65 ↗(On Diff #85713)

@test_guard_not_or_non_default_cc? There is nothing specific about cc99 in this test.

This revision is now accepted and ready to land.Jan 25 2017, 1:47 AM
mkazantsev updated this revision to Diff 85721.Jan 25 2017, 2:21 AM
mkazantsev marked an inline comment as done.

Some reformating, renamed test.

This revision was automatically updated to reflect the committed changes.