Skip to content

Commit 513db9e

Browse files
committed
Revert "[clang][wip] Add nondeterministic initialization at alloca generation"
This reverts commit e0f96d5.
1 parent 5abfe75 commit 513db9e

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include "llvm/IR/MatrixBuilder.h"
4242
#include "llvm/Passes/OptimizationLevel.h"
4343
#include "llvm/Support/ConvertUTF.h"
44-
#include "llvm/Support/Debug.h"
4544
#include "llvm/Support/MathExtras.h"
4645
#include "llvm/Support/Path.h"
4746
#include "llvm/Support/SaveAndRestore.h"
@@ -51,8 +50,6 @@
5150
#include <optional>
5251
#include <string>
5352

54-
#define DEBUG_TYPE "CGExpr"
55-
5653
using namespace clang;
5754
using namespace CodeGen;
5855

@@ -118,21 +115,12 @@ RawAddress CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, CharUnits Align,
118115
llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty,
119116
const Twine &Name,
120117
llvm::Value *ArraySize) {
121-
LLVM_DEBUG(llvm::dbgs() << "DEBUG: " << Name << "\n";);
122118
llvm::AllocaInst *Alloca;
123119
if (ArraySize)
124120
Alloca = Builder.CreateAlloca(Ty, ArraySize, Name);
125-
else {
121+
else
126122
Alloca = new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(),
127123
ArraySize, Name, AllocaInsertPt);
128-
if (Ty->isIntegerTy()) {
129-
llvm::IRBuilder<> StoreFreezePoisonBuilder(Alloca->getContext());
130-
StoreFreezePoisonBuilder.SetInsertPoint(getPostAllocaInsertPoint());
131-
auto FreezePoison = StoreFreezePoisonBuilder.CreateFreeze(
132-
llvm::PoisonValue::get(Ty), "freeze");
133-
StoreFreezePoisonBuilder.CreateStore(FreezePoison, Alloca);
134-
}
135-
}
136124
if (Allocas) {
137125
Allocas->Add(Alloca);
138126
}

0 commit comments

Comments
 (0)