Skip to content

Commit 7defdff

Browse files
committed
fixup! [Pass, SCCP] Support constant structure in PhiNode
1 parent e8ea8c0 commit 7defdff

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

llvm/lib/Transforms/Utils/SCCPSolver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ class SCCPInstVisitor : public InstVisitor<SCCPInstVisitor> {
761761
void handleCallArguments(CallBase &CB);
762762
void handleExtractOfWithOverflow(ExtractValueInst &EVI,
763763
const WithOverflowInst *WO, unsigned Idx);
764-
bool isInstOverDefined(Instruction &Inst);
764+
bool isInstFullyOverDefined(Instruction &Inst);
765765

766766
private:
767767
friend class InstVisitor<SCCPInstVisitor>;
@@ -1381,7 +1381,7 @@ void SCCPInstVisitor::visitPHINode(PHINode &PN) {
13811381
if (PN.getNumIncomingValues() > 64)
13821382
return (void)markOverdefined(&PN);
13831383

1384-
if (isInstOverDefined(PN))
1384+
if (isInstFullyOverDefined(PN))
13851385
return;
13861386
SmallVector<unsigned> FeasibleIncomingIndices;
13871387
for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) {
@@ -2146,7 +2146,7 @@ void SCCPInstVisitor::handleCallResult(CallBase &CB) {
21462146
}
21472147
}
21482148

2149-
bool SCCPInstVisitor::isInstOverDefined(Instruction &Inst) {
2149+
bool SCCPInstVisitor::isInstFullyOverDefined(Instruction &Inst) {
21502150
// For structure Type, we handle each member separately.
21512151
// A structure object won't be considered as overdefined when
21522152
// there is at least one member that is not overdefined.

llvm/test/Transforms/SCCP/constant-range-struct.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ define void @struct2_caller() {
160160

161161
%"phi_type" = type {i64, i64}
162162

163-
; Function Attrs: mustprogress
164163
define internal %"phi_type" @test(i32 %input) {
165164
; CHECK-LABEL: @test(
166165
; CHECK-NEXT: br label [[COND_TRUE_I:%.*]]

0 commit comments

Comments
 (0)