llvm-project
llvm-project copied to clipboard
Attributor incorrectly infers `align` (and probably `nonnull` too)
This is the same bug as #220520, but in Attributor.
declare void @g(ptr)
define void @src(ptr %p) {
call void @g(ptr align 4 %p)
store i8 1, ptr %p, align 1
ret void
}
./build/bin/opt -passes=attributor attributor_test.ll -S -o - generates:
declare void @g(ptr)
define void @src(ptr align 4 %p) {
call void @g(ptr align 4 %p)
store i8 1, ptr %p, align 4
ret void
}
But we can only assume the call is UB when %p is misaligned when the parameter is noundef.
Probably a similar fix to this one needs to be applied to Attributor too: #221018.
Hi, I'd like to work on this. It looks like a miscompilation