This is an archive of the discontinued LLVM Phabricator instance.

Add fastmath attributes to llvm.call_intrinsic
ClosedPublic

Authored by electriclilies on May 25 2023, 1:30 PM.

Diff Detail

Event Timeline

electriclilies created this revision.May 25 2023, 1:30 PM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
electriclilies requested review of this revision.May 25 2023, 1:30 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
ftynse added inline comments.May 25 2023, 1:32 PM
clang/lib/CodeGen/CGHLSLRuntime.cpp
367

This cleanup should go in a separate commit.

mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
130

Don't use auto unless the type is obvious from context (e.g., the RHS is a cast) or difficult to spell.

For some reason the diff is showing the difference between 2 commits on my branch, anyone know how to fix this?

electriclilies added inline comments.May 25 2023, 1:36 PM
clang/lib/CodeGen/CGHLSLRuntime.cpp
367

For some reason arcanist is showing the diff between my 2 latest commits, not between main and my branch, I added this in a previous commit then removed it in my final clean up commit..

Squish commits

ftynse added inline comments.May 25 2023, 1:43 PM
clang/lib/CodeGen/CGHLSLRuntime.cpp
367

If you create it with arc, the command indicates with respect to which other commit the diff is taken, e.g. arc diff HEAD^ is the diff between the currently checked out commit and the previous one (HEAD^). You can do several steps (HEAD^^^ for three) or specify the commit hash explicitly.

Remove whitespace

electriclilies added inline comments.May 25 2023, 1:45 PM
mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
130

This auto was already here, I changed it in previous commit. It showed up in the diff because I hadn't squashed my changes yet.

Mogball added inline comments.
mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
870 ↗(On Diff #525779)

please fit this definition into 80 characters wide

mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
99

I think the problem with the cast below is that this is passed by reference. You should not pass operation handles by reference.

electriclilies added inline comments.May 25 2023, 1:55 PM
mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
99

I think I can't pass it by value because it's const though..

Mogball added inline comments.May 25 2023, 2:01 PM
mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
99

where is it const?

99

if it were const, it wouldn't bind to a non-const reference anyways

electriclilies added inline comments.May 25 2023, 2:25 PM
mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
99

If I just try to pass the op into the dyn_cast, it gives this error, which says that the op is a const

/home/lily/modular/third-party/llvm-project/llvm/include/llvm/Support/Casting.h:64:65: error: cannot initialize a parameter of type 'mlir::Operation *' with an rvalue of type 'const mlir::LLVM::CallIntrinsicOp *
Mogball added inline comments.May 25 2023, 2:25 PM
mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
99

did you drop the reference?

99
CallIntrinsicOp &op

delete the &. You should never do this for ops anyways

electriclilies added inline comments.May 25 2023, 2:27 PM
mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
99

OK, I think I can upcast it to an Operation& to avoid this, and get rid of the copy

Mogball accepted this revision.May 25 2023, 2:36 PM
Mogball added inline comments.
mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
878 ↗(On Diff #525815)

here as well please

883 ↗(On Diff #525815)

and this one

This revision is now accepted and ready to land.May 25 2023, 2:36 PM
electriclilies added inline comments.May 25 2023, 2:36 PM
mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
99

Dropped the reference, it works now

This revision was automatically updated to reflect the committed changes.