This is an archive of the discontinued LLVM Phabricator instance.

[JumpThreading] make jump threading respect convergent annotation.
ClosedPublic

Authored by wengxt on Aug 30 2015, 2:09 PM.

Details

Summary

JumpThreading shouldn't duplicate a convergent call, because that would move a convergent call into a control-inequivalent location. For example,

if (cond) {
  ...
} else {
  ...
}
convergent_call();
if (cond) {
  ...
} else {
  ...
}

should not be optimized to

if (cond) {
  ...
  convergent_call();
  ...
} else {
  ...
  convergent_call();
  ...
}

Test Plan: test/Transforms/JumpThreading/basic.ll

Patch by Xuetian Weng.

Diff Detail

Event Timeline

wengxt updated this revision to Diff 33545.Aug 30 2015, 2:09 PM
wengxt retitled this revision from to [JumpThreading] make jump threading respect convergent annotation. For example, if (cond) { ... } else { ... } convergent_call(); if (cond) { ... } else { ... } should not be optimized to if (cond) { ....
wengxt updated this object.
wengxt added reviewers: resistor, jingyue.
wengxt added a subscriber: llvm-commits.
wengxt updated this object.Aug 30 2015, 2:11 PM
wengxt added a reviewer: arsenm.
wengxt set the repository for this revision to rL LLVM.
wengxt retitled this revision from [JumpThreading] make jump threading respect convergent annotation. For example, if (cond) { ... } else { ... } convergent_call(); if (cond) { ... } else { ... } should not be optimized to if (cond) { ... to [JumpThreading] make jump threading respect convergent annotation..
jingyue accepted this revision.Aug 30 2015, 4:46 PM
jingyue edited edge metadata.
jingyue added inline comments.
test/Transforms/JumpThreading/basic.ll
516

s/CHECK/CHECK-LABEL

This revision is now accepted and ready to land.Aug 30 2015, 4:46 PM
wengxt updated this revision to Diff 33556.Aug 30 2015, 7:44 PM
wengxt edited edge metadata.

address jingyue's comment

jingyue updated this object.Aug 30 2015, 10:25 PM
jingyue closed this revision.Aug 30 2015, 11:11 PM