<div dir="ltr">For those not following along, startingin r301379, Simplify* in InstructionSimplify now can just take a query struct  instead of 8000 optional arguments.  Nothing is really new since it used the same thing under the covers.<div><div><br></div><div>I'm slowly converting the old uses away (deletion of the old APIs is a different question).</div><div>Staring at most of them, i could just directly convert them using braced list initialization, and construct the objects again and again, but the vast majority of uses actually:</div><div><br></div><div>A. don't change the relevant query arguments over the lifetime of the pass</div><div>B. actually have more information sitting around than they are passing along.</div><div><br></div><div>For example, instcombine has a DomTree and AssumptionCache that are required, but it doesn't pass them to SimplifyBinOp in a bunch of cases.</div><div><br></div><div>JumpThreading has TLI but doesn't pass it to SimplifyCmpInst.</div><div><br></div><div>CVP at least admits it has a problem:</div><div>"CorrelatedValuePropagation.cpp:  // FIXME: Provide TLI, DT, AT to SimplifyInstruction.</div><div>CorrelatedValuePropagation.cpp:  if (Value *V = SimplifyInstruction(P, DL)) {</div><div>"</div><div>(This is because it uses LVI, which requires those things, but it doesn't ask for them itself)</div><div><br></div><div>Assuming this is not deliberate, it would seem to me to just be easiest to set up the query structure once in the pass and use it everywhere, which would hopefully avoid these issues in the future, besides making most of the call strings dramatically shorter :)</div><div><br></div><div>Is there any real downside (compile time performance, etc) to this vs what we do now (which is basically constructing the query objects again and again under the covers) that anyone can think of?</div><div><br></div><div>(again, assuming we are not deliberately avoiding passing info to Simplify* in most of these cases)</div><div><br></div></div><div>I figured i'd ask before i went writing the scripts/etc to help convert a bunch of this stuff :)</div><div><br></div></div>