[PATCH] D90380: [llvm-exegesis] Do not try to assign random registers twice.

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 29 03:56:40 PDT 2020


courbet created this revision.
courbet added a reviewer: gchatelet.
Herald added a subscriber: mstojanovic.
Herald added a project: LLVM.
courbet requested review of this revision.

Doing a random assignment assigns both tested (forward) and back-to-back
(backward) instructions.

When none of the tested instruction and back-to-back instruction have
implicit aliasing, we're currently trying to do a random register
asignment twice.

Fix this (see PR26418).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90380

Files:
  llvm/test/tools/llvm-exegesis/X86/latency-IN16rr.s
  llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp


Index: llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp
===================================================================
--- llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp
+++ llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp
@@ -140,7 +140,7 @@
       InstructionTemplate OtherIT(OtherInstr);
       if (!Forward.hasImplicitAliasing())
         setRandomAliasing(Forward, ThisIT, OtherIT);
-      if (!Back.hasImplicitAliasing())
+      else if (!Back.hasImplicitAliasing())
         setRandomAliasing(Back, OtherIT, ThisIT);
       CodeTemplate CT;
       CT.Execution = ExecutionModeBit;
Index: llvm/test/tools/llvm-exegesis/X86/latency-IN16rr.s
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-exegesis/X86/latency-IN16rr.s
@@ -0,0 +1,12 @@
+# RUN: llvm-exegesis -mode=latency -opcode-name=IN16rr -repetition-mode=duplicate | FileCheck %s
+
+CHECK:      ---
+CHECK-NEXT: mode: latency
+CHECK-NEXT: key:
+CHECK-NEXT:   instructions:
+CHECK-NEXT:     - 'IN16rr'
+CHECK-NEXT:     - {{.*}}
+CHECK-NEXT: config: ''
+CHECK-NEXT: register_initial_values:
+CHECK-DAG: - '[[REG1:[A-Z0-9]+]]=0x0'
+CHECK-LAST: ...


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90380.301561.patch
Type: text/x-patch
Size: 1191 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201029/c6d98751/attachment.bin>


More information about the llvm-commits mailing list