Skip to content

Commit

Permalink
llvm more opts
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewZhaoLuo committed Oct 9, 2021
1 parent 1c8da0f commit 444e51a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/target/llvm/llvm_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ void ParseLLVMTargetOptions(const Target& target, std::string* triple, std::stri
#if TVM_LLVM_VERSION < 50
opt.LessPreciseFPMADOption = true;
#endif
// Turn on all flags which trade FP precision for speed
opt.AllowFPOpFusion = llvm::FPOpFusion::Fast;
opt.UnsafeFPMath = false;
opt.NoInfsFPMath = false;
opt.UnsafeFPMath = true;
opt.NoInfsFPMath = true;
opt.NoNaNsFPMath = true;
opt.NoTrappingFPMath = true;
opt.NoSignedZerosFPMath = true;
if (soft_float_abi) {
opt.FloatABIType = llvm::FloatABI::Soft;
} else {
Expand Down Expand Up @@ -139,8 +142,8 @@ std::unique_ptr<llvm::TargetMachine> GetLLVMTargetMachine(const Target& target,
ICHECK(allow_null) << err << " target_triple=" << target_triple;
return nullptr;
}
llvm::TargetMachine* tm =
llvm_target->createTargetMachine(target_triple, mcpu, mattr, opt, llvm::Reloc::PIC_);
llvm::TargetMachine* tm = llvm_target->createTargetMachine(
target_triple, mcpu, mattr, opt, llvm::Reloc::PIC_, llvm::None, llvm::CodeGenOpt::Aggressive);
return std::unique_ptr<llvm::TargetMachine>(tm);
}

Expand Down

0 comments on commit 444e51a

Please sign in to comment.