Let JumpThreading to thread over blocks like following Merge block
Merge:
%B = phi i32 [0, %Entry], [%v1, %F1] %N = trunc i32 %B to i1 br i1 %N, label %T2, label %F2
Differential D17663
[JumpThreading] See through Cast Instructions haicheng on Feb 26 2016, 4:14 PM. Authored by
Details
Diff Detail
Event TimelineComment Actions Would it not be better to fix SimplifyICmpInst to have some way of returning that it has done some simplification? Comment Actions I am not sure. Currently, SimplifyICmpInst either return a ConstantInt or an existing value. Is it safe to let it return a new value? Will it break anything? Comment Actions I see what you're saying, but perhaps a better motivating example would be a case where the zext was of a phi value that was only constant on some paths?
Comment Actions Thank you very much, Geoff. I changed the test case. Please let me know if it is better. Comment Actions Making ComputeValueKnownInPredecessors() recursive for any cast instruction seems like it might be a bit heavy handed. Perhaps you could limit it to casts of phi nodes as is done with CmpInsts farther down to reduce the compile time impact? Perhaps someone more familiar with this pass (@majnemer, @sanjoy ?) could comment on this? Comment Actions I share the same concern as Geoff. A recursive solution is compile time heavy for catching some corner cases. Most cases will already be handled by SimplifyInst. Do you have any data on how much impact this has on compile times? Comment Actions Only see through Cast when the source is PHI or Cmp, two types of instructions that are most important to JumpThreading. This version makes less changes and takes much less compilation time. The measured compilation time shows the difference is within the noise range. Comment Actions This LGTM as well, with the one minor comment request.
|
This comment is incorrect, right?