Skip to content

[LVI][CVP] CVP error deleted the and instruction. #68381

Closed
llvm/llvm-project-release-prs
#728
@dianqk

Description

@dianqk
Member

I tried this IR:

define i32 @foo(i1 %c0, i1 %c1, i8 %v1, i8 %v2) {
start:
  br i1 %c0, label %bb0, label %bb1

bb0:                                              ; preds = %bb1, %start
  %v2_i32 = zext i8 %v2 to i32
  br label %bb1

bb1:                                              ; preds = %bb0, %start
  %x = phi i32 [ %v2_i32, %bb0 ], [ undef, %start ]
  br i1 %c1, label %bb0, label %bb2

bb2:                                              ; preds = %bb1
  %v1_i32 = zext i8 %v1 to i32
  %y = or i32 %x, %v1_i32
  %z = and i32 %y, 255
  ret i32 %z
}

%z = and i32 %y, 255 should not be deleted by CVP.

alive2: https://alive2.llvm.org/ce/z/A9T1PH
godbolt: https://llvm.godbolt.org/z/YEqPjTv83

This issue started with LLVM 15.

This IR is reduced from https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Implementing.20niche.20checks.

Extended to abs: https://alive2.llvm.org/ce/z/k_8paG.

Activity

self-assigned this
on Oct 6, 2023
added this to the LLVM 17.0.X Release milestone on Oct 6, 2023
moved this from Needs Triage to Needs Review in LLVM Release Statuson Oct 9, 2023
added a commit that references this issue on Oct 10, 2023
8185794
reopened this on Oct 10, 2023
dianqk

dianqk commented on Oct 10, 2023

@dianqk
MemberAuthor

While adding the abs test case, I found a new mis-compilation at #68683.
I need to fix this before adding abs test cases.

So let's do the backport first.

/cherry-pick 8185794

llvmbot

llvmbot commented on Oct 10, 2023

@llvmbot
Member

/branch llvm/llvm-project-release-prs/issue68381

13 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

    Participants

    @dianqk@llvmbot

    Issue actions

      [LVI][CVP] CVP error deleted the `and` instruction. · Issue #68381 · llvm/llvm-project