https://bugs.llvm.org/show_bug.cgi?id=48472
Bug ID: 48472
Summary: LowerConstantIntrinsics pass thinks address of global
is constant
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
If llc is given the following input:
@x = global i8 0, align 1
define i32 @example() {
entry:
%0 = call i1 @llvm.is.constant.i32(i32 ptrtoint (i8* @x to i32))
%1 = zext i1 %0 to i32
ret i32 %1
}
declare i1 @llvm.is.constant.i32(i32)
then LowerConstantIntrinsics will optimise this to "ret i32 1". It shouldn't be
doing this as the argument is an address of a global and LangRef says:
In particular, note that if the argument is a constant expression which
refers to a global (the address of which _is_ a constant, but not manifest
during the compile), then the intrinsic evaluates to false.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs