From edc3d80941ab7fa0f9f79be53961006375d38396 Mon Sep 17 00:00:00 2001 From: Orestis Kaparounakis Date: Fri, 12 Jul 2024 17:44:26 +0300 Subject: [PATCH 1/2] Comment out registration of irPassLLVMIRAutoQuantization pass Addresses #657. --- src/newton/newton.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/newton/newton.c b/src/newton/newton.c index a4a0ff8cd..9483274e3 100644 --- a/src/newton/newton.c +++ b/src/newton/newton.c @@ -206,10 +206,15 @@ processNewtonFile(State * N, char * filename) { irPassLLVMIROptimizeByRange(N); } - if (N->irPasses & kNewtonirPassLLVMIRAutoQuantization) - { - irPassLLVMIRAutoQuantization(N); - } + + /* + * irPassLLVMIRAutoQuantization pass is causing issues with the current implementation. + */ + // if (N->irPasses & kNewtonirPassLLVMIRAutoQuantization) + // { + // irPassLLVMIRAutoQuantization(N); + // } + /* * Dot backend. */ From 3802fd8e31db666edc07822e877e1873e92cfd60 Mon Sep 17 00:00:00 2001 From: Orestis Kaparounakis Date: Tue, 16 Jul 2024 10:36:01 +0300 Subject: [PATCH 2/2] Add error message for trying to use AutoQuantization pass Addresses #657. --- src/newton/main.c | 21 +++++++++++++-------- src/newton/newton.c | 16 ++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/newton/main.c b/src/newton/main.c index 92ff90126..b59cbf4b6 100644 --- a/src/newton/main.c +++ b/src/newton/main.c @@ -107,9 +107,9 @@ main(int argc, char *argv[]) {"latex", no_argument, 0, 'x'}, {"RTLcodegen", required_argument, 0, 'l'}, {"targetParam", required_argument, 0, 'T'}, - {"llvm-ir", required_argument, 0, 'I'}, - {"llvm-ir-liveness-check", no_argument, 0, 'L'}, - {"llvm-ir-auto-quantization", no_argument, 0, 'Q'}, + {"llvm-ir", required_argument, 0, 'I'}, + {"llvm-ir-liveness-check", no_argument, 0, 'L'}, + {"llvm-ir-auto-quantization", no_argument, 0, 'Q'}, {"estimator-synthesis", required_argument, 0, 420}, {"process", required_argument, 0, 421}, {"measurement", required_argument, 0, 422}, @@ -424,11 +424,16 @@ main(int argc, char *argv[]) break; } - case 'Q': - { - N->irPasses |= kNewtonirPassLLVMIRAutoQuantization; - break; - } + case 'Q': + { + N->irPasses |= kNewtonirPassLLVMIRAutoQuantization; + + flexprint(N->Fe, N->Fm, N->Fperr, "AutoQuantization pass was disabled at compilation.\n"); + consolePrintBuffers(N); + exit(EXIT_FAILURE); + + break; + } case 494: { diff --git a/src/newton/newton.c b/src/newton/newton.c index 9483274e3..9bd499002 100644 --- a/src/newton/newton.c +++ b/src/newton/newton.c @@ -206,14 +206,14 @@ processNewtonFile(State * N, char * filename) { irPassLLVMIROptimizeByRange(N); } - - /* - * irPassLLVMIRAutoQuantization pass is causing issues with the current implementation. - */ - // if (N->irPasses & kNewtonirPassLLVMIRAutoQuantization) - // { - // irPassLLVMIRAutoQuantization(N); - // } + if (N->irPasses & kNewtonirPassLLVMIRAutoQuantization) + { + /* + * irPassLLVMIRAutoQuantization pass is causing issues with the current implementation. + */ + // irPassLLVMIRAutoQuantization(N); + flexprint(N->Fe, N->Fm, N->Fperr, "AutoQuantization pass was disabled at compilation.\n"); + } /* * Dot backend.