Skip to content

Commit

Permalink
Partially debug null type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pchintalapudi committed Mar 10, 2022
1 parent 853151d commit 43e9ee3
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/aotcompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <llvm/Transforms/Utils/SimplifyCFGOptions.h>
#include <llvm/Passes/PassBuilder.h>
#include <llvm/Passes/PassPlugin.h>
#include <llvm/Passes/StandardInstrumentations.h>
#if defined(USE_POLLY)
#include <polly/RegisterPasses.h>
#include <polly/LinkAllPasses.h>
Expand Down Expand Up @@ -1216,7 +1217,10 @@ void addPipeline(ModulePassManager &MPM, int opt_level, bool lower_intrinsics, b
void optimizeModule(Module &M, TargetMachine *TM, int opt_level, bool lower_intrinsics, bool dump_native)
{
// llvm::PassBuilder pb(targetMachine->LLVM, llvm::PipelineTuningOptions(), llvm::None, &passInstrumentationCallbacks);
PassBuilder PB;
PassInstrumentationCallbacks PIC;
StandardInstrumentations SI(false);
SI.registerCallbacks(PIC);
PassBuilder PB(TM, PipelineTuningOptions(), None, &PIC);
// Create the analysis managers.
LoopAnalysisManager LAM;
PB.registerLoopAnalyses(LAM);
Expand Down
5 changes: 4 additions & 1 deletion src/llvm-alloc-opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <llvm/IR/Module.h>
#include <llvm/IR/Operator.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Verifier.h>
#include <llvm/Pass.h>
#include <llvm/Support/Debug.h>
#include <llvm/Transforms/Utils/PromoteMemToReg.h>
Expand Down Expand Up @@ -1148,7 +1149,9 @@ bool AllocOpt::runOnFunction(Function &F, function_ref<DominatorTree&()> GetDT)
Optimizer optimizer(F, *this, std::move(GetDT));
optimizer.initialize();
optimizer.optimizeAll();
return optimizer.finalize();
auto changed = optimizer.finalize();
assert(!verifyFunction(F));
return changed;
}

struct AllocOptLegacy : public FunctionPass {
Expand Down
2 changes: 2 additions & 0 deletions src/llvm-cpufeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <llvm/IR/Instructions.h>
#include <llvm/IR/PassManager.h>
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/Verifier.h>
#include <llvm/Target/TargetMachine.h>
#include <llvm/Support/Debug.h>

Expand Down Expand Up @@ -104,6 +105,7 @@ bool lowerCPUFeatures(Module &M)
for (auto I: Materialized) {
I->eraseFromParent();
}
assert(!verifyModule(M));
return true;
} else {
return false;
Expand Down
2 changes: 2 additions & 0 deletions src/llvm-demote-float16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/PassManager.h>
#include <llvm/IR/Module.h>
#include <llvm/IR/Verifier.h>
#include <llvm/Support/Debug.h>

using namespace llvm;
Expand Down Expand Up @@ -121,6 +122,7 @@ static bool demoteFloat16(Function &F)
if (erase.size() > 0) {
for (auto V : erase)
V->eraseFromParent();
assert(!verifyFunction(F));
return true;
}
else
Expand Down
5 changes: 5 additions & 0 deletions src/llvm-final-gc-lowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <llvm/IR/IntrinsicInst.h>
#include <llvm/IR/Module.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Verifier.h>
#include <llvm/Pass.h>
#include <llvm/Support/Debug.h>
#include <llvm/Transforms/Utils/ModuleUtils.h>
Expand Down Expand Up @@ -211,6 +212,7 @@ bool FinalLowerGC::doInitialization(Module &M) {
}
if (j != 0)
appendToCompilerUsed(M, ArrayRef<GlobalValue*>(functionList, j));
assert(!verifyModule(M));
return true;
}

Expand Down Expand Up @@ -244,6 +246,7 @@ bool FinalLowerGC::doFinalization(Module &M)
used = new GlobalVariable(M, ATy, false, GlobalValue::AppendingLinkage,
ConstantArray::get(ATy, init), "llvm.compiler.used");
used->setSection("llvm.metadata");
assert(!verifyModule(M));
return true;
}

Expand Down Expand Up @@ -320,6 +323,8 @@ bool FinalLowerGC::runOnFunction(Function &F)
}
}

assert(!verifyFunction(F));

return true;
}

Expand Down
2 changes: 2 additions & 0 deletions src/llvm-julia-licm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "llvm/Analysis/LoopIterator.h"
#include <llvm/IR/Dominators.h>
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/Verifier.h>
#include <llvm/Transforms/Utils/LoopUtils.h>
#include <llvm/Analysis/ValueTracking.h>

