[llvm] b2b460b - [mlgo] Fix tests

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 17:32:05 PDT 2022


Author: Mircea Trofin
Date: 2022-08-24T17:31:40-07:00
New Revision: b2b460b0a040d6a83a5eb821982ae9bb49c88f1b

URL: https://github.com/llvm/llvm-project/commit/b2b460b0a040d6a83a5eb821982ae9bb49c88f1b
DIFF: https://github.com/llvm/llvm-project/commit/b2b460b0a040d6a83a5eb821982ae9bb49c88f1b.diff

LOG: [mlgo] Fix tests

Missed a few tests in D119507

Added: 
    

Modified: 
    llvm/lib/Analysis/models/gen-inline-oz-test-model.py
    llvm/test/CodeGen/MLRegalloc/dev-rel-equivalence.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/models/gen-inline-oz-test-model.py b/llvm/lib/Analysis/models/gen-inline-oz-test-model.py
index d800b1476eede..4408a9eb97bd2 100644
--- a/llvm/lib/Analysis/models/gen-inline-oz-test-model.py
+++ b/llvm/lib/Analysis/models/gen-inline-oz-test-model.py
@@ -109,7 +109,7 @@ def build_mock_model(path, signature):
 
   def action(*inputs):
     s = tf.reduce_sum([tf.cast(x, tf.float32) for x in tf.nest.flatten(inputs)])
-    return {signature['output']: float('inf') + s + module.var}
+    return {signature['output']: tf.cast(tf.divide((s + module.var), tf.abs(s + module.var)), tf.int64)}
 
   module.action = tf.function()(action)
   action = {'action': module.action.get_concrete_function(signature['inputs'])}

diff  --git a/llvm/test/CodeGen/MLRegalloc/dev-rel-equivalence.ll b/llvm/test/CodeGen/MLRegalloc/dev-rel-equivalence.ll
index 43c363750f939..a4b354d6a0ae9 100644
--- a/llvm/test/CodeGen/MLRegalloc/dev-rel-equivalence.ll
+++ b/llvm/test/CodeGen/MLRegalloc/dev-rel-equivalence.ll
@@ -12,8 +12,8 @@
 ; RUN:   %S/Inputs/input.ll -o %t.release
 
 ; RUN: rm -rf %t %t_savedmodel
-; RUN: %python %S/../../../../lib/Analysis/models/saved-model-to-tflite.py %t_savedmodel %t
-; RUN: %python %S/../../../lib/Analysis/models/gen-regalloc-eviction-test-model.py %t
+; RUN: %python %S/../../../lib/Analysis/models/gen-regalloc-eviction-test-model.py %t_savedmodel
+; RUN: %python %S/../../../lib/Analysis/models/saved-model-to-tflite.py %t_savedmodel %t
 ; RUN: llc -mtriple=x86_64-linux-unknown -regalloc=greedy -regalloc-enable-advisor=development \
 ; RUN:   -regalloc-model=%t %S/Inputs/input.ll -o %t.development
 ; RUN: 
diff  %t.release %t.development


        


More information about the llvm-commits mailing list