[PATCH] D62319: IR: add 'byval(<ty>)' variant to 'byval' function parameters

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 07:55:48 PDT 2019


t.p.northover marked an inline comment as done.
t.p.northover added inline comments.


================
Comment at: llvm/lib/IR/Attributes.cpp:552-553
+    if (AI.isTypeAttribute()) {
+      if (getKindAsEnum() == AI.getKindAsEnum())
+        llvm_unreachable("Comparison of types would be unstable");
+      return getKindAsEnum() < AI.getKindAsEnum();
----------------
jordan_rose wrote:
> dblaikie wrote:
> > Prefer assertion rather than branch-to-unreachable
> > 
> >   assert(getKindAsEnum() != AI.getKindAsEnum() ...
> Swift is [hitting this assertion](https://ci.swift.org/job/swift-PR-osx/14173/consoleFull#1140632946ef3c3c00-f496-40b9-85a7-0eb69d0f491b) on its master-next branch right now when two type attributes are wrapping the same type. Is that supposed to be checked earlier or canonicalized away?
Sorry, I was on holiday last week. It should be fixed now. I've made FunctionComparator delve into attributes with types since it's main purpose seems to be going to heroic efforts to compare things stably anyway.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62319





More information about the llvm-commits mailing list