[PATCH] D67281: [AArch64][SimplifyCFG] Add additional cost for instructions in mergeConditionalStoreToAddress

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 22 02:52:14 PST 2019


lebedev.ri added a comment.

On X86 branch misprediction is ~10..~20 cycles, 
Is it dirt cheap on AArch64? (any number?)
Perhaps we need to redefine the threshold in terms of branch misprediction cost?



================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:2420-2423
+  // We need to be sure, that DomBlock has
+  // enough room for new instructions
+  // First add cost of Select instruction, that will be added to this block
+  // (this cost is equal to number of phi nodes in BB)
----------------
So in other words we'd only perform the fold only if the preceding block is not larger than
what we'd add via folding. In other words if we are okay flatteing 4-instruction 2-entry PHI,
the dominating BB must contain less than 4 instructions.
That seems awfully hand-wavy to me, i'm afraid :(
It will make the fold not happen in all the cases i'm aware of. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67281/new/

https://reviews.llvm.org/D67281





More information about the llvm-commits mailing list