[PATCH] D114543: Extend the `uwtable` attribute with unwind table kind

Augie Fackler via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 14 09:22:14 PST 2022


durin42 added a comment.

In D114543#3319576 <https://reviews.llvm.org/D114543#3319576>, @chill wrote:

> In D114543#3319347 <https://reviews.llvm.org/D114543#3319347>, @durin42 wrote:
>
>> As far as I can tell this patch broke the Rust compiler, but from the commit message it sounds like it shouldn't have?
>>
>> https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/8358#e85ad6f3-9992-4ea1-9cd3-d8db9f45f33e fails with
>>
>>   Attribute 'uwtable' should have an Argument
>>   i8* (i64, i64)* @__rust_alloc
>>   in function __rust_alloc
>>   LLVM ERROR: Broken function found, compilation aborted!
>>
>> Any thoughts?
>
> Yeah, that's puzzling. The attribute has an optional argument (or else we had to update ~3080 occurrences  of "uwtable" in tests), so reading it is
> a bit tricky:  https://github.com/llvm/llvm-project/blob/19b4e9d76ecc9a5343c093bc54d965734b996518/llvm/lib/Bitcode/Reader/BitcodeReader.cpp#L1631
> That message is output here https://github.com/llvm/llvm-project/blob/19b4e9d76ecc9a5343c093bc54d965734b996518/llvm/lib/IR/Verifier.cpp#L1710
> and I can trigger this line with
>
>   $ cat x.ll
>   define void @f() uwtable {
>   	ret void
>   }
>   $ ./bin/opt -S --passes=verify x.ll
>   ; ModuleID = 'x.ll'
>   source_filename = "x.ll"
>   
>   ; Function Attrs: uwtable
>   define void @f() #0 {
>     ret void
>   }
>   
>   attributes #0 = { uwtable }
>   $ ./bin/opt  x.ll -o x.bc
>   $ ./bin/opt --verify  x.bc -S
>   ; ModuleID = 'x.bc'
>   source_filename = "x.ll"
>   
>   ; Function Attrs: uwtable
>   define void @f() #0 {
>     ret void
>   }
>   
>   attributes #0 = { uwtable }
>   $ 
>
> Could there be a mismatch between two `llvm-project` versions, somehow?

I don't believe so: we build LLVM from HEAD and build Rust directly against LLVM. Is the parameter optional if uwtable is set programmatically, or only when we're reading IR streams?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114543



More information about the cfe-commits mailing list