[PATCH] D33544: [lnt][profile] Add support for X86-64 CFG view

Elad Cohen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 06:13:17 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL303853: [lnt][profile] Add support for X86-64 CFG view (authored by eladcohen).

Changed prior to commit:
  https://reviews.llvm.org/D33544?vs=100233&id=100234#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D33544

Files:
  lnt/trunk/lnt/server/ui/static/lnt_profile.js
  lnt/trunk/lnt/server/ui/templates/v4_profile.html


Index: lnt/trunk/lnt/server/ui/templates/v4_profile.html
===================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_profile.html
+++ lnt/trunk/lnt/server/ui/templates/v4_profile.html
@@ -93,6 +93,7 @@
         <option value="cfg-aarch64">Control-Flow Graph (AArch64)</option>
         <option value="cfg-aarch32t32">Control-Flow Graph (AArch32-T32)</option>
         <option value="cfg-aarch32a32">Control-Flow Graph (AArch32-A32)</option>
+        <option value="cfg-X86-64">Control-Flow Graph (X86-64)</option>
       </select>
     </div>
     <div class="span4">
Index: lnt/trunk/lnt/server/ui/static/lnt_profile.js
===================================================================
--- lnt/trunk/lnt/server/ui/static/lnt_profile.js
+++ lnt/trunk/lnt/server/ui/static/lnt_profile.js
@@ -102,6 +102,21 @@
         // TODO: add all control-flow-changing instructions.
     ],
 
+    X86_64JumpTargetRegexps: [
+        // (regexp, noFallThru?)
+        // branch conditional:
+        [new RegExp("^\\s*j(?:(?:a)|(?:ae)|(?:b)|(?:be)|(?:c)|(?:ecxz)|(?:rcxz)"
+                    "|(?:e)|(?:g)|(?:ge)|(?:l)|(?:le)|(?:na)|(?:nae)|(?:nb)"
+                    "|(?:nbe)|(?:nc)|(?:ne)|(?:ng)|(?:nge)|(?:nl)|(?:nle)"
+                    "|(?:no)|(?:np)|(?:ns)|(?:nz)|(?:o)|(?:p)|(?:pe)|(?:po)"
+                    "|(?:s)|(?:z))?\\s+([^\\s]+)"), false],
+        [new RegExp("^\\s*loop(?:(?:e)|(?:ne)|(?:nz)|(?:z))?\\s+([^\\s]+)"), false],
+        // branch unconditional:
+        [new RegExp("^\\s*jmp\\s+([^\\s]+)"), true],
+        // ret
+        [new RegExp("^\\s*retq"), true],
+    ],
+
     getJumpTargets: function(instruction, nextInstruction, cfg) {
         for(var i=0; i<this.jumpTargetRegexps.length; ++i) {
             var regexp = this.jumpTargetRegexps[i][0];
@@ -497,6 +512,10 @@
         else if (this.instructionSet == 'aarch32t32')
             instructionParser = new InstructionSetParser(
                 InstructionSetParser.prototype.AArch32T32JumpTargetRegexps);
+        else if (this.instructionSet == 'X86-64')
+            instructionParser = new InstructionSetParser(
+                InstructionSetParser.prototype.X86_64JumpTargetRegexps);
+
         else {
             // Do not try to continue if we don't have support for
             // the requested instruction set.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33544.100234.patch
Type: text/x-patch
Size: 2361 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170525/ca33037e/attachment.bin>


More information about the llvm-commits mailing list