[PATCH] D87306: [AttributeFuncs] Consider `noundef` in `typeIncompatible`
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 5 21:23:23 PDT 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGef48436e6273: [AttributeFuncs] Consider `noundef` in `typeIncompatible` (authored by jdoerfert).
Changed prior to commit:
https://reviews.llvm.org/D87306?vs=290817&id=296358#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87306/new/
https://reviews.llvm.org/D87306
Files:
llvm/lib/IR/Attributes.cpp
llvm/test/Transforms/DeadArgElim/returned.ll
llvm/test/Verifier/align.ll
llvm/test/Verifier/noundef.ll
Index: llvm/test/Verifier/noundef.ll
===================================================================
--- /dev/null
+++ llvm/test/Verifier/noundef.ll
@@ -0,0 +1,7 @@
+; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
+
+; CHECK: Wrong types for attribute: inalloca nest noalias nocapture noundef nonnull readnone readonly signext zeroext byref(void) byval(void) preallocated(void) sret(void) align 1 dereferenceable(1) dereferenceable_or_null(1)
+; CHECK-NEXT: @noundef_void
+define noundef void @noundef_void() {
+ ret void
+}
Index: llvm/test/Verifier/align.ll
===================================================================
--- llvm/test/Verifier/align.ll
+++ llvm/test/Verifier/align.ll
@@ -6,7 +6,7 @@
ret void
}
-; CHECK: Wrong types for attribute: inalloca nest noalias nocapture nonnull readnone readonly signext zeroext byref(void) byval(void) preallocated(void) sret(void) align 1 dereferenceable(1) dereferenceable_or_null(1)
+; CHECK: Wrong types for attribute: inalloca nest noalias nocapture noundef nonnull readnone readonly signext zeroext byref(void) byval(void) preallocated(void) sret(void) align 1 dereferenceable(1) dereferenceable_or_null(1)
; CHECK-NEXT: @align_non_pointer2
define align 4 void @align_non_pointer2(i32 %a) {
ret void
Index: llvm/test/Transforms/DeadArgElim/returned.ll
===================================================================
--- llvm/test/Transforms/DeadArgElim/returned.ll
+++ llvm/test/Transforms/DeadArgElim/returned.ll
@@ -45,7 +45,7 @@
; Drop all these attributes
; CHECK-LABEL: define internal void @test6
-define internal align 8 dereferenceable_or_null(2) noalias i8* @test6() {
+define internal align 8 dereferenceable_or_null(2) noundef noalias i8* @test6() {
ret i8* null
}
Index: llvm/lib/IR/Attributes.cpp
===================================================================
--- llvm/lib/IR/Attributes.cpp
+++ llvm/lib/IR/Attributes.cpp
@@ -1859,6 +1859,10 @@
.addByValAttr(Ty)
.addByRefAttr(Ty);
+ // Some attributes can apply to all "values" but there are no `void` values.
+ if (Ty->isVoidTy())
+ Incompatible.addAttribute(Attribute::NoUndef);
+
return Incompatible;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87306.296358.patch
Type: text/x-patch
Size: 2203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201006/25e85f96/attachment-0001.bin>
More information about the llvm-commits
mailing list