Skip to content

x86 backend crashes when enabling zero-upper feature for APX #101288

Closed
@KanRobert

Description

@KanRobert
define i32 @widget() {
bb:
  br label %bb1
bb1:
  %phi = phi i32 [ 0, %bb ], [ %zext, %bb1 ]
  %phi2 = phi i32 [ 0, %bb ], [ %add3, %bb1 ]
  %load = load i32, ptr null, align 4
  %add = add i32 %load, %phi
  store i32 %add, ptr null, align 4
  %icmp = icmp ugt i32 %phi, %add
  %zext = zext i1 %icmp to i32
  %add3 = add i32 %phi2, %zext
  %icmp4 = icmp ult i32 %phi2, 0
  %and = and i1 %icmp, false
  br i1 %and, label %bb1, label %bb2
bb2:
  ret i32 0
}
llc: skan/llvm-project/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp:899: void {anonymous}::X86FlagsCopyLoweringPass::rewriteMI(llvm::MachineBasicBlock&, llvm::MachineBasicBlock::iterator, const llvm::DebugLoc&, llvm::MachineInstr&, {anonymous}::CondRegArray&): Assertion `CC != X86::COND_INVALID && "Unknown EFLAG user!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: llc -mattr=+zu
1.      Running pass 'Function Pass Manager' on module '<stdin>'.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions