Hi,
I am trying to lower operations from one dialect to the standard dialect
In a Tablegen file, I have this piece of code :
def fixObscureTypeMismatch : NativeCodeCall<"$0">;
def LowerEqPattern : Pat<
(EqExpr $lhs,$rhs),
(fixObscureTypeMismatch (CmpIOp 0, $lhs, $rhs))>;
When building, I get this error :
[main] Building folder: cpp
[build] Starting build
[proc] Executing command: /usr/bin/cmake --build /home/lam/ETHZ/rsc/bsc-fiebigm/cpp/build --config Debug --target all -j 18 --
[build] [1/1 100% :: 0.015] Building LoweringJSONiqToStandard.inc...
[build] FAILED: LoweringJSONiqToStandard.inc
[build] cd /home/lam/ETHZ/rsc/bsc-fiebigm/cpp/build && /opt/clang+llvm-12.0.0git/bin/mlir-tblgen -gen-rewriters -I/home/lam/ETHZ/rsc/bsc-fiebigm/cpp/src -I /home/lam/ETHZ/rsc/bsc-fiebigm/cpp -I/opt/clang+llvm-12.0.0git/include -I/opt/clang+llvm-12.0.0git/include /home/lam/ETHZ/rsc/bsc-fiebigm/cpp/src/LoweringJSONiqToStandard.td --write-if-changed -o LoweringJSONiqToStandard.inc -d LoweringJSONiqToStandard.inc.d
[build] /home/lam/ETHZ/rsc/bsc-fiebigm/cpp/src/LoweringJSONiqToStandard.td:41:1: error: referencing unbound symbol ''
[build] def LowerEqPattern : Pat<
[build] ^
[build] ninja: build stopped: subcommand failed.
[build] Build finished with exit code 1
So I assume that I cannot write 0 as the first operand directly. I would like to specify that the EqExpr
should lower to CmpIOp
with the predicate set to 0 or “eq”. How do I do this?