efriedma added a comment.

The IR at this



================
Comment at: llvm/lib/IR/AutoUpgrade.cpp:574
+      if (ArgTy->getElementType()->isFloatingPointTy()) {
+        auto fArgs = F->getFunctionType()->params();
+        Type *Tys[] = {fArgs[0], fArgs[1]};
----------------
aemerson wrote:
> efriedma wrote:
> > This code is weird... you're computing the types in two different ways.  
> > Also, missing a check for F->arg_size() (so we don't crash on invalid IR).
> I'll consolidate the logic, but none of the other code here checks for IR 
> validity. By the time we reach here the IR should be valid, we're just 
> translating it to a newer version. I can put an assert anyway.
The IR during autoupgrade should be loosely "valid", to the point of passing 
the asm/bitcode parser, but we don't check the signature of intrinsics until 
later, so someone could write `declare <4 x float> 
@llvm.aarch64.neon.addp.v4f32()`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59655



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to