[PATCH] D152529: [NewGVN] Fold equivalent freeze instructions
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 9 05:48:43 PDT 2023
foad created this revision.
foad added reviewers: aqjune, fhahn, reames, spatel, efriedma, lebedev.ri, nikic.
Herald added subscribers: kmitropoulou, StephenFan, hiraditya.
Herald added a project: All.
foad requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D152529
Files:
llvm/lib/Transforms/Scalar/NewGVN.cpp
llvm/test/Transforms/NewGVN/freeze.ll
Index: llvm/test/Transforms/NewGVN/freeze.ll
===================================================================
--- llvm/test/Transforms/NewGVN/freeze.ll
+++ llvm/test/Transforms/NewGVN/freeze.ll
@@ -15,10 +15,9 @@
define void @f_multipleuses(i1 %a) {
; CHECK-LABEL: @f_multipleuses(
; CHECK-NEXT: [[B:%.*]] = freeze i1 [[A:%.*]]
-; CHECK-NEXT: [[C:%.*]] = freeze i1 [[A]]
; CHECK-NEXT: call void @use1(i1 [[B]])
-; CHECK-NEXT: call void @use1(i1 [[C]])
-; CHECK-NEXT: call void @use1(i1 [[C]])
+; CHECK-NEXT: call void @use1(i1 [[B]])
+; CHECK-NEXT: call void @use1(i1 [[B]])
; CHECK-NEXT: ret void
;
%b = freeze i1 %a
Index: llvm/lib/Transforms/Scalar/NewGVN.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/NewGVN.cpp
+++ llvm/lib/Transforms/Scalar/NewGVN.cpp
@@ -1994,6 +1994,7 @@
break;
case Instruction::BitCast:
case Instruction::AddrSpaceCast:
+ case Instruction::Freeze:
return createExpression(I);
break;
case Instruction::ICmp:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152529.529931.patch
Type: text/x-patch
Size: 1066 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230609/c2766ad4/attachment.bin>
More information about the llvm-commits
mailing list