[Attributor][FIX] Remove FIXME that seems outdated
authorJohannes Doerfert <johannes@jdoerfert.de>
Mon, 10 Feb 2020 02:21:56 +0000 (20:21 -0600)
committerJohannes Doerfert <johannes@jdoerfert.de>
Mon, 10 Feb 2020 06:55:10 +0000 (00:55 -0600)
The change is performed as stated by the FIXME and the tests are
adjusted. All changes look fine to me and values can be inferred as
undef without it being an error.

llvm/lib/Transforms/IPO/Attributor.cpp
llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll
llvm/test/Transforms/Attributor/dereferenceable-1.ll
llvm/test/Transforms/Attributor/undefined_behavior.ll

index d8d3108..da5260b 100644 (file)
@@ -4408,9 +4408,7 @@ struct AAValueSimplifyImpl : AAValueSimplify {
       else
         return false;
     } else {
-      // FIXME: It should be llvm::None but if you set llvm::None,
-      //        values are mistakenly infered as `undef` now.
-      SimplifiedAssociatedValue = &getAssociatedValue();
+      SimplifiedAssociatedValue = llvm::None;
     }
     return true;
   }
index c3fe2b4..06ce2d5 100644 (file)
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
-; RUN: opt -S -passes=attributor -aa-pipeline='basic-aa' -attributor-disable=false -attributor-max-iterations-verify -attributor-max-iterations=3 < %s | FileCheck %s
+; RUN: opt -S -passes=attributor -aa-pipeline='basic-aa' -attributor-disable=false -attributor-max-iterations-verify -attributor-max-iterations=1 < %s | FileCheck %s
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
index bc16ab8..b42d85a 100644 (file)
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -attributor -attributor-manifest-internal --attributor-disable=false -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=5 -S < %s | FileCheck %s --check-prefix=ATTRIBUTOR
-
+; RUN: opt -attributor -attributor-manifest-internal --attributor-disable=false -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=16 -S < %s | FileCheck %s --check-prefix=ATTRIBUTOR
+; FIXME: Figure out why we need 16 iterations here.
 
 declare void @deref_phi_user(i32* %a);
 
index fd0ddb1..8e16a91 100644 (file)
@@ -265,15 +265,14 @@ e:
 
 ; Branch on undef that depends on propagation of
 ; undef of a previous instruction.
-; FIXME: Currently it doesn't propagate the undef.
 define i32 @cond_br_on_undef3() {
 ; ATTRIBUTOR-LABEL: @cond_br_on_undef3(
 ; ATTRIBUTOR-NEXT:    %cond = icmp ne i32 1, undef
 ; ATTRIBUTOR-NEXT:    br i1 %cond, label %t, label %e
 ; ATTRIBUTOR:       t:
-; ATTRIBUTOR-NEXT:    ret i32 1
+; ATTRIBUTOR-NEXT:    unreachable
 ; ATTRIBUTOR:       e:
-; ATTRIBUTOR-NEXT:    ret i32 2
+; ATTRIBUTOR-NEXT:    unreachable
 
   %cond = icmp ne i32 1, undef
   br i1 %cond, label %t, label %e