summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/WebAssembly')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyInstrInteger.td6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInteger.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInteger.td
index cf2c6a38d51..16ed7acbb9d 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInteger.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInteger.td
@@ -40,3 +40,9 @@ defm UGE : ComparisonInt<SETUGE>;
defm CLZ : UnaryInt<ctlz>;
defm CTZ : UnaryInt<cttz>;
defm POPCNT : UnaryInt<ctpop>;
+
+// Expand the "don't care" operations to supported operations.
+def : Pat<(ctlz_zero_undef Int32:$src), (CLZ_I32 Int32:$src)>;
+def : Pat<(ctlz_zero_undef Int64:$src), (CLZ_I64 Int64:$src)>;
+def : Pat<(cttz_zero_undef Int32:$src), (CTZ_I32 Int32:$src)>;
+def : Pat<(cttz_zero_undef Int64:$src), (CTZ_I64 Int64:$src)>;
OpenPOWER on IntegriCloud