From b66f6b25cb5107d4c8f78d13b08d2bdba39ad919 Mon Sep 17 00:00:00 2001 From: Chris B Date: Wed, 8 Jan 2025 08:55:02 -0600 Subject: Revert #116331 & #121852 (#122105) --- clang/lib/CodeGen/CodeGenFunction.cpp | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') 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 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 -- cgit v1.1