diff options
author | Juneyoung Lee <aqjune@gmail.com> | 2020-03-16 12:45:54 +0900 |
---|---|---|
committer | Juneyoung Lee <aqjune@gmail.com> | 2020-03-16 12:45:54 +0900 |
commit | 4ffe3ac729aa7a9863ea9a7bd451785a787d7ad8 (patch) | |
tree | 8ea18ccf78aa169571d8bcf54f3b07a19ba63034 /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | 4c90a5297d11c241b00c1f6957d041c9986346ea (diff) | |
download | llvm-4ffe3ac729aa7a9863ea9a7bd451785a787d7ad8.zip llvm-4ffe3ac729aa7a9863ea9a7bd451785a787d7ad8.tar.gz llvm-4ffe3ac729aa7a9863ea9a7bd451785a787d7ad8.tar.bz2 |
Revert "[CodeGenPrepare] Freeze condition when transforming select to br"
This reverts commit 10aa7ea951e22dbd7f2ebdeb6410cfbc8a251eb1.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index fd55ef2..373064d 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -6131,8 +6131,7 @@ bool CodeGenPrepare::optimizeSelectInst(SelectInst *SI) { // Into: // start: // %cmp = cmp uge i32 %a, %b - // %cmp.frozen = freeze %cmp - // br i1 %cmp.frozen, label %select.true, label %select.false + // br i1 %cmp, label %select.true, label %select.false // select.true: // br label %select.end // select.false: @@ -6140,7 +6139,6 @@ bool CodeGenPrepare::optimizeSelectInst(SelectInst *SI) { // select.end: // %sel = phi i32 [ %c, %select.true ], [ %d, %select.false ] // - // %cmp should be freezed, otherwise it may introduce undefined behavior. // In addition, we may sink instructions that produce %c or %d from // the entry block into the destination(s) of the new branch. // If the true or false blocks do not contain a sunken instruction, that @@ -6219,9 +6217,7 @@ bool CodeGenPrepare::optimizeSelectInst(SelectInst *SI) { TT = TrueBlock; FT = FalseBlock; } - IRBuilder<> IB(SI); - auto CondFr = IB.CreateFreeze(SI->getCondition(), SI->getName() + ".frozen"); - IB.CreateCondBr(CondFr, TT, FT, SI); + IRBuilder<>(SI).CreateCondBr(SI->getCondition(), TT, FT, SI); SmallPtrSet<const Instruction *, 2> INS; INS.insert(ASI.begin(), ASI.end()); |