Expand Down Expand Up @@ -174,6 +175,7 @@ struct JuliaLICM : public JuliaPassContext {
}
}
}
assert(!verifyFunction(*L->getBlocks()[0]->getParent()));
return changed;
}
};
Expand Down
1 change: 1 addition & 0 deletions src/llvm-late-gc-lowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2699,6 +2699,7 @@ bool LateLowerGCFrame::runOnFunction(Function &F, bool *CFGModified) {
std::map<Value *, std::pair<int, int>> CallFrames; // = OptimizeCallFrames(S, Ordering);
PlaceRootsAndUpdateCalls(Colors, S, CallFrames);
CleanupIR(F, &S, CFGModified);
assert(!verifyFunction(F));
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions src/llvm-lower-handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <llvm/IR/Module.h>
#include <llvm/IR/Value.h>
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/Verifier.h>
#include <llvm/Pass.h>
#include <llvm/Support/Debug.h>
#include <llvm/Transforms/Utils/BasicBlockUtils.h>
Expand Down Expand Up @@ -215,6 +216,7 @@ static bool lowerExcHandlers(Function &F) {
LifetimeEnd->insertAfter(it.first);
}
}
assert(!verifyFunction(F));
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions src/llvm-muladd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <llvm/IR/Module.h>
#include <llvm/IR/Operator.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Verifier.h>
#include <llvm/Pass.h>
#include <llvm/Support/Debug.h>

Expand Down Expand Up @@ -80,6 +81,7 @@ static bool combineMulAdd(Function &F)
}
}
}
assert(!verifyFunction(F));
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions src/llvm-multiversioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/DebugInfoMetadata.h>
#include <llvm/IR/Verifier.h>
#include <llvm/Transforms/Utils/Cloning.h>

#include "julia.h"
Expand Down Expand Up @@ -1105,6 +1106,7 @@ static bool runMultiVersioning(Module &M, function_ref<LoopInfo&(Function&)> Get
// and collected all the shared/target-specific relocations.
clone.emit_metadata();

assert(!verifyModule(M));
return true;
}

Expand Down
1 change: 1 addition & 0 deletions src/llvm-propagate-addrspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ bool propagateJuliaAddrspaces(Function &F) {
visitor.ToDelete.clear();
visitor.LiftingMap.clear();
visitor.Visited.clear();
assert(!verifyFunction(F));
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions src/llvm-ptls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <llvm/IR/Constants.h>
#include <llvm/IR/LLVMContext.h>
#include <llvm/IR/MDBuilder.h>
#include <llvm/IR/Verifier.h>

#include <llvm/IR/InlineAsm.h>
#include <llvm/Transforms/Utils/BasicBlockUtils.h>
Expand Down Expand Up @@ -281,6 +282,7 @@ bool LowerPTLS::runOnModule(Module &_M, bool *CFGModified)
}
assert(pgcstack_getter->use_empty());
pgcstack_getter->eraseFromParent();
assert(!verifyModule(_M));
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions src/llvm-remove-addrspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <llvm/IR/Instructions.h>
#include <llvm/IR/InstIterator.h>
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/Verifier.h>
#include <llvm/Support/Debug.h>
#include <llvm/Transforms/Utils/Cloning.h>
#include <llvm/Transforms/Utils/ValueMapper.h>
Expand Down Expand Up @@ -453,6 +454,7 @@ bool removeAddrspaces(Module &M, AddrspaceRemapFunction ASRemapper)
}
}

assert(!verifyModule(M));
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions src/llvm-remove-ni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <llvm/IR/Module.h>
#include <llvm/IR/PassManager.h>
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/Verifier.h>
#include <llvm/Support/Debug.h>

#include "julia.h"
Expand All @@ -32,6 +33,7 @@ static bool removeNI(Module &M)
}
dlstr.erase(nistart, niend - nistart);
M.setDataLayout(dlstr);
assert(!verifyModule(M));
return true;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/llvm-simdloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <llvm/IR/Instructions.h>
#include <llvm/IR/LLVMContext.h>
#include <llvm/IR/Metadata.h>
#include <llvm/IR/Verifier.h>
#include <llvm/Support/Debug.h>

#include "julia_assert.h"
Expand Down Expand Up @@ -205,6 +206,7 @@ static bool markLoopInfo(Module &M, Function *marker, function_ref<LoopInfo &(Fu
I->deleteValue();
marker->eraseFromParent();

assert(!verifyModule(M));
return Changed;
}

Expand Down

0 comments on commit 43e9ee3

Please sign in to comment.