The "uniform-work-group-size" function attribute previously took a string value of "true" or "false". Since presence alone can convey the "true" semantics and absence can convey "false", the value is unnecessary. This patch converts it to a valueless string attribute: presence indicates true, absence indicates false. For backward compatibility, auto-upgrade logic is added in both UpgradeAttributes (bitcode) and UpgradeFunctionAttributes: if the old value is "true", the attribute is kept without a value; if "false", the attribute is removed.
22 lines
674 B
LLVM
22 lines
674 B
LLVM
; RUN: llvm-as < %s | llvm-dis - | FileCheck %s
|
|
|
|
; "uniform-work-group-size"="true" should be upgraded to a valueless attribute.
|
|
; CHECK: define void @true_val() #[[ATTR_TRUE:[0-9]+]]
|
|
define void @true_val() "uniform-work-group-size"="true" {
|
|
ret void
|
|
}
|
|
|
|
; "uniform-work-group-size"="false" should be removed entirely.
|
|
; CHECK: define void @false_val() {
|
|
define void @false_val() "uniform-work-group-size"="false" {
|
|
ret void
|
|
}
|
|
|
|
; Already-upgraded valueless attribute should be left alone.
|
|
; CHECK: define void @no_val() #[[ATTR_TRUE]]
|
|
define void @no_val() "uniform-work-group-size" {
|
|
ret void
|
|
}
|
|
|
|
; CHECK-DAG: attributes #[[ATTR_TRUE]] = { "uniform-work-group-size" }
|