[llvm] [BOLT] Remove duplicate expression (PR #80380)

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 18:55:59 PST 2024


https://github.com/maksfb created https://github.com/llvm/llvm-project/pull/80380

Reported by cpp check static analyzer in #80111.

Fixes #80111.

>From 9e33bdfd0ff67b32a2c243fc9bb55ebd4f66d23f Mon Sep 17 00:00:00 2001
From: Maksim Panchenko <maks at fb.com>
Date: Thu, 1 Feb 2024 18:46:22 -0800
Subject: [PATCH] [BOLT] Remove duplicate expression

Reported by cpp check static analyzer in #80111.

Fixes #80111.
---
 bolt/lib/Target/X86/X86MCPlusBuilder.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bolt/lib/Target/X86/X86MCPlusBuilder.cpp b/bolt/lib/Target/X86/X86MCPlusBuilder.cpp
index ce8a4d6914854..387cf481ba304 100644
--- a/bolt/lib/Target/X86/X86MCPlusBuilder.cpp
+++ b/bolt/lib/Target/X86/X86MCPlusBuilder.cpp
@@ -2197,7 +2197,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
               MO->BaseRegNum != X86::RIP && MO->BaseRegNum != X86::RBP &&
               MO->BaseRegNum != X86::NoRegister &&
               MO->IndexRegNum == X86::NoRegister &&
-              MO->SegRegNum == X86::NoRegister && MO->BaseRegNum != X86::RIP) {
+              MO->SegRegNum == X86::NoRegister) {
             VtableRegNum = MO->BaseRegNum;
             MethodOffset = MO->DispImm;
             MethodFetchInsns.push_back(&CurInst);



More information about the llvm-commits mailing list