Issue 181117
Summary [AggressiveInstCombine] Invalid trunc creation in store merge optimization
Labels crash, llvm:instcombine
Assignees nikic
Reporter nikic
    ```llvm
target triple = "x86_64-unknown-linux-gnu"

define void @test(i56 %arg, ptr %p) {
  %lo = trunc i56 %arg to i32
  store i32 %lo, ptr %p, align 4
  %shr = lshr i56 %arg, 32
  %hi = trunc i56 %shr to i32
  %p.4 = getelementptr i8, ptr %p, i64 4
  store i32 %hi, ptr %p.4, align 4
  ret void
}
```

> opt: /home/npopov/repos/llvm-project/llvm/lib/IR/Instructions.cpp:3043: static CastInst *llvm::CastInst::Create(Instruction::CastOps, Value *, Type *, const Twine &, InsertPosition): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to