@@ -120,23 +120,22 @@ static cl::opt<bool>
120
120
HoistCommon (" simplifycfg-hoist-common" , cl::Hidden, cl::init(true ),
121
121
cl::desc(" Hoist common instructions up to the parent block" ));
122
122
123
- static cl::opt<bool > HoistLoadsStoresWithCondFaulting (
124
- " simplifycfg-hoist-loads-stores- with-cond-faulting" , cl::Hidden,
123
+ static cl::opt<bool > HoistLoadsWithCondFaulting (
124
+ " simplifycfg-hoist-loads-with-cond-faulting" , cl::Hidden,
125
125
cl::init (true ),
126
- cl::desc(" Hoist loads/stores if the target supports "
127
- " conditional faulting" ));
126
+ cl::desc(" Hoist loads if the target supports conditional faulting" ));
127
+
128
+ static cl::opt<bool > HoistStoresWithCondFaulting (
129
+ " simplifycfg-hoist-stores-with-cond-faulting" , cl::Hidden,
130
+ cl::init (true ),
131
+ cl::desc(" Hoist stores if the target supports conditional faulting" ));
128
132
129
133
static cl::opt<unsigned > HoistLoadsStoresWithCondFaultingThreshold (
130
134
" hoist-loads-stores-with-cond-faulting-threshold" , cl::Hidden, cl::init(6 ),
131
135
cl::desc(" Control the maximal conditional load/store that we are willing "
132
136
" to speculatively execute to eliminate conditional branch "
133
137
" (default = 6)" ));
134
138
135
- static cl::opt<unsigned > DisableCloadCstore (
136
- " disable-cload-cstore" , cl::Hidden, cl::init(0 ),
137
- cl::desc(" Control to disable cond-faulting-load(1)/cond-faulting-store(2)"
138
- " /all(3)" ));
139
-
140
139
static cl::opt<unsigned >
141
140
HoistCommonSkipLimit (" simplifycfg-hoist-common-skip-limit" , cl::Hidden,
142
141
cl::init (20 ),
@@ -1781,10 +1780,10 @@ static bool isSafeCheapLoadStore(const Instruction *I,
1781
1780
const TargetTransformInfo &TTI) {
1782
1781
// Not handle volatile or atomic.
1783
1782
if (auto *L = dyn_cast<LoadInst>(I)) {
1784
- if (!L->isSimple () || (DisableCloadCstore & 1 ) )
1783
+ if (!L->isSimple () || !HoistLoadsWithCondFaulting )
1785
1784
return false ;
1786
1785
} else if (auto *S = dyn_cast<StoreInst>(I)) {
1787
- if (!S->isSimple () || (DisableCloadCstore & 2 ) )
1786
+ if (!S->isSimple () || !HoistStoresWithCondFaulting )
1788
1787
return false ;
1789
1788
} else
1790
1789
return false ;
@@ -3224,8 +3223,7 @@ bool SimplifyCFGOpt::speculativelyExecuteBB(BranchInst *BI,
3224
3223
SmallVector<Instruction *, 4 > SpeculatedDbgIntrinsics;
3225
3224
3226
3225
unsigned SpeculatedInstructions = 0 ;
3227
- bool HoistLoadsStores = HoistLoadsStoresWithCondFaulting &&
3228
- Options.HoistLoadsStoresWithCondFaulting ;
3226
+ bool HoistLoadsStores = Options.HoistLoadsStoresWithCondFaulting ;
3229
3227
SmallVector<Instruction *, 2 > SpeculatedConditionalLoadsStores;
3230
3228
Value *SpeculatedStoreValue = nullptr ;
3231
3229
StoreInst *SpeculatedStore = nullptr ;
@@ -8033,8 +8031,7 @@ bool SimplifyCFGOpt::simplifyCondBranch(BranchInst *BI, IRBuilder<> &Builder) {
8033
8031
hoistCommonCodeFromSuccessors (BI, !Options.HoistCommonInsts ))
8034
8032
return requestResimplify ();
8035
8033
8036
- if (BI && HoistLoadsStoresWithCondFaulting &&
8037
- Options.HoistLoadsStoresWithCondFaulting &&
8034
+ if (BI && Options.HoistLoadsStoresWithCondFaulting &&
8038
8035
isProfitableToSpeculate (BI, std::nullopt, TTI)) {
8039
8036
SmallVector<Instruction *, 2 > SpeculatedConditionalLoadsStores;
8040
8037
auto CanSpeculateConditionalLoadsStores = [&]() {
0 commit comments