projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c346cc3
)
[X86][KCFI] Don't fold loads into indirect calls that need a KCFI check
author
Sami Tolvanen
<samitolvanen@google.com>
Fri, 18 Nov 2022 21:23:04 +0000
(21:23 +0000)
committer
Sami Tolvanen
<samitolvanen@google.com>
Fri, 18 Nov 2022 21:55:41 +0000
(21:55 +0000)
Avoid unnecessary folding as X86KCFIPass would have to unfold these
anyway when emitting the KCFI_CHECK.
llvm/lib/Target/X86/X86InstrInfo.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Target/X86/X86InstrInfo.cpp
b/llvm/lib/Target/X86/X86InstrInfo.cpp
index
51fb860
..
86dc8f9
100644
(file)
--- a/
llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/
llvm/lib/Target/X86/X86InstrInfo.cpp
@@
-6135,6
+6135,11
@@
MachineInstr *X86InstrInfo::foldMemoryOperandImpl(
MI.getOpcode() != X86::ADD64rr)
return nullptr;
+ // Don't fold loads into indirect calls that need a KCFI check as we'll
+ // have to unfold these in X86KCFIPass anyway.
+ if (MI.isCall() && MI.getCFIType())
+ return nullptr;
+
MachineInstr *NewMI = nullptr;
// Attempt to fold any custom cases we have.