[PATCH] D71049: Remove implicit conversion that promotes half to other larger precision types for fp classification builtins

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 6 12:43:25 PST 2019


aaron.ballman added a comment.

Thank you for the patch -- can you add some test cases?



================
Comment at: clang/lib/Sema/SemaChecking.cpp:5835-5836
+            "is the only expected cast here");
+        Cast->setSubExpr(nullptr);
+        TheCall->setArg(NumArgs-1, CastArg);
+      }
----------------
I think this should be combined with the code above. Something like:
```
bool IgnoreCast = false;
if (CastArg-> is Float) {
  assert(stuff);
  IgnoreCast = true;
} else if (CastArg-> is Half) {
  assert(stuff);
  IgnoreCast = true;
}

if (IgnoreCast) {
  Cast->setSubExpr(nullptr);
  TheCall->setArg(NumArgs - 1, CastArg);
}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71049





More information about the cfe-commits mailing list