[PATCH] D17288: [CodeGenPrepare] Do select to branch transform when cmp's operand is expensive.

Zia Ansari via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 29 11:03:05 PST 2016


zansari added a comment.



> Even if branch prediction is failed, we may not lost anything. Because fdiv float/double takes more cycles than branch prediction miss penalty.

>  And if branch prediction is correct, we can hide fdiv's execution cycles.


This may happen to be a correct general statement to make today, but not one that is guaranteed to hold for future architectures. In my opinion, it's just too low level of a heuristic to make here.

In general, I think the heuristics are good for x86 (and perhaps other architectures), and I'd really like to see something like this, but I have to agree with Sanjay with regards to wanting to do this later.

It's also easier to hold on to selects and break them up later than to break them up early and change our minds and hope to reassemble them.


http://reviews.llvm.org/D17288





More information about the llvm-commits mailing list