Skip to content

Move where intrinsic function attributes are set#5795

Merged
dsharletg merged 8 commits intohalide:masterfrom
jwlawson:intrin_attrs
Mar 10, 2021
Merged

Move where intrinsic function attributes are set#5795
dsharletg merged 8 commits intohalide:masterfrom
jwlawson:intrin_attrs

Conversation

@jwlawson
Copy link
Contributor

@jwlawson jwlawson commented Mar 9, 2021

Currently Halide always sets the ReadNone and NoUnwind attributes to all intrinsic calls inside CodeGen_LLVM::call_intrin. The AMX intrinsics introduced in #5780 do access memory, so by setting the ReadNone attribute LLVM can do some invalid optimizations.

Instead of setting the attributes on the call to the intrinsic, we can set the attributes on the intrinsic function itself when registering it.

There were some raw calls to call_intrin in the ARM and Hexagon CodeGen backends. The ARM calls have been converted to use call_intrin_overload, while the Hexagon calls already use a wrapper function so this has been modified to set the attributes.


// ABDL - Widening absolute difference
// Need to be able to handle both signed and unsigned outputs for signed inputs.
{"vabdl_i8x8", "vabdl_i8x8", Int(16, 8), "vabdl", {Int(8, 8), Int(8, 8)}, ArmIntrinsic::NoMangle | ArmIntrinsic::NoPrefix},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be named "widening_absd"

@dsharletg
Copy link
Contributor

Going to start the build bots because the only change I suggested is a rename.

@steven-johnson
Copy link
Contributor

Ready to land?

@dsharletg dsharletg merged commit c67f486 into halide:master Mar 10, 2021
@alexreinking alexreinking added this to the v12.0.0 milestone May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants