[llvm] r261275 - [x86] fix initialization of PredictableSelectIsExpensive

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 15:08:48 PST 2016


Author: spatel
Date: Thu Feb 18 17:08:48 2016
New Revision: 261275

URL: http://llvm.org/viewvc/llvm-project?rev=261275&view=rev
Log:
[x86] fix initialization of PredictableSelectIsExpensive

This is effectively NFC because Atom is the only in-order x86 subtarget currently,
but the predicate would have become wrong if any other in-order CPU came along.

See related discussion in:
http://reviews.llvm.org/D16836


Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=261275&r1=261274&r2=261275&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Feb 18 17:08:48 2016
@@ -1846,9 +1846,9 @@ X86TargetLowering::X86TargetLowering(con
   MaxStoresPerMemmoveOptSize = 4;
   setPrefLoopAlignment(4); // 2^4 bytes.
 
-  // A predictable cmov does not hurt on an in-order CPU.
-  // FIXME: Use a CPU attribute to trigger this, not a CPU model.
-  PredictableSelectIsExpensive = !Subtarget.isAtom();
+  // An out-of-order CPU can speculatively execute past a predictable branch,
+  // but a conditional move could be stalled by an expensive earlier operation. 
+  PredictableSelectIsExpensive = Subtarget.getSchedModel().isOutOfOrder();
   EnableExtLdPromotion = true;
   setPrefFunctionAlignment(4); // 2^4 bytes.
 




More information about the llvm-commits mailing list