Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][RISCVVEmitter] Remove no-op ptr-to-ptr bitcast (NFC) #74179

Merged
merged 1 commit into from
Dec 2, 2023

Conversation

JOE1994
Copy link
Member

@JOE1994 JOE1994 commented Dec 2, 2023

Remove ptr-to-ptr bitcast which was added back in 939352b . With opaque pointers, the bitcast is now redundant.

Opaque ptr cleanup effort.

Remove ptr-to-ptr bitcast which was added back in 939352b .
With opaque pointers, the bitcast is now redundant.

Opaque ptr cleanup effort.
@llvmbot llvmbot added clang Clang issues not falling into any other category backend:RISC-V labels Dec 2, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Dec 2, 2023

@llvm/pr-subscribers-backend-risc-v

@llvm/pr-subscribers-clang

Author: Youngsuk Kim (JOE1994)

Changes

Remove ptr-to-ptr bitcast which was added back in 939352b . With opaque pointers, the bitcast is now redundant.

Opaque ptr cleanup effort.


Full diff: https://github.com/llvm/llvm-project/pull/74179.diff

1 Files Affected:

  • (modified) clang/utils/TableGen/RISCVVEmitter.cpp (-3)
diff --git a/clang/utils/TableGen/RISCVVEmitter.cpp b/clang/utils/TableGen/RISCVVEmitter.cpp
index cf731e8414a3b83..1fb41805a0473dd 100644
--- a/clang/utils/TableGen/RISCVVEmitter.cpp
+++ b/clang/utils/TableGen/RISCVVEmitter.cpp
@@ -180,13 +180,10 @@ void emitCodeGenSwitchBody(const RVVIntrinsic *RVVI, raw_ostream &OS) {
     return;
   }
 
-  // Cast pointer operand of vector load intrinsic.
   for (const auto &I : enumerate(RVVI->getInputTypes())) {
     if (I.value()->isPointer()) {
       assert(RVVI->getIntrinsicTypes().front() == -1 &&
              "RVVI should be vector load intrinsic.");
-      OS << "  Ops[" << I.index() << "] = Builder.CreateBitCast(Ops[";
-      OS << I.index() << "], ResultType->getPointerTo());\n";
     }
   }
 

@JOE1994 JOE1994 merged commit c638161 into llvm:main Dec 2, 2023
5 checks passed
@JOE1994 JOE1994 deleted the clang_remove_ptrtoptrbitcast branch December 2, 2023 18:51
@@ -180,13 +180,10 @@ void emitCodeGenSwitchBody(const RVVIntrinsic *RVVI, raw_ostream &OS) {
return;
}

// Cast pointer operand of vector load intrinsic.
for (const auto &I : enumerate(RVVI->getInputTypes())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not remove this for totally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:RISC-V clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants