Skip to content

[InstCombine] Failure to recognise a split i128 extension #126056

Closed
@RKSimon

Description

@RKSimon

Split off from #76524

https://alive2.llvm.org/ce/z/4SwMjF

----------------------------------------
define i128 @src(i32 noundef %x) {
  %coerce.sroa.0.0.extract.trunc = sext i32 noundef %x to i64
  %ashr = ashr i32 noundef %x, 31
  %coerce.sroa.2.0.extract.trunc = sext i32 %ashr to i64
  %x.sroa.2.0.insert.ext.i = zext i64 %coerce.sroa.2.0.extract.trunc to i128
  %x.sroa.2.0.insert.shift.i = shl nuw i128 %x.sroa.2.0.insert.ext.i, 64
  %x.sroa.0.0.insert.ext.i = zext i64 %coerce.sroa.0.0.extract.trunc to i128
  %x.sroa.0.0.insert.insert.i = or disjoint i128 %x.sroa.2.0.insert.shift.i, %x.sroa.0.0.insert.ext.i
  ret i128 %x.sroa.0.0.insert.insert.i
}
=>
define i128 @tgt(i32 noundef %x) {
  %xx = sext i32 noundef %x to i128
  ret i128 %xx
}
Transformation seems to be correct!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions