[PATCH] D115924: [ConstantFolding] Unify handling of load from uniform value

Axel Y. Rivera via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 17 07:39:06 PST 2021


ayrivera added a comment.

LGTM! Thanks for the quick fix.



================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:718
+    return UndefValue::get(Ty);
+  if (C->isNullValue() && !Ty->isX86_MMXTy() && !Ty->isX86_AMXTy())
+    return Constant::getNullValue(Ty);
----------------
nikic wrote:
> ayrivera wrote:
> > Is there a chance that Ty is not X86_MMX neither X86_AMX and C is NullValue(), but getNullValue doesn't support the type? For example, assume that Ty is a Function type, then in that case getNullValue will default into the llvm_unreachable.
> I believe other problematic types cannot appear as a load or bitcast type. You can't load a function type (only a pointer to a function type).
I see, thanks for the explanation. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115924/new/

https://reviews.llvm.org/D115924



More information about the llvm-commits mailing list