From 687fb4ffd59bad72c721504e99fe20fdb8430306 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sun, 20 Oct 2024 21:32:41 -0400 Subject: [PATCH 1/3] Add gcloaded TT --- enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp b/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp index 9947a7aff18..cc38c7c1de1 100644 --- a/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp +++ b/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp @@ -4780,6 +4780,20 @@ void TypeAnalyzer::visitCallBase(CallBase &call) { updateAnalysis(&call, TypeTree(BaseType::Pointer).Only(-1, &call), &call); return; } + if (funcName == "julia.gc_loaded") { + if (directions & UP) + updateAnalysis(call.getArgOperand(2), getAnalysis(&call), &call); + if (directions & DOWN) + updateAnalysis(&call, getAnalysis(call.getArgOperand(2)), &call); + return; + } + if (funcName == "julia.pointer_from_objref") { + if (directions & UP) + updateAnalysis(call.getArgOperand(0), getAnalysis(&call), &call); + if (directions & DOWN) + updateAnalysis(&call, getAnalysis(call.getArgOperand(0)), &call); + return; + } if (funcName == "_ZNSt6chrono3_V212steady_clock3nowEv") { updateAnalysis(&call, TypeTree(BaseType::Integer).Only(-1, &call), &call); return; From ed51f8eb1c215cde5ddcfa1be67bc64de438f32b Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sun, 20 Oct 2024 21:40:42 -0400 Subject: [PATCH 2/3] fix --- enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp b/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp index cc38c7c1de1..2812c5c2ece 100644 --- a/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp +++ b/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp @@ -4781,16 +4781,16 @@ void TypeAnalyzer::visitCallBase(CallBase &call) { return; } if (funcName == "julia.gc_loaded") { - if (directions & UP) + if (direction & UP) updateAnalysis(call.getArgOperand(2), getAnalysis(&call), &call); - if (directions & DOWN) + if (direction & DOWN) updateAnalysis(&call, getAnalysis(call.getArgOperand(2)), &call); return; } if (funcName == "julia.pointer_from_objref") { - if (directions & UP) + if (direction & UP) updateAnalysis(call.getArgOperand(0), getAnalysis(&call), &call); - if (directions & DOWN) + if (direction & DOWN) updateAnalysis(&call, getAnalysis(call.getArgOperand(0)), &call); return; } From 84339b2cd8e5df4de663b2aee57034b3ef0b72e2 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sun, 20 Oct 2024 22:00:07 -0400 Subject: [PATCH 3/3] fix --- enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp b/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp index 2812c5c2ece..ffac6ef7c06 100644 --- a/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp +++ b/enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp @@ -4782,9 +4782,9 @@ void TypeAnalyzer::visitCallBase(CallBase &call) { } if (funcName == "julia.gc_loaded") { if (direction & UP) - updateAnalysis(call.getArgOperand(2), getAnalysis(&call), &call); + updateAnalysis(call.getArgOperand(1), getAnalysis(&call), &call); if (direction & DOWN) - updateAnalysis(&call, getAnalysis(call.getArgOperand(2)), &call); + updateAnalysis(&call, getAnalysis(call.getArgOperand(1)), &call); return; } if (funcName == "julia.pointer_from_objref") {