diff options
author | Chris B <chris.bieneman@me.com> | 2025-01-08 08:55:02 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-08 08:55:02 -0600 |
commit | b66f6b25cb5107d4c8f78d13b08d2bdba39ad919 (patch) | |
tree | 24a7262e3c471c747441ada91d4c8696c4b6f561 /clang/lib/CodeGen | |
parent | 81898ac00e04ed3f352534a810829bdf4e6e14b7 (diff) | |
download | llvm-b66f6b25cb5107d4c8f78d13b08d2bdba39ad919.zip llvm-b66f6b25cb5107d4c8f78d13b08d2bdba39ad919.tar.gz llvm-b66f6b25cb5107d4c8f78d13b08d2bdba39ad919.tar.bz2 |
Revert #116331 & #121852 (#122105)
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 6 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 25 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 4 |
3 files changed, 1 insertions, 34 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index c8ff48f..a87c50b 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -757,8 +757,6 @@ void CodeGenFunction::EmitAttributedStmt(const AttributedStmt &S) { bool noinline = false; bool alwaysinline = false; bool noconvergent = false; - HLSLControlFlowHintAttr::Spelling flattenOrBranch = - HLSLControlFlowHintAttr::SpellingNotCalculated; const CallExpr *musttail = nullptr; for (const auto *A : S.getAttrs()) { @@ -790,9 +788,6 @@ void CodeGenFunction::EmitAttributedStmt(const AttributedStmt &S) { Builder.CreateAssumption(AssumptionVal); } } break; - case attr::HLSLControlFlowHint: { - flattenOrBranch = cast<HLSLControlFlowHintAttr>(A)->getSemanticSpelling(); - } break; } } SaveAndRestore save_nomerge(InNoMergeAttributedStmt, nomerge); @@ -800,7 +795,6 @@ void CodeGenFunction::EmitAttributedStmt(const AttributedStmt &S) { SaveAndRestore save_alwaysinline(InAlwaysInlineAttributedStmt, alwaysinline); SaveAndRestore save_noconvergent(InNoConvergentAttributedStmt, noconvergent); SaveAndRestore save_musttail(MustTailCall, musttail); - SaveAndRestore save_flattenOrBranch(HLSLControlFlowAttr, flattenOrBranch); EmitStmt(S.getSubStmt(), S.getAttrs()); } diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 067ff55..af58fa6 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -40,7 +40,6 @@ #include "llvm/IR/DataLayout.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/FPEnv.h" -#include "llvm/IR/Instruction.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/Intrinsics.h" #include "llvm/IR/MDBuilder.h" @@ -2084,29 +2083,7 @@ void CodeGenFunction::EmitBranchOnBoolExpr( Weights = createProfileWeights(TrueCount, CurrentCount - TrueCount); } - llvm::Instruction *BrInst = Builder.CreateCondBr(CondV, TrueBlock, FalseBlock, - Weights, Unpredictable); - switch (HLSLControlFlowAttr) { - case HLSLControlFlowHintAttr::Microsoft_branch: - case HLSLControlFlowHintAttr::Microsoft_flatten: { - llvm::MDBuilder MDHelper(CGM.getLLVMContext()); - - llvm::ConstantInt *BranchHintConstant = - HLSLControlFlowAttr == - HLSLControlFlowHintAttr::Spelling::Microsoft_branch - ? llvm::ConstantInt::get(CGM.Int32Ty, 1) - : llvm::ConstantInt::get(CGM.Int32Ty, 2); - - SmallVector<llvm::Metadata *, 2> Vals( - {MDHelper.createString("hlsl.controlflow.hint"), - MDHelper.createConstant(BranchHintConstant)}); - BrInst->setMetadata("hlsl.controlflow.hint", - llvm::MDNode::get(CGM.getLLVMContext(), Vals)); - break; - } - case HLSLControlFlowHintAttr::SpellingNotCalculated: - break; - } + Builder.CreateCondBr(CondV, TrueBlock, FalseBlock, Weights, Unpredictable); } /// ErrorUnsupported - Print out an error that codegen doesn't support the diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index bc612a0..f2240f8 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -615,10 +615,6 @@ public: /// True if the current statement has noconvergent attribute. bool InNoConvergentAttributedStmt = false; - /// HLSL Branch attribute. - HLSLControlFlowHintAttr::Spelling HLSLControlFlowAttr = - HLSLControlFlowHintAttr::SpellingNotCalculated; - // The CallExpr within the current statement that the musttail attribute // applies to. nullptr if there is no 'musttail' on the current statement. const CallExpr *MustTailCall = nullptr; |