[llvm-bugs] [Bug 44543] New: InstCombine should correctly propagate alignment
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Jan 14 08:09:30 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=44543
Bug ID: 44543
Summary: InstCombine should correctly propagate alignment
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: juneyoung.lee at sf.snu.ac.kr
CC: llvm-bugs at lists.llvm.org
Created attachment 23016
--> https://bugs.llvm.org/attachment.cgi?id=23016&action=edit
input.ll
```
$ cat input.ll
target datalayout = "p:64:64:64-i64:32:32"
define i64* @test1(i8* %x) {
entry:
%p = bitcast i8* %x to i64*
%b1 = load i64, i64* %p
%p2 = inttoptr i64 %b1 to i64*
ret i64* %p2
}
$ opt -instcombine input.ll -S -o -
target datalayout = "p:64:64:64-i64:32:32"
define i64* @test1(i8* %x) {
entry:
%0 = bitcast i8* %x to i64**
%b11 = load i64*, i64** %0, align 8
ret i64* %b11
}
```
The updated load should have align 4 because data layout says i64 has 4-bytes
alignment.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200114/3b7f861c/attachment.html>
More information about the llvm-bugs
mailing list