Index: clang/lib/CodeGen/CGCall.cpp =================================================================== --- clang/lib/CodeGen/CGCall.cpp +++ clang/lib/CodeGen/CGCall.cpp @@ -1785,7 +1785,7 @@ FuncAttrs.addAttribute("frame-pointer", FpKind); if (CodeGenOpts.LessPreciseFPMAD) - FuncAttrs.addAttribute("less-precise-fpmad", "true"); + FuncAttrs.addAttribute("less-precise-fpmad"); if (CodeGenOpts.NullPointerIsValid) FuncAttrs.addAttribute(llvm::Attribute::NullPointerIsValid); @@ -1800,7 +1800,7 @@ } if (LangOpts.getFPExceptionMode() == LangOptions::FPE_Ignore) - FuncAttrs.addAttribute("no-trapping-math", "true"); + FuncAttrs.addAttribute("no-trapping-math"); // Strict (compliant) code is the default, so only add this attribute to // indicate that we are trying to workaround a problem case. @@ -1810,17 +1810,17 @@ // TODO: Are these all needed? // unsafe/inf/nan/nsz are handled by instruction-level FastMathFlags. if (LangOpts.NoHonorInfs) - FuncAttrs.addAttribute("no-infs-fp-math", "true"); + FuncAttrs.addAttribute("no-infs-fp-math"); if (LangOpts.NoHonorNaNs) - FuncAttrs.addAttribute("no-nans-fp-math", "true"); + FuncAttrs.addAttribute("no-nans-fp-math"); if (LangOpts.UnsafeFPMath) - FuncAttrs.addAttribute("unsafe-fp-math", "true"); + FuncAttrs.addAttribute("unsafe-fp-math"); if (CodeGenOpts.SoftFloat) FuncAttrs.addAttribute("use-soft-float", "true"); FuncAttrs.addAttribute("stack-protector-buffer-size", llvm::utostr(CodeGenOpts.SSPBufferSize)); if (LangOpts.NoSignedZero) - FuncAttrs.addAttribute("no-signed-zeros-fp-math", "true"); + FuncAttrs.addAttribute("no-signed-zeros-fp-math"); // TODO: Reciprocal estimate codegen options should apply to instructions? const std::vector &Recips = CodeGenOpts.Reciprocals; Index: clang/lib/CodeGen/CodeGenFunction.cpp =================================================================== --- clang/lib/CodeGen/CodeGenFunction.cpp +++ clang/lib/CodeGen/CodeGenFunction.cpp @@ -173,11 +173,10 @@ "FPConstrained should be enabled on entire function"); auto mergeFnAttrValue = [&](StringRef Name, bool Value) { - auto OldValue = - CGF.CurFn->getFnAttribute(Name).getValueAsString() == "true"; + auto OldValue = CGF.CurFn->hasFnAttribute(Name); auto NewValue = OldValue & Value; - if (OldValue != NewValue) - CGF.CurFn->addFnAttr(Name, llvm::toStringRef(NewValue)); + if (OldValue && !NewValue) + CGF.CurFn->removeFnAttr(Name); }; mergeFnAttrValue("no-infs-fp-math", FPFeatures.getNoHonorInfs()); mergeFnAttrValue("no-nans-fp-math", FPFeatures.getNoHonorNaNs()); @@ -868,7 +867,7 @@ // Add no-jump-tables value. if (CGM.getCodeGenOpts().NoUseJumpTables) - Fn->addFnAttr("no-jump-tables", "true"); + Fn->addFnAttr("no-jump-tables"); // Add no-inline-line-tables value. if (CGM.getCodeGenOpts().NoInlineLineTables) Index: llvm/include/llvm/CodeGen/TargetLowering.h =================================================================== --- llvm/include/llvm/CodeGen/TargetLowering.h +++ llvm/include/llvm/CodeGen/TargetLowering.h @@ -1148,7 +1148,7 @@ /// Return true if lowering to a jump table is allowed. virtual bool areJTsAllowed(const Function *Fn) const { - if (Fn->getFnAttribute("no-jump-tables").getValueAsString() == "true") + if (Fn->hasFnAttribute("no-jump-tables")) return false; return isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) || Index: llvm/lib/Analysis/IVDescriptors.cpp =================================================================== --- llvm/lib/Analysis/IVDescriptors.cpp +++ llvm/lib/Analysis/IVDescriptors.cpp @@ -623,10 +623,8 @@ BasicBlock *Header = TheLoop->getHeader(); Function &F = *Header->getParent(); FastMathFlags FMF; - FMF.setNoNaNs( - F.getFnAttribute("no-nans-fp-math").getValueAsString() == "true"); - FMF.setNoSignedZeros( - F.getFnAttribute("no-signed-zeros-fp-math").getValueAsString() == "true"); + FMF.setNoNaNs(F.hasFnAttribute("no-nans-fp-math")); + FMF.setNoSignedZeros(F.hasFnAttribute("no-signed-zeros-fp-math")); if (AddReductionVar(Phi, RecurKind::Add, TheLoop, FMF, RedDes, DB, AC, DT)) { LLVM_DEBUG(dbgs() << "Found an ADD reduction PHI." << *Phi << "\n"); Index: llvm/lib/IR/Attributes.cpp =================================================================== --- llvm/lib/IR/Attributes.cpp +++ llvm/lib/IR/Attributes.cpp @@ -1661,6 +1661,16 @@ AttrBuilder &AttrBuilder::addAttribute(Attribute Attr) { if (Attr.isStringAttribute()) { + +#ifndef NDEBUG + // ensure StrBoolAttr are either set or unset, without any value set +#define GET_ATTR_NAMES +#define ATTRIBUTE_STRBOOL(ENUM_NAME, DISPLAY_NAME) \ + if (Attr.getKindAsString() == #DISPLAY_NAME) \ + assert(Attr.getValueAsString().empty() && "StrBoolAttr doens't need " \ + "value"); +#endif + addAttribute(Attr.getKindAsString(), Attr.getValueAsString()); return *this; } @@ -2164,13 +2174,15 @@ struct StrBoolAttr { static bool isSet(const Function &Fn, StringRef Kind) { - auto A = Fn.getFnAttribute(Kind); - return A.getValueAsString().equals("true"); + return Fn.hasFnAttribute(Kind); } static void set(Function &Fn, StringRef Kind, bool Val) { - Fn.addFnAttr(Kind, Val ? "true" : "false"); + if (Val) + Fn.addFnAttr(Kind); + else + Fn.removeFnAttr(Kind); } }; Index: llvm/lib/IR/AutoUpgrade.cpp =================================================================== --- llvm/lib/IR/AutoUpgrade.cpp +++ llvm/lib/IR/AutoUpgrade.cpp @@ -4452,6 +4452,22 @@ } void llvm::UpgradeAttributes(AttrBuilder &B) { + // StrBoolAttributes are either set with no value, or unset + SmallVector ToRemove; + for (auto &KV : B.td_attrs()) { +#define GET_ATTR_NAMES +#define ATTRIBUTE_STRBOOL(ENUM_NAME, DISPLAY_NAME) \ + if (KV.first == #DISPLAY_NAME) { \ + if (KV.second == "false") \ + ToRemove.push_back(KV.first); \ + else if (KV.second == "true") \ + KV.second = ""; \ + } +#include "llvm/IR/Attributes.inc" + } + for (auto const &AttrName : ToRemove) + B.removeAttribute(AttrName); + StringRef FramePointer; if (B.contains("no-frame-pointer-elim")) { // The value can be "true" or "false". Index: llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp =================================================================== --- llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp +++ llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp @@ -808,8 +808,7 @@ } static bool hasUnsafeFPMath(const Function &F) { - Attribute Attr = F.getFnAttribute("unsafe-fp-math"); - return Attr.getValueAsString() == "true"; + return F.hasFnAttribute("unsafe-fp-math"); } static std::pair getMul64(IRBuilder<> &Builder, Index: llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp =================================================================== --- llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp +++ llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp @@ -475,8 +475,7 @@ if (Op->isFast()) return true; const Function *F = CI->getParent()->getParent(); - Attribute Attr = F->getFnAttribute("unsafe-fp-math"); - return Attr.getValueAsString() == "true"; + return F->hasFnAttribute("unsafe-fp-math"); } bool AMDGPULibCalls::useNativeFunc(const StringRef F) const { Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp =================================================================== --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp @@ -589,10 +589,9 @@ // Returns true if all functions have the same function attribute value. // It also returns true when the module has no functions. static bool checkFunctionsAttributeConsistency(const Module &M, StringRef Attr, - StringRef Value) { - return !any_of(M, [&](const Function &F) { - return F.getFnAttribute(Attr).getValueAsString() != Value; - }); + bool Value) { + return all_of( + M, [&](const Function &F) { return F.hasFnAttribute(Attr) == Value; }); } // Returns true if all functions have the same denormal mode. // It also returns true when the module has no functions. @@ -702,7 +701,7 @@ // Set FP exceptions and rounding if (checkFunctionsAttributeConsistency(*MMI->getModule(), - "no-trapping-math", "true") || + "no-trapping-math") || TM.Options.NoTrappingFPMath) ATS.emitAttribute(ARMBuildAttrs::ABI_FP_exceptions, ARMBuildAttrs::Not_Allowed); Index: llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp =================================================================== --- llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp +++ llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp @@ -251,8 +251,7 @@ // Creating a separate target feature is not strictly necessary, it only // exists to make "unsafe-fp-math" force creating a new subtarget. - if (FnAttrs.hasFnAttribute("unsafe-fp-math") && - F.getFnAttribute("unsafe-fp-math").getValueAsString() == "true") + if (FnAttrs.hasFnAttribute("unsafe-fp-math")) FS = FS.empty() ? "+unsafe-fp" : "+unsafe-fp," + FS; auto &I = SubtargetMap[CPU + FS]; Index: llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp =================================================================== --- llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -4304,14 +4304,7 @@ // Allow unsafe math if unsafe-fp-math attribute explicitly says so. const Function &F = MF.getFunction(); - if (F.hasFnAttribute("unsafe-fp-math")) { - Attribute Attr = F.getFnAttribute("unsafe-fp-math"); - StringRef Val = Attr.getValueAsString(); - if (Val == "true") - return true; - } - - return false; + return F.hasFnAttribute("unsafe-fp-math"); } /// PerformADDCombineWithOperands - Try DAG combinations for an ADD with Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp =================================================================== --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -5682,8 +5682,7 @@ Function *Fn = BB->getParent(); // Only build lookup table when we have a target that supports it or the // attribute is not set. - if (!TTI.shouldBuildLookupTables() || - (Fn->getFnAttribute("no-jump-tables").getValueAsString() == "true")) + if (!TTI.shouldBuildLookupTables() || Fn->hasFnAttribute("no-jump-tables")) return false; // FIXME: If the switch is too sparse for a lookup table, perhaps we could Index: llvm/test/CodeGen/X86/switch.ll =================================================================== --- llvm/test/CodeGen/X86/switch.ll +++ llvm/test/CodeGen/X86/switch.ll @@ -31,7 +31,7 @@ } ; Should never be lowered as a jump table because of the attribute -define void @basic_nojumptable(i32 %x) "no-jump-tables"="true" { +define void @basic_nojumptable(i32 %x) "no-jump-tables" { entry: switch i32 %x, label %return [ i32 3, label %bb0 @@ -50,7 +50,7 @@ } ; Should be lowered as a jump table because of the attribute -define void @basic_nojumptable_false(i32 %x) "no-jump-tables"="false" { +define void @basic_nojumptable_false(i32 %x) { entry: switch i32 %x, label %return [ i32 3, label %bb0 Index: llvm/test/Transforms/IROutliner/outlining-compatible-and-attribute-transfer.ll =================================================================== --- llvm/test/Transforms/IROutliner/outlining-compatible-and-attribute-transfer.ll +++ llvm/test/Transforms/IROutliner/outlining-compatible-and-attribute-transfer.ll @@ -100,8 +100,7 @@ ret void } -attributes #0 = { "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "less-precise-fpmad"="true" -"unsafe-fp-math"="true" "no-infs-fp-math"="true"} +attributes #0 = { "no-nans-fp-math" "no-signed-zeros-fp-math" "less-precise-fpmad" "unsafe-fp-math" "no-infs-fp-math"} ; CHECK: define internal void @outlined_ir_func_0(float* [[ARG0:%.*]], float* [[ARG1:%.*]], float* [[ARG2:%.*]]) [[ATTR1:#[0-9]+]] { ; CHECK: entry_to_outline: @@ -122,5 +121,5 @@ ; CHECK-NEXT: [[CL:%.*]] = load i32, i32* [[ARG2]], align 4 -; CHECK: attributes [[ATTR1]] = { minsize optsize "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "unsafe-fp-math"="false" } -; CHECK: attributes [[ATTR]] = { minsize optsize "less-precise-fpmad"="true" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "unsafe-fp-math"="true" } +; CHECK: attributes [[ATTR1]] = { minsize optsize } +; CHECK: attributes [[ATTR]] = { minsize optsize "less-precise-fpmad" "no-infs-fp-math" "no-nans-fp-math" "no-signed-zeros-fp-math" "unsafe-fp-math" } Index: llvm/test/Transforms/Inline/attributes.ll =================================================================== --- llvm/test/Transforms/Inline/attributes.ll +++ llvm/test/Transforms/Inline/attributes.ll @@ -267,40 +267,40 @@ ; CHECK-NEXT: ret i32 } -define i32 @less-precise-fpmad_callee0(i32 %i) "less-precise-fpmad"="false" { +define i32 @less-precise-fpmad_callee0(i32 %i) { ret i32 %i -; CHECK: @less-precise-fpmad_callee0(i32 %i) [[FPMAD_FALSE:#[0-9]+]] { +; CHECK: @less-precise-fpmad_callee0(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @less-precise-fpmad_callee1(i32 %i) "less-precise-fpmad"="true" { +define i32 @less-precise-fpmad_callee1(i32 %i) "less-precise-fpmad" { ret i32 %i ; CHECK: @less-precise-fpmad_callee1(i32 %i) [[FPMAD_TRUE:#[0-9]+]] { ; CHECK-NEXT: ret i32 } -define i32 @test_less-precise-fpmad0(i32 %i) "less-precise-fpmad"="false" { +define i32 @test_less-precise-fpmad0(i32 %i) { %1 = call i32 @less-precise-fpmad_callee0(i32 %i) ret i32 %1 -; CHECK: @test_less-precise-fpmad0(i32 %i) [[FPMAD_FALSE]] { +; CHECK: @test_less-precise-fpmad0(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_less-precise-fpmad1(i32 %i) "less-precise-fpmad"="false" { +define i32 @test_less-precise-fpmad1(i32 %i) { %1 = call i32 @less-precise-fpmad_callee1(i32 %i) ret i32 %1 -; CHECK: @test_less-precise-fpmad1(i32 %i) [[FPMAD_FALSE]] { +; CHECK: @test_less-precise-fpmad1(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_less-precise-fpmad2(i32 %i) "less-precise-fpmad"="true" { +define i32 @test_less-precise-fpmad2(i32 %i) "less-precise-fpmad" { %1 = call i32 @less-precise-fpmad_callee0(i32 %i) ret i32 %1 -; CHECK: @test_less-precise-fpmad2(i32 %i) [[FPMAD_FALSE]] { +; CHECK: @test_less-precise-fpmad2(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_less-precise-fpmad3(i32 %i) "less-precise-fpmad"="true" { +define i32 @test_less-precise-fpmad3(i32 %i) "less-precise-fpmad" { %1 = call i32 @less-precise-fpmad_callee1(i32 %i) ret i32 %1 ; CHECK: @test_less-precise-fpmad3(i32 %i) [[FPMAD_TRUE]] { @@ -355,7 +355,7 @@ ; CHECK-NEXT: ret i32 } -define i32 @no-use-jump-tables_callee1(i32 %i) "no-jump-tables"="true" { +define i32 @no-use-jump-tables_callee1(i32 %i) "no-jump-tables" { ret i32 %i ; CHECK: @no-use-jump-tables_callee1(i32 %i) [[NOUSEJUMPTABLES:#[0-9]+]] { ; CHECK-NEXT: ret i32 @@ -375,14 +375,14 @@ ; CHECK-NEXT: ret i32 } -define i32 @test_no-use-jump-tables2(i32 %i) "no-jump-tables"="true" { +define i32 @test_no-use-jump-tables2(i32 %i) "no-jump-tables" { %1 = call i32 @no-use-jump-tables_callee0(i32 %i) ret i32 %1 ; CHECK: @test_no-use-jump-tables2(i32 %i) [[NOUSEJUMPTABLES]] { ; CHECK-NEXT: ret i32 } -define i32 @test_no-use-jump-tables3(i32 %i) "no-jump-tables"="true" { +define i32 @test_no-use-jump-tables3(i32 %i) "no-jump-tables" { %1 = call i32 @no-use-jump-tables_callee1(i32 %i) ret i32 %1 ; CHECK: @test_no-use-jump-tables3(i32 %i) [[NOUSEJUMPTABLES]] { @@ -440,160 +440,160 @@ ; CHECK-NEXT: ret i32 } -define i32 @no-infs-fp-math_callee0(i32 %i) "no-infs-fp-math"="false" { +define i32 @no-infs-fp-math_callee0(i32 %i) { ret i32 %i -; CHECK: @no-infs-fp-math_callee0(i32 %i) [[NO_INFS_FPMATH_FALSE:#[0-9]+]] { +; CHECK: @no-infs-fp-math_callee0(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @no-infs-fp-math_callee1(i32 %i) "no-infs-fp-math"="true" { +define i32 @no-infs-fp-math_callee1(i32 %i) "no-infs-fp-math" { ret i32 %i ; CHECK: @no-infs-fp-math_callee1(i32 %i) [[NO_INFS_FPMATH_TRUE:#[0-9]+]] { ; CHECK-NEXT: ret i32 } -define i32 @test_no-infs-fp-math0(i32 %i) "no-infs-fp-math"="false" { +define i32 @test_no-infs-fp-math0(i32 %i) { %1 = call i32 @no-infs-fp-math_callee0(i32 %i) ret i32 %1 -; CHECK: @test_no-infs-fp-math0(i32 %i) [[NO_INFS_FPMATH_FALSE]] { +; CHECK: @test_no-infs-fp-math0(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_no-infs-fp-math1(i32 %i) "no-infs-fp-math"="false" { +define i32 @test_no-infs-fp-math1(i32 %i) { %1 = call i32 @no-infs-fp-math_callee1(i32 %i) ret i32 %1 -; CHECK: @test_no-infs-fp-math1(i32 %i) [[NO_INFS_FPMATH_FALSE]] { +; CHECK: @test_no-infs-fp-math1(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_no-infs-fp-math2(i32 %i) "no-infs-fp-math"="true" { +define i32 @test_no-infs-fp-math2(i32 %i) "no-infs-fp-math" { %1 = call i32 @no-infs-fp-math_callee0(i32 %i) ret i32 %1 -; CHECK: @test_no-infs-fp-math2(i32 %i) [[NO_INFS_FPMATH_FALSE]] { +; CHECK: @test_no-infs-fp-math2(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_no-infs-fp-math3(i32 %i) "no-infs-fp-math"="true" { +define i32 @test_no-infs-fp-math3(i32 %i) "no-infs-fp-math" { %1 = call i32 @no-infs-fp-math_callee1(i32 %i) ret i32 %1 ; CHECK: @test_no-infs-fp-math3(i32 %i) [[NO_INFS_FPMATH_TRUE]] { ; CHECK-NEXT: ret i32 } -define i32 @no-nans-fp-math_callee0(i32 %i) "no-nans-fp-math"="false" { +define i32 @no-nans-fp-math_callee0(i32 %i) { ret i32 %i -; CHECK: @no-nans-fp-math_callee0(i32 %i) [[NO_NANS_FPMATH_FALSE:#[0-9]+]] { +; CHECK: @no-nans-fp-math_callee0(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @no-nans-fp-math_callee1(i32 %i) "no-nans-fp-math"="true" { +define i32 @no-nans-fp-math_callee1(i32 %i) "no-nans-fp-math" { ret i32 %i ; CHECK: @no-nans-fp-math_callee1(i32 %i) [[NO_NANS_FPMATH_TRUE:#[0-9]+]] { ; CHECK-NEXT: ret i32 } -define i32 @test_no-nans-fp-math0(i32 %i) "no-nans-fp-math"="false" { +define i32 @test_no-nans-fp-math0(i32 %i) { %1 = call i32 @no-nans-fp-math_callee0(i32 %i) ret i32 %1 -; CHECK: @test_no-nans-fp-math0(i32 %i) [[NO_NANS_FPMATH_FALSE]] { +; CHECK: @test_no-nans-fp-math0(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_no-nans-fp-math1(i32 %i) "no-nans-fp-math"="false" { +define i32 @test_no-nans-fp-math1(i32 %i) { %1 = call i32 @no-nans-fp-math_callee1(i32 %i) ret i32 %1 -; CHECK: @test_no-nans-fp-math1(i32 %i) [[NO_NANS_FPMATH_FALSE]] { +; CHECK: @test_no-nans-fp-math1(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_no-nans-fp-math2(i32 %i) "no-nans-fp-math"="true" { +define i32 @test_no-nans-fp-math2(i32 %i) "no-nans-fp-math" { %1 = call i32 @no-nans-fp-math_callee0(i32 %i) ret i32 %1 -; CHECK: @test_no-nans-fp-math2(i32 %i) [[NO_NANS_FPMATH_FALSE]] { +; CHECK: @test_no-nans-fp-math2(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_no-nans-fp-math3(i32 %i) "no-nans-fp-math"="true" { +define i32 @test_no-nans-fp-math3(i32 %i) "no-nans-fp-math" { %1 = call i32 @no-nans-fp-math_callee1(i32 %i) ret i32 %1 ; CHECK: @test_no-nans-fp-math3(i32 %i) [[NO_NANS_FPMATH_TRUE]] { ; CHECK-NEXT: ret i32 } -define i32 @no-signed-zeros-fp-math_callee0(i32 %i) "no-signed-zeros-fp-math"="false" { +define i32 @no-signed-zeros-fp-math_callee0(i32 %i) { ret i32 %i -; CHECK: @no-signed-zeros-fp-math_callee0(i32 %i) [[NO_SIGNED_ZEROS_FPMATH_FALSE:#[0-9]+]] { +; CHECK: @no-signed-zeros-fp-math_callee0(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @no-signed-zeros-fp-math_callee1(i32 %i) "no-signed-zeros-fp-math"="true" { +define i32 @no-signed-zeros-fp-math_callee1(i32 %i) "no-signed-zeros-fp-math" { ret i32 %i ; CHECK: @no-signed-zeros-fp-math_callee1(i32 %i) [[NO_SIGNED_ZEROS_FPMATH_TRUE:#[0-9]+]] { ; CHECK-NEXT: ret i32 } -define i32 @test_no-signed-zeros-fp-math0(i32 %i) "no-signed-zeros-fp-math"="false" { +define i32 @test_no-signed-zeros-fp-math0(i32 %i) { %1 = call i32 @no-signed-zeros-fp-math_callee0(i32 %i) ret i32 %1 -; CHECK: @test_no-signed-zeros-fp-math0(i32 %i) [[NO_SIGNED_ZEROS_FPMATH_FALSE]] { +; CHECK: @test_no-signed-zeros-fp-math0(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_no-signed-zeros-fp-math1(i32 %i) "no-signed-zeros-fp-math"="false" { +define i32 @test_no-signed-zeros-fp-math1(i32 %i) { %1 = call i32 @no-signed-zeros-fp-math_callee1(i32 %i) ret i32 %1 -; CHECK: @test_no-signed-zeros-fp-math1(i32 %i) [[NO_SIGNED_ZEROS_FPMATH_FALSE]] { +; CHECK: @test_no-signed-zeros-fp-math1(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_no-signed-zeros-fp-math2(i32 %i) "no-signed-zeros-fp-math"="true" { +define i32 @test_no-signed-zeros-fp-math2(i32 %i) "no-signed-zeros-fp-math" { %1 = call i32 @no-signed-zeros-fp-math_callee0(i32 %i) ret i32 %1 -; CHECK: @test_no-signed-zeros-fp-math2(i32 %i) [[NO_SIGNED_ZEROS_FPMATH_FALSE]] { +; CHECK: @test_no-signed-zeros-fp-math2(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_no-signed-zeros-fp-math3(i32 %i) "no-signed-zeros-fp-math"="true" { +define i32 @test_no-signed-zeros-fp-math3(i32 %i) "no-signed-zeros-fp-math" { %1 = call i32 @no-signed-zeros-fp-math_callee1(i32 %i) ret i32 %1 ; CHECK: @test_no-signed-zeros-fp-math3(i32 %i) [[NO_SIGNED_ZEROS_FPMATH_TRUE]] { ; CHECK-NEXT: ret i32 } -define i32 @unsafe-fp-math_callee0(i32 %i) "unsafe-fp-math"="false" { +define i32 @unsafe-fp-math_callee0(i32 %i) { ret i32 %i -; CHECK: @unsafe-fp-math_callee0(i32 %i) [[UNSAFE_FPMATH_FALSE:#[0-9]+]] { +; CHECK: @unsafe-fp-math_callee0(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @unsafe-fp-math_callee1(i32 %i) "unsafe-fp-math"="true" { +define i32 @unsafe-fp-math_callee1(i32 %i) "unsafe-fp-math" { ret i32 %i ; CHECK: @unsafe-fp-math_callee1(i32 %i) [[UNSAFE_FPMATH_TRUE:#[0-9]+]] { ; CHECK-NEXT: ret i32 } -define i32 @test_unsafe-fp-math0(i32 %i) "unsafe-fp-math"="false" { +define i32 @test_unsafe-fp-math0(i32 %i) { %1 = call i32 @unsafe-fp-math_callee0(i32 %i) ret i32 %1 -; CHECK: @test_unsafe-fp-math0(i32 %i) [[UNSAFE_FPMATH_FALSE]] { +; CHECK: @test_unsafe-fp-math0(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_unsafe-fp-math1(i32 %i) "unsafe-fp-math"="false" { +define i32 @test_unsafe-fp-math1(i32 %i) { %1 = call i32 @unsafe-fp-math_callee1(i32 %i) ret i32 %1 -; CHECK: @test_unsafe-fp-math1(i32 %i) [[UNSAFE_FPMATH_FALSE]] { +; CHECK: @test_unsafe-fp-math1(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_unsafe-fp-math2(i32 %i) "unsafe-fp-math"="true" { +define i32 @test_unsafe-fp-math2(i32 %i) "unsafe-fp-math" { %1 = call i32 @unsafe-fp-math_callee0(i32 %i) ret i32 %1 -; CHECK: @test_unsafe-fp-math2(i32 %i) [[UNSAFE_FPMATH_FALSE]] { +; CHECK: @test_unsafe-fp-math2(i32 %i) { ; CHECK-NEXT: ret i32 } -define i32 @test_unsafe-fp-math3(i32 %i) "unsafe-fp-math"="true" { +define i32 @test_unsafe-fp-math3(i32 %i) "unsafe-fp-math" { %1 = call i32 @unsafe-fp-math_callee1(i32 %i) ret i32 %1 ; CHECK: @test_unsafe-fp-math3(i32 %i) [[UNSAFE_FPMATH_TRUE]] { @@ -601,16 +601,11 @@ } ; CHECK: attributes [[SLH]] = { speculative_load_hardening } -; CHECK: attributes [[FPMAD_FALSE]] = { "less-precise-fpmad"="false" } -; CHECK: attributes [[FPMAD_TRUE]] = { "less-precise-fpmad"="true" } +; CHECK: attributes [[FPMAD_TRUE]] = { "less-precise-fpmad" } ; CHECK: attributes [[NOIMPLICITFLOAT]] = { noimplicitfloat } -; CHECK: attributes [[NOUSEJUMPTABLES]] = { "no-jump-tables"="true" } +; CHECK: attributes [[NOUSEJUMPTABLES]] = { "no-jump-tables" } ; CHECK: attributes [[NULLPOINTERISVALID]] = { null_pointer_is_valid } -; CHECK: attributes [[NO_INFS_FPMATH_FALSE]] = { "no-infs-fp-math"="false" } -; CHECK: attributes [[NO_INFS_FPMATH_TRUE]] = { "no-infs-fp-math"="true" } -; CHECK: attributes [[NO_NANS_FPMATH_FALSE]] = { "no-nans-fp-math"="false" } -; CHECK: attributes [[NO_NANS_FPMATH_TRUE]] = { "no-nans-fp-math"="true" } -; CHECK: attributes [[NO_SIGNED_ZEROS_FPMATH_FALSE]] = { "no-signed-zeros-fp-math"="false" } -; CHECK: attributes [[NO_SIGNED_ZEROS_FPMATH_TRUE]] = { "no-signed-zeros-fp-math"="true" } -; CHECK: attributes [[UNSAFE_FPMATH_FALSE]] = { "unsafe-fp-math"="false" } -; CHECK: attributes [[UNSAFE_FPMATH_TRUE]] = { "unsafe-fp-math"="true" } +; CHECK: attributes [[NO_INFS_FPMATH_TRUE]] = { "no-infs-fp-math" } +; CHECK: attributes [[NO_NANS_FPMATH_TRUE]] = { "no-nans-fp-math" } +; CHECK: attributes [[NO_SIGNED_ZEROS_FPMATH_TRUE]] = { "no-signed-zeros-fp-math" } +; CHECK: attributes [[UNSAFE_FPMATH_TRUE]] = { "unsafe-fp-math" }