OLD | NEW |
1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 virtual void doAddressOptLoad() {} | 281 virtual void doAddressOptLoad() {} |
282 virtual void doAddressOptStore() {} | 282 virtual void doAddressOptStore() {} |
283 virtual void doMockBoundsCheck(Operand *) {} | 283 virtual void doMockBoundsCheck(Operand *) {} |
284 virtual void randomlyInsertNop(float Probability, | 284 virtual void randomlyInsertNop(float Probability, |
285 RandomNumberGenerator &RNG) = 0; | 285 RandomNumberGenerator &RNG) = 0; |
286 /// This gives the target an opportunity to post-process the lowered expansion | 286 /// This gives the target an opportunity to post-process the lowered expansion |
287 /// before returning. | 287 /// before returning. |
288 virtual void postLower() {} | 288 virtual void postLower() {} |
289 | 289 |
290 /// Find two-address non-SSA instructions and set the DestNonKillable flag to | 290 /// Find (non-SSA) instructions where the Dest variable appears in some source |
291 /// keep liveness analysis consistent. | 291 /// operand, and set the IsDestRedefined flag. This keeps liveness analysis |
292 void inferTwoAddress(); | 292 /// consistent. |
| 293 void markRedefinitions(); |
293 | 294 |
294 /// Make a pass over the Cfg to determine which variables need stack slots and | 295 /// Make a pass over the Cfg to determine which variables need stack slots and |
295 /// place them in a sorted list (SortedSpilledVariables). Among those, vars, | 296 /// place them in a sorted list (SortedSpilledVariables). Among those, vars, |
296 /// classify the spill variables as local to the basic block vs global | 297 /// classify the spill variables as local to the basic block vs global |
297 /// (multi-block) in order to compute the parameters GlobalsSize and | 298 /// (multi-block) in order to compute the parameters GlobalsSize and |
298 /// SpillAreaSizeBytes (represents locals or general vars if the coalescing of | 299 /// SpillAreaSizeBytes (represents locals or general vars if the coalescing of |
299 /// locals is disallowed) along with alignments required for variables in each | 300 /// locals is disallowed) along with alignments required for variables in each |
300 /// area. We rely on accurate VMetadata in order to classify a variable as | 301 /// area. We rely on accurate VMetadata in order to classify a variable as |
301 /// global vs local (otherwise the variable is conservatively global). The | 302 /// global vs local (otherwise the variable is conservatively global). The |
302 /// in-args should be initialized to 0. | 303 /// in-args should be initialized to 0. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 342 |
342 /// Make a call to an external helper function. | 343 /// Make a call to an external helper function. |
343 InstCall *makeHelperCall(const IceString &Name, Variable *Dest, | 344 InstCall *makeHelperCall(const IceString &Name, Variable *Dest, |
344 SizeT MaxSrcs); | 345 SizeT MaxSrcs); |
345 | 346 |
346 void | 347 void |
347 _bundle_lock(InstBundleLock::Option BundleOption = InstBundleLock::Opt_None) { | 348 _bundle_lock(InstBundleLock::Option BundleOption = InstBundleLock::Opt_None) { |
348 Context.insert(InstBundleLock::create(Func, BundleOption)); | 349 Context.insert(InstBundleLock::create(Func, BundleOption)); |
349 } | 350 } |
350 void _bundle_unlock() { Context.insert(InstBundleUnlock::create(Func)); } | 351 void _bundle_unlock() { Context.insert(InstBundleUnlock::create(Func)); } |
351 void _set_dest_nonkillable() { | 352 void _set_dest_redefined() { Context.getLastInserted()->setDestRedefined(); } |
352 Context.getLastInserted()->setDestNonKillable(); | |
353 } | |
354 | 353 |
355 bool shouldOptimizeMemIntrins(); | 354 bool shouldOptimizeMemIntrins(); |
356 | 355 |
357 Cfg *Func; | 356 Cfg *Func; |
358 GlobalContext *Ctx; | 357 GlobalContext *Ctx; |
359 bool HasComputedFrame = false; | 358 bool HasComputedFrame = false; |
360 bool CallsReturnsTwice = false; | 359 bool CallsReturnsTwice = false; |
361 /// StackAdjustment keeps track of the current stack offset from its natural | 360 /// StackAdjustment keeps track of the current stack offset from its natural |
362 /// location, e.g. as arguments are pushed for a function call or as | 361 /// location, e.g. as arguments are pushed for a function call or as |
363 /// fixed-size alloca instructions are executed in the entry block. | 362 /// fixed-size alloca instructions are executed in the entry block. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 virtual void lower() {} | 453 virtual void lower() {} |
455 | 454 |
456 protected: | 455 protected: |
457 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 456 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
458 GlobalContext *Ctx; | 457 GlobalContext *Ctx; |
459 }; | 458 }; |
460 | 459 |
461 } // end of namespace Ice | 460 } // end of namespace Ice |
462 | 461 |
463 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 462 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
OLD | NEW |