VerifyDAGDiverence cost compilation time, avoid running it in non-debug
builds.
Details
Diff Detail
Event Timeline
TargetTransformInfo::hasBranchDivergence() only returns true only if the divergence makes sense for the given target.
So, the compile time should be only affected for such targets: AMDGPU, NVPTX etc.
On which target have you observed compile time increase? How much (% of the whole selection pass) was it affected?
I also initially planned to put the DAG verification under #ifdef NDEBUG.
My change was reviewed by Eli Friedman and he insisted on DAG verification for non-debug builds.
Maybe we should make him know that we changed this?
It's okay not to run the verifier in Release mode if it's hurting performance. I'm a bit surprised it's actually measurable, but I guess adding a bunch of extra walks over the DAG could add up to a few percent.
LGTM