[PATCH] Add a RequireStructuredCFG Field to TargetMachine.

Matt Arsenault Matthew.Arsenault at amd.com
Sun Nov 24 16:39:08 PST 2013



================
Comment at: lib/CodeGen/MachineBasicBlock.cpp:681
@@ +680,3 @@
+  // Performances might be harmed by HW implementing branching using exec mask
+  // and always execute both side of the branches anyway.
+  if (MF->getTarget().requiresStructuredCFG())
----------------
s/execute/executes

================
Comment at: include/llvm/Target/TargetMachine.h:160
@@ +159,3 @@
+  bool requiresStructuredCFG() const { return RequireStructuredCFG; }
+  void SetRequiresStructuredCFG(bool Value) { RequireStructuredCFG = Value; }
+
----------------
The others start with a lowercase letter, setRequiresStructurizedCFG

================
Comment at: docs/WritingAnLLVMBackend.rst:241-247
@@ -240,2 +240,9 @@
 
+Some hardware does not support jumping to an arbitrary program location and
+implements branching using masked execution and loop using special instruction
+around the loop body. Such class of hardware includes GPU for instance.
+In order to avoid some CFG modifying passes to introduce patterns that are not
+implementable by this class of hardware, a target must call
+``SetRequiresStructuredCFG(true)`` when being initialized.
+
 In addition, the ``XXXTargetMachine`` constructor should specify a
----------------
Better wording:

Some architectures, such as GPUs, do not support jumping to an arbitrary program location and implement branching using masked execution and loop using special instructions around the loop body. In order to avoid CFG modifications that introduce irreducible control flow not handled by such hardware, a target must call ``setRequiresStructuredCFG(true)`` when being initialized.


http://llvm-reviews.chandlerc.com/D2260



More information about the llvm-commits mailing list